From 5308fc3d9586b4ea72770793144a0aee85a59f30 Mon Sep 17 00:00:00 2001 From: Helmut Haensel Date: Tue, 2 Jun 2020 14:38:19 +0200 Subject: [PATCH 01/83] support include_mathjax option for Blink display --- Project.toml | 1 + src/PlotlyJS.jl | 3 ++- src/display.jl | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c32dd389..c142b91d 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ authors = ["Spencer Lyon "] version = "0.13.1" [deps] +AssetRegistry = "bf4720bc-e11a-5d0c-854e-bdca1663c893" Blink = "ad839575-38b3-5650-b840-f874b8c74a25" Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 67a188dc..a09b991c 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -14,6 +14,7 @@ import PlotlyBase: react, react! using WebIO +using AssetRegistry using JSExpr using JSExpr: @var, @new using Blink @@ -26,7 +27,7 @@ const _pkg_root = dirname(dirname(@__FILE__)) const _js_path = joinpath(_pkg_root, "assets", "plotly-latest.min.js") const _js_cdn_path = "https://cdn.plot.ly/plotly-latest.min.js" const _mathjax_cdn_path = - "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_SVG" + "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS-MML_SVG" struct PlotlyJSDisplay <: AbstractDisplay end diff --git a/src/display.jl b/src/display.jl index 1342e50e..5b67c682 100644 --- a/src/display.jl +++ b/src/display.jl @@ -156,9 +156,57 @@ function display_blink(p::SyncPlot) plotSize = size(p.plot) windowOptions = Dict("width"=>floor(Int,plotSize[1]*sizeBuffer), "height"=>floor(Int,plotSize[2]*sizeBuffer)) p.window = Blink.Window(windowOptions) + + # check if the inlcude_mathjax option is set and add the respective header + # the syntax is chosen identical to the python version: Layout(include_mathjax = ) + mathjax = mathjax_path(p) + mathjax == "" || try + # if file is local then add the mathjax path to the asset registry + # Currently `WebIO` does not support registering of directories, PR is pending ... + # otherwise we could do: `mathjax = WebIO.dep2url(mathjax)` + # so we have to use `AssetRegistry` directly + if WebIO.islocal(mathjax) + mathjax = joinpath(AssetRegistry.register(dirname(mathjax)), basename(mathjax)) + end + # add the mathjax file to the section + Blink.loadjs!(p.window, mathjax) + catch + @warn """Could not verify mathjax path! + + Consider installing IJulia. + Currently, however, TexFonts need to be installed manually... :-( + """ + end + Blink.body!(p.window, p.scope) end +# convert "cdn" and "local" to the respective online or local mathjax-paths +function mathjax_path(mj::AbstractString) + if mj == "cdn" + return _mathjax_cdn_path + elseif mj == "local" + mj = abspath(first(DEPOT_PATH), "conda", "3", "Lib", "site-packages", + "notebook", "static", "components", "MathJax", "MathJax.js") + return isfile(mj) ? (mj * "?config=TeX-AMS-MML_HTMLorMML-full") : "" + end + return mj +end + +# retrieve the mathjax option from the SyncPlot +function mathjax_path(p::SyncPlot) + local mathjax + try + # Layout(include_mathjax = ...) results in a layout field :include with a dictionary entry :mathjax + mathjax = p.plot.layout[:include][:mathjax] + catch + # if called from Plot's plotlyjs() backend, the extra_kwargs are passed literally, i.e `:include_mathjax` + mathjax = get(p.plot.layout, :include_mathjax, "") + end + # convert "cdn" and "local" to the respective online or local mathjax paths + return mathjax_path(mathjax) +end + function Base.close(p::SyncPlot) if p.window !== nothing && Blink.active(p.window) close(p.window) From 2088c5f6c36c650367cc94e35b2ef6a8c2b865a0 Mon Sep 17 00:00:00 2001 From: Helmut Haensel Date: Tue, 2 Jun 2020 16:19:04 +0200 Subject: [PATCH 02/83] modify mathjax option handling for plots from plotlyjs() backend --- src/display.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display.jl b/src/display.jl index 5b67c682..2cefb8b2 100644 --- a/src/display.jl +++ b/src/display.jl @@ -201,7 +201,7 @@ function mathjax_path(p::SyncPlot) mathjax = p.plot.layout[:include][:mathjax] catch # if called from Plot's plotlyjs() backend, the extra_kwargs are passed literally, i.e `:include_mathjax` - mathjax = get(p.plot.layout, :include_mathjax, "") + mathjax = get(p.plot.layout.fields, :include_mathjax, "") end # convert "cdn" and "local" to the respective online or local mathjax paths return mathjax_path(mathjax) From bb5111e4859cbc3736bcb026c447ee69bb8c4c2c Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 7 Jul 2020 09:59:57 -0400 Subject: [PATCH 03/83] update link to docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da7e4ab7..9cfae0ad 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Julia interface to [plotly.js][_plotlyjs] visualization library. This package constructs plotly graphics using all local resources. To interact or save graphics to the Plotly cloud, use the [`Plotly`](https://github.com/plotly/Plotly.jl) package. -Check out the [docs](http://spencerlyon.com/PlotlyJS.jl/)! +Check out the [docs](http://juliaplots.github.io/PlotlyJS.jl/)! @@ -16,7 +16,7 @@ Check out the [docs](http://spencerlyon.com/PlotlyJS.jl/)! ## Installation -If you intend to use the [Electron display](http://spencerlyon.com/PlotlyJS.jl/syncplots/#electronplot) or any of its features (recommended) you will need to enter the following at the Julia REPL: +If you intend to use the [Electron display](http://juliaplots.github.io/PlotlyJS.jl/syncplots/#electronplot) or any of its features (recommended) you will need to enter the following at the Julia REPL: ```julia using Blink From fe74b6d1a2002694795ff07a99e59ecb829fab5c Mon Sep 17 00:00:00 2001 From: Diego Javier Zea Date: Fri, 24 Jul 2020 18:55:16 +0200 Subject: [PATCH 04/83] Update for Julia 1: Use dot broadcast (#337) --- examples/box_plots.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/box_plots.jl b/examples/box_plots.jl index 6ee60f37..22880fba 100644 --- a/examples/box_plots.jl +++ b/examples/box_plots.jl @@ -2,7 +2,7 @@ using PlotlyJS function box1() y0 = rand(50) - y1 = rand(50) + 1 + y1 = rand(50) .+ 1 trace1 = box(;y=y0) trace2 = box(;y=y1) data = [trace1, trace2] From 02f1849113303656faa884447ca977761b8387bb Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Mon, 17 Aug 2020 09:59:11 -0400 Subject: [PATCH 05/83] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cfae0ad..4474ea6a 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ If you will be using this package from within Jupyterlab, please also install th ```sh -jupyter labextension install @jupyterlab/plotly-extension +jupyter labextension install jupyterlab-plotly ``` See the [jupyterlab extension documentation](https://jupyterlab.readthedocs.io/en/stable/user/extensions.html) for more details. From 8e08ae6ec1abb64659e4d1f29ca2e7edad7a6be8 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 18 Aug 2020 21:06:04 -0400 Subject: [PATCH 06/83] ENH: add pkgbutler --- .../workflows/jlpkgbutler-butler-workflow.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/jlpkgbutler-butler-workflow.yml diff --git a/.github/workflows/jlpkgbutler-butler-workflow.yml b/.github/workflows/jlpkgbutler-butler-workflow.yml new file mode 100644 index 00000000..f7894d9c --- /dev/null +++ b/.github/workflows/jlpkgbutler-butler-workflow.yml @@ -0,0 +1,20 @@ +name: Run the Julia Package Butler + +on: + push: + branches: + - master + schedule: + - cron: '0 */1 * * *' + +jobs: + butler: + name: "Run Package Butler" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: davidanthoff/julia-pkgbutler@releases/v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + ssh-private-key: ${{ secrets.JLPKGBUTLER_TOKEN }} + channel: stable From 81a372dd492c800398c2e28758881bc14ad3e2dc Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 18 Aug 2020 21:13:05 -0400 Subject: [PATCH 07/83] Update Project.toml --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index c32dd389..dabc9041 100644 --- a/Project.toml +++ b/Project.toml @@ -21,11 +21,11 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "≥ 0.8.0" Compat = "≥ 0.69.0" JSON = "≥ 0.7.0" -PlotlyBase = "≥ 0.3.0" +PlotlyBase = "≥ 0.4.0" Reexport = "≥ 0.2.0" Requires = "1.0" WebIO = "≥ 0.8.6" -julia = "≥ 0.7.0" +julia = "≥ 1.3.0" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From 2cbbe51c62a199a81459984ae19366fe2e8f6605 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 18 Aug 2020 21:15:00 -0400 Subject: [PATCH 08/83] Delete .travis.yml --- .travis.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5163aee4..00000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -# Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -sudo: required -os: - - linux -julia: - - 1.0 - - 1.1 - - nightly -matrix: - allow_failures: - - julia: nightly -addons: - apt: - packages: - - xvfb - - xauth - - libgtk-3-0 -notifications: - email: false -# uncomment the following lines to override the default test script -script: - - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - xvfb-run julia -e 'using Pkg; Pkg.build(); Pkg.test(coverage=true)' From cf7d8bfd84ec2841bdf052e5e2245ab46e2530aa Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 09:02:17 -0400 Subject: [PATCH 09/83] Delete jlpkgbutler-butler-workflow.yml --- .../workflows/jlpkgbutler-butler-workflow.yml | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/jlpkgbutler-butler-workflow.yml diff --git a/.github/workflows/jlpkgbutler-butler-workflow.yml b/.github/workflows/jlpkgbutler-butler-workflow.yml deleted file mode 100644 index f7894d9c..00000000 --- a/.github/workflows/jlpkgbutler-butler-workflow.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Run the Julia Package Butler - -on: - push: - branches: - - master - schedule: - - cron: '0 */1 * * *' - -jobs: - butler: - name: "Run Package Butler" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: davidanthoff/julia-pkgbutler@releases/v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - ssh-private-key: ${{ secrets.JLPKGBUTLER_TOKEN }} - channel: stable From e44faf026f3a7a218e4323029e1ac794041a359f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2020 09:03:17 -0400 Subject: [PATCH 10/83] CompatHelper: add new compat entry for "JSExpr" at version "1.0" (#307) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index dabc9041..a222b03f 100644 --- a/Project.toml +++ b/Project.toml @@ -20,6 +20,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" [compat] Blink = "≥ 0.8.0" Compat = "≥ 0.69.0" +JSExpr = "1.0" JSON = "≥ 0.7.0" PlotlyBase = "≥ 0.4.0" Reexport = "≥ 0.2.0" From 6897cdbce443587f1d9624bb995a0fd6214e1d97 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 09:04:37 -0400 Subject: [PATCH 11/83] Create .travis.yml --- .travis.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..26d2f400 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +# Documentation: http://docs.travis-ci.com/user/languages/julia/ +language: julia +sudo: required +os: + - linux +julia: + - 1.3 + - 1.4 + - nightly +matrix: + allow_failures: + - julia: nightly +addons: + apt: + packages: + - xvfb + - xauth + - libgtk-3-0 +notifications: + email: false +# uncomment the following lines to override the default test script +script: + - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi + - xvfb-run julia -e 'using Pkg; Pkg.build(); Pkg.test(coverage=true)' From 1e04355460d19b7057b13f1c353cf0ec524a00a8 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 09:08:31 -0400 Subject: [PATCH 12/83] Update CompatHelper.yml --- .github/workflows/CompatHelper.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index dd821e68..b468f0bc 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,19 +1,17 @@ + name: CompatHelper - on: schedule: - cron: '00 00 * * *' - + workflow_dispatch: jobs: CompatHelper: runs-on: ubuntu-latest steps: - - uses: julia-actions/setup-julia@latest - with: - version: 1.3 - name: Pkg.add("CompatHelper") run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - name: CompatHelper.main() env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional run: julia -e 'using CompatHelper; CompatHelper.main()' From 49fe3b3320fbbf3580cf334af054786f5fffcc0c Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 09:08:50 -0400 Subject: [PATCH 13/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index a222b03f..05babad4 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" [compat] Blink = "≥ 0.8.0" Compat = "≥ 0.69.0" -JSExpr = "1.0" +JSExpr = "0.5" JSON = "≥ 0.7.0" PlotlyBase = "≥ 0.4.0" Reexport = "≥ 0.2.0" From f1e43f41a074bbd0d01dfb789f74bb4c7a4b0812 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 16:12:42 -0400 Subject: [PATCH 14/83] Kaleido (#342) * ENH: use PlotlyBase's Kaleido for savefig * OPS: add pkg-butler * DEPS: depend on plotlyBase 0.4 * ENH: delete pkg-butler -- we need special CI * ENH: update travis settings * WIP: migrate docs to Documenter.jl instead of mkdocs --- .github/workflows/deploy_docs.yml | 21 + .travis.yml | 46 +- CHANGELOG.md | 708 ++++++++++++------ Project.toml | 4 +- deploy_docs.sh | 3 - docs/.gitignore | 2 + docs/Project.toml | 17 + docs/build_example_docs.jl | 108 +-- docs/building_traces_layouts.md | 482 ------------ docs/css/base16-solarized-light.css | 72 -- docs/css/base16-tomorrow-dark.css | 71 -- docs/css/base16-tomorrow-light.css | 71 -- docs/css/github.css | 62 -- docs/css/tomorrow-night-eighties.css | 65 -- docs/examples/3d.md | 355 --------- docs/examples/area.md | 79 -- docs/examples/bar.md | 399 ---------- docs/examples/box_plots.md | 375 ---------- docs/examples/contour.md | 430 ----------- docs/examples/finance.md | 108 --- docs/examples/heatmaps.md | 45 -- docs/examples/histograms.md | 27 - docs/examples/line_scatter.md | 465 ------------ docs/examples/maps.md | 79 -- docs/examples/shapes.md | 359 --------- docs/examples/subplots.md | 128 ---- docs/examples/tables.md | 164 ---- docs/examples/ternary.md | 138 ---- docs/examples/time_series.md | 21 - docs/examples/violin.md | 234 ------ docs/make.jl | 146 ++++ docs/manipulating_plots.md | 152 ---- docs/src/api.md | 6 + docs/{ => src}/basics.md | 4 +- docs/src/building_traces_layouts.md | 256 +++++++ docs/{ => src}/contributing.md | 23 +- docs/src/examples/3d.md | 267 +++++++ docs/src/examples/area.md | 46 ++ docs/src/examples/bar.md | 262 +++++++ docs/src/examples/box_plots.md | 251 +++++++ docs/src/examples/contour.md | 254 +++++++ docs/src/examples/finance.md | 60 ++ docs/src/examples/heatmaps.md | 26 + docs/src/examples/histograms.md | 20 + docs/src/examples/line_scatter.md | 339 +++++++++ docs/src/examples/maps.md | 57 ++ docs/src/examples/shapes.md | 182 +++++ docs/src/examples/subplots.md | 70 ++ docs/src/examples/tables.md | 118 +++ docs/src/examples/ternary.md | 118 +++ docs/src/examples/time_series.md | 14 + docs/src/examples/violin.md | 162 ++++ docs/{ => src}/index.md | 11 +- docs/src/manipulating_plots.md | 161 ++++ docs/{ => src}/styles.md | 0 docs/{ => src}/syncplots.md | 92 +-- docs/theme/__init__.py | 0 docs/theme/assets/fonts/icon.eot | Bin 2224 -> 0 bytes docs/theme/assets/fonts/icon.svg | 22 - docs/theme/assets/fonts/icon.ttf | Bin 2072 -> 0 bytes docs/theme/assets/fonts/icon.woff | Bin 2148 -> 0 bytes .../assets/images/favicon-e565ddfa3b.ico | Bin 1150 -> 0 bytes docs/theme/assets/images/favicon.ico | Bin 1150 -> 0 bytes .../javascripts/application-dfb6964a49.js | 1 - docs/theme/assets/javascripts/application.js | 1 - .../javascripts/modernizr-4a5cc7e01e.js | 1 - docs/theme/assets/javascripts/modernizr.js | 1 - .../stylesheets/application-21e06ffc21.css | 1 - docs/theme/assets/stylesheets/application.css | 1 - .../stylesheets/palettes-2d6c5d2926.css | 1 - docs/theme/assets/stylesheets/palettes.css | 1 - docs/theme/base.html | 180 ----- docs/theme/drawer.html | 69 -- docs/theme/footer.html | 42 -- docs/theme/header.html | 54 -- docs/theme/manifest.json | 7 - docs/theme/nav.html | 32 - docs/update_theme | 2 - examples/3d.jl | 9 +- examples/box_plots.jl | 2 +- examples/finance.jl | 12 +- examples/heatmaps.jl | 2 +- examples/histograms.jl | 2 +- examples/line_scatter.jl | 16 +- examples/maps.jl | 6 +- examples/shapes.jl | 3 +- examples/tables.jl | 5 +- examples/ternary.jl | 18 +- mkdocs.yml | 50 -- src/PlotlyJS.jl | 43 +- src/savefig_orca.jl | 4 - 91 files changed, 3523 insertions(+), 5300 deletions(-) create mode 100644 .github/workflows/deploy_docs.yml delete mode 100755 deploy_docs.sh create mode 100644 docs/.gitignore create mode 100644 docs/Project.toml delete mode 100644 docs/building_traces_layouts.md delete mode 100644 docs/css/base16-solarized-light.css delete mode 100644 docs/css/base16-tomorrow-dark.css delete mode 100644 docs/css/base16-tomorrow-light.css delete mode 100644 docs/css/github.css delete mode 100644 docs/css/tomorrow-night-eighties.css delete mode 100644 docs/examples/3d.md delete mode 100644 docs/examples/area.md delete mode 100644 docs/examples/bar.md delete mode 100644 docs/examples/box_plots.md delete mode 100644 docs/examples/contour.md delete mode 100644 docs/examples/finance.md delete mode 100644 docs/examples/heatmaps.md delete mode 100644 docs/examples/histograms.md delete mode 100644 docs/examples/line_scatter.md delete mode 100644 docs/examples/maps.md delete mode 100644 docs/examples/shapes.md delete mode 100644 docs/examples/subplots.md delete mode 100644 docs/examples/tables.md delete mode 100644 docs/examples/ternary.md delete mode 100644 docs/examples/time_series.md delete mode 100644 docs/examples/violin.md create mode 100644 docs/make.jl delete mode 100644 docs/manipulating_plots.md create mode 100644 docs/src/api.md rename docs/{ => src}/basics.md (94%) create mode 100644 docs/src/building_traces_layouts.md rename docs/{ => src}/contributing.md (70%) create mode 100644 docs/src/examples/3d.md create mode 100644 docs/src/examples/area.md create mode 100644 docs/src/examples/bar.md create mode 100644 docs/src/examples/box_plots.md create mode 100644 docs/src/examples/contour.md create mode 100644 docs/src/examples/finance.md create mode 100644 docs/src/examples/heatmaps.md create mode 100644 docs/src/examples/histograms.md create mode 100644 docs/src/examples/line_scatter.md create mode 100644 docs/src/examples/maps.md create mode 100644 docs/src/examples/shapes.md create mode 100644 docs/src/examples/subplots.md create mode 100644 docs/src/examples/tables.md create mode 100644 docs/src/examples/ternary.md create mode 100644 docs/src/examples/time_series.md create mode 100644 docs/src/examples/violin.md rename docs/{ => src}/index.md (81%) create mode 100644 docs/src/manipulating_plots.md rename docs/{ => src}/styles.md (100%) rename docs/{ => src}/syncplots.md (53%) delete mode 100644 docs/theme/__init__.py delete mode 100755 docs/theme/assets/fonts/icon.eot delete mode 100755 docs/theme/assets/fonts/icon.svg delete mode 100755 docs/theme/assets/fonts/icon.ttf delete mode 100755 docs/theme/assets/fonts/icon.woff delete mode 100644 docs/theme/assets/images/favicon-e565ddfa3b.ico delete mode 100644 docs/theme/assets/images/favicon.ico delete mode 100644 docs/theme/assets/javascripts/application-dfb6964a49.js delete mode 100644 docs/theme/assets/javascripts/application.js delete mode 100644 docs/theme/assets/javascripts/modernizr-4a5cc7e01e.js delete mode 100644 docs/theme/assets/javascripts/modernizr.js delete mode 100644 docs/theme/assets/stylesheets/application-21e06ffc21.css delete mode 100644 docs/theme/assets/stylesheets/application.css delete mode 100644 docs/theme/assets/stylesheets/palettes-2d6c5d2926.css delete mode 100644 docs/theme/assets/stylesheets/palettes.css delete mode 100644 docs/theme/base.html delete mode 100644 docs/theme/drawer.html delete mode 100644 docs/theme/footer.html delete mode 100644 docs/theme/header.html delete mode 100644 docs/theme/manifest.json delete mode 100644 docs/theme/nav.html delete mode 100755 docs/update_theme delete mode 100644 mkdocs.yml delete mode 100644 src/savefig_orca.jl diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml new file mode 100644 index 00000000..de5c6b95 --- /dev/null +++ b/.github/workflows/deploy_docs.yml @@ -0,0 +1,21 @@ +name: Deploy documentation + +on: + push: + branches: + - master + tags: + - v* + +jobs: + docdeploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/julia-buildpkg@latest + env: + PYTHON: "" + - uses: julia-actions/julia-docdeploy@releases/v1 + env: + DOCUMENTER_KEY: ${{ secrets.JLPKGBUTLER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml index 26d2f400..f2eb56a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,24 @@ -# Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -sudo: required -os: - - linux -julia: - - 1.3 +# Documentation: http://docs.travis-ci.com/user/languages/julia/ +language: julia +sudo: required +os: + - linux +julia: + - 1.3 - 1.4 - - nightly -matrix: - allow_failures: - - julia: nightly -addons: - apt: - packages: - - xvfb - - xauth - - libgtk-3-0 -notifications: - email: false -# uncomment the following lines to override the default test script -script: - - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - - xvfb-run julia -e 'using Pkg; Pkg.build(); Pkg.test(coverage=true)' + - 1.5 + - nightly +matrix: + allow_failures: + - julia: nightly +addons: + apt: + packages: + - xvfb + - xauth + - libgtk-3-0 +notifications: + email: false +# uncomment the following lines to override the default test script +script: + - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi diff --git a/CHANGELOG.md b/CHANGELOG.md index ee45520f..5eff0d98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,376 +1,664 @@ -# Change Log +# Changelog -## [v0.10.1](https://github.com/sglyon/PlotlyJS.jl/tree/v0.10.1) (2018-02-07) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.10.0...v0.10.1) +## [Unreleased](https://github.com/JuliaPlots/PlotlyJS.jl/tree/HEAD) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.13.1...HEAD) + +**Closed issues:** + +- Update jupyterlab instructions in readme [\#341](https://github.com/JuliaPlots/PlotlyJS.jl/issues/341) +- Link to documentations leads to 404 [\#336](https://github.com/JuliaPlots/PlotlyJS.jl/issues/336) +- Move to JuliaPlots [\#335](https://github.com/JuliaPlots/PlotlyJS.jl/issues/335) +- How to customize download plot options? [\#326](https://github.com/JuliaPlots/PlotlyJS.jl/issues/326) +- Problem for mesh3d intensity [\#324](https://github.com/JuliaPlots/PlotlyJS.jl/issues/324) +- Multiple Spheres in same figure [\#323](https://github.com/JuliaPlots/PlotlyJS.jl/issues/323) +- react! does not update plot [\#317](https://github.com/JuliaPlots/PlotlyJS.jl/issues/317) +- failed process: Process\(`curl -s -S -g -L -f -o /tmp/jl\_G4ODCZ/packages/PlotlyJS/AhkM5/deps/plotschema.json 'https://api.plot.ly/v2/plot-schema?sha1'`, ProcessExited\(22\)\) \[22\] [\#316](https://github.com/JuliaPlots/PlotlyJS.jl/issues/316) +- Neither showEditInChartStudio nor showSendToCloud configurations have any effect [\#313](https://github.com/JuliaPlots/PlotlyJS.jl/issues/313) +- Release patched version [\#306](https://github.com/JuliaPlots/PlotlyJS.jl/issues/306) +- react! eventually kills connection to Plotly [\#264](https://github.com/JuliaPlots/PlotlyJS.jl/issues/264) +- hover attribute does not show x and y coordinates [\#195](https://github.com/JuliaPlots/PlotlyJS.jl/issues/195) + +**Merged pull requests:** + +- Update for Julia 1: Use dot broadcast [\#337](https://github.com/JuliaPlots/PlotlyJS.jl/pull/337) ([diegozea](https://github.com/diegozea)) +- Modify plot window dimensions on creation to fit plot contents [\#315](https://github.com/JuliaPlots/PlotlyJS.jl/pull/315) ([dsfenn](https://github.com/dsfenn)) +- Update line\_scatter.jl [\#310](https://github.com/JuliaPlots/PlotlyJS.jl/pull/310) ([bdeket](https://github.com/bdeket)) +- Install TagBot as a GitHub Action [\#309](https://github.com/JuliaPlots/PlotlyJS.jl/pull/309) ([JuliaTagBot](https://github.com/JuliaTagBot)) +- CompatHelper: add new compat entry for "Requires" at version "1.0" [\#308](https://github.com/JuliaPlots/PlotlyJS.jl/pull/308) ([github-actions[bot]](https://github.com/apps/github-actions)) +- CompatHelper: add new compat entry for "JSExpr" at version "1.0" [\#307](https://github.com/JuliaPlots/PlotlyJS.jl/pull/307) ([github-actions[bot]](https://github.com/apps/github-actions)) + +## [v0.13.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.13.1) (2020-01-16) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.13.0...v0.13.1) + +**Closed issues:** + +- Usage of API functions, how does they work in Julia 1.2.0? [\#305](https://github.com/JuliaPlots/PlotlyJS.jl/issues/305) +- Create new labels [\#303](https://github.com/JuliaPlots/PlotlyJS.jl/issues/303) +- "options" keyword does not affect figure [\#300](https://github.com/JuliaPlots/PlotlyJS.jl/issues/300) +- question: how to make this code more compact? [\#298](https://github.com/JuliaPlots/PlotlyJS.jl/issues/298) +- shapes in subplots [\#297](https://github.com/JuliaPlots/PlotlyJS.jl/issues/297) +- Precompilation conflicts [\#294](https://github.com/JuliaPlots/PlotlyJS.jl/issues/294) +- color scale question [\#292](https://github.com/JuliaPlots/PlotlyJS.jl/issues/292) +- Plots don't appear in Juno's plot-pane [\#269](https://github.com/JuliaPlots/PlotlyJS.jl/issues/269) + +**Merged pull requests:** + +- Add pull request labeler [\#301](https://github.com/JuliaPlots/PlotlyJS.jl/pull/301) ([abhishalya](https://github.com/abhishalya)) +- fix \#294 [\#299](https://github.com/JuliaPlots/PlotlyJS.jl/pull/299) ([MoonCoral](https://github.com/MoonCoral)) + +## [v0.13.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.13.0) (2019-10-03) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.12.5...v0.13.0) + +**Closed issues:** + +- savefig fails for html format [\#293](https://github.com/JuliaPlots/PlotlyJS.jl/issues/293) +- Plots on a remote jupyter notebook [\#291](https://github.com/JuliaPlots/PlotlyJS.jl/issues/291) +- annotation [\#290](https://github.com/JuliaPlots/PlotlyJS.jl/issues/290) +- axis attributes do not work for scatter3d [\#287](https://github.com/JuliaPlots/PlotlyJS.jl/issues/287) +- No Output in Notebook \(Julia v1.0.2\) [\#255](https://github.com/JuliaPlots/PlotlyJS.jl/issues/255) + +**Merged pull requests:** + +- show plots in juno plotpane \(fix \#269\) [\#289](https://github.com/JuliaPlots/PlotlyJS.jl/pull/289) ([daschw](https://github.com/daschw)) +- Don't assume a global WebIO instance in JS code \(fix JupyterLab\). [\#288](https://github.com/JuliaPlots/PlotlyJS.jl/pull/288) ([travigd](https://github.com/travigd)) + +## [v0.12.5](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.12.5) (2019-06-28) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.12.4...v0.12.5) + +**Closed issues:** + +- File save error(.eps) [\#284](https://github.com/JuliaPlots/PlotlyJS.jl/issues/284) +- Plots don't display in Jupyter with WebIO v0.8.1 [\#278](https://github.com/JuliaPlots/PlotlyJS.jl/issues/278) + +**Merged pull requests:** + +- Update to latest WebIO. [\#285](https://github.com/JuliaPlots/PlotlyJS.jl/pull/285) ([travigd](https://github.com/travigd)) + +## [v0.12.4](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.12.4) (2019-05-16) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.12.3...v0.12.4) + +**Closed issues:** + +- How to combine heatmap and scatter? [\#280](https://github.com/JuliaPlots/PlotlyJS.jl/issues/280) +- Subplot layout editing issues [\#277](https://github.com/JuliaPlots/PlotlyJS.jl/issues/277) +- Failed to Precompile Mux, Blink, PlotlyJS [\#275](https://github.com/JuliaPlots/PlotlyJS.jl/issues/275) +- Julia : ERROR: KeyError: key "set\_facecolor" not found [\#270](https://github.com/JuliaPlots/PlotlyJS.jl/issues/270) +- Missing support [\#265](https://github.com/JuliaPlots/PlotlyJS.jl/issues/265) +- Cannot savefig to html on Julia 1.0.3 [\#263](https://github.com/JuliaPlots/PlotlyJS.jl/issues/263) +- Selecting points no longer works [\#262](https://github.com/JuliaPlots/PlotlyJS.jl/issues/262) + +**Merged pull requests:** + +- Revert "Add fix for WebIO 0.8.0+." [\#279](https://github.com/JuliaPlots/PlotlyJS.jl/pull/279) ([sglyon](https://github.com/sglyon)) +- Broadcasting change in Julia 1.1 [\#274](https://github.com/JuliaPlots/PlotlyJS.jl/pull/274) ([jlperla](https://github.com/jlperla)) +- Add fix for WebIO 0.8.0+. [\#267](https://github.com/JuliaPlots/PlotlyJS.jl/pull/267) ([travigd](https://github.com/travigd)) +- Do not recursively call JSON.lower [\#266](https://github.com/JuliaPlots/PlotlyJS.jl/pull/266) ([TotalVerb](https://github.com/TotalVerb)) +- Check for data files before downloading them during build. [\#237](https://github.com/JuliaPlots/PlotlyJS.jl/pull/237) ([jjstickel](https://github.com/jjstickel)) + +## [v0.12.3](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.12.3) (2019-01-23) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.12.2...v0.12.3) + +**Closed issues:** + +- index.js and display.jl out of sync [\#261](https://github.com/JuliaPlots/PlotlyJS.jl/issues/261) +- WebGL / Max Dataset Size/Data Point Quantity? [\#260](https://github.com/JuliaPlots/PlotlyJS.jl/issues/260) +- Error when "using Blink" [\#259](https://github.com/JuliaPlots/PlotlyJS.jl/issues/259) + +## [v0.12.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.12.2) (2018-12-29) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.12.1...v0.12.2) + +**Closed issues:** + +- \_use\_remote not defined [\#257](https://github.com/JuliaPlots/PlotlyJS.jl/issues/257) +- Subplots do not scale correctly when using plotlyjs\(\) with Plots.jl [\#256](https://github.com/JuliaPlots/PlotlyJS.jl/issues/256) +- Blank plots [\#254](https://github.com/JuliaPlots/PlotlyJS.jl/issues/254) + +**Merged pull requests:** + +- Insert PlotlyJSDisplay just after REPL instead of pushing. [\#258](https://github.com/JuliaPlots/PlotlyJS.jl/pull/258) ([EricForgy](https://github.com/EricForgy)) + +## [v0.12.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.12.1) (2018-12-03) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.12.0...v0.12.1) **Closed issues:** -- Installation issue on local computer: plotly.js javascript libary not found - [\#176](https://github.com/sglyon/PlotlyJS.jl/issues/176) -- Allow calling init\_notebook outside of jupyter [\#174](https://github.com/sglyon/PlotlyJS.jl/issues/174) -- ERROR: LoadError: Cannot find Electron. [\#172](https://github.com/sglyon/PlotlyJS.jl/issues/172) -- Require DataFrames failed [\#169](https://github.com/sglyon/PlotlyJS.jl/issues/169) -- Add violin trace [\#167](https://github.com/sglyon/PlotlyJS.jl/issues/167) -- save to pdf [\#137](https://github.com/sglyon/PlotlyJS.jl/issues/137) +- Blink/Atom/Electron not connecting properly to PlotlyJS [\#253](https://github.com/JuliaPlots/PlotlyJS.jl/issues/253) +- Transforms [\#252](https://github.com/JuliaPlots/PlotlyJS.jl/issues/252) -## [v0.10.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.10.0) (2018-02-01) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.9.0...v0.10.0) +## [v0.12.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.12.0) (2018-11-05) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.11.2...v0.12.0) **Closed issues:** -- Blink Display error [\#170](https://github.com/sglyon/PlotlyJS.jl/issues/170) +- Styles not working as expected [\#249](https://github.com/JuliaPlots/PlotlyJS.jl/issues/249) +- Issues with displaying plot in jupyter-lab [\#248](https://github.com/JuliaPlots/PlotlyJS.jl/issues/248) +- Can't add PlotlyJS [\#246](https://github.com/JuliaPlots/PlotlyJS.jl/issues/246) +- Blank plots [\#245](https://github.com/JuliaPlots/PlotlyJS.jl/issues/245) +- seeming regression on Julia 0.7 [\#239](https://github.com/JuliaPlots/PlotlyJS.jl/issues/239) +- Plotly examples do not work [\#236](https://github.com/JuliaPlots/PlotlyJS.jl/issues/236) +- PlotlyJS plots not showing up in Juno/ijulia [\#235](https://github.com/JuliaPlots/PlotlyJS.jl/issues/235) +- Layout: strange bug [\#234](https://github.com/JuliaPlots/PlotlyJS.jl/issues/234) +- Juno compatibility [\#229](https://github.com/JuliaPlots/PlotlyJS.jl/issues/229) **Merged pull requests:** -- Sl/plotlybase [\#171](https://github.com/sglyon/PlotlyJS.jl/pull/171) ([sglyon](https://github.com/sglyon)) +- Fix the link to the Plots.jl homepage in index.md [\#247](https://github.com/JuliaPlots/PlotlyJS.jl/pull/247) ([Kryohi](https://github.com/Kryohi)) +- Fixed a typo in the docs [\#241](https://github.com/JuliaPlots/PlotlyJS.jl/pull/241) ([ghuba](https://github.com/ghuba)) + +## [v0.11.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.11.2) (2018-09-27) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.11.1...v0.11.2) + +**Closed issues:** + +- How to clear a figure without generating an error? [\#233](https://github.com/JuliaPlots/PlotlyJS.jl/issues/233) +- JSString not defined [\#232](https://github.com/JuliaPlots/PlotlyJS.jl/issues/232) +- OSTYPE environmental variable in ORCA/deps/bin [\#228](https://github.com/JuliaPlots/PlotlyJS.jl/issues/228) +- Cones and streamtubes [\#227](https://github.com/JuliaPlots/PlotlyJS.jl/issues/227) +- ColorBrewer palettes not working in PlotlyJS v0.11.1 [\#225](https://github.com/JuliaPlots/PlotlyJS.jl/issues/225) +- Dynamical plotting with extendtraces! in Julia 0.7 [\#223](https://github.com/JuliaPlots/PlotlyJS.jl/issues/223) +- Plots integration still not working [\#222](https://github.com/JuliaPlots/PlotlyJS.jl/issues/222) +- Feature request: Parallel Coordinates Plot [\#218](https://github.com/JuliaPlots/PlotlyJS.jl/issues/218) + +**Merged pull requests:** + +- use webio for Juno integration [\#231](https://github.com/JuliaPlots/PlotlyJS.jl/pull/231) ([pfitzseb](https://github.com/pfitzseb)) +- ENH: enables dynamical plotting when run in terminal or atom [\#224](https://github.com/JuliaPlots/PlotlyJS.jl/pull/224) ([kleskjr](https://github.com/kleskjr)) + +## [v0.11.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.11.1) (2018-09-06) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.11.0...v0.11.1) + +**Closed issues:** + +- Can't close plot windows programmatically [\#220](https://github.com/JuliaPlots/PlotlyJS.jl/issues/220) +- used to work; doesn't now [\#219](https://github.com/JuliaPlots/PlotlyJS.jl/issues/219) +- Error while building the package in Julia 0.7 [\#217](https://github.com/JuliaPlots/PlotlyJS.jl/issues/217) +- Missing "Reexport" dependency [\#215](https://github.com/JuliaPlots/PlotlyJS.jl/issues/215) +- Cannot display under Atom/Juno \(Julia v0.7.0\) [\#214](https://github.com/JuliaPlots/PlotlyJS.jl/issues/214) +- Not sure if this warning is yours.... [\#196](https://github.com/JuliaPlots/PlotlyJS.jl/issues/196) -## [v0.9.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.9.0) (2018-01-20) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.8.3...v0.9.0) +## [v0.11.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.11.0) (2018-09-05) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.10.3...v0.11.0) + +**Implemented enhancements:** + +- Integrate with the display-backend stack [\#122](https://github.com/JuliaPlots/PlotlyJS.jl/issues/122) + +**Closed issues:** + +- Markdown not defined on master during build [\#212](https://github.com/JuliaPlots/PlotlyJS.jl/issues/212) +- UndefVarError: plotattributes not defined [\#211](https://github.com/JuliaPlots/PlotlyJS.jl/issues/211) +- Error building - Julia 1.0 [\#210](https://github.com/JuliaPlots/PlotlyJS.jl/issues/210) +- Manual redraw! [\#209](https://github.com/JuliaPlots/PlotlyJS.jl/issues/209) +- Fails to build or precompile on Julia 1.0.0 - Markdown not defined [\#207](https://github.com/JuliaPlots/PlotlyJS.jl/issues/207) +- Failure on Linux, 0.7.0 [\#205](https://github.com/JuliaPlots/PlotlyJS.jl/issues/205) +- Error building `PlotlyJS` on 1.0.0 [\#204](https://github.com/JuliaPlots/PlotlyJS.jl/issues/204) +- PlotlyJS can't be built on Julia 0.7 [\#203](https://github.com/JuliaPlots/PlotlyJS.jl/issues/203) +- Build failure of master \(v0.10.2\) on julia 1.0: `Markdown not defined` [\#202](https://github.com/JuliaPlots/PlotlyJS.jl/issues/202) +- Failure to precompile under Julia v0.7.0: Date not defined [\#201](https://github.com/JuliaPlots/PlotlyJS.jl/issues/201) +- Failure to Precompile: JSString not defined [\#198](https://github.com/JuliaPlots/PlotlyJS.jl/issues/198) +- Failing to plot locally, Julia0.6.4 OSX [\#197](https://github.com/JuliaPlots/PlotlyJS.jl/issues/197) +- savefig areaplot [\#192](https://github.com/JuliaPlots/PlotlyJS.jl/issues/192) +- Add show for "application/vnd.plotly.v1+json" mime type [\#191](https://github.com/JuliaPlots/PlotlyJS.jl/issues/191) +- displayModeBar = false [\#185](https://github.com/JuliaPlots/PlotlyJS.jl/issues/185) +- Remove Blink dependency? [\#184](https://github.com/JuliaPlots/PlotlyJS.jl/issues/184) +- savefig stacked in a while loop for saving a subplot from Plots.jl [\#180](https://github.com/JuliaPlots/PlotlyJS.jl/issues/180) +- Build fails on julia-0.6.0 [\#179](https://github.com/JuliaPlots/PlotlyJS.jl/issues/179) +- Ensuring Blink.AtomShell.install\(\) called [\#175](https://github.com/JuliaPlots/PlotlyJS.jl/issues/175) +- Issue generating figures with a for loop [\#165](https://github.com/JuliaPlots/PlotlyJS.jl/issues/165) +- Module Options [\#108](https://github.com/JuliaPlots/PlotlyJS.jl/issues/108) +- Hook into plotly events [\#27](https://github.com/JuliaPlots/PlotlyJS.jl/issues/27) + +**Merged pull requests:** + +- info -\> @info [\#216](https://github.com/JuliaPlots/PlotlyJS.jl/pull/216) ([cstjean](https://github.com/cstjean)) +- Import html\_body from PlotlyBase [\#213](https://github.com/JuliaPlots/PlotlyJS.jl/pull/213) ([cstjean](https://github.com/cstjean)) +- WIP: Sl/0.7 [\#208](https://github.com/JuliaPlots/PlotlyJS.jl/pull/208) ([sglyon](https://github.com/sglyon)) +- Fix deprecations [\#206](https://github.com/JuliaPlots/PlotlyJS.jl/pull/206) ([femtocleaner[bot]](https://github.com/apps/femtocleaner)) +- Fixes for Julia v0.7 [\#200](https://github.com/JuliaPlots/PlotlyJS.jl/pull/200) ([VPetukhov](https://github.com/VPetukhov)) +- webio integration [\#193](https://github.com/JuliaPlots/PlotlyJS.jl/pull/193) ([piever](https://github.com/piever)) + +## [v0.10.3](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.10.3) (2018-06-23) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.10.2...v0.10.3) + +**Closed issues:** + +- Fail to plot scatter3d [\#190](https://github.com/JuliaPlots/PlotlyJS.jl/issues/190) +- changes in scatter3d axis label specification? [\#189](https://github.com/JuliaPlots/PlotlyJS.jl/issues/189) +- Unable to use `scatter` [\#188](https://github.com/JuliaPlots/PlotlyJS.jl/issues/188) +- currently uninstallable on 0.6.2. [\#187](https://github.com/JuliaPlots/PlotlyJS.jl/issues/187) +- Adding logo [\#186](https://github.com/JuliaPlots/PlotlyJS.jl/issues/186) + +## [v0.10.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.10.2) (2018-03-05) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.10.1...v0.10.2) + +**Closed issues:** + +- JupyterLab incompatibility [\#182](https://github.com/JuliaPlots/PlotlyJS.jl/issues/182) +- Error requiring IJulia from PlotlyJS [\#181](https://github.com/JuliaPlots/PlotlyJS.jl/issues/181) + +**Merged pull requests:** + +- Fix paths in build.jl [\#183](https://github.com/JuliaPlots/PlotlyJS.jl/pull/183) ([EricForgy](https://github.com/EricForgy)) + +## [v0.10.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.10.1) (2018-02-07) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.10.0...v0.10.1) + +**Closed issues:** + +- Installation issue on local computer: plotly.js javascript libary not found - [\#176](https://github.com/JuliaPlots/PlotlyJS.jl/issues/176) +- Allow calling init\_notebook outside of jupyter [\#174](https://github.com/JuliaPlots/PlotlyJS.jl/issues/174) +- ERROR: LoadError: Cannot find Electron. [\#172](https://github.com/JuliaPlots/PlotlyJS.jl/issues/172) +- Require DataFrames failed [\#169](https://github.com/JuliaPlots/PlotlyJS.jl/issues/169) +- Add violin trace [\#167](https://github.com/JuliaPlots/PlotlyJS.jl/issues/167) +- save to pdf [\#137](https://github.com/JuliaPlots/PlotlyJS.jl/issues/137) + +## [v0.10.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.10.0) (2018-02-01) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.9.0...v0.10.0) + +**Closed issues:** + +- Blink Display error [\#170](https://github.com/JuliaPlots/PlotlyJS.jl/issues/170) + +**Merged pull requests:** + +- Sl/plotlybase [\#171](https://github.com/JuliaPlots/PlotlyJS.jl/pull/171) ([sglyon](https://github.com/sglyon)) + +## [v0.9.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.9.0) (2018-01-20) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.8.3...v0.9.0) **Fixed bugs:** -- Race condition with Blink.jl v0.6.0 and onwards [\#162](https://github.com/sglyon/PlotlyJS.jl/issues/162) +- Race condition with Blink.jl v0.6.0 and onwards [\#162](https://github.com/JuliaPlots/PlotlyJS.jl/issues/162) **Closed issues:** -- Blink/ElectronDisplay [\#164](https://github.com/sglyon/PlotlyJS.jl/issues/164) +- Blink/ElectronDisplay [\#164](https://github.com/JuliaPlots/PlotlyJS.jl/issues/164) **Merged pull requests:** -- Violins [\#168](https://github.com/sglyon/PlotlyJS.jl/pull/168) ([sglyon](https://github.com/sglyon)) -- Fixed some typos [\#166](https://github.com/sglyon/PlotlyJS.jl/pull/166) ([ghuba](https://github.com/ghuba)) -- add subplot examples [\#163](https://github.com/sglyon/PlotlyJS.jl/pull/163) ([jbrea](https://github.com/jbrea)) +- Violins [\#168](https://github.com/JuliaPlots/PlotlyJS.jl/pull/168) ([sglyon](https://github.com/sglyon)) +- Fixed some typos [\#166](https://github.com/JuliaPlots/PlotlyJS.jl/pull/166) ([ghuba](https://github.com/ghuba)) +- add subplot examples [\#163](https://github.com/JuliaPlots/PlotlyJS.jl/pull/163) ([jbrea](https://github.com/jbrea)) -## [v0.8.3](https://github.com/sglyon/PlotlyJS.jl/tree/v0.8.3) (2018-01-11) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.8.2...v0.8.3) +## [v0.8.3](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.8.3) (2018-01-11) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.8.2...v0.8.3) **Fixed bugs:** -- `by` not defined [\#158](https://github.com/sglyon/PlotlyJS.jl/issues/158) +- `by` not defined [\#158](https://github.com/JuliaPlots/PlotlyJS.jl/issues/158) **Closed issues:** -- Subplots generated with comprehension don't show up in Electron in REPL [\#160](https://github.com/sglyon/PlotlyJS.jl/issues/160) +- Subplots generated with comprehension don't show up in Electron in REPL [\#160](https://github.com/JuliaPlots/PlotlyJS.jl/issues/160) + +## [v0.8.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.8.2) (2018-01-06) -## [v0.8.2](https://github.com/sglyon/PlotlyJS.jl/tree/v0.8.2) (2018-01-06) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.8.1...v0.8.2) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.8.1...v0.8.2) -## [v0.8.1](https://github.com/sglyon/PlotlyJS.jl/tree/v0.8.1) (2017-12-19) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.8.0...v0.8.1) +## [v0.8.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.8.1) (2017-12-19) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.8.0...v0.8.1) **Fixed bugs:** -- Do subplots work with surfaces? [\#156](https://github.com/sglyon/PlotlyJS.jl/issues/156) +- Do subplots work with surfaces? [\#156](https://github.com/JuliaPlots/PlotlyJS.jl/issues/156) **Closed issues:** -- apply "columnar" attributes to each series [\#154](https://github.com/sglyon/PlotlyJS.jl/issues/154) -- Error tagging new release [\#153](https://github.com/sglyon/PlotlyJS.jl/issues/153) -- DataFrames v0.11 [\#151](https://github.com/sglyon/PlotlyJS.jl/issues/151) -- right side of plot is not using correct color [\#148](https://github.com/sglyon/PlotlyJS.jl/issues/148) -- subplots throw away shape information [\#138](https://github.com/sglyon/PlotlyJS.jl/issues/138) -- LoadError: Javascript error [\#116](https://github.com/sglyon/PlotlyJS.jl/issues/116) -- RE: EOFError: read end of file [\#105](https://github.com/sglyon/PlotlyJS.jl/issues/105) -- Giant memory leak. [\#102](https://github.com/sglyon/PlotlyJS.jl/issues/102) -- histogram crashing when using PlotlyJS over ssh tunnel [\#101](https://github.com/sglyon/PlotlyJS.jl/issues/101) -- Generating ElectronPlot/ saving plots from Jupyter Notebook [\#88](https://github.com/sglyon/PlotlyJS.jl/issues/88) -- Properties with underscores not handled correctly on trace creation [\#76](https://github.com/sglyon/PlotlyJS.jl/issues/76) -- Wishlist [\#61](https://github.com/sglyon/PlotlyJS.jl/issues/61) -- line labels and legends for subplots collect next to the first subplot [\#59](https://github.com/sglyon/PlotlyJS.jl/issues/59) -- Save multiple plots to single html file \(no subplots\) [\#43](https://github.com/sglyon/PlotlyJS.jl/issues/43) -- Add options for savefig [\#4](https://github.com/sglyon/PlotlyJS.jl/issues/4) +- apply "columnar" attributes to each series [\#154](https://github.com/JuliaPlots/PlotlyJS.jl/issues/154) +- Error tagging new release [\#153](https://github.com/JuliaPlots/PlotlyJS.jl/issues/153) +- DataFrames v0.11 [\#151](https://github.com/JuliaPlots/PlotlyJS.jl/issues/151) +- right side of plot is not using correct color [\#148](https://github.com/JuliaPlots/PlotlyJS.jl/issues/148) +- subplots throw away shape information [\#138](https://github.com/JuliaPlots/PlotlyJS.jl/issues/138) +- LoadError: Javascript error [\#116](https://github.com/JuliaPlots/PlotlyJS.jl/issues/116) +- RE: EOFError: read end of file [\#105](https://github.com/JuliaPlots/PlotlyJS.jl/issues/105) +- Giant memory leak. [\#102](https://github.com/JuliaPlots/PlotlyJS.jl/issues/102) +- histogram crashing when using PlotlyJS over ssh tunnel [\#101](https://github.com/JuliaPlots/PlotlyJS.jl/issues/101) +- Generating ElectronPlot/ saving plots from Jupyter Notebook [\#88](https://github.com/JuliaPlots/PlotlyJS.jl/issues/88) +- Properties with underscores not handled correctly on trace creation [\#76](https://github.com/JuliaPlots/PlotlyJS.jl/issues/76) +- Wishlist [\#61](https://github.com/JuliaPlots/PlotlyJS.jl/issues/61) +- line labels and legends for subplots collect next to the first subplot [\#59](https://github.com/JuliaPlots/PlotlyJS.jl/issues/59) +- Save multiple plots to single html file \(no subplots\) [\#43](https://github.com/JuliaPlots/PlotlyJS.jl/issues/43) +- Add options for savefig [\#4](https://github.com/JuliaPlots/PlotlyJS.jl/issues/4) **Merged pull requests:** -- ENH: subplots with 3d works closes \#156 [\#157](https://github.com/sglyon/PlotlyJS.jl/pull/157) ([sglyon](https://github.com/sglyon)) +- ENH: subplots with 3d works closes \#156 [\#157](https://github.com/JuliaPlots/PlotlyJS.jl/pull/157) ([sglyon](https://github.com/sglyon)) + +## [v0.8.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.8.0) (2017-12-12) -## [v0.8.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.8.0) (2017-12-12) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.7.1...v0.8.0) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.7.1...v0.8.0) **Closed issues:** -- Plot won't display in Atom or in Blink window [\#147](https://github.com/sglyon/PlotlyJS.jl/issues/147) -- Advanced heatmap features help [\#146](https://github.com/sglyon/PlotlyJS.jl/issues/146) -- "updatemenus" support [\#144](https://github.com/sglyon/PlotlyJS.jl/issues/144) -- PlotlyJS \(as a Plots.jl backend\) now fails in Juno \(Atom\) on Ubuntu 16.04 [\#142](https://github.com/sglyon/PlotlyJS.jl/issues/142) -- Possible issue - Error during installation [\#141](https://github.com/sglyon/PlotlyJS.jl/issues/141) -- Run femtocleaner [\#140](https://github.com/sglyon/PlotlyJS.jl/issues/140) -- Unable to install PlotlyJS on Julia 0.6 on Mac [\#139](https://github.com/sglyon/PlotlyJS.jl/issues/139) +- Plot won't display in Atom or in Blink window [\#147](https://github.com/JuliaPlots/PlotlyJS.jl/issues/147) +- Advanced heatmap features help [\#146](https://github.com/JuliaPlots/PlotlyJS.jl/issues/146) +- "updatemenus" support [\#144](https://github.com/JuliaPlots/PlotlyJS.jl/issues/144) +- PlotlyJS \(as a Plots.jl backend\) now fails in Juno \(Atom\) on Ubuntu 16.04 [\#142](https://github.com/JuliaPlots/PlotlyJS.jl/issues/142) +- Possible issue - Error during installation [\#141](https://github.com/JuliaPlots/PlotlyJS.jl/issues/141) +- Run femtocleaner [\#140](https://github.com/JuliaPlots/PlotlyJS.jl/issues/140) +- Unable to install PlotlyJS on Julia 0.6 on Mac [\#139](https://github.com/JuliaPlots/PlotlyJS.jl/issues/139) **Merged pull requests:** -- Develop [\#152](https://github.com/sglyon/PlotlyJS.jl/pull/152) ([sglyon](https://github.com/sglyon)) -- Tiny Cycler fixes [\#149](https://github.com/sglyon/PlotlyJS.jl/pull/149) ([alyst](https://github.com/alyst)) -- use Requires.jl [\#145](https://github.com/sglyon/PlotlyJS.jl/pull/145) ([sglyon](https://github.com/sglyon)) +- Develop [\#152](https://github.com/JuliaPlots/PlotlyJS.jl/pull/152) ([sglyon](https://github.com/sglyon)) +- Tiny Cycler fixes [\#149](https://github.com/JuliaPlots/PlotlyJS.jl/pull/149) ([alyst](https://github.com/alyst)) +- use Requires.jl [\#145](https://github.com/JuliaPlots/PlotlyJS.jl/pull/145) ([sglyon](https://github.com/sglyon)) -## [v0.7.1](https://github.com/sglyon/PlotlyJS.jl/tree/v0.7.1) (2017-10-25) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.7.0...v0.7.1) +## [v0.7.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.7.1) (2017-10-25) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.7.0...v0.7.1) **Merged pull requests:** -- Sl/cyclers [\#143](https://github.com/sglyon/PlotlyJS.jl/pull/143) ([sglyon](https://github.com/sglyon)) +- Sl/cyclers [\#143](https://github.com/JuliaPlots/PlotlyJS.jl/pull/143) ([sglyon](https://github.com/sglyon)) + +## [v0.7.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.7.0) (2017-10-20) -## [v0.7.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.7.0) (2017-10-20) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.6.5...v0.7.0) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.6.5...v0.7.0) -## [v0.6.5](https://github.com/sglyon/PlotlyJS.jl/tree/v0.6.5) (2017-10-20) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.6.4...v0.6.5) +## [v0.6.5](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.6.5) (2017-10-20) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.6.4...v0.6.5) **Closed issues:** -- Hover text doesn't handle same-x data points [\#135](https://github.com/sglyon/PlotlyJS.jl/issues/135) -- HTML output points to a local copy of plotly.js [\#133](https://github.com/sglyon/PlotlyJS.jl/issues/133) -- Inconistent numeric format on logarithmic axis labels [\#132](https://github.com/sglyon/PlotlyJS.jl/issues/132) -- Titles cut off of example plots in documentation [\#131](https://github.com/sglyon/PlotlyJS.jl/issues/131) -- Empty plots in Jupyter notebooks [\#130](https://github.com/sglyon/PlotlyJS.jl/issues/130) -- Using julia 0.6: `filter\(flt, itr\) is deprecated` [\#124](https://github.com/sglyon/PlotlyJS.jl/issues/124) -- no show \(Windows 7, Julia 0.5, electron\) [\#81](https://github.com/sglyon/PlotlyJS.jl/issues/81) +- Hover text doesn't handle same-x data points [\#135](https://github.com/JuliaPlots/PlotlyJS.jl/issues/135) +- HTML output points to a local copy of plotly.js [\#133](https://github.com/JuliaPlots/PlotlyJS.jl/issues/133) +- Inconistent numeric format on logarithmic axis labels [\#132](https://github.com/JuliaPlots/PlotlyJS.jl/issues/132) +- Titles cut off of example plots in documentation [\#131](https://github.com/JuliaPlots/PlotlyJS.jl/issues/131) +- Empty plots in Jupyter notebooks [\#130](https://github.com/JuliaPlots/PlotlyJS.jl/issues/130) +- Using julia 0.6: `filter\(flt, itr\) is deprecated` [\#124](https://github.com/JuliaPlots/PlotlyJS.jl/issues/124) +- no show \(Windows 7, Julia 0.5, electron\) [\#81](https://github.com/JuliaPlots/PlotlyJS.jl/issues/81) **Merged pull requests:** -- Fix deprecations [\#134](https://github.com/sglyon/PlotlyJS.jl/pull/134) ([femtocleaner[bot]](https://github.com/apps/femtocleaner)) +- Fix deprecations [\#134](https://github.com/JuliaPlots/PlotlyJS.jl/pull/134) ([femtocleaner[bot]](https://github.com/apps/femtocleaner)) + +## [v0.6.4](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.6.4) (2017-07-13) -## [v0.6.4](https://github.com/sglyon/PlotlyJS.jl/tree/v0.6.4) (2017-07-13) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.6.3...v0.6.4) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.6.3...v0.6.4) **Closed issues:** -- Subplots not appearing [\#128](https://github.com/sglyon/PlotlyJS.jl/issues/128) -- Transparent surface plots [\#126](https://github.com/sglyon/PlotlyJS.jl/issues/126) -- Error showing value of type PlotlyJS.SyncPlot{PlotlyJS.ElectronDisplay} [\#110](https://github.com/sglyon/PlotlyJS.jl/issues/110) +- Subplots not appearing [\#128](https://github.com/JuliaPlots/PlotlyJS.jl/issues/128) +- Transparent surface plots [\#126](https://github.com/JuliaPlots/PlotlyJS.jl/issues/126) +- Error showing value of type PlotlyJS.SyncPlot{PlotlyJS.ElectronDisplay} [\#110](https://github.com/JuliaPlots/PlotlyJS.jl/issues/110) **Merged pull requests:** -- Abstrrrract [\#129](https://github.com/sglyon/PlotlyJS.jl/pull/129) ([JobJob](https://github.com/JobJob)) -- Readall rename and Js loading default [\#127](https://github.com/sglyon/PlotlyJS.jl/pull/127) ([JobJob](https://github.com/JobJob)) +- Abstrrrract [\#129](https://github.com/JuliaPlots/PlotlyJS.jl/pull/129) ([JobJob](https://github.com/JobJob)) +- Readall rename and Js loading default [\#127](https://github.com/JuliaPlots/PlotlyJS.jl/pull/127) ([JobJob](https://github.com/JobJob)) -## [v0.6.3](https://github.com/sglyon/PlotlyJS.jl/tree/v0.6.3) (2017-06-26) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.6.2...v0.6.3) +## [v0.6.3](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.6.3) (2017-06-26) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.6.2...v0.6.3) **Closed issues:** -- Failed to precompile PlotlyJS on windows, Julia 0.5 [\#123](https://github.com/sglyon/PlotlyJS.jl/issues/123) -- xaxis\_title in mesh3d [\#121](https://github.com/sglyon/PlotlyJS.jl/issues/121) -- Changing colorscale in Scatter Plots [\#117](https://github.com/sglyon/PlotlyJS.jl/issues/117) -- Error handling websocket connection [\#115](https://github.com/sglyon/PlotlyJS.jl/issues/115) -- Feature request: DateTime support [\#87](https://github.com/sglyon/PlotlyJS.jl/issues/87) -- savefig hangs if the plot hasn't been displayed for long enough [\#73](https://github.com/sglyon/PlotlyJS.jl/issues/73) -- Using with Hydrogen? [\#42](https://github.com/sglyon/PlotlyJS.jl/issues/42) +- Failed to precompile PlotlyJS on windows, Julia 0.5 [\#123](https://github.com/JuliaPlots/PlotlyJS.jl/issues/123) +- xaxis\_title in mesh3d [\#121](https://github.com/JuliaPlots/PlotlyJS.jl/issues/121) +- Changing colorscale in Scatter Plots [\#117](https://github.com/JuliaPlots/PlotlyJS.jl/issues/117) +- Error handling websocket connection [\#115](https://github.com/JuliaPlots/PlotlyJS.jl/issues/115) +- Feature request: DateTime support [\#87](https://github.com/JuliaPlots/PlotlyJS.jl/issues/87) +- savefig hangs if the plot hasn't been displayed for long enough [\#73](https://github.com/JuliaPlots/PlotlyJS.jl/issues/73) +- Using with Hydrogen? [\#42](https://github.com/JuliaPlots/PlotlyJS.jl/issues/42) **Merged pull requests:** -- Update CI URLs to point to new caching infrastructure [\#120](https://github.com/sglyon/PlotlyJS.jl/pull/120) ([staticfloat](https://github.com/staticfloat)) -- Fix duplicate setting of keyword parameter, test more versions, add badges [\#119](https://github.com/sglyon/PlotlyJS.jl/pull/119) ([ScottPJones](https://github.com/ScottPJones)) +- Update CI URLs to point to new caching infrastructure [\#120](https://github.com/JuliaPlots/PlotlyJS.jl/pull/120) ([staticfloat](https://github.com/staticfloat)) +- Fix duplicate setting of keyword parameter, test more versions, add badges [\#119](https://github.com/JuliaPlots/PlotlyJS.jl/pull/119) ([ScottPJones](https://github.com/ScottPJones)) + +## [v0.6.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.6.2) (2017-05-01) -## [v0.6.2](https://github.com/sglyon/PlotlyJS.jl/tree/v0.6.2) (2017-05-01) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.6.1...v0.6.2) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.6.1...v0.6.2) -## [v0.6.1](https://github.com/sglyon/PlotlyJS.jl/tree/v0.6.1) (2017-04-28) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.6.0...v0.6.1) +## [v0.6.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.6.1) (2017-04-28) -## [v0.6.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.6.0) (2017-04-14) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.5.2...v0.6.0) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.6.0...v0.6.1) + +## [v0.6.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.6.0) (2017-04-14) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.5.2...v0.6.0) **Closed issues:** -- HTML script virus in examples [\#113](https://github.com/sglyon/PlotlyJS.jl/issues/113) -- 2D-Histogram examples are not working [\#111](https://github.com/sglyon/PlotlyJS.jl/issues/111) -- close plot window [\#109](https://github.com/sglyon/PlotlyJS.jl/issues/109) -- Errors arise after clearing workspace [\#107](https://github.com/sglyon/PlotlyJS.jl/issues/107) -- plot heatmap function gives a compile error when working on a variable from a global scope [\#106](https://github.com/sglyon/PlotlyJS.jl/issues/106) -- Plotting a 3D surface with facecolor different from its height values [\#104](https://github.com/sglyon/PlotlyJS.jl/issues/104) -- WARNING: bytestring is deprecated [\#103](https://github.com/sglyon/PlotlyJS.jl/issues/103) -- clims in heatmap not supported? [\#99](https://github.com/sglyon/PlotlyJS.jl/issues/99) -- Plot, plot, \[plots\] and docs [\#74](https://github.com/sglyon/PlotlyJS.jl/issues/74) +- HTML script virus in examples [\#113](https://github.com/JuliaPlots/PlotlyJS.jl/issues/113) +- 2D-Histogram examples are not working [\#111](https://github.com/JuliaPlots/PlotlyJS.jl/issues/111) +- close plot window [\#109](https://github.com/JuliaPlots/PlotlyJS.jl/issues/109) +- Errors arise after clearing workspace [\#107](https://github.com/JuliaPlots/PlotlyJS.jl/issues/107) +- plot heatmap function gives a compile error when working on a variable from a global scope [\#106](https://github.com/JuliaPlots/PlotlyJS.jl/issues/106) +- Plotting a 3D surface with facecolor different from its height values [\#104](https://github.com/JuliaPlots/PlotlyJS.jl/issues/104) +- WARNING: bytestring is deprecated [\#103](https://github.com/JuliaPlots/PlotlyJS.jl/issues/103) +- clims in heatmap not supported? [\#99](https://github.com/JuliaPlots/PlotlyJS.jl/issues/99) +- Plot, plot, \[plots\] and docs [\#74](https://github.com/JuliaPlots/PlotlyJS.jl/issues/74) **Merged pull requests:** -- Sl/dataframes [\#112](https://github.com/sglyon/PlotlyJS.jl/pull/112) ([sglyon](https://github.com/sglyon)) +- Sl/dataframes [\#112](https://github.com/JuliaPlots/PlotlyJS.jl/pull/112) ([sglyon](https://github.com/sglyon)) -## [v0.5.2](https://github.com/sglyon/PlotlyJS.jl/tree/v0.5.2) (2016-12-07) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.5.1...v0.5.2) +## [v0.5.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.5.2) (2016-12-07) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.5.1...v0.5.2) **Closed issues:** -- Plot is too big? [\#98](https://github.com/sglyon/PlotlyJS.jl/issues/98) -- Stacked subplots, more than 2 yaxis [\#96](https://github.com/sglyon/PlotlyJS.jl/issues/96) -- Loaded notebooks have no plots [\#89](https://github.com/sglyon/PlotlyJS.jl/issues/89) +- Plot is too big? [\#98](https://github.com/JuliaPlots/PlotlyJS.jl/issues/98) +- Stacked subplots, more than 2 yaxis [\#96](https://github.com/JuliaPlots/PlotlyJS.jl/issues/96) +- Loaded notebooks have no plots [\#89](https://github.com/JuliaPlots/PlotlyJS.jl/issues/89) **Merged pull requests:** -- Complete Contour Examples [\#95](https://github.com/sglyon/PlotlyJS.jl/pull/95) ([caimichael](https://github.com/caimichael)) -- adds TestSetExtensions to clean up test results [\#93](https://github.com/sglyon/PlotlyJS.jl/pull/93) ([ssfrr](https://github.com/ssfrr)) -- Simpler way to fix use with Interact in IJulia on page refresh [\#92](https://github.com/sglyon/PlotlyJS.jl/pull/92) ([JobJob](https://github.com/JobJob)) +- Complete Contour Examples [\#95](https://github.com/JuliaPlots/PlotlyJS.jl/pull/95) ([caimichael](https://github.com/caimichael)) +- adds TestSetExtensions to clean up test results [\#93](https://github.com/JuliaPlots/PlotlyJS.jl/pull/93) ([ssfrr](https://github.com/ssfrr)) +- Simpler way to fix use with Interact in IJulia on page refresh [\#92](https://github.com/JuliaPlots/PlotlyJS.jl/pull/92) ([JobJob](https://github.com/JobJob)) + +## [v0.5.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.5.1) (2016-10-29) -## [v0.5.1](https://github.com/sglyon/PlotlyJS.jl/tree/v0.5.1) (2016-10-29) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.5.0...v0.5.1) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.5.0...v0.5.1) **Closed issues:** -- Add nteract support for JupyterPlot [\#90](https://github.com/sglyon/PlotlyJS.jl/issues/90) -- Aspect ratio for 2D plot [\#85](https://github.com/sglyon/PlotlyJS.jl/issues/85) -- error install :\( [\#83](https://github.com/sglyon/PlotlyJS.jl/issues/83) -- handle 2D data matrices in 1D plots e.g. `scatter` [\#82](https://github.com/sglyon/PlotlyJS.jl/issues/82) -- Grab gadfly dark theme [\#79](https://github.com/sglyon/PlotlyJS.jl/issues/79) -- Float32 arrays don't plot reliably on 0.5.0 [\#78](https://github.com/sglyon/PlotlyJS.jl/issues/78) -- Save and edit plot in cloud [\#75](https://github.com/sglyon/PlotlyJS.jl/issues/75) +- Add nteract support for JupyterPlot [\#90](https://github.com/JuliaPlots/PlotlyJS.jl/issues/90) +- Aspect ratio for 2D plot [\#85](https://github.com/JuliaPlots/PlotlyJS.jl/issues/85) +- error install :\( [\#83](https://github.com/JuliaPlots/PlotlyJS.jl/issues/83) +- handle 2D data matrices in 1D plots e.g. `scatter` [\#82](https://github.com/JuliaPlots/PlotlyJS.jl/issues/82) +- Grab gadfly dark theme [\#79](https://github.com/JuliaPlots/PlotlyJS.jl/issues/79) +- Float32 arrays don't plot reliably on 0.5.0 [\#78](https://github.com/JuliaPlots/PlotlyJS.jl/issues/78) +- Save and edit plot in cloud [\#75](https://github.com/JuliaPlots/PlotlyJS.jl/issues/75) **Merged pull requests:** -- adds stem plot trace as wrapper around `scatter` [\#86](https://github.com/sglyon/PlotlyJS.jl/pull/86) ([ssfrr](https://github.com/ssfrr)) -- Use dark theme in Juno [\#84](https://github.com/sglyon/PlotlyJS.jl/pull/84) ([MikeInnes](https://github.com/MikeInnes)) -- Examples completed [\#71](https://github.com/sglyon/PlotlyJS.jl/pull/71) ([caimichael](https://github.com/caimichael)) +- adds stem plot trace as wrapper around `scatter` [\#86](https://github.com/JuliaPlots/PlotlyJS.jl/pull/86) ([ssfrr](https://github.com/ssfrr)) +- Use dark theme in Juno [\#84](https://github.com/JuliaPlots/PlotlyJS.jl/pull/84) ([MikeInnes](https://github.com/MikeInnes)) +- Examples completed [\#71](https://github.com/JuliaPlots/PlotlyJS.jl/pull/71) ([caimichael](https://github.com/caimichael)) -## [v0.5.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.5.0) (2016-09-21) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.4.3...v0.5.0) +## [v0.5.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.5.0) (2016-09-21) -## [v0.4.3](https://github.com/sglyon/PlotlyJS.jl/tree/v0.4.3) (2016-09-21) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.4.2...v0.4.3) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.4.3...v0.5.0) + +## [v0.4.3](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.4.3) (2016-09-21) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.4.2...v0.4.3) **Merged pull requests:** -- Caimichael/examples [\#72](https://github.com/sglyon/PlotlyJS.jl/pull/72) ([sglyon](https://github.com/sglyon)) +- Caimichael/examples [\#72](https://github.com/JuliaPlots/PlotlyJS.jl/pull/72) ([sglyon](https://github.com/sglyon)) -## [v0.4.2](https://github.com/sglyon/PlotlyJS.jl/tree/v0.4.2) (2016-09-07) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.4.1...v0.4.2) +## [v0.4.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.4.2) (2016-09-07) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.4.1...v0.4.2) **Closed issues:** -- Error updating package [\#70](https://github.com/sglyon/PlotlyJS.jl/issues/70) +- Error updating package [\#70](https://github.com/JuliaPlots/PlotlyJS.jl/issues/70) + +## [v0.4.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.4.1) (2016-09-07) -## [v0.4.1](https://github.com/sglyon/PlotlyJS.jl/tree/v0.4.1) (2016-09-07) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.4.0...v0.4.1) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.4.0...v0.4.1) **Merged pull requests:** -- don't use a generator in \_symbol\_dict [\#69](https://github.com/sglyon/PlotlyJS.jl/pull/69) ([tkelman](https://github.com/tkelman)) +- don't use a generator in \_symbol\_dict [\#69](https://github.com/JuliaPlots/PlotlyJS.jl/pull/69) ([tkelman](https://github.com/tkelman)) -## [v0.4.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.4.0) (2016-09-07) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.3.3...v0.4.0) +## [v0.4.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.4.0) (2016-09-07) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.3.3...v0.4.0) **Closed issues:** -- PlotlyJS doesn't show plots on Julia 0.5 RC3. [\#68](https://github.com/sglyon/PlotlyJS.jl/issues/68) +- PlotlyJS doesn't show plots on Julia 0.5 RC3. [\#68](https://github.com/JuliaPlots/PlotlyJS.jl/issues/68) **Merged pull requests:** -- RFC: start for more convenient `plot` API [\#66](https://github.com/sglyon/PlotlyJS.jl/pull/66) ([sglyon](https://github.com/sglyon)) +- RFC: start for more convenient `plot` API [\#66](https://github.com/JuliaPlots/PlotlyJS.jl/pull/66) ([sglyon](https://github.com/sglyon)) + +## [v0.3.3](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.3.3) (2016-08-24) -## [v0.3.3](https://github.com/sglyon/PlotlyJS.jl/tree/v0.3.3) (2016-08-24) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.3.2...v0.3.3) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.3.2...v0.3.3) -## [v0.3.2](https://github.com/sglyon/PlotlyJS.jl/tree/v0.3.2) (2016-08-23) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.3.1...v0.3.2) +## [v0.3.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.3.2) (2016-08-23) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.3.1...v0.3.2) **Closed issues:** -- Does PlotlyJS.jl support unicode now? [\#64](https://github.com/sglyon/PlotlyJS.jl/issues/64) -- Loading PlotlyJS fails on Julia V0.5-rc1 [\#62](https://github.com/sglyon/PlotlyJS.jl/issues/62) -- Cloud [\#55](https://github.com/sglyon/PlotlyJS.jl/issues/55) -- Plots.jl animations [\#53](https://github.com/sglyon/PlotlyJS.jl/issues/53) -- ERROR: connect: connection refused \(ECONNREFUSED\) [\#33](https://github.com/sglyon/PlotlyJS.jl/issues/33) -- Include MathJax.js [\#30](https://github.com/sglyon/PlotlyJS.jl/issues/30) -- Javascript error on package load with IJulia/Firefox [\#28](https://github.com/sglyon/PlotlyJS.jl/issues/28) -- Resize plot when electron window is resized [\#25](https://github.com/sglyon/PlotlyJS.jl/issues/25) +- Does PlotlyJS.jl support unicode now? [\#64](https://github.com/JuliaPlots/PlotlyJS.jl/issues/64) +- Loading PlotlyJS fails on Julia V0.5-rc1 [\#62](https://github.com/JuliaPlots/PlotlyJS.jl/issues/62) +- Cloud [\#55](https://github.com/JuliaPlots/PlotlyJS.jl/issues/55) +- Plots.jl animations [\#53](https://github.com/JuliaPlots/PlotlyJS.jl/issues/53) +- ERROR: connect: connection refused \(ECONNREFUSED\) [\#33](https://github.com/JuliaPlots/PlotlyJS.jl/issues/33) +- Include MathJax.js [\#30](https://github.com/JuliaPlots/PlotlyJS.jl/issues/30) +- Javascript error on package load with IJulia/Firefox [\#28](https://github.com/JuliaPlots/PlotlyJS.jl/issues/28) +- Resize plot when electron window is resized [\#25](https://github.com/JuliaPlots/PlotlyJS.jl/issues/25) **Merged pull requests:** -- Extend `JSON.lower` instead of `JSON.print` [\#65](https://github.com/sglyon/PlotlyJS.jl/pull/65) ([TotalVerb](https://github.com/TotalVerb)) -- Fixes for Julia 0.5 [\#63](https://github.com/sglyon/PlotlyJS.jl/pull/63) ([timholy](https://github.com/timholy)) -- fix dates in json [\#58](https://github.com/sglyon/PlotlyJS.jl/pull/58) ([tbreloff](https://github.com/tbreloff)) -- Update README [\#57](https://github.com/sglyon/PlotlyJS.jl/pull/57) ([matthieugomez](https://github.com/matthieugomez)) -- Solve issue \#55 [\#56](https://github.com/sglyon/PlotlyJS.jl/pull/56) ([matthieugomez](https://github.com/matthieugomez)) +- Extend `JSON.lower` instead of `JSON.print` [\#65](https://github.com/JuliaPlots/PlotlyJS.jl/pull/65) ([TotalVerb](https://github.com/TotalVerb)) +- Fixes for Julia 0.5 [\#63](https://github.com/JuliaPlots/PlotlyJS.jl/pull/63) ([timholy](https://github.com/timholy)) +- fix dates in json [\#58](https://github.com/JuliaPlots/PlotlyJS.jl/pull/58) ([tbreloff](https://github.com/tbreloff)) +- Update README [\#57](https://github.com/JuliaPlots/PlotlyJS.jl/pull/57) ([matthieugomez](https://github.com/matthieugomez)) +- Solve issue \#55 [\#56](https://github.com/JuliaPlots/PlotlyJS.jl/pull/56) ([matthieugomez](https://github.com/matthieugomez)) + +## [v0.3.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.3.1) (2016-06-22) -## [v0.3.1](https://github.com/sglyon/PlotlyJS.jl/tree/v0.3.1) (2016-06-22) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.3.0...v0.3.1) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.3.0...v0.3.1) **Closed issues:** -- Electron backend on Windows throws error [\#51](https://github.com/sglyon/PlotlyJS.jl/issues/51) -- Error when saving as pdf using Electron Display [\#50](https://github.com/sglyon/PlotlyJS.jl/issues/50) -- Reloaded notebook's PlotlyJS doesn't work [\#45](https://github.com/sglyon/PlotlyJS.jl/issues/45) +- Electron backend on Windows throws error [\#51](https://github.com/JuliaPlots/PlotlyJS.jl/issues/51) +- Error when saving as pdf using Electron Display [\#50](https://github.com/JuliaPlots/PlotlyJS.jl/issues/50) +- Reloaded notebook's PlotlyJS doesn't work [\#45](https://github.com/JuliaPlots/PlotlyJS.jl/issues/45) **Merged pull requests:** -- Remove `kind` field for GenericTrace and Shape. [\#54](https://github.com/sglyon/PlotlyJS.jl/pull/54) ([sglyon](https://github.com/sglyon)) +- Remove `kind` field for GenericTrace and Shape. [\#54](https://github.com/JuliaPlots/PlotlyJS.jl/pull/54) ([sglyon](https://github.com/sglyon)) -## [v0.3.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.3.0) (2016-06-17) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.2.0...v0.3.0) +## [v0.3.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.3.0) (2016-06-17) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.2.0...v0.3.0) **Closed issues:** -- Error when plotting in IJulia notebooks [\#46](https://github.com/sglyon/PlotlyJS.jl/issues/46) -- Error message with savefig [\#44](https://github.com/sglyon/PlotlyJS.jl/issues/44) -- Background not set? [\#36](https://github.com/sglyon/PlotlyJS.jl/issues/36) -- How to save the JSON object [\#35](https://github.com/sglyon/PlotlyJS.jl/issues/35) +- Error when plotting in IJulia notebooks [\#46](https://github.com/JuliaPlots/PlotlyJS.jl/issues/46) +- Error message with savefig [\#44](https://github.com/JuliaPlots/PlotlyJS.jl/issues/44) +- Background not set? [\#36](https://github.com/JuliaPlots/PlotlyJS.jl/issues/36) +- How to save the JSON object [\#35](https://github.com/JuliaPlots/PlotlyJS.jl/issues/35) **Merged pull requests:** -- Sl/savefig [\#49](https://github.com/sglyon/PlotlyJS.jl/pull/49) ([sglyon](https://github.com/sglyon)) -- Update use of JSON.colon to JSON.separator [\#48](https://github.com/sglyon/PlotlyJS.jl/pull/48) ([cdsousa](https://github.com/cdsousa)) -- Compat update for String rename [\#40](https://github.com/sglyon/PlotlyJS.jl/pull/40) ([StefanKarpinski](https://github.com/StefanKarpinski)) -- JSON for vectors of traces. [\#39](https://github.com/sglyon/PlotlyJS.jl/pull/39) ([EricForgy](https://github.com/EricForgy)) -- Let string interpolation stringify to JSON format [\#38](https://github.com/sglyon/PlotlyJS.jl/pull/38) ([EricForgy](https://github.com/EricForgy)) +- Sl/savefig [\#49](https://github.com/JuliaPlots/PlotlyJS.jl/pull/49) ([sglyon](https://github.com/sglyon)) +- Update use of JSON.colon to JSON.separator [\#48](https://github.com/JuliaPlots/PlotlyJS.jl/pull/48) ([cdsousa](https://github.com/cdsousa)) +- Compat update for String rename [\#40](https://github.com/JuliaPlots/PlotlyJS.jl/pull/40) ([StefanKarpinski](https://github.com/StefanKarpinski)) +- JSON for vectors of traces. [\#39](https://github.com/JuliaPlots/PlotlyJS.jl/pull/39) ([EricForgy](https://github.com/EricForgy)) +- Let string interpolation stringify to JSON format [\#38](https://github.com/JuliaPlots/PlotlyJS.jl/pull/38) ([EricForgy](https://github.com/EricForgy)) + +## [v0.2.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.2.0) (2016-05-04) -## [v0.2.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.2.0) (2016-05-04) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.1.4...v0.2.0) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.1.4...v0.2.0) **Closed issues:** -- Why is `text` using only the first element of a `Vector{ASCIIString}`? [\#34](https://github.com/sglyon/PlotlyJS.jl/issues/34) +- Why is `text` using only the first element of a `Vector{ASCIIString}`? [\#34](https://github.com/JuliaPlots/PlotlyJS.jl/issues/34) -## [v0.1.4](https://github.com/sglyon/PlotlyJS.jl/tree/v0.1.4) (2016-03-31) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.1.3...v0.1.4) +## [v0.1.4](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.1.4) (2016-03-31) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.1.3...v0.1.4) **Closed issues:** -- PlotlyJS doesn't work with Interact [\#31](https://github.com/sglyon/PlotlyJS.jl/issues/31) +- PlotlyJS doesn't work with Interact [\#31](https://github.com/JuliaPlots/PlotlyJS.jl/issues/31) + +## [v0.1.3](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.1.3) (2016-03-31) -## [v0.1.3](https://github.com/sglyon/PlotlyJS.jl/tree/v0.1.3) (2016-03-31) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.1.2...v0.1.3) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.1.2...v0.1.3) -## [v0.1.2](https://github.com/sglyon/PlotlyJS.jl/tree/v0.1.2) (2016-03-25) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.1.1...v0.1.2) +## [v0.1.2](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.1.2) (2016-03-25) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.1.1...v0.1.2) **Closed issues:** -- Let attributes that should have underscores through somehow [\#12](https://github.com/sglyon/PlotlyJS.jl/issues/12) -- Implement show properly [\#3](https://github.com/sglyon/PlotlyJS.jl/issues/3) +- Let attributes that should have underscores through somehow [\#12](https://github.com/JuliaPlots/PlotlyJS.jl/issues/12) +- Implement show properly [\#3](https://github.com/JuliaPlots/PlotlyJS.jl/issues/3) + +## [v0.1.1](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.1.1) (2016-03-11) -## [v0.1.1](https://github.com/sglyon/PlotlyJS.jl/tree/v0.1.1) (2016-03-11) -[Full Changelog](https://github.com/sglyon/PlotlyJS.jl/compare/v0.1.0...v0.1.1) +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/v0.1.0...v0.1.1) **Closed issues:** -- restyle! needs to be fixed... Julia and javascript have different semantics [\#23](https://github.com/sglyon/PlotlyJS.jl/issues/23) -- IJulia notebook export to HTML don't show the plot [\#22](https://github.com/sglyon/PlotlyJS.jl/issues/22) +- restyle! needs to be fixed... Julia and javascript have different semantics [\#23](https://github.com/JuliaPlots/PlotlyJS.jl/issues/23) +- IJulia notebook export to HTML don't show the plot [\#22](https://github.com/JuliaPlots/PlotlyJS.jl/issues/22) **Merged pull requests:** -- Matching plotly.js semantics in restyle! [\#24](https://github.com/sglyon/PlotlyJS.jl/pull/24) ([sglyon](https://github.com/sglyon)) +- Matching plotly.js semantics in restyle! [\#24](https://github.com/JuliaPlots/PlotlyJS.jl/pull/24) ([sglyon](https://github.com/sglyon)) + +## [v0.1.0](https://github.com/JuliaPlots/PlotlyJS.jl/tree/v0.1.0) (2016-03-05) + +[Full Changelog](https://github.com/JuliaPlots/PlotlyJS.jl/compare/7d69a1c8497429bf579e05dad8da72934eae947d...v0.1.0) -## [v0.1.0](https://github.com/sglyon/PlotlyJS.jl/tree/v0.1.0) (2016-03-05) **Closed issues:** -- Have display not duplicate plots in windows [\#20](https://github.com/sglyon/PlotlyJS.jl/issues/20) -- Clean up design [\#19](https://github.com/sglyon/PlotlyJS.jl/issues/19) -- Conflict with DataFrames.jl [\#16](https://github.com/sglyon/PlotlyJS.jl/issues/16) -- is collapse\( \) supposed to work with multiple columns? [\#15](https://github.com/sglyon/PlotlyJS.jl/issues/15) -- savefig \(via cairosvg\) doesn't show negative signs in tick labels [\#14](https://github.com/sglyon/PlotlyJS.jl/issues/14) -- Events [\#13](https://github.com/sglyon/PlotlyJS.jl/issues/13) -- Implement `attr` function with kwarg + \_ mini-language [\#11](https://github.com/sglyon/PlotlyJS.jl/issues/11) -- Rename to PlotlyJS.jl [\#9](https://github.com/sglyon/PlotlyJS.jl/issues/9) -- Error showing Plot [\#8](https://github.com/sglyon/PlotlyJS.jl/issues/8) -- Integrate various plotly packages [\#5](https://github.com/sglyon/PlotlyJS.jl/issues/5) -- subplots [\#1](https://github.com/sglyon/PlotlyJS.jl/issues/1) +- Have display not duplicate plots in windows [\#20](https://github.com/JuliaPlots/PlotlyJS.jl/issues/20) +- Clean up design [\#19](https://github.com/JuliaPlots/PlotlyJS.jl/issues/19) +- Conflict with DataFrames.jl [\#16](https://github.com/JuliaPlots/PlotlyJS.jl/issues/16) +- is collapse\( \) supposed to work with multiple columns? [\#15](https://github.com/JuliaPlots/PlotlyJS.jl/issues/15) +- savefig \(via cairosvg\) doesn't show negative signs in tick labels [\#14](https://github.com/JuliaPlots/PlotlyJS.jl/issues/14) +- Events [\#13](https://github.com/JuliaPlots/PlotlyJS.jl/issues/13) +- Implement `attr` function with kwarg + \_ mini-language [\#11](https://github.com/JuliaPlots/PlotlyJS.jl/issues/11) +- Rename to PlotlyJS.jl [\#9](https://github.com/JuliaPlots/PlotlyJS.jl/issues/9) +- Error showing Plot [\#8](https://github.com/JuliaPlots/PlotlyJS.jl/issues/8) +- Integrate various plotly packages [\#5](https://github.com/JuliaPlots/PlotlyJS.jl/issues/5) +- subplots [\#1](https://github.com/JuliaPlots/PlotlyJS.jl/issues/1) **Merged pull requests:** -- Sl/syncplots [\#21](https://github.com/sglyon/PlotlyJS.jl/pull/21) ([sglyon](https://github.com/sglyon)) -- Add a Gitter chat badge to README.md [\#17](https://github.com/sglyon/PlotlyJS.jl/pull/17) ([gitter-badger](https://github.com/gitter-badger)) -- Tweak JS API use [\#7](https://github.com/sglyon/PlotlyJS.jl/pull/7) ([MikeInnes](https://github.com/MikeInnes)) -- fix Plot\(\) error [\#6](https://github.com/sglyon/PlotlyJS.jl/pull/6) ([tbreloff](https://github.com/tbreloff)) -- Update REQUIRE [\#2](https://github.com/sglyon/PlotlyJS.jl/pull/2) ([cc7768](https://github.com/cc7768)) +- Sl/syncplots [\#21](https://github.com/JuliaPlots/PlotlyJS.jl/pull/21) ([sglyon](https://github.com/sglyon)) +- Add a Gitter chat badge to README.md [\#17](https://github.com/JuliaPlots/PlotlyJS.jl/pull/17) ([gitter-badger](https://github.com/gitter-badger)) +- Tweak JS API use [\#7](https://github.com/JuliaPlots/PlotlyJS.jl/pull/7) ([MikeInnes](https://github.com/MikeInnes)) +- fix Plot\(\) error [\#6](https://github.com/JuliaPlots/PlotlyJS.jl/pull/6) ([tbreloff](https://github.com/tbreloff)) +- Update REQUIRE [\#2](https://github.com/JuliaPlots/PlotlyJS.jl/pull/2) ([cc7768](https://github.com/cc7768)) -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/Project.toml b/Project.toml index 05babad4..2a7e5e52 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.13.1" +version = "0.14.0" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" @@ -22,7 +22,7 @@ Blink = "≥ 0.8.0" Compat = "≥ 0.69.0" JSExpr = "0.5" JSON = "≥ 0.7.0" -PlotlyBase = "≥ 0.4.0" +PlotlyBase = "0.4" Reexport = "≥ 0.2.0" Requires = "1.0" WebIO = "≥ 0.8.6" diff --git a/deploy_docs.sh b/deploy_docs.sh deleted file mode 100755 index 6027c78c..00000000 --- a/deploy_docs.sh +++ /dev/null @@ -1,3 +0,0 @@ -julia docs/build_example_docs.jl -mkdocs build -c -mkdocs gh-deploy -c -b gh-pages -r origin -v diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..a303fff2 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +build/ +site/ diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 00000000..1059bb46 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,17 @@ +[deps] +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" +Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" +JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" +RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[compat] +PlotlyBase = "0.4.1" diff --git a/docs/build_example_docs.jl b/docs/build_example_docs.jl index 3c23578e..7dfb12df 100644 --- a/docs/build_example_docs.jl +++ b/docs/build_example_docs.jl @@ -5,69 +5,81 @@ puts each example from the julia file into a code block and adds a short html div below with the interactive output. =# using PlotlyJS -using Distributions, Quandl, RDatasets # used in examples -doc_style = Style(layout=Layout(margin=attr(t=60, b=60, l=50, r=50))) +# used in examples +using Distributions, HTTP, DataFrames, RDatasets, Colors, CSV, JSON +using Random, Dates, LinearAlgebra, DelimitedFiles -# Read all file names in -this_dir = dirname(@__FILE__) -if length(ARGS) == 0 - all_file_names = readdir(joinpath(this_dir, "..", "examples")) -else - all_file_names = [endswith(i, ".jl") ? i : "$(i).jl" for i in ARGS] -end - -nfiles = length(all_file_names) -# Check whether files are julia files and select julia files -cft(x) = x[end-2:end]==".jl" ? true : false -am_i_julia_file = map(cft, all_file_names) -all_julia_files = all_file_names[am_i_julia_file] -for i in all_julia_files - println(i) - include(joinpath(this_dir, "..", "examples", i)) -end +const THIS_DIR = dirname(@__FILE__) -use_style!(doc_style) # Walk through each example in a file and get the markdown from `single_example` -function single_file(filename::String) +function single_example_file(filename::String) + base_fn = split(filename, ".")[1] + start_example = "```@example $(base_fn)" + end_example = "```" # Open a file to write to - open(joinpath(this_dir, "examples", filename[1:end-3]*".md"), "w") do outfile + open(joinpath(THIS_DIR, "src", "examples", "$(base_fn).md"), "w") do outfile - # Read lines from a files - fulltext = open(f->read(f, String), joinpath(this_dir, "..", "examples", filename), "r") - all_lines = split(fulltext, "\n") - l = 1 - regex = r"^function ([^_].+?)\(" - regex_end = r"^end$" + write_example(ex) = println(outfile, start_example, "\n", ex, "\n", end_example, "\n") - while true - # Find next function name (break if none) - l = findnext(x -> match(regex, x) != nothing, all_lines, l+1) - if l == 0 - break - end - # find corresponding end for this function - end_l = findnext(x -> match(regex_end, x) != nothing, all_lines, l+1) + fn_h1 = titlecase(replace(base_fn, "_" => " ")) + println(outfile, "# $(fn_h1)\n") - # Pull out function text - func_block = join(all_lines[l:end_l], "\n") - fun_name = match(regex, all_lines[l])[1] + # Read lines from a files + fulltext = open( + f->read(f, String), + joinpath(THIS_DIR, "..", "examples", filename), + "r" + ) + all_lines = split(fulltext, "\n") + l = 1 + regex = r"^function ([^_].+?)\(" + regex_end = r"^end$" - println("adding $fun_name") + # find preamble + if base_fn == "subplots" # special case + preamble = "using PlotlyJS, Dates\ninclude(\"../../../examples/line_scatter.jl\")" + write_example(preamble) + else + first_line = findfirst(x -> match(regex, x) !== nothing, all_lines) + if first_line !== nothing + preamble = strip(join(all_lines[1:first_line-1], "\n")) + write_example(preamble) + end + end - # Get html block - plt = eval(Expr(:call, Symbol(fun_name))).plot - relayout!(plt, margin=attr(t=60, b=60, l=50, r=50)) - html_block = PlotlyJS.html_body(plt) + while true + # Find next function name (break if none) + l = findnext(x -> match(regex, x) !== nothing, all_lines, l+1) + if l == 0 || l === nothing + break + end + # find corresponding end for this function + end_l = findnext(x -> match(regex_end, x) !== nothing, all_lines, l+1) - println(outfile, "```julia\n$func_block\n$(fun_name)()\n```\n\n\n$html_block\n\n") - l = end_l - end + # Pull out function text + func_block = join(all_lines[l:end_l], "\n") + fun_name = match(regex, all_lines[l])[1] + # println("adding $fun_name") + an_ex = string(func_block, "\n", fun_name, "()") + write_example(an_ex) + l = end_l + end end # do outfile return nothing end -main() = map(single_file, all_julia_files) +function main() + # Read all file names in + if length(ARGS) == 0 + all_file_names = readdir(joinpath(THIS_DIR, "..", "examples")) + else + all_file_names = [endswith(i, ".jl") ? i : "$(i).jl" for i in ARGS] + end + all_julia_files = filter(x -> endswith(x, ".jl"), all_file_names) + + foreach(single_example_file, all_julia_files) +end diff --git a/docs/building_traces_layouts.md b/docs/building_traces_layouts.md deleted file mode 100644 index 27a64421..00000000 --- a/docs/building_traces_layouts.md +++ /dev/null @@ -1,482 +0,0 @@ -Recall that the `Plotly.newPlot` javascript function expects to receive an -array of `trace` objects and, optionally, a `layout` object. In this section we -will learn how to build these object in Julia. - -## Traces - -A `Plot` instance will have a vector of `trace`s. These should each be a subtype of `AbstractTrace`. - -PlotlyJS.jl defines one such subtype: - -```julia -mutable struct GenericTrace{T<:AbstractDict{Symbol,Any}} <: AbstractTrace - kind::ASCIIString - fields::T -end -``` - -The `kind` field specifies the type of trace and the `fields` is an AbstractDict object that maps trace attributes to their values. - -Let's consider an example. Suppose we would like to build the following JSON -object: - -```json -{ - "type": "scatter", - "x": [1, 2, 3, 4, 5], - "y": [1, 6, 3, 6, 1], - "mode": "markers+text", - "name": "Team A", - "text": ["A-1", "A-2", "A-3", "A-4", "A-5"], - "textposition": "top center", - "textfont": { - "family": "Raleway, sans-serif" - }, - "marker": { "size": 12 } -} -``` - -One way to do this in Julia is: - -```julia -fields = Dict{Symbol,Any}(:type => "scatter", - :x => [1, 2, 3, 4, 5], - :y => [1, 6, 3, 6, 1], - :mode => "markers+text", - :name => "Team A", - :text => ["A-1", "A-2", "A-3", "A-4", "A-5"], - :textposition => "top center", - :textfont => Dict(:family => "Raleway, sans-serif"), - :marker => Dict(:size => 12)) -GenericTrace("scatter", fields) -``` - -A more convenient syntax is: - -```julia -t1 = scatter(;x=[1, 2, 3, 4, 5], - y=[1, 6, 3, 6, 1], - mode="markers+text", - name="Team A", - text=["A-1", "A-2", "A-3", "A-4", "A-5"], - textposition="top center", - textfont_family="Raleway, sans-serif", - marker_size=12) -``` - -Notice a few things: - -- The trace `type` became the function name. There is a similar method for all -plotly.js traces types. -- All other trace attributes were set using keyword arguments. This allows us -to avoid typing out the symbol prefix (`:`) and the arrows (`=>`) that were -necessary when constructing the `Dict` -- We can set nested attributes using underscores. Notice that the JSON -`"marker": { "size": 12 }` was written `marker_size=12`. - -We can verify that this is indeed equivalent JSON by printing the JSON obtained -from `JSON.json(t1, 2)` which is (note the order of the attributes is different, -but the content is identical): - -```json -{ - "type": "scatter", - "y": [ - 1, - 6, - 3, - 6, - 1 - ], - "text": [ - "A-1", - "A-2", - "A-3", - "A-4", - "A-5" - ], - "textfont": { - "family": "Raleway, sans-serif" - }, - "name": "Team A", - "x": [ - 1, - 2, - 3, - 4, - 5 - ], - "textposition": "top center", - "mode": "markers+text", - "marker": { - "size": 12 - } -} -``` - -### Accessing attributes - -If we then wanted to extract a particular attribute, we can do so using -`getindex(t1, :attrname)`, or the syntactic sugar `t1[:attrname]`. Note that -both symbols and strings can be used in a call to `getindex`: - -```jlcon -julia> t1["marker"] -Dict{Any,Any} with 1 entry: - :size => 12 - -julia> t1[:marker] -Dict{Any,Any} with 1 entry: - :size => 12 -``` - -To access a nested property use `parent.child` - -```jlcon -julia> t1["textfont.family"] -"Raleway, sans-serif" -``` - -### Setting additional attributes - -We can also set additional attributes. Suppose we wanted to set `marker.color` -to be red. We can do this with a call to `setindex!(t1, "red", :marker_color)`, -or equivalently `t1["marker_color"] = "red"`: - -```jlcon -julia> t1["marker_color"] = "red" -"red" - -julia> println(JSON.json(t1, 2)) -{ - "type": "scatter", - "y": [ - 1, - 6, - 3, - 6, - 1 - ], - "text": [ - "A-1", - "A-2", - "A-3", - "A-4", - "A-5" - ], - "textfont": { - "family": "Raleway, sans-serif" - }, - "name": "Team A", - "x": [ - 1, - 2, - 3, - 4, - 5 - ], - "textposition": "top center", - "mode": "markers+text", - "marker": { - "size": 12, - "color": "red" - } -} -``` - -Notice how the `color` attribute was correctly added within the existing -`marker` attribute (alongside `size`), instead of replacing the `marker` -attribute. - -You can also use this syntax to add completely new nested attributes: - -```jlcon -julia> t1["line_width"] = 5 -5 - -julia> println(JSON.json(t1, 2)) -{ - "type": "scatter", - "y": [ - 1, - 6, - 3, - 6, - 1 - ], - "text": [ - "A-1", - "A-2", - "A-3", - "A-4", - "A-5" - ], - "textfont": { - "family": "Raleway, sans-serif" - }, - "name": "Team A", - "line": { - "width": 5 - }, - "x": [ - 1, - 2, - 3, - 4, - 5 - ], - "textposition": "top center", - "mode": "markers+text", - "marker": { - "size": 12, - "color": "red" - } -} -``` - -## Layouts - -The `Layout` type is defined as - -```julia -mutable struct Layout{T<:AbstractDict{Symbol,Any}} <: AbstractLayout - fields::T -end -``` - -You can construct a layout using the same convenient keyword argument syntax -that we used for traces: - -```jlcon -julia> l = Layout(;title="Penguins", - xaxis_range=[0, 42.0], xaxis_title="fish", - yaxis_title="Weight", - xaxis_showgrid=true, yaxis_showgrid=true, - legend_y=1.15, legend_x=0.7) -layout with fields legend, margin, title, xaxis, and yaxis - - -julia> println(JSON.json(l, 2)) -{ - "yaxis": { - "title": "Weight", - "showgrid": true - }, - "legend": { - "y": 1.15, - "x": 0.7 - }, - "xaxis": { - "range": [ - 0.0, - 42.0 - ], - "title": "fish", - "showgrid": true - }, - "title": "Penguins", - "margin": { - "r": 50, - "l": 50, - "b": 50, - "t": 60 - } -} -``` - -## `attr` - -There is a special function named `attr` that allows you to apply the same -keyword magic we saw in the trace and layout functions, but to nested -attributes. Let's revisit the previous example, but use `attr` to build up our -`xaxis` and `legend`: - -```jlcon -julia> l2 = Layout(;title="Penguins", - xaxis=attr(range=[0, 42.0], title="fish", showgrid=true), - yaxis_title="Weight", yaxis_showgrid=true, - legend=attr(x=0.7, y=1.15)) -layout with fields legend, margin, title, xaxis, and yaxis - - -julia> println(JSON.json(l2, 2)) -{ - "yaxis": { - "title": "Weight", - "showgrid": true - }, - "legend": { - "y": 1.15, - "x": 0.7 - }, - "xaxis": { - "range": [ - 0.0, - 42.0 - ], - "title": "fish", - "showgrid": true - }, - "title": "Penguins", - "margin": { - "r": 50, - "l": 50, - "b": 50, - "t": 60 - } -} -``` - -Notice we got the exact same output as before, but we didn't have to resort to -building the `Dict` by hand _or_ prefixing multiple arguments with `xaxis_` or -`legend_`. - - -## Using `DataFrame`s - -!!! note - New in version 0.6.0 - -You can also construct traces using the columns of any subtype of -`AbstractDataFrame` (e.g. the `DataFrame` type from DataFrames.jl). - -To demonstrate this functionality let's load the famous iris data set: - -```jlcon -julia> using DataFrames, RDatasets - -julia> iris = dataset("datasets", "iris"); - -julia> head(iris) -6×5 DataFrames.DataFrame -│ Row │ SepalLength │ SepalWidth │ PetalLength │ PetalWidth │ Species │ -├─────┼─────────────┼────────────┼─────────────┼────────────┼──────────┤ -│ 1 │ 5.1 │ 3.5 │ 1.4 │ 0.2 │ "setosa" │ -│ 2 │ 4.9 │ 3.0 │ 1.4 │ 0.2 │ "setosa" │ -│ 3 │ 4.7 │ 3.2 │ 1.3 │ 0.2 │ "setosa" │ -│ 4 │ 4.6 │ 3.1 │ 1.5 │ 0.2 │ "setosa" │ -│ 5 │ 5.0 │ 3.6 │ 1.4 │ 0.2 │ "setosa" │ -│ 6 │ 5.4 │ 3.9 │ 1.7 │ 0.4 │ "setosa" │ -``` - -Suppose that we wanted to construct a scatter trace with the `SepalLength` -column as the x variable and the `SepalWidth` columns as the y variable. We -do this by calling - -```jlcon -julia> my_trace = scatter(iris, x=:SepalLength, y=:SepalWidth, marker_color=:red) -scatter with fields marker, type, x, and y - -julia> [my_trace[:x][1:5] my_trace[:y][1:5]] -5×2 DataArrays.DataArray{Float64,2}: - 5.1 3.5 - 4.9 3.0 - 4.7 3.2 - 4.6 3.1 - 5.0 3.6 - -julia> my_trace[:marker_color] -:red -``` - -How does this work? The basic rule is that if the value of any keyword argument -is a Julia Symbol (i.e. created with `:something`), then the function creating -the trace checks if that symbol is one of the column names in the DataFrame. -If so, it extracts the column from the DataFrame and sets that as the value -for the keyword argument. Otherwise it passes the symbol directly through. - -In the above example, when we constructed `my_trace` the value of the keyword -argument `x` was set to the Symbol `:SepalLength`. This did match a column name -from `iris` so that column was extracted and replaced `:SepalLength` as the -value for the `x` argument. The same holds for `y` and `SepalWidth`. - -However, when setting `marker_color=:red` we found that `:red` is not one of -the column names, so the value for the `marker_color` keyword argument remained -`:red`. - -The DataFrame interface becomes more useful when constructing whole plots. See -the [convenience methods](syncplots.md#convenience-methods) section of the -documentation for more information. - -!!! note - New in version 0.9.0 - -As of version 0.9.0, you can construct groups of traces using the DataFrame -api. This is best understood by example, so let's see it in action: - -```jlcon -julia> using RDatasets - -julia> iris = dataset("datasets", "iris"); - -julia> unique(iris[:Species]) -3-element DataArrays.DataArray{String,1}: - "setosa" - "versicolor" - "virginica" - -julia> traces = scatter(iris, group=:Species, x=:SepalLength, y=:SepalWidth, mode="markers", marker_size=8) -3-element Array{PlotlyJS.GenericTrace,1}: - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:x, [5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9 … 5.0, 4.5, 4.4, 5.0, 5.1, 4.8, 5.1, 4.6, 5.3, 5.0]),Pair{Symbol,Any}(:mode, "markers"),Pair{Symbol,Any}(:y, [3.5, 3.0, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1 … 3.5, 2.3, 3.2, 3.5, 3.8, 3.0, 3.8, 3.2, 3.7, 3.3]),Pair{Symbol,Any}(:type, "scatter"),Pair{Symbol,Any}(:name, "setosa"),Pair{Symbol,Any}(:marker, Dict{Any,Any}(Pair{Any,Any}(:size, 8))))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:x, [7.0, 6.4, 6.9, 5.5, 6.5, 5.7, 6.3, 4.9, 6.6, 5.2 … 5.5, 6.1, 5.8, 5.0, 5.6, 5.7, 5.7, 6.2, 5.1, 5.7]),Pair{Symbol,Any}(:mode, "markers"),Pair{Symbol,Any}(:y, [3.2, 3.2, 3.1, 2.3, 2.8, 2.8, 3.3, 2.4, 2.9, 2.7 … 2.6, 3.0, 2.6, 2.3, 2.7, 3.0, 2.9, 2.9, 2.5, 2.8]),Pair{Symbol,Any}(:type, "scatter"),Pair{Symbol,Any}(:name, "versicolor"),Pair{Symbol,Any}(:marker, Dict{Any,Any}(Pair{Any,Any}(:size, 8))))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:x, [6.3, 5.8, 7.1, 6.3, 6.5, 7.6, 4.9, 7.3, 6.7, 7.2 … 6.7, 6.9, 5.8, 6.8, 6.7, 6.7, 6.3, 6.5, 6.2, 5.9]),Pair{Symbol,Any}(:mode, "markers"),Pair{Symbol,Any}(:y, [3.3, 2.7, 3.0, 2.9, 3.0, 3.0, 2.5, 2.9, 2.5, 3.6 … 3.1, 3.1, 2.7, 3.2, 3.3, 3.0, 2.5, 3.0, 3.4, 3.0]),Pair{Symbol,Any}(:type, "scatter"),Pair{Symbol,Any}(:name, "virginica"),Pair{Symbol,Any}(:marker, Dict{Any,Any}(Pair{Any,Any}(:size, 8))))) - -julia> [t[:name] for t in traces] -3-element Array{String,1}: - "setosa" - "versicolor" - "virginica" -``` - -Notice how there are three `Species` in the `iris` DataFrame, and when passing -`group=:Species` to `scatter` we obtained three traces. - -We can pass a `Vector{Symbol}` as group, to split the data on the value in more -than one column: - -```jlcon -julia> tips = dataset("reshape2", "tips"); - -julia> unique(tips[:Sex]) -2-element DataArrays.DataArray{String,1}: - "Female" - "Male" - -julia> unique(tips[:Day]) -4-element DataArrays.DataArray{String,1}: - "Sun" - "Sat" - "Thur" - "Fri" - -julia> traces = violin(tips, group=[:Sex, :Day], x=:TotalBill, orientation="h") -8-element Array{PlotlyJS.GenericTrace,1}: - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:type, "violin"),Pair{Symbol,Any}(:name, "(Female, Fri)"),Pair{Symbol,Any}(:orientation, "h"),Pair{Symbol,Any}(:x, [5.75, 16.32, 22.75, 11.35, 15.38, 13.42, 15.98, 16.27, 10.09]))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:type, "violin"),Pair{Symbol,Any}(:name, "(Female, Sat)"),Pair{Symbol,Any}(:orientation, "h"),Pair{Symbol,Any}(:x, [20.29, 15.77, 19.65, 15.06, 20.69, 16.93, 26.41, 16.45, 3.07, 17.07 … 10.59, 10.63, 12.76, 13.27, 28.17, 12.9, 30.14, 22.12, 35.83, 27.18]))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:type, "violin"),Pair{Symbol,Any}(:name, "(Female, Sun)"),Pair{Symbol,Any}(:orientation, "h"),Pair{Symbol,Any}(:x, [16.99, 24.59, 35.26, 14.83, 10.33, 16.97, 10.29, 34.81, 25.71, 17.31, 29.85, 25.0, 13.39, 16.21, 17.51, 9.6, 20.9, 18.15]))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:type, "violin"),Pair{Symbol,Any}(:name, "(Female, Thur)"),Pair{Symbol,Any}(:orientation, "h"),Pair{Symbol,Any}(:x, [10.07, 34.83, 10.65, 12.43, 24.08, 13.42, 12.48, 29.8, 14.52, 11.38 … 18.64, 11.87, 19.81, 43.11, 13.0, 12.74, 13.0, 16.4, 16.47, 18.78]))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:type, "violin"),Pair{Symbol,Any}(:name, "(Male, Fri)"),Pair{Symbol,Any}(:orientation, "h"),Pair{Symbol,Any}(:x, [28.97, 22.49, 40.17, 27.28, 12.03, 21.01, 12.46, 12.16, 8.58, 13.42]))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:type, "violin"),Pair{Symbol,Any}(:name, "(Male, Sat)"),Pair{Symbol,Any}(:orientation, "h"),Pair{Symbol,Any}(:x, [20.65, 17.92, 39.42, 19.82, 17.81, 13.37, 12.69, 21.7, 9.55, 18.35 … 15.69, 11.61, 10.77, 15.53, 10.07, 12.6, 32.83, 29.03, 22.67, 17.82]))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:type, "violin"),Pair{Symbol,Any}(:name, "(Male, Sun)"),Pair{Symbol,Any}(:orientation, "h"),Pair{Symbol,Any}(:x, [10.34, 21.01, 23.68, 25.29, 8.77, 26.88, 15.04, 14.78, 10.27, 15.42 … 34.63, 34.65, 23.33, 45.35, 23.17, 40.55, 20.69, 30.46, 23.1, 15.69]))) - PlotlyJS.GenericTrace{Dict{Symbol,Any}}(Dict{Symbol,Any}(Pair{Symbol,Any}(:type, "violin"),Pair{Symbol,Any}(:name, "(Male, Thur)"),Pair{Symbol,Any}(:orientation, "h"),Pair{Symbol,Any}(:x, [27.2, 22.76, 17.29, 19.44, 16.66, 32.68, 15.98, 13.03, 18.28, 24.71 … 9.78, 7.51, 28.44, 15.48, 16.58, 7.56, 10.34, 13.51, 18.71, 20.53]))) - -julia> [t[:name] for t in traces] -8-element Array{String,1}: - "(Female, Fri)" - "(Female, Sat)" - "(Female, Sun)" - "(Female, Thur)" - "(Male, Fri)" - "(Male, Sat)" - "(Male, Sun)" - "(Male, Thur)" -``` - -Also new in version 0.9.0, when using the DataFrame API you are allowed to pass -a function as the value for a keyword argument. When the each trace is -constructed, the value will be replaced by calling the function on whatever -DataFrame is being used. When used in conjunction with the `group` argument, -this allows you to _compute_ group specific trace attributes on the fly. - -See the docstring for `GenericTrace` and the `violin_side_by_side` example on -the [violin example page](examples/violin.md) more details. diff --git a/docs/css/base16-solarized-light.css b/docs/css/base16-solarized-light.css deleted file mode 100644 index be8ee046..00000000 --- a/docs/css/base16-solarized-light.css +++ /dev/null @@ -1,72 +0,0 @@ -/* - Name: Base16 Solarized Light - Author: Ethan Schoonover (http://ethanschoonover.com/solarized) - Pygments template by Jan T. Sott (https://github.com/idleberg) - Created with Base16 Builder by Chris Kempson (https://github.com/chriskempson/base16-builder) -*/ -.codehilite .hll { background-color: #eee8d5 } -.codehilite { background: #fdf6e3; color: #002b36 } -.codehilite .c { color: #839496 } /* Comment */ -.codehilite .err { color: #dc322f } /* Error */ -.codehilite .k { color: #6c71c4 } /* Keyword */ -.codehilite .l { color: #cb4b16 } /* Literal */ -.codehilite .n { color: #002b36 } /* Name */ -.codehilite .o { color: #2aa198 } /* Operator */ -.codehilite .p { color: #002b36 } /* Punctuation */ -.codehilite .cm { color: #839496 } /* Comment.Multiline */ -.codehilite .cp { color: #839496 } /* Comment.Preproc */ -.codehilite .c1 { color: #839496 } /* Comment.Single */ -.codehilite .cs { color: #839496 } /* Comment.Special */ -.codehilite .gd { color: #dc322f } /* Generic.Deleted */ -.codehilite .ge { font-style: italic } /* Generic.Emph */ -.codehilite .gh { color: #002b36; font-weight: bold } /* Generic.Heading */ -.codehilite .gi { color: #859900 } /* Generic.Inserted */ -.codehilite .gp { color: #839496; font-weight: bold } /* Generic.Prompt */ -.codehilite .gs { font-weight: bold } /* Generic.Strong */ -.codehilite .gu { color: #2aa198; font-weight: bold } /* Generic.Subheading */ -.codehilite .kc { color: #6c71c4 } /* Keyword.Constant */ -.codehilite .kd { color: #6c71c4 } /* Keyword.Declaration */ -.codehilite .kn { color: #2aa198 } /* Keyword.Namespace */ -.codehilite .kp { color: #6c71c4 } /* Keyword.Pseudo */ -.codehilite .kr { color: #6c71c4 } /* Keyword.Reserved */ -.codehilite .kt { color: #b58900 } /* Keyword.Type */ -.codehilite .ld { color: #859900 } /* Literal.Date */ -.codehilite .m { color: #cb4b16 } /* Literal.Number */ -.codehilite .s { color: #859900 } /* Literal.String */ -.codehilite .na { color: #268bd2 } /* Name.Attribute */ -.codehilite .nb { color: #002b36 } /* Name.Builtin */ -.codehilite .nc { color: #b58900 } /* Name.Class */ -.codehilite .no { color: #dc322f } /* Name.Constant */ -.codehilite .nd { color: #2aa198 } /* Name.Decorator */ -.codehilite .ni { color: #002b36 } /* Name.Entity */ -.codehilite .ne { color: #dc322f } /* Name.Exception */ -.codehilite .nf { color: #268bd2 } /* Name.Function */ -.codehilite .nl { color: #002b36 } /* Name.Label */ -.codehilite .nn { color: #b58900 } /* Name.Namespace */ -.codehilite .nx { color: #268bd2 } /* Name.Other */ -.codehilite .py { color: #002b36 } /* Name.Property */ -.codehilite .nt { color: #2aa198 } /* Name.Tag */ -.codehilite .nv { color: #dc322f } /* Name.Variable */ -.codehilite .ow { color: #2aa198 } /* Operator.Word */ -.codehilite .w { color: #002b36 } /* Text.Whitespace */ -.codehilite .mf { color: #cb4b16 } /* Literal.Number.Float */ -.codehilite .mh { color: #cb4b16 } /* Literal.Number.Hex */ -.codehilite .mi { color: #cb4b16 } /* Literal.Number.Integer */ -.codehilite .mo { color: #cb4b16 } /* Literal.Number.Oct */ -.codehilite .sb { color: #859900 } /* Literal.String.Backtick */ -.codehilite .sc { color: #002b36 } /* Literal.String.Char */ -.codehilite .sd { color: #839496 } /* Literal.String.Doc */ -.codehilite .s2 { color: #859900 } /* Literal.String.Double */ -.codehilite .se { color: #cb4b16 } /* Literal.String.Escape */ -.codehilite .sh { color: #859900 } /* Literal.String.Heredoc */ -.codehilite .si { color: #cb4b16 } /* Literal.String.Interpol */ -.codehilite .sx { color: #859900 } /* Literal.String.Other */ -.codehilite .sr { color: #859900 } /* Literal.String.Regex */ -.codehilite .s1 { color: #859900 } /* Literal.String.Single */ -.codehilite .ss { color: #859900 } /* Literal.String.Symbol */ -.codehilite .bp { color: #002b36 } /* Name.Builtin.Pseudo */ -.codehilite .vc { color: #dc322f } /* Name.Variable.Class */ -.codehilite .vg { color: #dc322f } /* Name.Variable.Global */ -.codehilite .vi { color: #dc322f } /* Name.Variable.Instance */ -.codehilite .il { color: #cb4b16 } /* Literal.Number.Integer.Long */ -code { background: #f6f3ea; color: #002b36 } diff --git a/docs/css/base16-tomorrow-dark.css b/docs/css/base16-tomorrow-dark.css deleted file mode 100644 index 4c210806..00000000 --- a/docs/css/base16-tomorrow-dark.css +++ /dev/null @@ -1,71 +0,0 @@ -/* - Name: Base16 Tomorrow Dark - Author: Chris Kempson (http://chriskempson.com) - Pygments template by Jan T. Sott (https://github.com/idleberg) - Created with Base16 Builder by Chris Kempson (https://github.com/chriskempson/base16-builder) -*/ -.codehilite .hll { background-color: #373b41 } -code, .codehilite { background: #1d1f21; color: #ffffff } -.codehilite .c { color: #969896 } /* Comment */ -.codehilite .err { color: #cc6666 } /* Error */ -.codehilite .k { color: #b294bb } /* Keyword */ -.codehilite .l { color: #de935f } /* Literal */ -.codehilite .n { color: #ffffff } /* Name */ -.codehilite .o { color: #8abeb7 } /* Operator */ -.codehilite .p { color: #ffffff } /* Punctuation */ -.codehilite .cm { color: #969896 } /* Comment.Multiline */ -.codehilite .cp { color: #969896 } /* Comment.Preproc */ -.codehilite .c1 { color: #969896 } /* Comment.Single */ -.codehilite .cs { color: #969896 } /* Comment.Special */ -.codehilite .gd { color: #cc6666 } /* Generic.Deleted */ -.codehilite .ge { font-style: italic } /* Generic.Emph */ -.codehilite .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */ -.codehilite .gi { color: #b5bd68 } /* Generic.Inserted */ -.codehilite .gp { color: #969896; font-weight: bold } /* Generic.Prompt */ -.codehilite .gs { font-weight: bold } /* Generic.Strong */ -.codehilite .gu { color: #8abeb7; font-weight: bold } /* Generic.Subheading */ -.codehilite .kc { color: #b294bb } /* Keyword.Constant */ -.codehilite .kd { color: #b294bb } /* Keyword.Declaration */ -.codehilite .kn { color: #8abeb7 } /* Keyword.Namespace */ -.codehilite .kp { color: #b294bb } /* Keyword.Pseudo */ -.codehilite .kr { color: #b294bb } /* Keyword.Reserved */ -.codehilite .kt { color: #f0c674 } /* Keyword.Type */ -.codehilite .ld { color: #b5bd68 } /* Literal.Date */ -.codehilite .m { color: #de935f } /* Literal.Number */ -.codehilite .s { color: #b5bd68 } /* Literal.String */ -.codehilite .na { color: #81a2be } /* Name.Attribute */ -.codehilite .nb { color: #ffffff } /* Name.Builtin */ -.codehilite .nc { color: #f0c674 } /* Name.Class */ -.codehilite .no { color: #cc6666 } /* Name.Constant */ -.codehilite .nd { color: #8abeb7 } /* Name.Decorator */ -.codehilite .ni { color: #ffffff } /* Name.Entity */ -.codehilite .ne { color: #cc6666 } /* Name.Exception */ -.codehilite .nf { color: #81a2be } /* Name.Function */ -.codehilite .nl { color: #ffffff } /* Name.Label */ -.codehilite .nn { color: #f0c674 } /* Name.Namespace */ -.codehilite .nx { color: #81a2be } /* Name.Other */ -.codehilite .py { color: #ffffff } /* Name.Property */ -.codehilite .nt { color: #8abeb7 } /* Name.Tag */ -.codehilite .nv { color: #cc6666 } /* Name.Variable */ -.codehilite .ow { color: #8abeb7 } /* Operator.Word */ -.codehilite .w { color: #ffffff } /* Text.Whitespace */ -.codehilite .mf { color: #de935f } /* Literal.Number.Float */ -.codehilite .mh { color: #de935f } /* Literal.Number.Hex */ -.codehilite .mi { color: #de935f } /* Literal.Number.Integer */ -.codehilite .mo { color: #de935f } /* Literal.Number.Oct */ -.codehilite .sb { color: #b5bd68 } /* Literal.String.Backtick */ -.codehilite .sc { color: #ffffff } /* Literal.String.Char */ -.codehilite .sd { color: #969896 } /* Literal.String.Doc */ -.codehilite .s2 { color: #b5bd68 } /* Literal.String.Double */ -.codehilite .se { color: #de935f } /* Literal.String.Escape */ -.codehilite .sh { color: #b5bd68 } /* Literal.String.Heredoc */ -.codehilite .si { color: #de935f } /* Literal.String.Interpol */ -.codehilite .sx { color: #b5bd68 } /* Literal.String.Other */ -.codehilite .sr { color: #b5bd68 } /* Literal.String.Regex */ -.codehilite .s1 { color: #b5bd68 } /* Literal.String.Single */ -.codehilite .ss { color: #b5bd68 } /* Literal.String.Symbol */ -.codehilite .bp { color: #ffffff } /* Name.Builtin.Pseudo */ -.codehilite .vc { color: #cc6666 } /* Name.Variable.Class */ -.codehilite .vg { color: #cc6666 } /* Name.Variable.Global */ -.codehilite .vi { color: #cc6666 } /* Name.Variable.Instance */ -.codehilite .il { color: #de935f } /* Literal.Number.Integer.Long */ diff --git a/docs/css/base16-tomorrow-light.css b/docs/css/base16-tomorrow-light.css deleted file mode 100644 index ea34ec21..00000000 --- a/docs/css/base16-tomorrow-light.css +++ /dev/null @@ -1,71 +0,0 @@ -/* - Name: Base16 Tomorrow Light - Author: Chris Kempson (http://chriskempson.com) - Pygments template by Jan T. Sott (https://github.com/idleberg) - Created with Base16 Builder by Chris Kempson (https://github.com/chriskempson/base16-builder) -*/ -.codehilite .hll { background-color: #e0e0e0 } -code, .codehilite { background: #ffffff; color: #1d1f21 } -.codehilite .c { color: #b4b7b4 } /* Comment */ -.codehilite .err { color: #cc6666 } /* Error */ -.codehilite .k { color: #b294bb } /* Keyword */ -.codehilite .l { color: #de935f } /* Literal */ -.codehilite .n { color: #1d1f21 } /* Name */ -.codehilite .o { color: #8abeb7 } /* Operator */ -.codehilite .p { color: #1d1f21 } /* Punctuation */ -.codehilite .cm { color: #b4b7b4 } /* Comment.Multiline */ -.codehilite .cp { color: #b4b7b4 } /* Comment.Preproc */ -.codehilite .c1 { color: #b4b7b4 } /* Comment.Single */ -.codehilite .cs { color: #b4b7b4 } /* Comment.Special */ -.codehilite .gd { color: #cc6666 } /* Generic.Deleted */ -.codehilite .ge { font-style: italic } /* Generic.Emph */ -.codehilite .gh { color: #1d1f21; font-weight: bold } /* Generic.Heading */ -.codehilite .gi { color: #b5bd68 } /* Generic.Inserted */ -.codehilite .gp { color: #b4b7b4; font-weight: bold } /* Generic.Prompt */ -.codehilite .gs { font-weight: bold } /* Generic.Strong */ -.codehilite .gu { color: #8abeb7; font-weight: bold } /* Generic.Subheading */ -.codehilite .kc { color: #b294bb } /* Keyword.Constant */ -.codehilite .kd { color: #b294bb } /* Keyword.Declaration */ -.codehilite .kn { color: #8abeb7 } /* Keyword.Namespace */ -.codehilite .kp { color: #b294bb } /* Keyword.Pseudo */ -.codehilite .kr { color: #b294bb } /* Keyword.Reserved */ -.codehilite .kt { color: #f0c674 } /* Keyword.Type */ -.codehilite .ld { color: #b5bd68 } /* Literal.Date */ -.codehilite .m { color: #de935f } /* Literal.Number */ -.codehilite .s { color: #b5bd68 } /* Literal.String */ -.codehilite .na { color: #81a2be } /* Name.Attribute */ -.codehilite .nb { color: #1d1f21 } /* Name.Builtin */ -.codehilite .nc { color: #f0c674 } /* Name.Class */ -.codehilite .no { color: #cc6666 } /* Name.Constant */ -.codehilite .nd { color: #8abeb7 } /* Name.Decorator */ -.codehilite .ni { color: #1d1f21 } /* Name.Entity */ -.codehilite .ne { color: #cc6666 } /* Name.Exception */ -.codehilite .nf { color: #81a2be } /* Name.Function */ -.codehilite .nl { color: #1d1f21 } /* Name.Label */ -.codehilite .nn { color: #f0c674 } /* Name.Namespace */ -.codehilite .nx { color: #81a2be } /* Name.Other */ -.codehilite .py { color: #1d1f21 } /* Name.Property */ -.codehilite .nt { color: #8abeb7 } /* Name.Tag */ -.codehilite .nv { color: #cc6666 } /* Name.Variable */ -.codehilite .ow { color: #8abeb7 } /* Operator.Word */ -.codehilite .w { color: #1d1f21 } /* Text.Whitespace */ -.codehilite .mf { color: #de935f } /* Literal.Number.Float */ -.codehilite .mh { color: #de935f } /* Literal.Number.Hex */ -.codehilite .mi { color: #de935f } /* Literal.Number.Integer */ -.codehilite .mo { color: #de935f } /* Literal.Number.Oct */ -.codehilite .sb { color: #b5bd68 } /* Literal.String.Backtick */ -.codehilite .sc { color: #1d1f21 } /* Literal.String.Char */ -.codehilite .sd { color: #b4b7b4 } /* Literal.String.Doc */ -.codehilite .s2 { color: #b5bd68 } /* Literal.String.Double */ -.codehilite .se { color: #de935f } /* Literal.String.Escape */ -.codehilite .sh { color: #b5bd68 } /* Literal.String.Heredoc */ -.codehilite .si { color: #de935f } /* Literal.String.Interpol */ -.codehilite .sx { color: #b5bd68 } /* Literal.String.Other */ -.codehilite .sr { color: #b5bd68 } /* Literal.String.Regex */ -.codehilite .s1 { color: #b5bd68 } /* Literal.String.Single */ -.codehilite .ss { color: #b5bd68 } /* Literal.String.Symbol */ -.codehilite .bp { color: #1d1f21 } /* Name.Builtin.Pseudo */ -.codehilite .vc { color: #cc6666 } /* Name.Variable.Class */ -.codehilite .vg { color: #cc6666 } /* Name.Variable.Global */ -.codehilite .vi { color: #cc6666 } /* Name.Variable.Instance */ -.codehilite .il { color: #de935f } /* Literal.Number.Integer.Long */ diff --git a/docs/css/github.css b/docs/css/github.css deleted file mode 100644 index 803733f2..00000000 --- a/docs/css/github.css +++ /dev/null @@ -1,62 +0,0 @@ -/* - * GitHub style for Pygments - * Courtesy of GitHub.com - */ - -.codehilite .hll { background-color: #f8f8f8; border: 1px solid #ccc; padding: 6px 10px; border-radius: 3px; } -.codehilite .c { color: #999988; font-style: italic; } -.codehilite .err { color: #a61717; background-color: #e3d2d2; } -.codehilite .cm { color: #999988; font-style: italic; } -.codehilite .cp { color: #999999; } -.codehilite .c1 { color: #999988; font-style: italic; } -.codehilite .cs { color: #999999; font-style: italic; } -.codehilite .gd { color: #000000; background-color: #ffdddd; } -.codehilite .gd .x { color: #000000; background-color: #ffaaaa; } -.codehilite .ge { font-style: italic; } -.codehilite .gr { color: #aa0000; } -.codehilite .gh { color: #999999; } -.codehilite .gi { color: #000000; background-color: #ddffdd; } -.codehilite .gi .x { color: #000000; background-color: #aaffaa; } -.codehilite .go { color: #888888; } -.codehilite .gp { color: #555555; } -.codehilite .gu { color: #800080; } -.codehilite .gt { color: #aa0000; } -.codehilite .kt { color: #445588; } -.codehilite .m { color: #009999; } -.codehilite .s { color: #dd1144; } -.codehilite .n { color: #333333; } -.codehilite .na { color: teal; } -.codehilite .nb { color: #0086b3; } -.codehilite .nc { color: #445588; } -.codehilite .no { color: teal; } -.codehilite .ni { color: purple; } -.codehilite .ne { color: #990000; } -.codehilite .nf { color: #990000; } -.codehilite .nn { color: #555555; } -.codehilite .nt { color: navy; } -.codehilite .nv { color: teal; } -.codehilite .w { color: #bbbbbb; } -.codehilite .mf { color: #009999; } -.codehilite .mh { color: #009999; } -.codehilite .mi { color: #009999; } -.codehilite .mo { color: #009999; } -.codehilite .sb { color: #dd1144; } -.codehilite .sc { color: #dd1144; } -.codehilite .sd { color: #dd1144; } -.codehilite .s2 { color: #dd1144; } -.codehilite .se { color: #dd1144; } -.codehilite .sh { color: #dd1144; } -.codehilite .si { color: #dd1144; } -.codehilite .sx { color: #dd1144; } -.codehilite .sr { color: #009926; } -.codehilite .s1 { color: #dd1144; } -.codehilite .ss { color: #990073; } -.codehilite .bp { color: #999999; } -.codehilite .vc { color: teal; } -.codehilite .vg { color: teal; } -.codehilite .vi { color: teal; } -.codehilite .il { color: #009999; } -.codehilite .gc { color: #999; background-color: #EAF2F5; } - -/* Make plotly menubar go behind header instead of on top when scrolling */ -div.modebar.modebar--hover {z-index: 0 !important;} diff --git a/docs/css/tomorrow-night-eighties.css b/docs/css/tomorrow-night-eighties.css deleted file mode 100644 index 84487597..00000000 --- a/docs/css/tomorrow-night-eighties.css +++ /dev/null @@ -1,65 +0,0 @@ -.codehilite .hll { background-color: #515151 } -.codehilite { background: #2d2d2d; color: #cccccc } -.codehilite .c { color: #999999 } /* Comment */ -.codehilite .err { color: #f2777a } /* Error */ -.codehilite .k { color: #cc99cc } /* Keyword */ -.codehilite .l { color: #f99157 } /* Literal */ -.codehilite .n { color: #cccccc } /* Name */ -.codehilite .o { color: #66cccc } /* Operator */ -.codehilite .p { color: #cccccc } /* Punctuation */ -.codehilite .cm { color: #999999 } /* Comment.Multiline */ -.codehilite .cp { color: #999999 } /* Comment.Preproc */ -.codehilite .c1 { color: #999999 } /* Comment.Single */ -.codehilite .cs { color: #999999 } /* Comment.Special */ -.codehilite .gd { color: #f2777a } /* Generic.Deleted */ -.codehilite .ge { font-style: italic } /* Generic.Emph */ -.codehilite .gh { color: #cccccc; font-weight: bold } /* Generic.Heading */ -.codehilite .gi { color: #99cc99 } /* Generic.Inserted */ -.codehilite .gp { color: #999999; font-weight: bold } /* Generic.Prompt */ -.codehilite .gs { font-weight: bold } /* Generic.Strong */ -.codehilite .gu { color: #66cccc; font-weight: bold } /* Generic.Subheading */ -.codehilite .kc { color: #cc99cc } /* Keyword.Constant */ -.codehilite .kd { color: #cc99cc } /* Keyword.Declaration */ -.codehilite .kn { color: #66cccc } /* Keyword.Namespace */ -.codehilite .kp { color: #cc99cc } /* Keyword.Pseudo */ -.codehilite .kr { color: #cc99cc } /* Keyword.Reserved */ -.codehilite .kt { color: #ffcc66 } /* Keyword.Type */ -.codehilite .ld { color: #99cc99 } /* Literal.Date */ -.codehilite .m { color: #f99157 } /* Literal.Number */ -.codehilite .s { color: #99cc99 } /* Literal.String */ -.codehilite .na { color: #6699cc } /* Name.Attribute */ -.codehilite .nb { color: #cccccc } /* Name.Builtin */ -.codehilite .nc { color: #ffcc66 } /* Name.Class */ -.codehilite .no { color: #f2777a } /* Name.Constant */ -.codehilite .nd { color: #66cccc } /* Name.Decorator */ -.codehilite .ni { color: #cccccc } /* Name.Entity */ -.codehilite .ne { color: #f2777a } /* Name.Exception */ -.codehilite .nf { color: #6699cc } /* Name.Function */ -.codehilite .nl { color: #cccccc } /* Name.Label */ -.codehilite .nn { color: #ffcc66 } /* Name.Namespace */ -.codehilite .nx { color: #6699cc } /* Name.Other */ -.codehilite .py { color: #cccccc } /* Name.Property */ -.codehilite .nt { color: #66cccc } /* Name.Tag */ -.codehilite .nv { color: #f2777a } /* Name.Variable */ -.codehilite .ow { color: #66cccc } /* Operator.Word */ -.codehilite .w { color: #cccccc } /* Text.Whitespace */ -.codehilite .mf { color: #f99157 } /* Literal.Number.Float */ -.codehilite .mh { color: #f99157 } /* Literal.Number.Hex */ -.codehilite .mi { color: #f99157 } /* Literal.Number.Integer */ -.codehilite .mo { color: #f99157 } /* Literal.Number.Oct */ -.codehilite .sb { color: #99cc99 } /* Literal.String.Backtick */ -.codehilite .sc { color: #cccccc } /* Literal.String.Char */ -.codehilite .sd { color: #999999 } /* Literal.String.Doc */ -.codehilite .s2 { color: #99cc99 } /* Literal.String.Double */ -.codehilite .se { color: #f99157 } /* Literal.String.Escape */ -.codehilite .sh { color: #99cc99 } /* Literal.String.Heredoc */ -.codehilite .si { color: #f99157 } /* Literal.String.Interpol */ -.codehilite .sx { color: #99cc99 } /* Literal.String.Other */ -.codehilite .sr { color: #99cc99 } /* Literal.String.Regex */ -.codehilite .s1 { color: #99cc99 } /* Literal.String.Single */ -.codehilite .ss { color: #99cc99 } /* Literal.String.Symbol */ -.codehilite .bp { color: #cccccc } /* Name.Builtin.Pseudo */ -.codehilite .vc { color: #f2777a } /* Name.Variable.Class */ -.codehilite .vg { color: #f2777a } /* Name.Variable.Global */ -.codehilite .vi { color: #f2777a } /* Name.Variable.Instance */ -.codehilite .il { color: #f99157 } /* Literal.Number.Integer.Long */ diff --git a/docs/examples/3d.md b/docs/examples/3d.md deleted file mode 100644 index 75d24600..00000000 --- a/docs/examples/3d.md +++ /dev/null @@ -1,355 +0,0 @@ -```julia -function random_line() - n = 400 - rw() = cumsum(randn(n)) - trace1 = scatter3d(;x=rw(),y=rw(), z=rw(), mode="lines", - marker=attr(color="#1f77b4", size=12, symbol="circle", - line=attr(color="rgb(0,0,0)", width=0)), - line=attr(color="#1f77b4", width=1)) - trace2 = scatter3d(;x=rw(),y=rw(), z=rw(), mode="lines", - marker=attr(color="#9467bd", size=12, symbol="circle", - line=attr(color="rgb(0,0,0)", width=0)), - line=attr(color="rgb(44, 160, 44)", width=1)) - trace3 = scatter3d(;x=rw(),y=rw(), z=rw(), mode="lines", - marker=attr(color="#bcbd22", size=12, symbol="circle", - line=attr(color="rgb(0,0,0)", width=0)), - line=attr(color="#bcbd22", width=1)) - layout = Layout(autosize=false, width=500, height=500, - margin=attr(l=0, r=0, b=0, t=65)) - plot([trace1, trace2, trace3], layout) -end -random_line() -``` - - -
- - - - - -```julia -function topo_surface() - z = Vector[[27.80985, 49.61936, 83.08067, 116.6632, 130.414, 150.7206, 220.1871, - 156.1536, 148.6416, 203.7845, 206.0386, 107.1618, 68.36975, 45.3359, - 49.96142, 21.89279, 17.02552, 11.74317, 14.75226, 13.6671, 5.677561, - 3.31234, 1.156517, -0.147662], - [27.71966, 48.55022, 65.21374, 95.27666, 116.9964, 133.9056, 152.3412, - 151.934, 160.1139, 179.5327, 147.6184, 170.3943, 121.8194, 52.58537, - 33.08871, 38.40972, 44.24843, 69.5786, 4.019351, 3.050024, 3.039719, - 2.996142, 2.967954, 1.999594], - [30.4267, 33.47752, 44.80953, 62.47495, 77.43523, 104.2153, 102.7393, 137.0004, - 186.0706, 219.3173, 181.7615, 120.9154, 143.1835, 82.40501, 48.47132, - 74.71461, 60.0909, 7.073525, 6.089851, 6.53745, 6.666096, 7.306965, 5.73684, - 3.625628], - [16.66549, 30.1086, 39.96952, 44.12225, 59.57512, 77.56929, 106.8925, - 166.5539, 175.2381, 185.2815, 154.5056, 83.0433, 62.61732, 62.33167, - 60.55916, 55.92124, 15.17284, 8.248324, 36.68087, 61.93413, 20.26867, - 68.58819, 46.49812, 0.2360095], - [8.815617, 18.3516, 8.658275, 27.5859, 48.62691, 60.18013, 91.3286, - 145.7109, 116.0653, 106.2662, 68.69447, 53.10596, 37.92797, 47.95942, - 47.42691, 69.20731, 44.95468, 29.17197, 17.91674, 16.25515, 14.65559, - 17.26048, 31.22245, 46.71704], - [6.628881, 10.41339, 24.81939, 26.08952, 30.1605, 52.30802, 64.71007, - 76.30823, 84.63686, 99.4324, 62.52132, 46.81647, 55.76606, 82.4099, - 140.2647, 81.26501, 56.45756, 30.42164, 17.28782, 8.302431, 2.981626, - 2.698536, 5.886086, 5.268358], - [21.83975, 6.63927, 18.97085, 32.89204, 43.15014, 62.86014, 104.6657, - 130.2294, 114.8494, 106.9873, 61.89647, 55.55682, 86.80986, 89.27802, - 122.4221, 123.9698, 109.0952, 98.41956, 77.61374, 32.49031, 14.67344, - 7.370775, 0.03711011, 0.6423392], - [53.34303, 26.79797, 6.63927, 10.88787, 17.2044, 56.18116, 79.70141, - 90.8453, 98.27675, 80.87243, 74.7931, 75.54661, 73.4373, 74.11694, 68.1749, - 46.24076, 39.93857, 31.21653, 36.88335, 40.02525, 117.4297, 12.70328, - 1.729771, 0], - [25.66785, 63.05717, 22.1414, 17.074, 41.74483, 60.27227, 81.42432, 114.444, - 102.3234, 101.7878, 111.031, 119.2309, 114.0777, 110.5296, 59.19355, - 42.47175, 14.63598, 6.944074, 6.944075, 27.74936, 0, 0, 0.09449376, 0.07732264], - [12.827, 69.20554, 46.76293, 13.96517, 33.88744, 61.82613, 84.74799, - 121.122, 145.2741, 153.1797, 204.786, 227.9242, 236.3038, 228.3655, - 79.34425, 25.93483, 6.944074, 6.944074, 6.944075, 7.553681, 0, 0, 0, 0], - [0, 68.66396, 59.0435, 33.35762, 47.45282, 57.8355, 78.91689, 107.8275, - 168.0053, 130.9597, 212.5541, 165.8122, 210.2429, 181.1713, 189.7617, - 137.3378, 84.65395, 8.677168, 6.956576, 8.468093, 0, 0, 0, 0], - [0, 95.17499, 80.03818, 59.89862, 39.58476, 50.28058, 63.81641, 80.61302, - 66.37824, 198.7651, 244.3467, 294.2474, 264.3517, 176.4082, 60.21857, - 77.41475, 53.16981, 56.16393, 6.949235, 7.531059, 3.780177, 0, 0, 0], - [0, 134.9879, 130.3696, 96.86325, 75.70494, 58.86466, 57.20374, 55.18837, - 78.128, 108.5582, 154.3774, 319.1686, 372.8826, 275.4655, 130.2632, 54.93822, - 25.49719, 8.047439, 8.084393, 5.115252, 5.678269, 0, 0, 0], - [0, 48.08919, 142.5558, 140.3777, 154.7261, 87.9361, 58.11092, 52.83869, - 67.14822, 83.66798, 118.9242, 150.0681, 272.9709, 341.1366, 238.664, 190.2, - 116.8943, 91.48672, 14.0157, 42.29277, 5.115252, 0, 0, 0], - [0, 54.1941, 146.3839, 99.48143, 96.19411, 102.9473, 76.14089, 57.7844, - 47.0402, 64.36799, 84.23767, 162.7181, 121.3275, 213.1646, 328.482, - 285.4489, 283.8319, 212.815, 164.549, 92.29631, 7.244015, 1.167, 0, 0], - [0, 6.919659, 195.1709, 132.5253, 135.2341, 89.85069, 89.45549, 60.29967, - 50.33806, 39.17583, 59.06854, 74.52159, 84.93402, 187.1219, 123.9673, - 103.7027, 128.986, 165.1283, 249.7054, 95.39966, 10.00284, 2.39255, 0, 0], - [0, 21.73871, 123.1339, 176.7414, 158.2698, 137.235, 105.3089, 86.63255, 53.11591, - 29.03865, 30.40539, 39.04902, 49.23405, 63.27853, 111.4215, 101.1956, - 40.00962, 59.84565, 74.51253, 17.06316, 2.435141, 2.287471, -0.0003636982, 0], - [0, 0, 62.04672, 136.3122, 201.7952, 168.1343, 95.2046, 58.90624, 46.94091, - 49.27053, 37.10416, 17.97011, 30.93697, 33.39257, 44.03077, 55.64542, - 78.22423, 14.42782, 9.954997, 7.768213, 13.0254, 21.73166, 2.156372, - 0.5317867], - [0, 0, 79.62993, 139.6978, 173.167, 192.8718, 196.3499, 144.6611, 106.5424, - 57.16653, 41.16107, 32.12764, 13.8566, 10.91772, 12.07177, 22.38254, - 24.72105, 6.803666, 4.200841, 16.46857, 15.70744, 33.96221, 7.575688, - -0.04880907], - [0, 0, 33.2664, 57.53643, 167.2241, 196.4833, 194.7966, 182.1884, 119.6961, - 73.02113, 48.36549, 33.74652, 26.2379, 16.3578, 6.811293, 6.63927, 6.639271, - 8.468093, 6.194273, 3.591233, 3.81486, 8.600739, 5.21889, 0], - [0, 0, 29.77937, 54.97282, 144.7995, 207.4904, 165.3432, 171.4047, 174.9216, - 100.2733, 61.46441, 50.19171, 26.08209, 17.18218, 8.468093, 6.63927, - 6.334467, 6.334467, 5.666687, 4.272203, 0, 0, 0, 0], - [0, 0, 31.409, 132.7418, 185.5796, 121.8299, 185.3841, 160.6566, 116.1478, - 118.1078, 141.7946, 65.56351, 48.84066, 23.13864, 18.12932, 10.28531, - 6.029663, 6.044627, 5.694764, 3.739085, 3.896037, 0, 0, 0], - [0, 0, 19.58994, 42.30355, 96.26777, 187.1207, 179.6626, 221.3898, 154.2617, - 142.1604, 148.5737, 67.17937, 40.69044, 39.74512, 26.10166, 14.48469, - 8.65873, 3.896037, 3.571392, 3.896037, 3.896037, 3.896037, 1.077756, 0], - [0.001229679, 3.008948, 5.909858, 33.50574, 104.3341, 152.2165, 198.1988, - 191.841, 228.7349, 168.1041, 144.2759, 110.7436, 57.65214, 42.63504, - 27.91891, 15.41052, 8.056102, 3.90283, 3.879774, 3.936718, 3.968634, - 0.1236256, 3.985531, -0.1835741], - [0, 5.626141, 7.676256, 63.16226, 45.99762, 79.56688, 227.311, 203.9287, - 172.5618, 177.1462, 140.4554, 123.9905, 110.346, 65.12319, 34.31887, - 24.5278, 9.561069, 3.334991, 5.590495, 5.487353, 5.909499, 5.868994, - 5.833817, 3.568177]] - trace = surface(z=z) - layout = Layout(title="Mt. Bruno Elevation", autosize=false, width=500, - height=500, margin=attr(l=65, r=50, b=65, t=90)) - plot(trace, layout) -end -topo_surface() -``` - - -
- - - - - -```julia -function multiple_surface() - z1 = Vector[[8.83, 8.89, 8.81, 8.87, 8.9, 8.87], - [8.89, 8.94, 8.85, 8.94, 8.96, 8.92], - [8.84, 8.9, 8.82, 8.92, 8.93, 8.91], - [8.79, 8.85, 8.79, 8.9, 8.94, 8.92], - [8.79, 8.88, 8.81, 8.9, 8.95, 8.92], - [8.8, 8.82, 8.78, 8.91, 8.94, 8.92], - [8.75, 8.78, 8.77, 8.91, 8.95, 8.92], - [8.8, 8.8, 8.77, 8.91, 8.95, 8.94], - [8.74, 8.81, 8.76, 8.93, 8.98, 8.99], - [8.89, 8.99, 8.92, 9.1, 9.13, 9.11], - [8.97, 8.97, 8.91, 9.09, 9.11, 9.11], - [9.04, 9.08, 9.05, 9.25, 9.28, 9.27], - [9, 9.01, 9, 9.2, 9.23, 9.2], - [8.99, 8.99, 8.98, 9.18, 9.2, 9.19], - [8.93, 8.97, 8.97, 9.18, 9.2, 9.18]] - z2 = map(x->x+1, z1) - z3 = map(x->x-1, z1) - trace1 = surface(z=z1, colorscale="Viridis") - trace2 = surface(z=z2, showscale=false, opacity=0.9, colorscale="Viridis") - trace3 = surface(z=z3, showscale=false, opacity=0.9, colorscale="Viridis") - plot([trace1, trace2, trace3]) -end -multiple_surface() -``` - - -
- - - - - -```julia -function clustering_alpha_shapes() - @eval using DataFrames, RDatasets, Colors - - # load data - iris = dataset("datasets", "iris") - nms = unique(iris[:Species]) - colors = [RGB(0.89, 0.1, 0.1), RGB(0.21, 0.50, 0.72), RGB(0.28, 0.68, 0.3)] - - data = GenericTrace[] - - for (i, nm) in enumerate(nms) - df = iris[iris[:Species] .== nm, :] - x=df[:SepalLength] - y=df[:SepalWidth] - z=df[:PetalLength] - trace = scatter3d(;name=nm, mode="markers", - marker_size=3, marker_color=colors[i], marker_line_width=0, - x=x, y=y, z=z) - push!(data, trace) - - cluster = mesh3d(;color=colors[i], opacity=0.3, x=x, y=y, z=z) - push!(data, cluster) - end - - # notice the nested attrs to create complex JSON objects - layout = Layout(width=800, height=550, autosize=false, title="Iris dataset", - scene=attr(xaxis=attr(gridcolor="rgb(255, 255, 255)", - zerolinecolor="rgb(255, 255, 255)", - showbackground=true, - backgroundcolor="rgb(230, 230,230)"), - yaxis=attr(gridcolor="rgb(255, 255, 255)", - zerolinecolor="rgb(255, 255, 255)", - showbackground=true, - backgroundcolor="rgb(230, 230,230)"), - zaxis=attr(gridcolor="rgb(255, 255, 255)", - zerolinecolor="rgb(255, 255, 255)", - showbackground=true, - backgroundcolor="rgb(230, 230,230)"), - aspectratio=attr(x=1, y=1, z=0.7), - aspectmode = "manual")) - plot(data, layout) -end -clustering_alpha_shapes() -``` - - -
- - - - - -```julia -function scatter_3d() - @eval using Distributions - Σ = fill(0.5, 3, 3) + Diagonal([0.5, 0.5, 0.5]) - obs1 = rand(MvNormal(zeros(3), Σ), 200)' - obs2 = rand(MvNormal(zeros(3), 0.5Σ), 100)' - - trace1 = scatter3d(;x=obs1[:, 1], y=obs1[:, 2], z=obs1[:, 3], - mode="markers", opacity=0.8, - marker_size=12, marker_line_width=0.5, - marker_line_color="rgba(217, 217, 217, 0.14)") - - trace2 = scatter3d(;x=obs2[:, 1], y=obs2[:, 2], z=obs2[:, 3], - mode="markers", opacity=0.9, - marker=attr(color="rgb(127, 127, 127)", - symbol="circle", line_width=1.0, - line_color="rgb(204, 204, 204)")) - - layout = Layout(margin=attr(l=0, r=0, t=0, b=0)) - - plot([trace1, trace2], layout) -end -scatter_3d() -``` - - -
- - - - - -```julia -function trisurf() - facecolor = repeat([ - "rgb(50, 200, 200)", - "rgb(100, 200, 255)", - "rgb(150, 200, 115)", - "rgb(200, 200, 50)", - "rgb(230, 200, 10)", - "rgb(255, 140, 0)" - ], inner=[2]) - - t = mesh3d( - x=[0, 0, 1, 1, 0, 0, 1, 1], - y=[0, 1, 1, 0, 0, 1, 1, 0], - z=[0, 0, 0, 0, 1, 1, 1, 1], - i=[7, 0, 0, 0, 4, 4, 2, 6, 4, 0, 3, 7], - j=[3, 4, 1, 2, 5, 6, 5, 5, 0, 1, 2, 2], - k=[0, 7, 2, 3, 6, 7, 1, 2, 5, 5, 7, 6], - facecolor=facecolor) - - plot(t) -end -trisurf() -``` - - -
- - - - - -```julia -function meshcube() - t = mesh3d( - x=[0, 0, 1, 1, 0, 0, 1, 1], - y=[0, 1, 1, 0, 0, 1, 1, 0], - z=[0, 0, 0, 0, 1, 1, 1, 1], - i=[7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2], - j=[3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3], - k=[0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6], - intensity=range(0, stop=1, length=8), - colorscale=[ - [0, "rgb(255, 0, 255)"], - [0.5, "rgb(0, 255, 0)"], - [1, "rgb(0, 0, 255)"] - ] - ) - plot(t) -end -meshcube() -``` - - -
- - - - - diff --git a/docs/examples/area.md b/docs/examples/area.md deleted file mode 100644 index 02a21f5f..00000000 --- a/docs/examples/area.md +++ /dev/null @@ -1,79 +0,0 @@ -```julia -function area1() - trace1 = scatter(;x=1:4, y=[0, 2, 3, 5], fill="tozeroy") - trace2 = scatter(;x=1:4, y=[3, 5, 1, 7], fill="tonexty") - plot([trace1, trace2]) -end -area1() -``` - - -
- - - - - -```julia -function area2() - function _stacked_area!(traces) - for (i, tr) in enumerate(traces[2:end]) - for j in 1:min(length(traces[i]["y"]), length(tr["y"])) - tr["y"][j] += traces[i]["y"][j] - end - end - traces - end - - traces = [scatter(;x=1:3, y=[2, 1, 4], fill="tozeroy"), - scatter(;x=1:3, y=[1, 1, 2], fill="tonexty"), - scatter(;x=1:3, y=[3, 0, 2], fill="tonexty")] - _stacked_area!(traces) - - plot(traces, Layout(title="stacked and filled line chart")) -end -area2() -``` - - -
- - - - - -```julia -function area3() - trace1 = scatter(;x=1:4, y=[0, 2, 3, 5], fill="tozeroy", mode="none") - trace2 = scatter(;x=1:4, y=[3, 5, 1, 7], fill="tonexty", mode="none") - plot([trace1, trace2], - Layout(title="Overlaid Chart Without Boundary Lines")) -end -area3() -``` - - -
- - - - - diff --git a/docs/examples/bar.md b/docs/examples/bar.md deleted file mode 100644 index fc0577fb..00000000 --- a/docs/examples/bar.md +++ /dev/null @@ -1,399 +0,0 @@ -```julia -function bar1() - data = bar(;x=["giraffes", "orangutans", "monkeys"], - y=[20, 14, 23]) - plot(data) -end -bar1() -``` - - -
- - - - - -```julia -function bar2() - trace1 = bar(;x=["giraffes", "orangutans", "monkeys"], - y=[20, 14, 23], - name="SF Zoo") - trace2 = bar(;x=["giraffes", "orangutans", "monkeys"], - y=[12, 18, 29], - name="LA Zoo") - data = [trace1, trace2] - layout = Layout(;barmode="group") - plot(data, layout) -end -bar2() -``` - - -
- - - - - -```julia -function bar3() - trace1 = bar(;x=["giraffes", "orangutans", "monkeys"], - y=[20, 14, 23], - name="SF Zoo") - trace2 = bar(x=["giraffes", "orangutans", "monkeys"], - y=[12, 18, 29], - name="LA Zoo") - data = [trace1, trace2] - layout = Layout(;barmode="stack") - plot(data, layout) -end -bar3() -``` - - -
- - - - - -```julia -function bar4() - data = bar(;x=["Product A", "Product B", "Product C"], - y=[20, 14, 23], - text=["$(i)% market share" for i in rand(15:30, 3)], - marker=attr(color="rgb(158, 202, 225)", opacity=0.6), - line=attr(color="rgb(8, 48, 107)", width=1.5)) - - layout = Layout(;title="January 2013 Sales Report") - - plot(data, layout) -end -bar4() -``` - - -
- - - - - -```julia -function bar5() - x_value = ["Product A", "Product B", "Product C"] - y_value = [20, 14, 23] - - data = bar(;x=x_value, - y=y_value, - text=["$(i)% market share" for i in rand(15:30, 3)], - marker=attr(color="rgb(158, 202, 225)", opacity=0.6, - line=attr(color="rgb(8, 48, 107)", width=1.5))) - - annotations = [] - - for i in 1:length(x_value) - result = attr(x=x_value[i], - y=y_value[i], - text=y_value[i], - xanchor="center", - yanchor="bottom", - showarrow=false) - push!(annotations, result) - end - - layout = Layout(;title="January 2013 Sales Report", - annotations=annotations) - plot(data, layout) -end -bar5() -``` - - -
- - - - - -```julia -function bar6() - trace1 = bar(;x=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", - "Sep", "Oct", "Nov", "Dec"], - y=[20, 14, 25, 16, 18, 22, 19, 15, 12, 16, 14, 17], - name="Primary Product", - marker_color="rgb(49, 130, 189)", - opacity=0.7) - trace2 = bar(;x=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", - "Sep", "Oct", "Nov", "Dec"], - y=[19, 14, 22, 14, 16, 19, 15, 14, 10, 12, 12, 16], - name="Secondary Product", - marker=attr(color="rgb(204, 204, 204)", opacity=0.5)) - data = [trace1, trace2] - layout = Layout(;title="2013 Sales Report", - xaxis_tickangle=-45, - barmode="group") - plot(data, layout) -end -bar6() -``` - - -
- - - - - -```julia -function bar7() - data = bar(;x=["Feature $(s)" for s in 'A':'E'], - y=[20, 14, 23, 25, 22], - marker_color=["rgba(204, 204, 204, 1)", - "rgba(222, 45, 38, 0.8)", - "rgba(204, 204, 204, 1)", - "rgba(204, 204, 204, 1)", - "rgba(204, 204, 204, 1)"]) - layout = Layout(;title="Least Used Feature") - plot(data, layout) -end -bar7() -``` - - -
- - - - - -```julia -function bar8() - data = bar(;x=["Liam", "Sophie", "Jacob", "Mia", "William", "Olivia"], - y=[8.0, 8.0, 12.0, 12.0, 13.0, 20.0], - text=["4.17 below the mean", "4.17 below the mean", - "0.17 below the mean", "0.17 below the mean", - "0.83 above the mean", "7.83 above the mean"], - marker_color="rgb(142, 124, 195)") - layout = Layout(;title="Number of Graphs Made this Week", - font_family="Raleway, sans-serif", - showlegend=false, - xaxis_tickangle=-45, - yaxis=attr(zeroline=false, gridwidth=2), - bargap=0.05) - plot(data, layout) -end -bar8() -``` - - -
- - - - - -```julia -function bar9() - trace1 = bar(;x=1995:2012, - y=[219, 146, 112, 127, 124, 180, 236, 207, 236, 263, 350, - 430, 474, 526, 488, 537, 500, 439], - name="Rest of world", - marker_color="rgb(55, 83, 109)") - trace2 = bar(;x=1995:2012, - y=[16, 13, 10, 11, 28, 37, 43, 55, 56, 88, 105, 156, 270, - 299, 340, 403, 549, 499], - name="China", - marker_color="rgb(26, 118, 255)") - - data = [trace1, trace2] - - layout = Layout(;title="US Export of Plastic Scrap", - xaxis=attr(tickfont_size= 14, - tickfont_color="rgb(107, 107, 107)"), - yaxis=attr(title="USD (millions)", - titlefont=attr(size=16, - color="rgb(107, 107, 107)"), - tickfont=attr(size=14, - color="rgb(107, 107, 107)")), - legend=attr(x=0, y=1.0, bgcolor="rgba(255, 255, 255, 0)", - bordercolor="rgba(255, 255, 255, 0)"), - barmode="group", - bargap=0.15, - bargroupgap=0.1) - plot(data, layout) -end -bar9() -``` - - -
- - - - - -```julia -function bar10() - x_data = ["Product Revenue", "Services Revenue", "Total Revenue", - "Fixed Costs", "Variable Costs", "Total Costs", "Total"] - y_data = [400, 660, 660, 590, 400, 400, 340] - textList = ["\$430K", "\$260K", "\$690K", "\$-120K", "\$-200K", "\$-320K", - "\$370K"] - - #Base - trace1 = bar(;x=x_data, - y=[0, 430, 0, 570, 370, 370, 0], - marker_color="rgba(1, 1, 1, 0.0)") - - #Revenue - trace2 = bar(;x=x_data, - y=[430, 260, 690, 0, 0, 0, 0], - marker_color="rgba(55, 128, 191, 0.7)", - line=attr(color="rgba(55, 128, 191, 1.0)", width=2)) - - #Cost - trace3 = bar(;x=x_data, - y=[0, 0, 0, 120, 200, 320, 0], - marker=attr(color="rgba(219, 64, 82, 0.7)", - line=attr(color="rgba(219, 64, 82, 1.0)", width=2))) - - #Profit - trace4 = bar(;x=x_data, - y=[0, 0, 0, 0, 0, 0, 370], - marker=attr(color="rgba(50, 171, 96, 0.7)", - line=attr(color="rgba(50, 171, 96, 1.0)", width=2))) - - data = [trace1, trace2, trace3, trace4] - - annotations = [] - for i in 1:7 - result = attr(x=x_data[i], - y=y_data[i], - text=textList[i], - font=attr(;family="Arial", font_size=14, - font_color="rgba(245, 246, 249, 1)"), - showarrow=false) - push!(annotations, result) - end - - layout = Layout(;title="Annual Profit 2015", - barmode="stack", - paper_bgcolor="rgba(245, 246, 249, 1)", - plot_bgcolor="rgba(245, 246, 249, 1)", - width=600, - height=600, - showlegend=false, - xaxis_showtickabels=true, - annotations=annotations) - - plot(data, layout) -end -bar10() -``` - - -
- - - - - -```julia -function bar11() - trace1 = bar(;x=[1, 2, 3, 4], - y=[1, 4, 9, 16], - name="Trace1") - trace2 = bar(;x=[1, 2, 3, 4], - y=[6, -8, -4.5, 8], - name="Trace2") - trace3 = bar(;x=[1, 2, 3, 4], - y=[-15, -3, 4.5, -8], - name="Trace3") - trace4 = bar(;x=[1, 2, 3, 4], - y=[-1, 3, -3, -4], - name="Trace4") - data = [trace1, trace2, trace3, trace4] - layout = Layout(;xaxis_title="X axis", - yaxis_title="Y axis", - barmode="relative", - title="Relative Barmode") - plot(data, layout) -end -bar11() -``` - - -
- - - - - diff --git a/docs/examples/box_plots.md b/docs/examples/box_plots.md deleted file mode 100644 index 603bf745..00000000 --- a/docs/examples/box_plots.md +++ /dev/null @@ -1,375 +0,0 @@ -```julia -function box1() - y0 = rand(50) - y1 = rand(50) + 1 - trace1 = box(;y=y0) - trace2 = box(;y=y1) - data = [trace1, trace2] - plot(data) -end -box1() -``` - - -
- - - - - -```julia -function box2() - data = box(;y=[0, 1, 1, 2, 3, 5, 8, 13, 21], - boxpoints="all", - jitter=0.3, - pointpos=-1.8) - plot(data) -end -box2() -``` - - -
- - - - - -```julia -function box3() - trace1 = box(;x=[1, 2, 3, 4, 4, 4, 8, 9, 10], - name="Set 1") - trace2 = box(;x=[2, 3, 3, 3, 3, 5, 6, 6, 7], - name="Set 2") - data = [trace1, trace2] - layout = Layout(;title="Horizontal Box Plot") - - plot(data, layout) -end -box3() -``` - - -
- - - - - -```julia -function box4() - x0 = ["day 1", "day 1", "day 1", "day 1", "day 1", "day 1", - "day 2", "day 2", "day 2", "day 2", "day 2", "day 2"] - trace1 = box(;y=[0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3], - x=x0, - name="kale", - marker_color="#3D9970") - trace2 = box(;y=[0.6, 0.7, 0.3, 0.6, 0.0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2], - x=x0, - name="radishes", - marker_color="#FF4136") - trace3 = box(;y=[0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1.0, 0.3, 0.6, 0.8, 0.5], - x=x0, - name="carrots", - marker_color="#FF851B") - data = [trace1, trace2, trace3] - layout = Layout(;yaxis=attr(title="normalized moisture", zeroline=false), - boxmode="group") - plot(data, layout) -end -box4() -``` - - -
- - - - - -```julia -function box5() - trace1 = box(;y=[0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, - 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, - 12, 16, 20.90, 22.3, 23.25], - name="All Points", - jitter=0.3, - pointpos=-1.8, - marker_color="rgb(7, 40, 89)", - boxpoints="all") - trace2 = box(;y=[0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, - 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, - 12, 16, 20.90, 22.3, 23.25], - name="Only Wiskers", - marker_color="rgb(9, 56, 125)", - boxpoints=false) - trace3 = box(;y=[0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, - 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, - 12, 16, 20.90, 22.3, 23.25], - name="Suspected Outlier", - marker=attr(color="rgb(8, 8, 156)", - outliercolor="rgba(219, 64, 82, 0.6)", - line=attr(outliercolor="rgba(219, 64, 82, 1.0)", - outlierwidth=2)), - boxpoints="suspectedoutliers") - trace4 = box(;y=[0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, - 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, - 12, 16, 20.90, 22.3, 23.25], - name="Wiskers and Outliers", - marker_color="rgb(107, 174, 214)", - boxpoints="Outliers") - data = [trace1, trace2, trace3, trace4] - layout = Layout(;title="Box Plot Styling Outliers") - plot(data, layout) -end -box5() -``` - - -
- - - - - -```julia -function box6() - trace1 = box(;y=[2.37, 2.16, 4.82, 1.73, 1.04, 0.23, 1.32, 2.91, 0.11, - 4.51, 0.51, 3.75, 1.35, 2.98, 4.50, 0.18, 4.66, 1.30, - 2.06, 1.19], - name="Only Mean", - marker_color="rgb(8, 81, 156)", - boxmean=true) - trace2 = box(;y=[2.37, 2.16, 4.82, 1.73, 1.04, 0.23, 1.32, 2.91, 0.11, - 4.51, 0.51, 3.75, 1.35, 2.98, 4.50, 0.18, 4.66, 1.30, - 2.06, 1.19], - name="Mean and Standard Deviation", - marker_color="rgb(10, 140, 208)", - boxmean="sd") - data = [trace1, trace2] - layout = Layout(;title="Box Plot Styling Mean and Standard Deviation") - plot(data, layout) -end -box6() -``` - - -
- - - - - -```julia -function box7() - y0 = ["day 1", "day 1", "day 1", "day 1", "day 1", "day 1", - "day 2", "day 2", "day 2", "day 2", "day 2", "day 2"] - trace1 = box(;x=[0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3], - y=y0, - name="kale", - marker_color="#3D9970", - boxmean=false, - orientation="h") - trace2 = box(;x=[0.6, 0.7, 0.3, 0.6, 0.0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2], - y=y0, - name="radishes", - marker_color="#FF4136", - boxmean=false, - orientation="h") - trace3 = box(;x=[0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1.0, 0.3, 0.6, 0.8, 0.5], - y=y0, - name="carrots", - marker_color="#FF851B", - boxmean=false, - orientation="h") - data = [trace1, trace2, trace3] - layout = Layout(;title="Grouped Horizontal Box Plot", - xaxis=attr(title="normalized moisture", zeroline=false), - boxmode="group") - plot(data, layout) -end -box7() -``` - - -
- - - - - -```julia -function box8() - trace1 = box(;y=[1, 2, 3, 4, 4, 4, 8, 9, 10], - name="Sample A", - marker_color="rgb(214, 12, 140)") - trace2 = box(;y=[2, 3, 3, 3, 3, 5, 6, 6, 7], - name="Sample B", - marker_color="rgb(0, 128, 128)") - data = [trace1, trace2] - layout = Layout(;title="Colored Box Plot") - plot(data, layout) -end -box8() -``` - - -
- - - - - -```julia -function box9() - xData = ["Carmelo
Anthony", "Dwyane
Wade", "Deron
Williams", - "Brook
Lopez", "Damian
Lillard", "David
West", - "Blake
Griffin", "David
Lee", "Demar
Derozan"] - - _getrandom(num, mul) = mul .* rand(num) - - yData = Array[ - _getrandom(30, 10), - _getrandom(30, 20), - _getrandom(30, 25), - _getrandom(30, 40), - _getrandom(30, 45), - _getrandom(30, 30), - _getrandom(30, 20), - _getrandom(30, 15), - _getrandom(30, 43) - ] - colors = ["rgba(93, 164, 214, 0.5)", "rgba(255, 144, 14, 0.5)", - "rgba(44, 160, 101, 0.5)", "rgba(255, 65, 54, 0.5)", - "rgba(207, 114, 255, 0.5)", "rgba(127, 96, 0, 0.5)", - "rgba(255, 140, 184, 0.5)", "rgba(79, 90, 117, 0.5)", - "rgba(222, 223, 0, 0.5)"] - - data = GenericTrace[] - for i in 1:length(xData) - trace = box(;y=yData[i], - name=xData[i], - boxpoints="all", - jitter=0.5, - whiskerwidth=0.2, - fillcolor="cls", - marker_size=2, - line_width=1) - push!(data, trace) - end - - t = "Points Scored by the Top 9 Scoring NBA Players in 2012" - layout = Layout(;title=t, - yaxis=attr(autorange=true, showgrid=true, zeroline=true, - dtick=5, gridcolor="rgb(255, 255, 255)", - gridwidth=1, - zerolinecolor="rgb(255, 255, 255)", - zerolinewidth=2), - margin=attr(l=40, r=30, b=80, t=100), - paper_bgcolor="rgb(243, 243, 243)", - plot_bgcolor="rgb(243, 243, 243)", - showlegend=false) - plot(data, layout) -end -box9() -``` - - -
- - - - - -```julia -function box10() - n_box = 30 - colors = ["hsl($i, 50%, 50%)" for i in range(0, stop=360, length=n_box)] - - gen_y_data(i) = - 3.5*sin(pi*i/n_box) + i/n_box + (1.5+0.5*cos(pi*i/n_box)).*rand(10) - - ys = Array[gen_y_data(i) for i in 1:n_box] - - # Create Traces - data = GenericTrace[box(y=y, marker_color=mc) for (y, mc) in zip(ys, colors)] - - #Format the layout - layout = Layout(;xaxis=attr(;showgrid=false, zeroline=false, - tickangle=60, showticklabels=true), - yaxis=attr(;zeroline=false, gridcolor="white"), - paper_bgcolor="rgb(233, 233, 233)", - plot_bgcolor="rgb(233, 233, 233)", - showlegend=true) - plot(data, layout) -end -box10() -``` - - -
- - - - - diff --git a/docs/examples/contour.md b/docs/examples/contour.md deleted file mode 100644 index 00b17a33..00000000 --- a/docs/examples/contour.md +++ /dev/null @@ -1,430 +0,0 @@ -```julia -function contour1() - x = y = [-2*pi + 4*pi*i/100 for i in 1:100] - z = [sin(x[i]) * cos(y[j]) * sin(x[i]*x[i]+y[j]*y[j])/log(x[i]*x[i]+y[j]*y[j]+1) - for i in 1:100 for j in 1:100] - z_ = [z[i:i+99] for i in 1:100:10000] - - data = contour(;z=z_, x=x, y=y) - - plot(data) -end -contour1() -``` - - -
- - - - - -```julia -function contour2() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z) - - layout = Layout(;title="Basic Contour Plot") - plot(data, layout) -end -contour2() -``` - - -
- - - - - -```julia -function contour3() - x = [-9, -6, -5 , -3, -1] - y = [0, 1, 4, 5, 7] - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - trace = contour(x=x, y=y, z=z) - - layout = Layout(title="Setting the X and Y Coordinates in a Contour Plot") - plot(trace, layout) -end -contour3() -``` - - -
- - - - - -```julia -function contour4() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, colorscale="Jet") - - layout = Layout(;title="Colorscale for Contour Plot") - plot(data, layout) -end -contour4() -``` - - -
- - - - - -```julia -function contour5() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, - colorscale="Jet", - autocontour=false, - contours=Dict(:start=>0, :end=>8, :size=>2)) - - layout = Layout(;title="Customizing Size and Range of Contours") - plot(data, layout) -end -contour5() -``` - - -
- - - - - -```julia -function contour6() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, colorscale="Jet", dx=10, x0=5, dy=10, y0=10) - - layout = Layout(;title="Customizing Spacing Between X and Y Axis Ticks") - - plot(data, layout) -end -contour6() -``` - - -
- - - - - -```julia -function contour7() - z = [NaN NaN NaN 12 13 14 15 16 - NaN 1 NaN 11 NaN NaN NaN 17 - NaN 2 6 7 NaN NaN NaN 18 - NaN 3 NaN 8 NaN NaN NaN 19 - 5 4 10 9 NaN NaN NaN 20 - NaN NaN NaN 27 NaN NaN NaN 21 - NaN NaN NaN 26 25 24 23 22]' - - p1 = plot(contour(;z=z, showscale=false)) - p2 = plot(contour(;z=z, connectgaps=true, showscale=false)) - p3 = plot(heatmap(;z=z, zsmooth="best",showscale=false)) - p4 = plot(heatmap(;z=z, zsmooth="best", connectgaps=true, showscale=false)) - - p = [p1 p2; p3 p4] - - relayout!(p, title="Connect the Gaps Between Null Values in the Z Matrix") - - p -end -contour7() -``` - - -
- - - - - -```julia -function contour8() - z = [2 4 7 12 13 14 15 16 - 3 1 6 11 12 13 16 17 - 4 2 7 7 11 14 17 18 - 5 3 8 8 13 15 18 19 - 7 4 10 9 16 18 20 19 - 9 10 5 27 23 21 21 21 - 11 14 17 26 25 24 23 22] - - p1 = plot(contour(;z=z, line_smoothing=0)) - p2 = plot(contour(;z=z, line_smoothing=0.85)) - - p = [p1 p2] - - relayout!(p, title="Smoothing Contour Lines") - - p -end -contour8() -``` - - -
- - - - - -```julia -function contour9() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, contours_coloring="heatmap") - - layout = Layout(;title="Smooth Contour Coloring") - plot(data, layout) -end -contour9() -``` - - -
- - - - - -```julia -function contour10() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, colorscale="Jet", contours_coloring="lines") - - layout = Layout(;title="Contour Lines") - plot(data, layout) -end -contour10() -``` - - -
- - - - - -```julia -function contour11() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, - colorscale=[[0, "rgb(166,206,227)"], - [0.25, "rgb(31,120,180)"], - [0.45, "rgb(178,223,138)"], - [0.64, "rgb(51,160,44)"], - [0.85, "rgb(251,154,153)"], - [1, "rgb(227,26,28)"]]) - - layout = Layout(;title="Custom Contour Plot Colorscale") - - plot(data, layout) -end -contour11() -``` - - -
- - - - - -```julia -function contour12() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, - colorbar=attr(;title="Color Bar Title",titleside="right", - titlefont=attr(;size=14, - family="Arial, sans-serif"))) - - layout = Layout(;title="Colorbar with Title") - plot(data,layout) -end -contour12() -``` - - -
- - - - - -```julia -function contour13() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, - colorbar=attr(;thickness=75, thicknessmode="pixels", - len=0.9, lenmode="fraction", - outlinewidth=0)) - - layout = Layout(;title="Colorbar Size for Contour Plots") - plot(data,layout) -end -contour13() -``` - - -
- - - - - -```julia -function contour14() - z = [10 10.625 12.5 15.625 20 - 5.625 6.25 8.125 11.25 15.625 - 2.5 3.125 5. 8.125 12.5 - 0.625 1.25 3.125 6.25 10.625 - 0 0.625 2.5 5.625 10] - data = contour(;z=z, - colorbar=attr(;ticks="outside", dtick=1, - tickwidth=2, ticklen=10, - tickcolor="grey", showticklabels=true, - tickfont_size=15, xpad=50)) - - layout = Layout(;title="Styling Color Bar Ticks for Contour Plots") - plot(data,layout) -end -contour14() -``` - - -
- - - - - diff --git a/docs/examples/finance.md b/docs/examples/finance.md deleted file mode 100644 index 5b87800f..00000000 --- a/docs/examples/finance.md +++ /dev/null @@ -1,108 +0,0 @@ -```julia -function ohlc1() - t = ohlc(open=[33.0, 33.3, 33.5, 33.0, 34.1], - high=[33.1, 33.3, 33.6, 33.2, 34.8], - low=[32.7, 32.7, 32.8, 32.6, 32.8], - close=[33.0, 32.9, 33.3, 33.1, 33.1]) - plot(t) -end -ohlc1() -``` - - -
- - - - - -```julia -function ohlc2() - # uses Quandl.jl - - function get_ohlc(ticker; kwargs...) - df = quandlget("WIKI/$(ticker)", format="DataFrame") - ohlc(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) - end - - p1 = plot(get_ohlc("AAPL", name="Apple"), Layout(title="Apple")) - p2 = plot(get_ohlc("GOOG", name="Google"), Layout(title="Google")) - - [p1 p2] -end -ohlc2() -``` - - -
- - - - - -```julia -function candlestick1() - t = candlestick(open=[33.0, 33.3, 33.5, 33.0, 34.1], - high=[33.1, 33.3, 33.6, 33.2, 34.8], - low=[32.7, 32.7, 32.8, 32.6, 32.8], - close=[33.0, 32.9, 33.3, 33.1, 33.1]) - plot(t) -end -candlestick1() -``` - - -
- - - - - -```julia -function candlestick2() - # uses Quandl.jl - - function get_candlestick(ticker; kwargs...) - df = quandlget("WIKI/$(ticker)", format="DataFrame") - candlestick(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) - end - - p1 = plot(get_candlestick("AAPL", name="Apple"), Layout(title="Apple")) - p2 = plot(get_candlestick("GOOG", name="Google"), Layout(title="Google")) - - [p1 p2] -end -candlestick2() -``` - - -
- - - - - diff --git a/docs/examples/heatmaps.md b/docs/examples/heatmaps.md deleted file mode 100644 index bed52b7f..00000000 --- a/docs/examples/heatmaps.md +++ /dev/null @@ -1,45 +0,0 @@ -```julia -function heatmap1() - plot(heatmap(z=[1 20 30; 20 1 60; 30 60 1])) -end -heatmap1() -``` - - -
- - - - - -```julia -function heatmap2() - trace = heatmap( - x=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], - y=["Morning", "Afternoon", "Evening"], - z=rand(1:30, 5, 3) - ) - plot(trace) -end -heatmap2() -``` - - -
- - - - - diff --git a/docs/examples/histograms.md b/docs/examples/histograms.md deleted file mode 100644 index aba5cb73..00000000 --- a/docs/examples/histograms.md +++ /dev/null @@ -1,27 +0,0 @@ -```julia -function two_hists() - x0 = randn(500) - x1 = x0.+1 - - trace1 = histogram(x=x0, opacity=0.75) - trace2 = histogram(x=x1, opacity=0.75) - data = [trace1, trace2] - layout = Layout(barmode="overlay") - plot(data, layout) -end -two_hists() -``` - - -
- - - - - diff --git a/docs/examples/line_scatter.md b/docs/examples/line_scatter.md deleted file mode 100644 index d0eb750a..00000000 --- a/docs/examples/line_scatter.md +++ /dev/null @@ -1,465 +0,0 @@ -```julia -function linescatter1() - trace1 = scatter(;x=1:4, y=[10, 15, 13, 17], mode="markers") - trace2 = scatter(;x=2:5, y=[16, 5, 11, 9], mode="lines") - trace3 = scatter(;x=1:4, y=[12, 9, 15, 12], mode="lines+markers") - plot([trace1, trace2, trace3]) -end -linescatter1() -``` - - -
- - - - - -```julia -function linescatter2() - trace1 = scatter(;x=1:5, y=[1, 6, 3, 6, 1], - mode="markers", name="Team A", - text=["A-1", "A-2", "A-3", "A-4", "A-5"], - marker_size=12) - - trace2 = scatter(;x=1:5+0.5, y=[4, 1, 7, 1, 4], - mode="markers", name= "Team B", - text=["B-a", "B-b", "B-c", "B-d", "B-e"]) - # setting marker.size this way is _equivalent_ to what we did for trace1 - trace2["marker"] = Dict(:size => 12) - - data = [trace1, trace2] - layout = Layout(;title="Data Labels Hover", xaxis_range=[0.75, 5.25], - yaxis_range=[0, 8]) - plot(data, layout) -end -linescatter2() -``` - - -
- - - - - -```julia -function linescatter3() - trace1 = scatter(;x=1:5, y=[1, 6, 3, 6, 1], - mode="markers+text", name="Team A", - textposition="top center", - text=["A-1", "A-2", "A-3", "A-4", "A-5"], - marker_size=12, textfont_family="Raleway, sans-serif") - - trace2 = scatter(;x=1:5+0.5, y=[4, 1, 7, 1, 4], - mode="markers+text", name= "Team B", - textposition="bottom center", - text= ["B-a", "B-b", "B-c", "B-d", "B-e"], - marker_size=12, textfont_family="Times New Roman") - - data = [trace1, trace2] - - layout = Layout(;title="Data Labels on the Plot", xaxis_range=[0.75, 5.25], - yaxis_range=[0, 8], legend_y=0.5, legend_yref="paper", - legend=attr(family="Arial, sans-serif", size=20, - color="grey")) - plot(data, layout) -end -linescatter3() -``` - - -
- - - - - -```julia -function linescatter4() - trace1 = scatter(;y=fill(5, 40), mode="markers", marker_size=40, - marker_color=0:39) - layout = Layout(title="Scatter Plot with a Color Dimension") - plot(trace1, layout) -end -linescatter4() -``` - - -
- - - - - -```julia -function linescatter5() - - country = ["Switzerland (2011)", "Chile (2013)", "Japan (2014)", - "United States (2012)", "Slovenia (2014)", "Canada (2011)", - "Poland (2010)", "Estonia (2015)", "Luxembourg (2013)", - "Portugal (2011)"] - - votingPop = [40, 45.7, 52, 53.6, 54.1, 54.2, 54.5, 54.7, 55.1, 56.6] - regVoters = [49.1, 42, 52.7, 84.3, 51.7, 61.1, 55.3, 64.2, 91.1, 58.9] - - # notice use of `attr` function to make nested attributes - trace1 = scatter(;x=votingPop, y=country, mode="markers", - name="Percent of estimated voting age population", - marker=attr(color="rgba(156, 165, 196, 0.95)", - line_color="rgba(156, 165, 196, 1.0)", - line_width=1, size=16, symbol="circle")) - - trace2 = scatter(;x=regVoters, y=country, mode="markers", - name="Percent of estimated registered voters") - # also could have set the marker props above by using a dict - trace2["marker"] = Dict(:color => "rgba(204, 204, 204, 0.95)", - :line => Dict(:color=> "rgba(217, 217, 217, 1.0)", - :width=> 1), - :symbol => "circle", - :size => 16) - - data = [trace1, trace2] - layout = Layout(Dict{Symbol,Any}(:paper_bgcolor => "rgb(254, 247, 234)", - :plot_bgcolor => "rgb(254, 247, 234)"); - title="Votes cast for ten lowest voting age population in OECD countries", - width=600, height=600, hovermode="closest", - margin=Dict(:l => 140, :r => 40, :b => 50, :t => 80), - xaxis=attr(showgrid=false, showline=true, - linecolor="rgb(102, 102, 102)", - titlefont_font_color="rgb(204, 204, 204)", - tickfont_font_color="rgb(102, 102, 102)", - autotick=false, dtick=10, ticks="outside", - tickcolor="rgb(102, 102, 102)"), - legend=attr(font_size=10, yanchor="middle", - xanchor="right"), - ) - plot(data, layout) -end -linescatter5() -``` - - -
- - - - - -```julia -function linescatter6() - trace1 = scatter(;x=[52698, 43117], y=[53, 31], - mode="markers", - name="North America", - text=["United States", "Canada"], - marker=attr(color="rgb(164, 194, 244)", size=12, - line=attr(color="white", width=0.5)) - ) - - trace2 = scatter(;x=[39317, 37236, 35650, 30066, 29570, 27159, 23557, 21046, 18007], - y=[33, 20, 13, 19, 27, 19, 49, 44, 38], - mode="markers", name="Europe", - marker_size=12, marker_color="rgb(255, 217, 102)", - text=["Germany", "Britain", "France", "Spain", "Italy", - "Czech Rep.", "Greece", "Poland", "Portugal"]) - - trace3 = scatter(;x=[42952, 37037, 33106, 17478, 9813, 5253, 4692, 3899], - y=[23, 42, 54, 89, 14, 99, 93, 70], - mode="markers", - name="Asia/Pacific", - marker_size=12, marker_color="rgb(234, 153, 153)", - text=["Australia", "Japan", "South Korea", "Malaysia", - "China", "Indonesia", "Philippines", "India"]) - - trace4 = scatter(;x=[19097, 18601, 15595, 13546, 12026, 7434, 5419], - y=[43, 47, 56, 80, 86, 93, 80], - mode="markers", name="Latin America", - marker_size=12, marker_color="rgb(142, 124, 195)", - text=["Chile", "Argentina", "Mexico", "Venezuela", - "Venezuela", "El Salvador", "Bolivia"]) - - data = [trace1, trace2, trace3, trace4] - - layout = Layout(;title="Quarter 1 Growth", - xaxis=attr(title="GDP per Capital", showgrid=false, zeroline=false), - yaxis=attr(title="Percent", zeroline=false)) - - plot(data, layout) -end -linescatter6() -``` - - -
- - - - - -```julia -function batman() - # reference: https://github.com/alanedelman/18.337_2015/blob/master/Lecture01_0909/The%20Bat%20Curve.ipynb - σ(x) = √(1-x.^2) - el(x) = 3*σ(x/7) - s(x) = 4.2 - 0.5*x - 2.0*σ(0.5*x-0.5) - b(x) = σ(abs(2-x)-1) - x.^2/11 + 0.5x - 3 - c(x) = [1.7, 1.7, 2.6, 0.9] - - p(i, f; kwargs...) = scatter(;x=[-i; 0.0; i], y=[f(i); NaN; f(i)], - marker_color="black", showlegend=false, - kwargs...) - traces = vcat(p(3:0.1:7, el; name="wings 1"), - p(4:0.1:7, t->-el(t); name="wings 2"), - p(1:0.1:3, s; name="Shoulders"), - p(0:0.1:4, b; name="Bottom"), - p([0, 0.5, 0.8, 1], c; name="head")) - - plot(traces, Layout(title="Batman")) -end -batman() -``` - - -
- - - - - -```julia -function dumbell() - # reference: https://plot.ly/r/dumbbell-plots/ - @eval using DataFrames - - # read Data into dataframe - nm = tempname() - url = "https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv" - download(url, nm) - df = readtable(nm) - rm(nm) - - # sort dataframe by male earnings - df = sort(df, cols=[:Men], rev=false) - - men = scatter(;y=df[:School], x=df[:Men], mode="markers", name="Men", - marker=attr(color="blue", size=12)) - women = scatter(;y=df[:School], x=df[:Women], mode="markers", name="Women", - marker=attr(color="pink", size=12)) - - lines = map(eachrow(df)) do r - scatter(y=fill(r[:School], 2), x=[r[:Women], r[:Men]], mode="lines", - name=r[:School], showlegend=false, line_color="gray") - end - - data = Base.typed_vcat(GenericTrace, men, women, lines) - layout = Layout(width=650, height=650, margin_l=100, yaxis_title="School", - xaxis_title="Annual Salary (thousands)", - title="Gender earnings disparity") - - plot(data, layout) -end -dumbell() -``` - - -
- - - - - -```julia -function errorbars1() - trace1 = scatter(;x=vcat(1:10, 10:-1:1), - y=vcat(2:11, 9:-1:0), - fill="tozerox", - fillcolor="rgba(0, 100, 80, 0.2)", - line_color="transparent", - name="Fair", - showlegend=false) - - trace2 = scatter(;x=vcat(1:10, 10:-1:1), - y=[5.5, 3.0, 5.5, 8.0, 6.0, 3.0, 8.0, 5.0, 6.0, 5.5, 4.75, - 5.0, 4.0, 7.0, 2.0, 4.0, 7.0, 4.4, 2.0, 4.5], - fill="tozerox", - fillcolor="rgba(0, 176, 246, 0.2)", - line_color="transparent", - name="Premium", - showlegend=false) - - trace3 = scatter(;x=vcat(1:10, 10:-1:1), - y=[11.0, 9.0, 7.0, 5.0, 3.0, 1.0, 3.0, 5.0, 3.0, 1.0, - -1.0, 1.0, 3.0, 1.0, -0.5, 1.0, 3.0, 5.0, 7.0, 9.], - fill="tozerox", - fillcolor="rgba(231, 107, 243, 0.2)", - line_color="transparent", - name="Fair", - showlegend=false) - - trace4 = scatter(;x=1:10, y=1:10, - line_color="rgb(00, 100, 80)", - mode="lines", - name="Fair") - - trace5 = scatter(;x=1:10, - y=[5.0, 2.5, 5.0, 7.5, 5.0, 2.5, 7.5, 4.5, 5.5, 5.], - line_color="rgb(0, 176, 246)", - mode="lines", - name="Premium") - - trace6 = scatter(;x=1:10, y=vcat(10:-2:0, [2, 4,2, 0]), - line_color="rgb(231, 107, 243)", - mode="lines", - name="Ideal") - data = [trace1, trace2, trace3, trace4, trace5, trace6] - layout = Layout(;paper_bgcolor="rgb(255, 255, 255)", - plot_bgcolor="rgb(229, 229, 229)", - - xaxis=attr(gridcolor="rgb(255, 255, 255)", - range=[1, 10], - showgrid=true, - showline=false, - showticklabels=true, - tickcolor="rgb(127, 127, 127)", - ticks="outside", - zeroline=false), - - yaxis=attr(gridcolor="rgb(255, 255, 255)", - showgrid=true, - showline=false, - showticklabels=true, - tickcolor="rgb(127, 127, 127)", - ticks="outside", - zeroline=false)) - - plot(data, layout) -end -errorbars1() -``` - - -
- - - - - -```julia -function errorbars2() - function random_dates(d1::DateTime, d2::DateTime, n::Int) - map(Date, sort!(rand(d1:Dates.Hour(12):d2, n))) - end - - function _random_number(num, mul) - value = [] - j = 0 - rand = 0 - while j <= num+1 - rand = rand() * mul - append!(value, [rand]) - j += 1 - end - return value - end - - dates = random_dates(DateTime(2001, 1, 1), DateTime(2005, 12, 31), 50) - - trace1 = scatter(;x=dates, - y=20.0 .* rand(50), - line_width=0, - marker_color="444", - mode="lines", - name="Lower Bound") - - trace2 = scatter(;x=dates, - y=21.0 .* rand(50), - fill="tonexty", - fillcolor="rgba(68, 68, 68, 0.3)", - line_color="rgb(31, 119, 180)", - mode="lines", - name="Measurement") - - trace3 = scatter(;x=dates, - y=22.0 .* rand(50), - fill="tonexty", - fillcolor="rgba(68, 68, 68, 0.3)", - line_width=0, - marker_color="444", - mode="lines", - name="Upper Bound") - - data = [trace1, trace2, trace3] - t = "Continuous, variable value error bars
Notice the hover text!" - layout = Layout(;title=t, yaxis_title="Wind speed (m/s)") - plot(data, layout) -end -errorbars2() -``` - - -
- - - - - diff --git a/docs/examples/maps.md b/docs/examples/maps.md deleted file mode 100644 index f0db4728..00000000 --- a/docs/examples/maps.md +++ /dev/null @@ -1,79 +0,0 @@ -```julia -function maps1() - marker = attr(size=[20, 30, 15, 10], - color=[10, 20, 40, 50], - cmin=0, - cmax=50, - colorscale="Greens", - colorbar=attr(title="Some rate", - ticksuffix="%", - showticksuffix="last"), - line_color="black") - trace = scattergeo(;mode="markers", locations=["FRA", "DEU", "RUS", "ESP"], - marker=marker, name="Europe Data") - layout = Layout(geo_scope="europe", geo_resolution=50, width=500, height=550, - margin=attr(l=0, r=0, t=10, b=0)) - plot(trace, layout) -end -maps1() -``` - - -
- - - - - -```julia -function maps2() - @eval using DataFrames - - # read Data into dataframe - nm = tempname() - url = "https://raw.githubusercontent.com/plotly/datasets/master/2014_us_cities.csv" - download(url, nm) - df = readtable(nm) - rm(nm) - - trace = scattergeo(;locationmode="USA-states", - lat=df[:lat], - lon=df[:lon], - hoverinfo="text", - text=[string(x[:name], " pop: ", x[:pop]) for x in eachrow(df)], - marker_size=df[:pop]/50_000, - marker_line_color="black", marker_line_width=2) - geo = attr(scope="usa", - projection_type="albers usa", - showland=true, - landcolor="rgb(217, 217, 217)", - subunitwidth=1, - countrywidth=1, - subunitcolor="rgb(255,255,255)", - countrycolor="rgb(255,255,255)") - - layout = Layout(;title="2014 US City Populations", showlegend=false, geo=geo) - plot(trace, layout) -end -maps2() -``` - - -
- - - - - diff --git a/docs/examples/shapes.md b/docs/examples/shapes.md deleted file mode 100644 index c8947250..00000000 --- a/docs/examples/shapes.md +++ /dev/null @@ -1,359 +0,0 @@ -```julia -function house() - trace1 = scatter() - x0 = [2, 2, 5.5, 9, 9, 2, 5, 5, 6] - y0 = [1, 5.5, 9.5, 5.5, 1, 5.5, 1, 4, 4] - x1 = [2, 5.5, 9, 9, 2, 9, 5, 6, 6] - y1 = [5.5, 9.5, 5.5, 1, 1, 5.5, 4, 4, 1] - shapes = line(x0, x1, y0, y1; xref="x", yref="y") - plot([trace1], - Layout(;shapes=shapes, xaxis_range=(1, 10), yaxis_range=(0, 10))) -end -house() -``` - - -
- - - - - -```julia -function house2() - trace1 = scatter() - _p = string("M 2 1 L 2 5.5 L 5.5 9.6 L 9 5.5 L 9 1 L 2 1 ", - "M 2 5.5 L 9 5.5 ", - "M 5 1 L 5 4 L 6 4 L 6 1 Z") - plot([trace1], - Layout(;shapes=[path(_p)], xaxis_range=(1, 10), yaxis_range=(0, 10))) -end -house2() -``` - - -
- - - - - -```julia -function clusters() - @eval using Distributions - x0 = rand(Normal(2, 0.45), 300) - y0 = rand(Normal(2, 0.45), 300) - x1 = rand(Normal(6, 0.4), 200) - y1 = rand(Normal(6, 0.4), 200) - x2 = rand(Normal(4, 0.3), 200) - y2 = rand(Normal(4, 0.3), 200) - - data = [scatter(;x=x0, y=y0, mode="markers"), - scatter(;x=x1, y=y1, mode="markers"), - scatter(;x=x2, y=y2, mode="markers"), - scatter(;x=x1, y=y0, mode="markers")] - - args = [(x0, y0, "blue"), (x1, y1, "orange"), (x2, y2, "green"), - (x1, y0, "red")] - shapes = [circle(x0=minimum(x), y0=minimum(y), - x1=maximum(x), y1=maximum(y); - opacity=0.2, fillcolor=c, line_color=c) - for (x, y, c) in args] - plot(data, Layout(;height=400, width=480, showlegend=false, shapes=shapes)) -end -clusters() -``` - - -
- - - - - -```julia -function temperature() - x = ["2015-02-01", "2015-02-02", "2015-02-03", "2015-02-04", "2015-02-05", - "2015-02-06", "2015-02-07", "2015-02-08", "2015-02-09", "2015-02-10", - "2015-02-11", "2015-02-12", "2015-02-13", "2015-02-14", "2015-02-15", - "2015-02-16", "2015-02-17", "2015-02-18", "2015-02-19", "2015-02-20", - "2015-02-21", "2015-02-22", "2015-02-23", "2015-02-24", "2015-02-25", - "2015-02-26", "2015-02-27", "2015-02-28"] - y = rand(1:20, length(x)) - data = scatter(;x=x, y=y, name="temperature", mode="line") - - shapes = rect(["2015-02-04", "2015-02-20"], ["2015-02-06", "2015-02-22"], - 0, 1; fillcolor="#d3d3d3", opacity=0.2, line_width=0, - xref="x", yref="paper") - plot(data, Layout(shapes=shapes, width=500, height=500)) -end -temperature() -``` - - -
- - - - - -```julia -function vlines1() - # one scalar argument produces one line. Need to wrap in an array because - # layout.shapes should be an array - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = [vline(2)] - plot([trace1], Layout(;shapes=shapes)) -end -vlines1() -``` - - -
- - - - - -```julia -function vlines2() - # one argument draws a vertical line up the entire plot - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = vline([2, 6]) - plot([trace1], Layout(;shapes=shapes)) -end -vlines2() -``` - - -
- - - - - -```julia -function vlines3() - # yref paper makes the 2nd and 3rd arguments on a (0, 1) scale vertically - # so 0.5 is 1/2 through the plot regardless of the values on y-axis - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = vline([2, 6], 0, 0.5; yref="paper") - plot([trace1], Layout(;shapes=shapes)) -end -vlines3() -``` - - -
- - - - - -```julia -function vlines4() - # Whichever argument is a scalar is repeated - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = vline([2, 6], 0, [0.5, 0.75]; yref="paper") - plot([trace1], Layout(;shapes=shapes)) -end -vlines4() -``` - - -
- - - - - -```julia -function vlines5() - # we can also set arbitrary line attributes line color and dash - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = vline([2, 6], 0, [0.5, 0.75]; yref="paper", - line_color="green", line_dash="dashdot") - plot([trace1], Layout(;shapes=shapes)) -end -vlines5() -``` - - -
- - - - - -```julia -function hlines1() - # one scalar argument produces one line. Need to wrap in an array because - # layout.shapes should be an array - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = [hline(2)] - plot([trace1], Layout(;shapes=shapes)) -end -hlines1() -``` - - -
- - - - - -```julia -function hlines2() - # one argument draws a horizontal line across the entire plot - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = hline([25, 81]) - plot([trace1], Layout(;shapes=shapes)) -end -hlines2() -``` - - -
- - - - - -```julia -function hlines3() - # xref paper makes the 2nd and 3rd arguments on a (0, 1) scale horizontally - # so 0.5 is 1/2 through the plot regardless of the values on x-axis - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = hline([25, 81], 0, 0.5; xref="paper") - plot([trace1], Layout(;shapes=shapes)) -end -hlines3() -``` - - -
- - - - - -```julia -function hlines4() - # Whichever argument is a scalar is repeated - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = hline([25, 81], 0, [0.5, 0.75]; xref="paper") - plot([trace1], Layout(;shapes=shapes)) -end -hlines4() -``` - - -
- - - - - -```julia -function hlines5() - # we can also set arbitrary line attributes line color and dash - trace1 = scatter(;x=1:10, y=(1:10).^2) - shapes = hline([25, 81], 0, [0.5, 0.75]; xref="paper", - line_color="green", line_dash="dashdot") - plot([trace1], Layout(;shapes=shapes)) -end -hlines5() -``` - - -
- - - - - diff --git a/docs/examples/subplots.md b/docs/examples/subplots.md deleted file mode 100644 index b426c9f7..00000000 --- a/docs/examples/subplots.md +++ /dev/null @@ -1,128 +0,0 @@ -```julia -function subplots1() - p1 = linescatter1() - p2 = linescatter2() - p = [p1 p2] - p -end -subplots1() -``` - - -
- - - - - -```julia -function subplots2() - p1 = linescatter1() - p2 = linescatter2() - p = [p1, p2] - p -end -subplots2() -``` - - -
- - - - - -```julia -function subplots3() - p1 = linescatter6() - p2 = linescatter2() - p3 = linescatter3() - p4 = batman() - p = [p1 p2; p3 p4] - p.plot.layout["showlegend"] = false - p.plot.layout["width"] = 1000 - p.plot.layout["height"] = 600 - p -end -subplots3() -``` - - -
- - - - - -```julia -function subplots_withcomprehension() - hcat([plot(scatter(x = 1:5, y = rand(5))) for i in 1:3]...) -end -subplots_withcomprehension() -``` - - -
- - - - - -```julia -function subplots_withsharedaxes() - data = [ - scatter(x=1:3, y=2:4), - scatter(x=20:10:40, y=fill(5, 3), xaxis="x2", yaxis="y"), - scatter(x=2:4, y=600:100:800, xaxis="x", yaxis="y3"), - scatter(x=4000:1000:6000, y=7000:1000:9000, xaxis="x4", yaxis="y4") - ] - layout = Layout( - xaxis_domain=[0, 0.45], - yaxis_domain=[0, 0.45], - xaxis4=attr(domain=[0.55, 1.0], anchor="y4"), - xaxis2_domain=[0.55, 1], - yaxis3_domain=[0.55, 1], - yaxis4=attr(domain=[0.55, 1], anchor="x4") - ) - plot(data, layout) -end -subplots_withsharedaxes() -``` - - -
- - - - - diff --git a/docs/examples/tables.md b/docs/examples/tables.md deleted file mode 100644 index cbc50277..00000000 --- a/docs/examples/tables.md +++ /dev/null @@ -1,164 +0,0 @@ -```julia -function table1() - values = [ - "Salaries" 1200000 1300000 1300000 1400000 - "Office" 20000 20000 20000 20000 - "Merchandise" 80000 70000 120000 90000 - "Legal" 2000 2000 2000 2000 - "TOTAL" 12120000 130902000 131222000 14102000 - ] - - trace = table( - header=attr( - values=["Expenses", "Q1", "Q2", "Q3", "Q4"], - align="center", line=attr(width=1, color="black"), - fill_color="grey", font=attr(family="Arial", size=12, color="white") - ), - cells=attr( - values=values, align="center", line=attr(color="black", width=1), - font=attr(family="Arial", size=11, color="black") - ) - ) - plot(trace) - -end -table1() -``` - - -
- - - - - -```julia -function table2() - values = [ - "Salaries" 1200000 1300000 1300000 1400000 - "Office" 20000 20000 20000 20000 - "Merchandise" 80000 70000 120000 90000 - "Legal" 2000 2000 2000 2000 - "TOTAL" 12120000 130902000 131222000 14102000 - ] - - trace = table( - header=attr( - values=["EXPENSES", "Q1", "Q2", "Q3", "Q4"], - align=["left", "center"], line=attr(width=1, color="#506784"), - fill_color="#119DFF", - font=attr(family="Arial", size=12, color="white") - ), - cells=attr( - values=values, align=["left", "center"], - line=attr(color="#506784", width=1), - font=attr(family="Arial", size=11, color="#506784"), - fill_color=["#25FEFD", "white"] - ) - ) - plot(trace) - -end -table2() -``` - - -
- - - - - -```julia -function table2a() - p1 = table1() - restyle!(p1, - header=attr( - align=["left", "center"], line_color="#506784", fill_color="#119DFF" - ), - cells=attr( - align=["left", "center"], line_color="#506784", - fill_color=["#25FEFD", "white"], font_color="#506784" - ) - ) - p1 -end -table2a() -``` - - -
- - - - - -```julia -function table3() - nm = tempname() - url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" - download(url, nm) - df = readtable(nm) - rm(nm) - - data = Array(df) - - trace = table( - columnwidth=[200, 500, 600, 600, 400, 400, 600, 600, 600], - # columnorder=0:9, - header=attr( - values=map(x-> replace(string(x), '_', '-'), names(df)), - align="center", - line=attr(width=1, color="rgb(50, 50, 50)"), - fill_color=["rgb(235, 100, 230)"], - font=attr(family="Arial", size=12, color="white") - ), - cells=attr( - values=Array(df), - align=["center", "center"], - line=attr(width=1, color="black"), - fill_color=["rgba(228, 222, 249, 0.65)", "rgb(235, 193, 238)", "rgba(228, 222, 249, 0.65)"], - font=attr(family="Arial", size=10, color="black") - ) - ) - - layout = Layout( - title="Bitcoin mining stats for 180 days", - width=1200 - ) - plot(trace, layout) -end -table3() -``` - - -
- - - - - diff --git a/docs/examples/ternary.md b/docs/examples/ternary.md deleted file mode 100644 index d8cfb9a1..00000000 --- a/docs/examples/ternary.md +++ /dev/null @@ -1,138 +0,0 @@ -```julia -function ternary_markers() - function make_ax(title, tickangle) - attr(title=title, titlefont_size=20, tickangle=tickangle, - tickfont_size=15, tickcolor="rgba(0, 0, 0, 0)", ticklen=5, - showline=true, showgrid=true) - end - - raw_data = [ - Dict(:journalist=>75, :developer=>:25, :designer=>0, :label=>"point 1"), - Dict(:journalist=>70, :developer=>:10, :designer=>20, :label=>"point 2"), - Dict(:journalist=>75, :developer=>:20, :designer=>5, :label=>"point 3"), - Dict(:journalist=>5, :developer=>:60, :designer=>35, :label=>"point 4"), - Dict(:journalist=>10, :developer=>:80, :designer=>10, :label=>"point 5"), - Dict(:journalist=>10, :developer=>:90, :designer=>0, :label=>"point 6"), - Dict(:journalist=>20, :developer=>:70, :designer=>10, :label=>"point 7"), - Dict(:journalist=>10, :developer=>:20, :designer=>70, :label=>"point 8"), - Dict(:journalist=>15, :developer=>:5, :designer=>80, :label=>"point 9"), - Dict(:journalist=>10, :developer=>:10, :designer=>80, :label=>"point 10"), - Dict(:journalist=>20, :developer=>:10, :designer=>70, :label=>"point 11") - ] - - t = scatterternary( - mode="markers", - a=[_[:journalist] for _ in raw_data], - b=[_[:developer] for _ in raw_data], - c=[_[:designer] for _ in raw_data], - text=[_[:label] for _ in raw_data], - marker=attr(symbol=100, color="#DB7365", size=14, line_width=2) - ) - layout = Layout( - ternary=attr( - sum=100, - aaxis=make_ax("Journalist", 0), - baxis=make_ax("Developer", 45), - caxis=make_ax("Designer", -45), - bgcolor="#fff1e0", - ), annotations=attr( - showarrow=false, - text="Replica of Tom Pearson's block", - x=1.0, y=1.3, font_size=15 - ), - paper_bgcolor="#fff1e0" - ) - plot(t, layout) -end -ternary_markers() -``` - - -
- - - - - -```julia -function filled_ternary() - function make_ax(title) - attr( - title=title, - ticksuffix="%", - min=0.01, - linewidth=2, - ticks="outside", - ticklen=8, - showgrid=true - ) - end - - fn = tempname() - download("https://gist.githubusercontent.com/davenquinn/988167471993bc2ece29/raw/f38d9cb3dd86e315e237fde5d65e185c39c931c2/data.json", fn) - raw_data = JSON.parsefile(fn) - rm(fn) - - colors = [ - "#8dd3c7", - "#ffffb3", - "#bebada", - "#fb8072", - "#80b1d3", - "#fdb462", - "#b3de69", - "#fccde5", - "#d9d9d9", - "#bc80bd", - "#ccebc5", - "#ffed6f" - ] - - traces = Array(GenericTrace, length(raw_data)) - for (i, (k, v)) in enumerate(raw_data) - traces[i] = scatterternary(mode="lines", name=k, - a=[_["clay"] for _ in v], - b=[_["sand"] for _ in v], - c=[_["silt"] for _ in v], - line_color="#444", - fill="toself", - fillcolor=colors[i], - hoveron="fills+points" - ) - end - layout = Layout( - ternary=attr( - sum=100, - aaxis=make_ax("Clay"), - baxis=make_ax("Sand"), - caxis=make_ax("Slit")), - showlegend=false, - width=700, - annotations=[attr( - showarrow=false, x=0.15, y=1.1, text="Soil types fill plot" - )] - ) - plot(traces, layout) -end -filled_ternary() -``` - - -
- - - - - diff --git a/docs/examples/time_series.md b/docs/examples/time_series.md deleted file mode 100644 index b48df110..00000000 --- a/docs/examples/time_series.md +++ /dev/null @@ -1,21 +0,0 @@ -```julia -function datetimestrings() - x = ["2013-10-04 22:23:00", "2013-11-04 22:23:00", "2013-12-04 22:23:00"] - plot(scatter(x=x, y=[1 ,3, 6])) -end -datetimestrings() -``` - - -
- - - - - diff --git a/docs/examples/violin.md b/docs/examples/violin.md deleted file mode 100644 index 00e71cc9..00000000 --- a/docs/examples/violin.md +++ /dev/null @@ -1,234 +0,0 @@ -```julia -function violin_box_overlay() - y = abs.(100 .* randn(300)) - data = [ - violin(x0="sample 1", name="violin", y=y, points="all"), - box(x0="sample 1", name="box", y=y, boxpoints=false) - ] - plot(data, Layout(legend=attr(x=0.95, xanchor="right"))) -end -violin_box_overlay() -``` - - -
- - - - - -```julia -function violin_grouped() - days = repeat(["day 1", "day 2"], inner=5) - y_kale = [0.2, 0.2, 0.6, 1, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3] - y_radish = [0.6, 0.7, 0.3, 0.6, 0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2] - y_carrot = [0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1, 0.3, 0.6, 0.8, 0.5] - colors = ["#3D9970", "#FF4136", "#FF851B"] - names = ["kale", "radishes", "carrots"] - ys = (y_kale, y_radish, y_carrot) - - data = [ - violin( - y=y, name=name, x=days, span=[0, nothing], jitter=0, points="all", - marker=attr(symbol="line-ew", color=color, line=attr(color=color, width=2)) - ) for (y, name, color) in zip(ys, names, colors) - ] - layout = Layout( - yaxis=attr(zeroline=false, title="normalized moisture"), - violinmode="group" - ) - plot(data, layout) -end -violin_grouped() -``` - - -
- - - - - -```julia -function violin_nonlinear() - p1 = plot( - violin( - x=["1798-01-01", "1798-04-04", "1798-05-05", - "1798-05-05", "1798-07-05", "1798-07-22", "1799-01-01"], - orientation="h", box_visible=true, xcalendar="discworld", - name="discworld dates" - ) - ) - p2 = plot( - violin( - x=["A", "B", "C", "C", "C", "D", "G"], - orientation="h", box_visible=true, xcalendar="discworld", - name="categories" - ), Layout(xaxis_categoryarray='A':'G') - ) - p = [p1; p2] - relayout!(p, showlegend=false, margin_l=100) - p -end -violin_nonlinear() -``` - - -
- - - - - -```julia -function violin_old_faithful() - y = [79, 54, 74, 62, 85, 55, 88, 85, 51, 85, 54, 84, 78, 47, 83, 52, 62, - 84, 52, 79, 51, 47, 78, 69, 74, 83, 55, 76, 78, 79, 73, 77, 66, 80, 74, 52, - 48, 80, 59, 90, 80, 58, 84, 58, 73, 83, 64, 53, 82, 59, 75, 90, 54, 80, 54, - 83, 71, 64, 77, 81, 59, 84, 48, 82, 60, 92, 78, 78, 65, 73, 82, 56, 79, 71, - 62, 76, 60, 78, 76, 83, 75, 82, 70, 65, 73, 88, 76, 80, 48, 86, 60, 90, 50, - 78, 63, 72, 84, 75, 51, 82, 62, 88, 49, 83, 81, 47, 84, 52, 86, 81, 75, 59, - 89, 79, 59, 81, 50, 85, 59, 87, 53, 69, 77, 56, 88, 81, 45, 82, 55, 90, 45, - 83, 56, 89, 46, 82, 51, 86, 53, 79, 81, 60, 82, 77, 76, 59, 80, 49, 96, 53, - 77, 77, 65, 81, 71, 70, 81, 93, 53, 89, 45, 86, 58, 78, 66, 76, 63, 88, 52, - 93, 49, 57, 77, 68, 81, 81, 73, 50, 85, 74, 55, 77, 83, 83, 51, 78, 84, 46, - 83, 55, 81, 57, 76, 84, 77, 81, 87, 77, 51, 78, 60, 82, 91, 53, 78, 46, 77, - 84, 49, 83, 71, 80, 49, 75, 64, 76, 53, 94, 55, 76, 50, 82, 54, 75, 78, 79, - 78, 78, 70, 79, 70, 54, 86, 50, 90, 54, 54, 77, 79, 64, 75, 47, 86, 63, 85, - 82, 57, 82, 67, 74, 54, 83, 73, 73, 88, 80, 71, 83, 56, 79, 78, 84, 58, 83, - 43, 60, 75, 81, 46, 90, 46, 74] - plot(violin(y=y, points="all", name="Old Faithful", meanline_visible=true)) -end -violin_old_faithful() -``` - - -
- - - - - -```julia -function violin_side_by_side() - # requires RDatasets and DataFrames - tips = dataset("reshape2", "tips") - parts = zip( - ("Female", "Male"), - ("positive", "negative"), - ("#bebada", "#8dd3c7"), - (1.0, -0.6) - ) - traces = GenericTrace[] - for (sex, side, color, pointpos) in parts - sub_tips = tips[tips[:Sex] .== sex, :] - sub_traces = violin(sub_tips, - group=:Day, - x=:TotalBill, y0=(df) -> df[1, :Day], - side=side, orientation="h", - marker=attr(line=attr(width=2, color=color), symbol="line-ns"), - line_color=color, - hoveron="points+kde", text=(df) -> "Sample length $(size(df, 1))", - scalemode="count", scalegroup=sex, legendgroup=sex, name=sex, - points="all", jitter=0, pointpos=pointpos, - span=[0], - box_visible=true, meanline_visible=true, - showlegend=false, - ) - sub_traces[1][:showlegend] = true - append!(traces, sub_traces) - end - # TODO: make the layout - layout = Layout( - hovermode="closest", violinmode="overlay", - title="Total bill distribution
scaled by number of bills per gender", - legend_tracegroupgap=0, violingap=0, violingroupgap=0, - yaxis=attr(showgrid=true, categoryarray=["Thur", "Fri", "Sat", "Sun"]), - ) - plot(traces, layout) -end -violin_side_by_side() -``` - - -
- - - - - -```julia -function violin_style() - y1 = vcat(abs.(20 .* rand(100)), rand(UInt16, 300) .* 500 ./ typemax(UInt16)) - y2 = [25.261999999999997, 66.5419, 98.2114, 0.09070629 ] - box = attr(fillcolor="black", line_color="black", width=0.01) - span = [0, nothing] - trace1 = violin( - bandwidth=5, points=false, y=y1, name="Radial Velocity", - span=span, line_color="#67353E", box=box - ) - trace2 = violin( - bandwidth=5, points=false, y=y2, name="Pulsar Timing", - span=span, line_color="#34ABA2", box=box - ) - - layout = Layout( - paper_bgcolor="#d3d3d3", plot_bgcolor="#d3d3d3", - showlegend=false, violingap=0, xaxis_side="top", - yaxis=attr( - showline=false, showticklabels=false, range=(-5, 550), - zeroline=false, visible=false, showgrid=false, - ), - annotations=[attr( - text="Orbital Period Estimations", font_size=20, - xref="paper", yref="paper", showarrow=false, - )] - ) - plot([trace1, trace2], layout) -end -violin_style() -``` - - -
- - - - - diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 00000000..30e438f4 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,146 @@ +using Documenter +using PlotlyJS +using PlotlyBase + +const THIS_DIR = dirname(@__FILE__) + +# used in examples +using Distributions, HTTP, DataFrames, RDatasets, Colors, CSV, JSON +using Random, Dates, LinearAlgebra, DelimitedFiles + +# to override display_dict below +import Documenter.Utilities: display_dict, limitstringmime +using Base64: stringmime + +function display_dict(p::PlotlyBase.Plot) + out = Dict{MIME,Any}() + # Always generate text/plain + out[MIME"text/plain"()] = limitstringmime(MIME"text/plain"(), p) + svg_m = MIME"image/svg+xml"() + out[svg_m] = stringmime(svg_m, p) + out +end + +display_dict(p::PlotlyJS.SyncPlot) = display_dict(p.plot) + +## handle examples +# Walk through each example in a file and get the markdown from `single_example` +function single_example_file(filename::String) + base_fn = split(filename, ".")[1] + start_example = "```@example $(base_fn)" + end_example = "```" + # Open a file to write to + open(joinpath(THIS_DIR, "src", "examples", "$(base_fn).md"), "w") do outfile + + write_example(ex) = println(outfile, start_example, "\n", ex, "\n", end_example, "\n") + + fn_h1 = titlecase(replace(base_fn, "_" => " ")) + println(outfile, "# $(fn_h1)\n") + + # Read lines from a files + fulltext = open( + f->read(f, String), + joinpath(THIS_DIR, "..", "examples", filename), + "r" + ) + all_lines = split(fulltext, "\n") + l = 1 + regex = r"^function ([^_].+?)\(" + regex_end = r"^end$" + + # find preamble + if base_fn == "subplots" # special case + preamble = "using PlotlyJS, Dates\ninclude(\"../../../examples/line_scatter.jl\")" + write_example(preamble) + else + first_line = findfirst(x -> match(regex, x) !== nothing, all_lines) + if first_line !== nothing + preamble = strip(join(all_lines[1:first_line-1], "\n")) + write_example(preamble) + end + end + + while true + # Find next function name (break if none) + l = findnext(x -> match(regex, x) !== nothing, all_lines, l+1) + if l == 0 || l === nothing + break + end + # find corresponding end for this function + end_l = findnext(x -> match(regex_end, x) !== nothing, all_lines, l+1) + + # Pull out function text + func_block = join(all_lines[l:end_l], "\n") + fun_name = match(regex, all_lines[l])[1] + # println("adding $fun_name") + an_ex = string(func_block, "\n", fun_name, "()") + write_example(an_ex) + l = end_l + end + end # do outfile + + return nothing +end + +function handle_examples() + @info "Updating examples!" + # Read all file names in + if length(ARGS) == 0 + all_file_names = readdir(joinpath(THIS_DIR, "..", "examples")) + else + all_file_names = [endswith(i, ".jl") ? i : "$(i).jl" for i in ARGS] + end + all_julia_files = filter(x -> endswith(x, ".jl"), all_file_names) + + foreach(single_example_file, all_julia_files) +end + +handle_examples() + +makedocs( + sitename = "PlotlyJS", + format = Documenter.HTML( + assets = [ + asset("https://cdn.plot.ly/plotly-1.54.7.js") + ] + ), + modules = [PlotlyJS, PlotlyBase], + linkcheck=true, + pages = [ + "Home" => "index.md", + "User Guide" => [ + "Preliminaries" => "basics.md", + "Building Blocks" => "building_traces_layouts.md", + "Putting it together" => "syncplots.md", + "Working with plots" => "manipulating_plots.md", + "Styles" => "styles.md", + "Contributing" => "contributing.md", + ], + "Examples" => [ + "3d" => "examples/3d.md", + "Area" => "examples/area.md", + "Bar" => "examples/bar.md", + "Box Plots" => "examples/box_plots.md", + "Contour" => "examples/contour.md", + "Financial Charts" => "examples/finance.md", + "Heatmaps" => "examples/heatmaps.md", + "Histograms" => "examples/histograms.md", + "Line and Scatter" => "examples/line_scatter.md", + "Maps" => "examples/maps.md", + "Shapes" => "examples/shapes.md", + "Subplots" => "examples/subplots.md", + "Tables" => "examples/tables.md", + "Ternary" => "examples/ternary.md", + "Time Series" => "examples/time_series.md", + "Violin" => "examples/violin.md", + ], + "API Docs" => "api.md" + ] +) + +# Documenter can also automatically deploy documentation to gh-pages. +# See "Hosting Documentation" and deploydocs() in the Documenter manual +# for more information. +#=deploydocs( + repo = "" +)=# diff --git a/docs/manipulating_plots.md b/docs/manipulating_plots.md deleted file mode 100644 index 9f1e2b5f..00000000 --- a/docs/manipulating_plots.md +++ /dev/null @@ -1,152 +0,0 @@ - - -There are various methods defined on the `Plot` type. We will cover a few of -them here, but consult the (forthcoming) API docs for more exhaustive coverage. - -## Julia functions - -`Plot` and `SyncPlot` both have implementations of common Julia methods: - -- `size`: returns the `width` and `layout` attributes in the plot's layout -- `copy`: create a shallow copy of all traces in the plot and the layout, but -create a new `divid` - -## API functions - -All exported functions from the plotly.js -[API](https://plot.ly/javascript/plotlyjs-function-reference/) have been -exposed to Julia and operate on both `Plot` and `SyncPlot` instances. Each of -these functions has semantics that match the semantics of plotly.js - -In PlotlyJS.jl these functions are spelled: - -- [`restyle!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyrestyle): edit attributes on one or more traces -- [`relayout!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyrelayout): edit attributes on the layout -- [`update!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyupdate): combination of `restyle!` and `relayout!` -- [`react!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyreact): In place updating of all traces and layout in plot. More efficient than constructing an entirely new plot from scratch, but has the same effect. -- [`addtraces!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyaddtraces): add traces to a plot at specified indices -- [`deletetraces!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlydeletetraces): delete specific traces from a plot -- [`movetraces!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlymovetraces): reorder traces in a plot -- [`redraw!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyredraw): for a redraw of an entire plot -- [`purge!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlypurge): completely remove all data and layout from the chart -- [`extendtraces!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyextendtraces): Extend specific attributes of one or more traces with more data by appending to the end of the attribute -- [`prependtraces!`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyprependtraces): Prepend additional data to specific attributes on one or more traces - - -When any of these routines is called on a `SyncPlot` the underlying `Plot` -object (in the `plot` field on the `SyncPlot`) is updated and the plotly.js -function is called. This is where `SyncPlot` gets its name: when modifying a -plot, it keeps the Julia object and the display in sync. - - - -For more details on which methods are available for each of the above functions -consult the docstrings or (forthcoming) API documentation. - -!!! note - Be especially careful when trying to use `restyle!`, `extendtraces!`, and - `prependtraces!` to set attributes that are arrays. The semantics are a bit - subtle. Check the docstring for details and examples - -## Subplots - -A common task is to construct subpots, or plots with more than one set of axes. -This is possible using the declarative plotly.js syntax, but can be tedious at -best. - -PlotlyJS.jl provides a conveient syntax for constructing what we will -call regular grids of subplots. By regular we mean a square grid of plots. - -To do this we will make a pun of the `vcat`, `hcat`, and `hvcat` functions from -`Base` and leverage the array construction syntax to build up our subplots. - -Suppose we are working with the following plots: - -```julia -p1 = Plot(scatter(;y=randn(3))) -p2 = Plot(histogram(;x=randn(50), nbinsx=4)) -p3 = Plot(scatter(;y=cumsum(randn(12)), name="Random Walk")) -p4 = Plot([scatter(;x=1:4, y=[0, 2, 3, 5], fill="tozeroy"), - scatter(;x=1:4, y=[3, 5, 1, 7], fill="tonexty")]) -``` - -If we wanted to combine `p1` and `p2` as subplots side-by-side, we would do - -```julia -[p1 p2] -``` - -which would be displayed as - -
- - - - -If instead we wanted two rows and one column we could - -```julia -[p3, p4] -``` - -
- - - -Finally, we can make a 2x2 grid of subplots: - -```julia -[p1 p2 - p3 p4] -``` - -
- - - -## Saving figures - -In order to save figures in other formats you must you need to have the -[ORCA.jl](https://github.com/sglyon/ORCA.jl) package installed and loaded. To -install this, call `add ORCA` from the Julia package manager REPL mode (which -you can enter by pressing `]` at the REPL). To load, call `using ORCA`. - -After loading you can also save figures in a variety of formats: - - -```julia -savefig(p::Union{Plot,SyncPlot}, "output_filename.pdf") -savefig(p::Union{Plot,SyncPlot}, "output_filename.html") -savefig(p::Union{Plot,SyncPlot}, "output_filename.json") -savefig(p::Union{Plot,SyncPlot}, "output_filename.png") -savefig(p::Union{Plot,SyncPlot}, "output_filename.eps") -savefig(p::Union{Plot,SyncPlot}, "output_filename.svg") -savefig(p::Union{Plot,SyncPlot}, "output_filename.jpeg") -savefig(p::Union{Plot,SyncPlot}, "output_filename.webp") -``` - -!!! note - You can also save the json for a figure by calling - `savejson(p::Union{Plot,SyncPlot}, filename::String)`. This does not - require the ORCA.jl package. diff --git a/docs/src/api.md b/docs/src/api.md new file mode 100644 index 00000000..5f664f0d --- /dev/null +++ b/docs/src/api.md @@ -0,0 +1,6 @@ +# API Documentation + +```@autodocs +Modules = [PlotlyBase, PlotlyJS] +Order = [:function, :type] +``` diff --git a/docs/basics.md b/docs/src/basics.md similarity index 94% rename from docs/basics.md rename to docs/src/basics.md index 11e4a847..74a1b770 100644 --- a/docs/basics.md +++ b/docs/src/basics.md @@ -52,5 +52,5 @@ The fields of the `Plot` type map 1-1 to the arguments to the `Plotly.newplot` function -[_plotlyjs]: https://plot.ly/javascript -[_plotlyref]: https://plot.ly/javascript/reference +[_plotlyjs]: https://plotly.com/javascript/ +[_plotlyref]: https://plotly.com/javascript/reference/ diff --git a/docs/src/building_traces_layouts.md b/docs/src/building_traces_layouts.md new file mode 100644 index 00000000..8a6a2579 --- /dev/null +++ b/docs/src/building_traces_layouts.md @@ -0,0 +1,256 @@ +# Building Blocks + +```@setup traces_layous +using PlotlyJS, JSON +``` + +Recall that the `Plotly.newPlot` javascript function expects to receive an +array of `trace` objects and, optionally, a `layout` object. In this section we +will learn how to build these object in Julia. + +## Traces + +A `Plot` instance will have a vector of `trace`s. These should each be a subtype of `AbstractTrace`. + +PlotlyJS.jl defines one such subtype: + +```julia +mutable struct GenericTrace{T<:AbstractDict{Symbol,Any}} <: AbstractTrace + kind::ASCIIString + fields::T +end +``` + +The `kind` field specifies the type of trace and the `fields` is an AbstractDict object that maps trace attributes to their values. + +Let's consider an example. Suppose we would like to build the following JSON +object: + +```json +{ + "type": "scatter", + "x": [1, 2, 3, 4, 5], + "y": [1, 6, 3, 6, 1], + "mode": "markers+text", + "name": "Team A", + "text": ["A-1", "A-2", "A-3", "A-4", "A-5"], + "textposition": "top center", + "textfont": { + "family": "Raleway, sans-serif" + }, + "marker": { "size": 12 } +} +``` + +One way to do this in Julia is: + +```@example traces_layous +fields = Dict{Symbol,Any}(:type => "scatter", + :x => [1, 2, 3, 4, 5], + :y => [1, 6, 3, 6, 1], + :mode => "markers+text", + :name => "Team A", + :text => ["A-1", "A-2", "A-3", "A-4", "A-5"], + :textposition => "top center", + :textfont => Dict(:family => "Raleway, sans-serif"), + :marker => Dict(:size => 12)) +GenericTrace("scatter", fields) +``` + +A more convenient syntax is: + +```@setup traces_layous +using PlotlyJS, JSON +``` + +```@example traces_layous +t1 = scatter(;x=[1, 2, 3, 4, 5], + y=[1, 6, 3, 6, 1], + mode="markers+text", + name="Team A", + text=["A-1", "A-2", "A-3", "A-4", "A-5"], + textposition="top center", + textfont_family="Raleway, sans-serif", + marker_size=12) +``` + +Notice a few things: + +- The trace `type` became the function name. There is a similar method for all +plotly.js traces types. +- All other trace attributes were set using keyword arguments. This allows us +to avoid typing out the symbol prefix (`:`) and the arrows (`=>`) that were +necessary when constructing the `Dict` +- We can set nested attributes using underscores. Notice that the JSON +`"marker": { "size": 12 }` was written `marker_size=12`. + +We can verify that this is indeed equivalent JSON by printing the JSON: (note the order of the attributes is different, but the content is identical): + +```@example traces_layous +print(JSON.json(t1, 2)) +``` + +### Accessing attributes + +If we then wanted to extract a particular attribute, we can do so using +`getindex(t1, :attrname)`, or the syntactic sugar `t1[:attrname]`. Note that +both symbols and strings can be used in a call to `getindex`: + +```@repl traces_layous +t1["marker"] +t1[:marker] +``` + +To access a nested property use `parent.child` + +```@repl traces_layous +t1["textfont.family"] +``` + +### Setting additional attributes + +We can also set additional attributes. Suppose we wanted to set `marker.color` +to be red. We can do this with a call to `setindex!(t1, "red", :marker_color)`, +or equivalently `t1["marker_color"] = "red"`: + +```@repl traces_layous +t1["marker_color"] = "red" + +println(JSON.json(t1, 2)) +``` + +Notice how the `color` attribute was correctly added within the existing +`marker` attribute (alongside `size`), instead of replacing the `marker` +attribute. + +You can also use this syntax to add completely new nested attributes: + +```@repl traces_layous +t1["line_width"] = 5 +println(JSON.json(t1, 2)) +``` + +## Layouts + +The `Layout` type is defined as + +```julia +mutable struct Layout{T<:AbstractDict{Symbol,Any}} <: AbstractLayout + fields::T +end +``` + +You can construct a layout using the same convenient keyword argument syntax +that we used for traces: + +```@repl traces_layous +l = Layout(;title="Penguins", + xaxis_range=[0, 42.0], xaxis_title="fish", + yaxis_title="Weight", + xaxis_showgrid=true, yaxis_showgrid=true, + legend_y=1.15, legend_x=0.7) +println(JSON.json(l, 2)) +``` + +## `attr` + +There is a special function named `attr` that allows you to apply the same +keyword magic we saw in the trace and layout functions, but to nested +attributes. Let's revisit the previous example, but use `attr` to build up our +`xaxis` and `legend`: + +```@repl traces_layous +l2 = Layout(;title="Penguins", + xaxis=attr(range=[0, 42.0], title="fish", showgrid=true), + yaxis_title="Weight", yaxis_showgrid=true, + legend=attr(x=0.7, y=1.15)) +println(JSON.json(l2, 2)) +``` + +Notice we got the exact same output as before, but we didn't have to resort to +building the `Dict` by hand _or_ prefixing multiple arguments with `xaxis_` or +`legend_`. + + +## Using `DataFrame`s + +!!! note + New in version 0.6.0 + +You can also construct traces using the columns of any subtype of +`AbstractDataFrame` (e.g. the `DataFrame` type from DataFrames.jl). + +To demonstrate this functionality let's load the famous iris data set: + +```@repl traces_layous +using DataFrames, RDatasets +iris = dataset("datasets", "iris"); +first(iris, 10) +``` + +Suppose that we wanted to construct a scatter trace with the `SepalLength` +column as the x variable and the `SepalWidth` columns as the y variable. We +do this by calling + +```@repl traces_layous +my_trace = scatter(iris, x=:SepalLength, y=:SepalWidth, marker_color=:red) +[my_trace[:x][1:5] my_trace[:y][1:5]] +my_trace[:marker_color] +``` + +How does this work? The basic rule is that if the value of any keyword argument +is a Julia Symbol (i.e. created with `:something`), then the function creating +the trace checks if that symbol is one of the column names in the DataFrame. +If so, it extracts the column from the DataFrame and sets that as the value +for the keyword argument. Otherwise it passes the symbol directly through. + +In the above example, when we constructed `my_trace` the value of the keyword +argument `x` was set to the Symbol `:SepalLength`. This did match a column name +from `iris` so that column was extracted and replaced `:SepalLength` as the +value for the `x` argument. The same holds for `y` and `SepalWidth`. + +However, when setting `marker_color=:red` we found that `:red` is not one of +the column names, so the value for the `marker_color` keyword argument remained +`:red`. + +The DataFrame interface becomes more useful when constructing whole plots. See +the [convenience methods](@ref constructors) section of the +documentation for more information. + +!!! note + New in version 0.9.0 + +As of version 0.9.0, you can construct groups of traces using the DataFrame +api. This is best understood by example, so let's see it in action: + +```@repl traces_layous +iris = dataset("datasets", "iris"); +unique(iris[:Species]) +traces = scatter( + iris, group=:Species, x=:SepalLength, y=:SepalWidth, mode="markers", marker_size=8 +) +[t[:name] for t in traces] +``` + +Notice how there are three `Species` in the `iris` DataFrame, and when passing +`group=:Species` to `scatter` we obtained three traces. + +We can pass a `Vector{Symbol}` as group, to split the data on the value in more +than one column: + +```@repl traces_layous +tips = dataset("reshape2", "tips"); +unique(tips[:Sex]) +unique(tips[:Day]) +traces = violin(tips, group=[:Sex, :Day], x=:TotalBill, orientation="h") +[t[:name] for t in traces] +``` + +Also new in version 0.9.0, when using the DataFrame API you are allowed to pass +a function as the value for a keyword argument. When the each trace is +constructed, the value will be replaced by calling the function on whatever +DataFrame is being used. When used in conjunction with the `group` argument, +this allows you to _compute_ group specific trace attributes on the fly. + +See the docstring for `GenericTrace` and the `violin_side_by_side` example on +the [Violin](@ref) example page more details. diff --git a/docs/contributing.md b/docs/src/contributing.md similarity index 70% rename from docs/contributing.md rename to docs/src/contributing.md index 7aa7f843..a3decf4f 100644 --- a/docs/contributing.md +++ b/docs/src/contributing.md @@ -1,7 +1,7 @@ ## Contributing Contributions are welcome! For a quick list at the things on our radar, check -out the [issue list](https://github.com/spencerlyon2/PlotlyJS.jl/issues). +out the [issue list](https://github.com/JuliaPlots/PlotlyJS.jl/issues). If submitting pull requests on GitHub is intimidating, we're happy to help you work through getting your code polished up and included in the right places. @@ -15,18 +15,14 @@ Other projects that are helpful are: ### Documentation The documentation for PlotlyJS.jl is contained in the `docs` directory of this -repository. It currently uses a combination of the python-based `mkdocs` and a -custom Julia script for generating examples. +repository. -For more details on how to use `mkdocs`, please see -[their documentation](http://www.mkdocs.org). For convenience, I will list the -most common commands here. All of these should be run from the root directory of -this repository: +Docs are build using the `Documenter.jl` package and can be built following these steps: -- `mkdocs build -c`: Build the documentation and put it in the `site` folder -- `mkdocs serve`: Build the documentation and start a local web-server that can - be used to view the docs. Note that this is required to view any plotly.js - examples +1. Change into the `docs` directory +2. Start julia +3. Activate the docs project by entering package mode (`]`) and then running `activate .` +4. Execute `include("make.jl")` from the Julia prompt #### Adding Examples @@ -36,7 +32,7 @@ tl;dr: adding examples to the docs is as easy as 1, 2, 3... `examples` directory 2. Run the Julia script `docs/build_example_docs.jl` to re-generate the markdown source for the examples section of the docs -3. Rebuild the site using one of the `mkdocs` commands from above +3. Rebuild the site using one of the instructions above One of the most helpful things users can do to contribute to the documentation is to add more examples. These are automatically generated from the Julia @@ -60,5 +56,4 @@ The next step is to have Julia re-build the markdown (`.md`) files in `examples` folder. To do this run the script `docs/build_example_docs.jl`. If I were in the root directory of the repository, I could do this by running `julia docs/build_example_docs.jl`. -The final step is to build the docs again using one of the `mkdocs` commands -from above. +The final step is to build the docs again using one of the commands from above. diff --git a/docs/src/examples/3d.md b/docs/src/examples/3d.md new file mode 100644 index 00000000..9e424e54 --- /dev/null +++ b/docs/src/examples/3d.md @@ -0,0 +1,267 @@ +# 3D + +```@example 3d +using PlotlyJS, DataFrames, RDatasets, Colors, Distributions, LinearAlgebra +``` + +```@example 3d +function random_line() + n = 400 + rw() = cumsum(randn(n)) + trace1 = scatter3d(;x=rw(),y=rw(), z=rw(), mode="lines", + marker=attr(color="#1f77b4", size=12, symbol="circle", + line=attr(color="rgb(0,0,0)", width=0)), + line=attr(color="#1f77b4", width=1)) + trace2 = scatter3d(;x=rw(),y=rw(), z=rw(), mode="lines", + marker=attr(color="#9467bd", size=12, symbol="circle", + line=attr(color="rgb(0,0,0)", width=0)), + line=attr(color="rgb(44, 160, 44)", width=1)) + trace3 = scatter3d(;x=rw(),y=rw(), z=rw(), mode="lines", + marker=attr(color="#bcbd22", size=12, symbol="circle", + line=attr(color="rgb(0,0,0)", width=0)), + line=attr(color="#bcbd22", width=1)) + layout = Layout(autosize=false, width=500, height=500, + margin=attr(l=0, r=0, b=0, t=65)) + plot([trace1, trace2, trace3], layout) +end +random_line() +``` + +```@example 3d +function topo_surface() + z = Vector[[27.80985, 49.61936, 83.08067, 116.6632, 130.414, 150.7206, 220.1871, + 156.1536, 148.6416, 203.7845, 206.0386, 107.1618, 68.36975, 45.3359, + 49.96142, 21.89279, 17.02552, 11.74317, 14.75226, 13.6671, 5.677561, + 3.31234, 1.156517, -0.147662], + [27.71966, 48.55022, 65.21374, 95.27666, 116.9964, 133.9056, 152.3412, + 151.934, 160.1139, 179.5327, 147.6184, 170.3943, 121.8194, 52.58537, + 33.08871, 38.40972, 44.24843, 69.5786, 4.019351, 3.050024, 3.039719, + 2.996142, 2.967954, 1.999594], + [30.4267, 33.47752, 44.80953, 62.47495, 77.43523, 104.2153, 102.7393, 137.0004, + 186.0706, 219.3173, 181.7615, 120.9154, 143.1835, 82.40501, 48.47132, + 74.71461, 60.0909, 7.073525, 6.089851, 6.53745, 6.666096, 7.306965, 5.73684, + 3.625628], + [16.66549, 30.1086, 39.96952, 44.12225, 59.57512, 77.56929, 106.8925, + 166.5539, 175.2381, 185.2815, 154.5056, 83.0433, 62.61732, 62.33167, + 60.55916, 55.92124, 15.17284, 8.248324, 36.68087, 61.93413, 20.26867, + 68.58819, 46.49812, 0.2360095], + [8.815617, 18.3516, 8.658275, 27.5859, 48.62691, 60.18013, 91.3286, + 145.7109, 116.0653, 106.2662, 68.69447, 53.10596, 37.92797, 47.95942, + 47.42691, 69.20731, 44.95468, 29.17197, 17.91674, 16.25515, 14.65559, + 17.26048, 31.22245, 46.71704], + [6.628881, 10.41339, 24.81939, 26.08952, 30.1605, 52.30802, 64.71007, + 76.30823, 84.63686, 99.4324, 62.52132, 46.81647, 55.76606, 82.4099, + 140.2647, 81.26501, 56.45756, 30.42164, 17.28782, 8.302431, 2.981626, + 2.698536, 5.886086, 5.268358], + [21.83975, 6.63927, 18.97085, 32.89204, 43.15014, 62.86014, 104.6657, + 130.2294, 114.8494, 106.9873, 61.89647, 55.55682, 86.80986, 89.27802, + 122.4221, 123.9698, 109.0952, 98.41956, 77.61374, 32.49031, 14.67344, + 7.370775, 0.03711011, 0.6423392], + [53.34303, 26.79797, 6.63927, 10.88787, 17.2044, 56.18116, 79.70141, + 90.8453, 98.27675, 80.87243, 74.7931, 75.54661, 73.4373, 74.11694, 68.1749, + 46.24076, 39.93857, 31.21653, 36.88335, 40.02525, 117.4297, 12.70328, + 1.729771, 0], + [25.66785, 63.05717, 22.1414, 17.074, 41.74483, 60.27227, 81.42432, 114.444, + 102.3234, 101.7878, 111.031, 119.2309, 114.0777, 110.5296, 59.19355, + 42.47175, 14.63598, 6.944074, 6.944075, 27.74936, 0, 0, 0.09449376, 0.07732264], + [12.827, 69.20554, 46.76293, 13.96517, 33.88744, 61.82613, 84.74799, + 121.122, 145.2741, 153.1797, 204.786, 227.9242, 236.3038, 228.3655, + 79.34425, 25.93483, 6.944074, 6.944074, 6.944075, 7.553681, 0, 0, 0, 0], + [0, 68.66396, 59.0435, 33.35762, 47.45282, 57.8355, 78.91689, 107.8275, + 168.0053, 130.9597, 212.5541, 165.8122, 210.2429, 181.1713, 189.7617, + 137.3378, 84.65395, 8.677168, 6.956576, 8.468093, 0, 0, 0, 0], + [0, 95.17499, 80.03818, 59.89862, 39.58476, 50.28058, 63.81641, 80.61302, + 66.37824, 198.7651, 244.3467, 294.2474, 264.3517, 176.4082, 60.21857, + 77.41475, 53.16981, 56.16393, 6.949235, 7.531059, 3.780177, 0, 0, 0], + [0, 134.9879, 130.3696, 96.86325, 75.70494, 58.86466, 57.20374, 55.18837, + 78.128, 108.5582, 154.3774, 319.1686, 372.8826, 275.4655, 130.2632, 54.93822, + 25.49719, 8.047439, 8.084393, 5.115252, 5.678269, 0, 0, 0], + [0, 48.08919, 142.5558, 140.3777, 154.7261, 87.9361, 58.11092, 52.83869, + 67.14822, 83.66798, 118.9242, 150.0681, 272.9709, 341.1366, 238.664, 190.2, + 116.8943, 91.48672, 14.0157, 42.29277, 5.115252, 0, 0, 0], + [0, 54.1941, 146.3839, 99.48143, 96.19411, 102.9473, 76.14089, 57.7844, + 47.0402, 64.36799, 84.23767, 162.7181, 121.3275, 213.1646, 328.482, + 285.4489, 283.8319, 212.815, 164.549, 92.29631, 7.244015, 1.167, 0, 0], + [0, 6.919659, 195.1709, 132.5253, 135.2341, 89.85069, 89.45549, 60.29967, + 50.33806, 39.17583, 59.06854, 74.52159, 84.93402, 187.1219, 123.9673, + 103.7027, 128.986, 165.1283, 249.7054, 95.39966, 10.00284, 2.39255, 0, 0], + [0, 21.73871, 123.1339, 176.7414, 158.2698, 137.235, 105.3089, 86.63255, 53.11591, + 29.03865, 30.40539, 39.04902, 49.23405, 63.27853, 111.4215, 101.1956, + 40.00962, 59.84565, 74.51253, 17.06316, 2.435141, 2.287471, -0.0003636982, 0], + [0, 0, 62.04672, 136.3122, 201.7952, 168.1343, 95.2046, 58.90624, 46.94091, + 49.27053, 37.10416, 17.97011, 30.93697, 33.39257, 44.03077, 55.64542, + 78.22423, 14.42782, 9.954997, 7.768213, 13.0254, 21.73166, 2.156372, + 0.5317867], + [0, 0, 79.62993, 139.6978, 173.167, 192.8718, 196.3499, 144.6611, 106.5424, + 57.16653, 41.16107, 32.12764, 13.8566, 10.91772, 12.07177, 22.38254, + 24.72105, 6.803666, 4.200841, 16.46857, 15.70744, 33.96221, 7.575688, + -0.04880907], + [0, 0, 33.2664, 57.53643, 167.2241, 196.4833, 194.7966, 182.1884, 119.6961, + 73.02113, 48.36549, 33.74652, 26.2379, 16.3578, 6.811293, 6.63927, 6.639271, + 8.468093, 6.194273, 3.591233, 3.81486, 8.600739, 5.21889, 0], + [0, 0, 29.77937, 54.97282, 144.7995, 207.4904, 165.3432, 171.4047, 174.9216, + 100.2733, 61.46441, 50.19171, 26.08209, 17.18218, 8.468093, 6.63927, + 6.334467, 6.334467, 5.666687, 4.272203, 0, 0, 0, 0], + [0, 0, 31.409, 132.7418, 185.5796, 121.8299, 185.3841, 160.6566, 116.1478, + 118.1078, 141.7946, 65.56351, 48.84066, 23.13864, 18.12932, 10.28531, + 6.029663, 6.044627, 5.694764, 3.739085, 3.896037, 0, 0, 0], + [0, 0, 19.58994, 42.30355, 96.26777, 187.1207, 179.6626, 221.3898, 154.2617, + 142.1604, 148.5737, 67.17937, 40.69044, 39.74512, 26.10166, 14.48469, + 8.65873, 3.896037, 3.571392, 3.896037, 3.896037, 3.896037, 1.077756, 0], + [0.001229679, 3.008948, 5.909858, 33.50574, 104.3341, 152.2165, 198.1988, + 191.841, 228.7349, 168.1041, 144.2759, 110.7436, 57.65214, 42.63504, + 27.91891, 15.41052, 8.056102, 3.90283, 3.879774, 3.936718, 3.968634, + 0.1236256, 3.985531, -0.1835741], + [0, 5.626141, 7.676256, 63.16226, 45.99762, 79.56688, 227.311, 203.9287, + 172.5618, 177.1462, 140.4554, 123.9905, 110.346, 65.12319, 34.31887, + 24.5278, 9.561069, 3.334991, 5.590495, 5.487353, 5.909499, 5.868994, + 5.833817, 3.568177]] + trace = surface(z=z) + layout = Layout(title="Mt. Bruno Elevation", autosize=false, width=500, + height=500, margin=attr(l=65, r=50, b=65, t=90)) + plot(trace, layout) +end +topo_surface() +``` + +```@example 3d +function multiple_surface() + z1 = Vector[[8.83, 8.89, 8.81, 8.87, 8.9, 8.87], + [8.89, 8.94, 8.85, 8.94, 8.96, 8.92], + [8.84, 8.9, 8.82, 8.92, 8.93, 8.91], + [8.79, 8.85, 8.79, 8.9, 8.94, 8.92], + [8.79, 8.88, 8.81, 8.9, 8.95, 8.92], + [8.8, 8.82, 8.78, 8.91, 8.94, 8.92], + [8.75, 8.78, 8.77, 8.91, 8.95, 8.92], + [8.8, 8.8, 8.77, 8.91, 8.95, 8.94], + [8.74, 8.81, 8.76, 8.93, 8.98, 8.99], + [8.89, 8.99, 8.92, 9.1, 9.13, 9.11], + [8.97, 8.97, 8.91, 9.09, 9.11, 9.11], + [9.04, 9.08, 9.05, 9.25, 9.28, 9.27], + [9, 9.01, 9, 9.2, 9.23, 9.2], + [8.99, 8.99, 8.98, 9.18, 9.2, 9.19], + [8.93, 8.97, 8.97, 9.18, 9.2, 9.18]] + z2 = map(x->x.+1, z1) + z3 = map(x->x.-1, z1) + trace1 = surface(z=z1, colorscale="Viridis") + trace2 = surface(z=z2, showscale=false, opacity=0.9, colorscale="Viridis") + trace3 = surface(z=z3, showscale=false, opacity=0.9, colorscale="Viridis") + plot([trace1, trace2, trace3]) +end +multiple_surface() +``` + +```@example 3d +function clustering_alpha_shapes() + # load data + iris = dataset("datasets", "iris") + nms = unique(iris[:Species]) + colors = [RGB(0.89, 0.1, 0.1), RGB(0.21, 0.50, 0.72), RGB(0.28, 0.68, 0.3)] + + data = GenericTrace[] + + for (i, nm) in enumerate(nms) + df = iris[iris[:Species] .== nm, :] + x=df[:SepalLength] + y=df[:SepalWidth] + z=df[:PetalLength] + trace = scatter3d(;name=nm, mode="markers", + marker_size=3, marker_color=colors[i], marker_line_width=0, + x=x, y=y, z=z) + push!(data, trace) + + cluster = mesh3d(;color=colors[i], opacity=0.3, x=x, y=y, z=z) + push!(data, cluster) + end + + # notice the nested attrs to create complex JSON objects + layout = Layout(width=800, height=550, autosize=false, title="Iris dataset", + scene=attr(xaxis=attr(gridcolor="rgb(255, 255, 255)", + zerolinecolor="rgb(255, 255, 255)", + showbackground=true, + backgroundcolor="rgb(230, 230,230)"), + yaxis=attr(gridcolor="rgb(255, 255, 255)", + zerolinecolor="rgb(255, 255, 255)", + showbackground=true, + backgroundcolor="rgb(230, 230,230)"), + zaxis=attr(gridcolor="rgb(255, 255, 255)", + zerolinecolor="rgb(255, 255, 255)", + showbackground=true, + backgroundcolor="rgb(230, 230,230)"), + aspectratio=attr(x=1, y=1, z=0.7), + aspectmode = "manual")) + plot(data, layout) +end +clustering_alpha_shapes() +``` + +```@example 3d +function scatter_3d() + Σ = fill(0.5, 3, 3) + Diagonal([0.5, 0.5, 0.5]) + obs1 = rand(MvNormal(zeros(3), Σ), 200)' + obs2 = rand(MvNormal(zeros(3), 0.5Σ), 100)' + + trace1 = scatter3d(;x=obs1[:, 1], y=obs1[:, 2], z=obs1[:, 3], + mode="markers", opacity=0.8, + marker_size=12, marker_line_width=0.5, + marker_line_color="rgba(217, 217, 217, 0.14)") + + trace2 = scatter3d(;x=obs2[:, 1], y=obs2[:, 2], z=obs2[:, 3], + mode="markers", opacity=0.9, + marker=attr(color="rgb(127, 127, 127)", + symbol="circle", line_width=1.0, + line_color="rgb(204, 204, 204)")) + + layout = Layout(margin=attr(l=0, r=0, t=0, b=0)) + + plot([trace1, trace2], layout) +end +scatter_3d() +``` + +```@example 3d +function trisurf() + facecolor = repeat([ + "rgb(50, 200, 200)", + "rgb(100, 200, 255)", + "rgb(150, 200, 115)", + "rgb(200, 200, 50)", + "rgb(230, 200, 10)", + "rgb(255, 140, 0)" + ], inner=[2]) + + t = mesh3d( + x=[0, 0, 1, 1, 0, 0, 1, 1], + y=[0, 1, 1, 0, 0, 1, 1, 0], + z=[0, 0, 0, 0, 1, 1, 1, 1], + i=[7, 0, 0, 0, 4, 4, 2, 6, 4, 0, 3, 7], + j=[3, 4, 1, 2, 5, 6, 5, 5, 0, 1, 2, 2], + k=[0, 7, 2, 3, 6, 7, 1, 2, 5, 5, 7, 6], + facecolor=facecolor) + + plot(t) +end +trisurf() +``` + +```@example 3d +function meshcube() + t = mesh3d( + x=[0, 0, 1, 1, 0, 0, 1, 1], + y=[0, 1, 1, 0, 0, 1, 1, 0], + z=[0, 0, 0, 0, 1, 1, 1, 1], + i=[7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2], + j=[3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3], + k=[0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6], + intensity=range(0, stop=1, length=8), + colorscale=[ + [0, "rgb(255, 0, 255)"], + [0.5, "rgb(0, 255, 0)"], + [1, "rgb(0, 0, 255)"] + ] + ) + plot(t) +end +meshcube() +``` + diff --git a/docs/src/examples/area.md b/docs/src/examples/area.md new file mode 100644 index 00000000..327cb48c --- /dev/null +++ b/docs/src/examples/area.md @@ -0,0 +1,46 @@ +# Area + +```@example area +using PlotlyJS +``` + +```@example area +function area1() + trace1 = scatter(;x=1:4, y=[0, 2, 3, 5], fill="tozeroy") + trace2 = scatter(;x=1:4, y=[3, 5, 1, 7], fill="tonexty") + plot([trace1, trace2]) +end +area1() +``` + +```@example area +function area2() + function _stacked_area!(traces) + for (i, tr) in enumerate(traces[2:end]) + for j in 1:min(length(traces[i]["y"]), length(tr["y"])) + tr["y"][j] += traces[i]["y"][j] + end + end + traces + end + + traces = [scatter(;x=1:3, y=[2, 1, 4], fill="tozeroy"), + scatter(;x=1:3, y=[1, 1, 2], fill="tonexty"), + scatter(;x=1:3, y=[3, 0, 2], fill="tonexty")] + _stacked_area!(traces) + + plot(traces, Layout(title="stacked and filled line chart")) +end +area2() +``` + +```@example area +function area3() + trace1 = scatter(;x=1:4, y=[0, 2, 3, 5], fill="tozeroy", mode="none") + trace2 = scatter(;x=1:4, y=[3, 5, 1, 7], fill="tonexty", mode="none") + plot([trace1, trace2], + Layout(title="Overlaid Chart Without Boundary Lines")) +end +area3() +``` + diff --git a/docs/src/examples/bar.md b/docs/src/examples/bar.md new file mode 100644 index 00000000..4e8b01c2 --- /dev/null +++ b/docs/src/examples/bar.md @@ -0,0 +1,262 @@ +# Bar + +```@example bar +using PlotlyJS +``` + +```@example bar +function bar1() + data = bar(;x=["giraffes", "orangutans", "monkeys"], + y=[20, 14, 23]) + plot(data) +end +bar1() +``` + +```@example bar +function bar2() + trace1 = bar(;x=["giraffes", "orangutans", "monkeys"], + y=[20, 14, 23], + name="SF Zoo") + trace2 = bar(;x=["giraffes", "orangutans", "monkeys"], + y=[12, 18, 29], + name="LA Zoo") + data = [trace1, trace2] + layout = Layout(;barmode="group") + plot(data, layout) +end +bar2() +``` + +```@example bar +function bar3() + trace1 = bar(;x=["giraffes", "orangutans", "monkeys"], + y=[20, 14, 23], + name="SF Zoo") + trace2 = bar(x=["giraffes", "orangutans", "monkeys"], + y=[12, 18, 29], + name="LA Zoo") + data = [trace1, trace2] + layout = Layout(;barmode="stack") + plot(data, layout) +end +bar3() +``` + +```@example bar +function bar4() + data = bar(;x=["Product A", "Product B", "Product C"], + y=[20, 14, 23], + text=["$(i)% market share" for i in rand(15:30, 3)], + marker=attr(color="rgb(158, 202, 225)", opacity=0.6), + line=attr(color="rgb(8, 48, 107)", width=1.5)) + + layout = Layout(;title="January 2013 Sales Report") + + plot(data, layout) +end +bar4() +``` + +```@example bar +function bar5() + x_value = ["Product A", "Product B", "Product C"] + y_value = [20, 14, 23] + + data = bar(;x=x_value, + y=y_value, + text=["$(i)% market share" for i in rand(15:30, 3)], + marker=attr(color="rgb(158, 202, 225)", opacity=0.6, + line=attr(color="rgb(8, 48, 107)", width=1.5))) + + annotations = [] + + for i in 1:length(x_value) + result = attr(x=x_value[i], + y=y_value[i], + text=y_value[i], + xanchor="center", + yanchor="bottom", + showarrow=false) + push!(annotations, result) + end + + layout = Layout(;title="January 2013 Sales Report", + annotations=annotations) + plot(data, layout) +end +bar5() +``` + +```@example bar +function bar6() + trace1 = bar(;x=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", + "Sep", "Oct", "Nov", "Dec"], + y=[20, 14, 25, 16, 18, 22, 19, 15, 12, 16, 14, 17], + name="Primary Product", + marker_color="rgb(49, 130, 189)", + opacity=0.7) + trace2 = bar(;x=["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", + "Sep", "Oct", "Nov", "Dec"], + y=[19, 14, 22, 14, 16, 19, 15, 14, 10, 12, 12, 16], + name="Secondary Product", + marker=attr(color="rgb(204, 204, 204)", opacity=0.5)) + data = [trace1, trace2] + layout = Layout(;title="2013 Sales Report", + xaxis_tickangle=-45, + barmode="group") + plot(data, layout) +end +bar6() +``` + +```@example bar +function bar7() + data = bar(;x=["Feature $(s)" for s in 'A':'E'], + y=[20, 14, 23, 25, 22], + marker_color=["rgba(204, 204, 204, 1)", + "rgba(222, 45, 38, 0.8)", + "rgba(204, 204, 204, 1)", + "rgba(204, 204, 204, 1)", + "rgba(204, 204, 204, 1)"]) + layout = Layout(;title="Least Used Feature") + plot(data, layout) +end +bar7() +``` + +```@example bar +function bar8() + data = bar(;x=["Liam", "Sophie", "Jacob", "Mia", "William", "Olivia"], + y=[8.0, 8.0, 12.0, 12.0, 13.0, 20.0], + text=["4.17 below the mean", "4.17 below the mean", + "0.17 below the mean", "0.17 below the mean", + "0.83 above the mean", "7.83 above the mean"], + marker_color="rgb(142, 124, 195)") + layout = Layout(;title="Number of Graphs Made this Week", + font_family="Raleway, sans-serif", + showlegend=false, + xaxis_tickangle=-45, + yaxis=attr(zeroline=false, gridwidth=2), + bargap=0.05) + plot(data, layout) +end +bar8() +``` + +```@example bar +function bar9() + trace1 = bar(;x=1995:2012, + y=[219, 146, 112, 127, 124, 180, 236, 207, 236, 263, 350, + 430, 474, 526, 488, 537, 500, 439], + name="Rest of world", + marker_color="rgb(55, 83, 109)") + trace2 = bar(;x=1995:2012, + y=[16, 13, 10, 11, 28, 37, 43, 55, 56, 88, 105, 156, 270, + 299, 340, 403, 549, 499], + name="China", + marker_color="rgb(26, 118, 255)") + + data = [trace1, trace2] + + layout = Layout(;title="US Export of Plastic Scrap", + xaxis=attr(tickfont_size= 14, + tickfont_color="rgb(107, 107, 107)"), + yaxis=attr(title="USD (millions)", + titlefont=attr(size=16, + color="rgb(107, 107, 107)"), + tickfont=attr(size=14, + color="rgb(107, 107, 107)")), + legend=attr(x=0, y=1.0, bgcolor="rgba(255, 255, 255, 0)", + bordercolor="rgba(255, 255, 255, 0)"), + barmode="group", + bargap=0.15, + bargroupgap=0.1) + plot(data, layout) +end +bar9() +``` + +```@example bar +function bar10() + x_data = ["Product Revenue", "Services Revenue", "Total Revenue", + "Fixed Costs", "Variable Costs", "Total Costs", "Total"] + y_data = [400, 660, 660, 590, 400, 400, 340] + textList = ["\$430K", "\$260K", "\$690K", "\$-120K", "\$-200K", "\$-320K", + "\$370K"] + + #Base + trace1 = bar(;x=x_data, + y=[0, 430, 0, 570, 370, 370, 0], + marker_color="rgba(1, 1, 1, 0.0)") + + #Revenue + trace2 = bar(;x=x_data, + y=[430, 260, 690, 0, 0, 0, 0], + marker_color="rgba(55, 128, 191, 0.7)", + line=attr(color="rgba(55, 128, 191, 1.0)", width=2)) + + #Cost + trace3 = bar(;x=x_data, + y=[0, 0, 0, 120, 200, 320, 0], + marker=attr(color="rgba(219, 64, 82, 0.7)", + line=attr(color="rgba(219, 64, 82, 1.0)", width=2))) + + #Profit + trace4 = bar(;x=x_data, + y=[0, 0, 0, 0, 0, 0, 370], + marker=attr(color="rgba(50, 171, 96, 0.7)", + line=attr(color="rgba(50, 171, 96, 1.0)", width=2))) + + data = [trace1, trace2, trace3, trace4] + + annotations = [] + for i in 1:7 + result = attr(x=x_data[i], + y=y_data[i], + text=textList[i], + font=attr(;family="Arial", font_size=14, + font_color="rgba(245, 246, 249, 1)"), + showarrow=false) + push!(annotations, result) + end + + layout = Layout(;title="Annual Profit 2015", + barmode="stack", + paper_bgcolor="rgba(245, 246, 249, 1)", + plot_bgcolor="rgba(245, 246, 249, 1)", + width=600, + height=600, + showlegend=false, + xaxis_showtickabels=true, + annotations=annotations) + + plot(data, layout) +end +bar10() +``` + +```@example bar +function bar11() + trace1 = bar(;x=[1, 2, 3, 4], + y=[1, 4, 9, 16], + name="Trace1") + trace2 = bar(;x=[1, 2, 3, 4], + y=[6, -8, -4.5, 8], + name="Trace2") + trace3 = bar(;x=[1, 2, 3, 4], + y=[-15, -3, 4.5, -8], + name="Trace3") + trace4 = bar(;x=[1, 2, 3, 4], + y=[-1, 3, -3, -4], + name="Trace4") + data = [trace1, trace2, trace3, trace4] + layout = Layout(;xaxis_title="X axis", + yaxis_title="Y axis", + barmode="relative", + title="Relative Barmode") + plot(data, layout) +end +bar11() +``` + diff --git a/docs/src/examples/box_plots.md b/docs/src/examples/box_plots.md new file mode 100644 index 00000000..207e15b2 --- /dev/null +++ b/docs/src/examples/box_plots.md @@ -0,0 +1,251 @@ +# Box Plots + +```@example box_plots +using PlotlyJS +``` + +```@example box_plots +function box1() + y0 = rand(50) + y1 = rand(50) .+ 1 + trace1 = box(;y=y0) + trace2 = box(;y=y1) + data = [trace1, trace2] + plot(data) +end +box1() +``` + +```@example box_plots +function box2() + data = box(;y=[0, 1, 1, 2, 3, 5, 8, 13, 21], + boxpoints="all", + jitter=0.3, + pointpos=-1.8) + plot(data) +end +box2() +``` + +```@example box_plots +function box3() + trace1 = box(;x=[1, 2, 3, 4, 4, 4, 8, 9, 10], + name="Set 1") + trace2 = box(;x=[2, 3, 3, 3, 3, 5, 6, 6, 7], + name="Set 2") + data = [trace1, trace2] + layout = Layout(;title="Horizontal Box Plot") + + plot(data, layout) +end +box3() +``` + +```@example box_plots +function box4() + x0 = ["day 1", "day 1", "day 1", "day 1", "day 1", "day 1", + "day 2", "day 2", "day 2", "day 2", "day 2", "day 2"] + trace1 = box(;y=[0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3], + x=x0, + name="kale", + marker_color="#3D9970") + trace2 = box(;y=[0.6, 0.7, 0.3, 0.6, 0.0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2], + x=x0, + name="radishes", + marker_color="#FF4136") + trace3 = box(;y=[0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1.0, 0.3, 0.6, 0.8, 0.5], + x=x0, + name="carrots", + marker_color="#FF851B") + data = [trace1, trace2, trace3] + layout = Layout(;yaxis=attr(title="normalized moisture", zeroline=false), + boxmode="group") + plot(data, layout) +end +box4() +``` + +```@example box_plots +function box5() + trace1 = box(;y=[0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, + 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, + 12, 16, 20.90, 22.3, 23.25], + name="All Points", + jitter=0.3, + pointpos=-1.8, + marker_color="rgb(7, 40, 89)", + boxpoints="all") + trace2 = box(;y=[0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, + 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, + 12, 16, 20.90, 22.3, 23.25], + name="Only Wiskers", + marker_color="rgb(9, 56, 125)", + boxpoints=false) + trace3 = box(;y=[0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, + 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, + 12, 16, 20.90, 22.3, 23.25], + name="Suspected Outlier", + marker=attr(color="rgb(8, 8, 156)", + outliercolor="rgba(219, 64, 82, 0.6)", + line=attr(outliercolor="rgba(219, 64, 82, 1.0)", + outlierwidth=2)), + boxpoints="suspectedoutliers") + trace4 = box(;y=[0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, + 7.75, 8.15, 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, + 12, 16, 20.90, 22.3, 23.25], + name="Wiskers and Outliers", + marker_color="rgb(107, 174, 214)", + boxpoints="Outliers") + data = [trace1, trace2, trace3, trace4] + layout = Layout(;title="Box Plot Styling Outliers") + plot(data, layout) +end +box5() +``` + +```@example box_plots +function box6() + trace1 = box(;y=[2.37, 2.16, 4.82, 1.73, 1.04, 0.23, 1.32, 2.91, 0.11, + 4.51, 0.51, 3.75, 1.35, 2.98, 4.50, 0.18, 4.66, 1.30, + 2.06, 1.19], + name="Only Mean", + marker_color="rgb(8, 81, 156)", + boxmean=true) + trace2 = box(;y=[2.37, 2.16, 4.82, 1.73, 1.04, 0.23, 1.32, 2.91, 0.11, + 4.51, 0.51, 3.75, 1.35, 2.98, 4.50, 0.18, 4.66, 1.30, + 2.06, 1.19], + name="Mean and Standard Deviation", + marker_color="rgb(10, 140, 208)", + boxmean="sd") + data = [trace1, trace2] + layout = Layout(;title="Box Plot Styling Mean and Standard Deviation") + plot(data, layout) +end +box6() +``` + +```@example box_plots +function box7() + y0 = ["day 1", "day 1", "day 1", "day 1", "day 1", "day 1", + "day 2", "day 2", "day 2", "day 2", "day 2", "day 2"] + trace1 = box(;x=[0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3], + y=y0, + name="kale", + marker_color="#3D9970", + boxmean=false, + orientation="h") + trace2 = box(;x=[0.6, 0.7, 0.3, 0.6, 0.0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2], + y=y0, + name="radishes", + marker_color="#FF4136", + boxmean=false, + orientation="h") + trace3 = box(;x=[0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1.0, 0.3, 0.6, 0.8, 0.5], + y=y0, + name="carrots", + marker_color="#FF851B", + boxmean=false, + orientation="h") + data = [trace1, trace2, trace3] + layout = Layout(;title="Grouped Horizontal Box Plot", + xaxis=attr(title="normalized moisture", zeroline=false), + boxmode="group") + plot(data, layout) +end +box7() +``` + +```@example box_plots +function box8() + trace1 = box(;y=[1, 2, 3, 4, 4, 4, 8, 9, 10], + name="Sample A", + marker_color="rgb(214, 12, 140)") + trace2 = box(;y=[2, 3, 3, 3, 3, 5, 6, 6, 7], + name="Sample B", + marker_color="rgb(0, 128, 128)") + data = [trace1, trace2] + layout = Layout(;title="Colored Box Plot") + plot(data, layout) +end +box8() +``` + +```@example box_plots +function box9() + xData = ["Carmelo
Anthony", "Dwyane
Wade", "Deron
Williams", + "Brook
Lopez", "Damian
Lillard", "David
West", + "Blake
Griffin", "David
Lee", "Demar
Derozan"] + + _getrandom(num, mul) = mul .* rand(num) + + yData = Array[ + _getrandom(30, 10), + _getrandom(30, 20), + _getrandom(30, 25), + _getrandom(30, 40), + _getrandom(30, 45), + _getrandom(30, 30), + _getrandom(30, 20), + _getrandom(30, 15), + _getrandom(30, 43) + ] + colors = ["rgba(93, 164, 214, 0.5)", "rgba(255, 144, 14, 0.5)", + "rgba(44, 160, 101, 0.5)", "rgba(255, 65, 54, 0.5)", + "rgba(207, 114, 255, 0.5)", "rgba(127, 96, 0, 0.5)", + "rgba(255, 140, 184, 0.5)", "rgba(79, 90, 117, 0.5)", + "rgba(222, 223, 0, 0.5)"] + + data = GenericTrace[] + for i in 1:length(xData) + trace = box(;y=yData[i], + name=xData[i], + boxpoints="all", + jitter=0.5, + whiskerwidth=0.2, + fillcolor="cls", + marker_size=2, + line_width=1) + push!(data, trace) + end + + t = "Points Scored by the Top 9 Scoring NBA Players in 2012" + layout = Layout(;title=t, + yaxis=attr(autorange=true, showgrid=true, zeroline=true, + dtick=5, gridcolor="rgb(255, 255, 255)", + gridwidth=1, + zerolinecolor="rgb(255, 255, 255)", + zerolinewidth=2), + margin=attr(l=40, r=30, b=80, t=100), + paper_bgcolor="rgb(243, 243, 243)", + plot_bgcolor="rgb(243, 243, 243)", + showlegend=false) + plot(data, layout) +end +box9() +``` + +```@example box_plots +function box10() + n_box = 30 + colors = ["hsl($i, 50%, 50%)" for i in range(0, stop=360, length=n_box)] + + gen_y_data(i) = + (3.5*sin(pi*i/n_box) + i/n_box) .+ (1.5+0.5*cos(pi*i/n_box)).*rand(10) + + ys = Array[gen_y_data(i) for i in 1:n_box] + + # Create Traces + data = GenericTrace[box(y=y, marker_color=mc) for (y, mc) in zip(ys, colors)] + + #Format the layout + layout = Layout(;xaxis=attr(;showgrid=false, zeroline=false, + tickangle=60, showticklabels=true), + yaxis=attr(;zeroline=false, gridcolor="white"), + paper_bgcolor="rgb(233, 233, 233)", + plot_bgcolor="rgb(233, 233, 233)", + showlegend=true) + plot(data, layout) +end +box10() +``` + diff --git a/docs/src/examples/contour.md b/docs/src/examples/contour.md new file mode 100644 index 00000000..3450479c --- /dev/null +++ b/docs/src/examples/contour.md @@ -0,0 +1,254 @@ +# Contour + +```@example contour +using PlotlyJS +``` + +```@example contour +function contour1() + x = y = [-2*pi + 4*pi*i/100 for i in 1:100] + z = [sin(x[i]) * cos(y[j]) * sin(x[i]*x[i]+y[j]*y[j])/log(x[i]*x[i]+y[j]*y[j]+1) + for i in 1:100 for j in 1:100] + z_ = [z[i:i+99] for i in 1:100:10000] + + data = contour(;z=z_, x=x, y=y) + + plot(data) +end +contour1() +``` + +```@example contour +function contour2() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z) + + layout = Layout(;title="Basic Contour Plot") + plot(data, layout) +end +contour2() +``` + +```@example contour +function contour3() + x = [-9, -6, -5 , -3, -1] + y = [0, 1, 4, 5, 7] + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + trace = contour(x=x, y=y, z=z) + + layout = Layout(title="Setting the X and Y Coordinates in a Contour Plot") + plot(trace, layout) +end +contour3() +``` + +```@example contour +function contour4() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, colorscale="Jet") + + layout = Layout(;title="Colorscale for Contour Plot") + plot(data, layout) +end +contour4() +``` + +```@example contour +function contour5() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, + colorscale="Jet", + autocontour=false, + contours=Dict(:start=>0, :end=>8, :size=>2)) + + layout = Layout(;title="Customizing Size and Range of Contours") + plot(data, layout) +end +contour5() +``` + +```@example contour +function contour6() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, colorscale="Jet", dx=10, x0=5, dy=10, y0=10) + + layout = Layout(;title="Customizing Spacing Between X and Y Axis Ticks") + + plot(data, layout) +end +contour6() +``` + +```@example contour +function contour7() + z = [NaN NaN NaN 12 13 14 15 16 + NaN 1 NaN 11 NaN NaN NaN 17 + NaN 2 6 7 NaN NaN NaN 18 + NaN 3 NaN 8 NaN NaN NaN 19 + 5 4 10 9 NaN NaN NaN 20 + NaN NaN NaN 27 NaN NaN NaN 21 + NaN NaN NaN 26 25 24 23 22]' + + p1 = plot(contour(;z=z, showscale=false)) + p2 = plot(contour(;z=z, connectgaps=true, showscale=false)) + p3 = plot(heatmap(;z=z, zsmooth="best",showscale=false)) + p4 = plot(heatmap(;z=z, zsmooth="best", connectgaps=true, showscale=false)) + + p = [p1 p2; p3 p4] + + relayout!(p, title="Connect the Gaps Between Null Values in the Z Matrix") + + p +end +contour7() +``` + +```@example contour +function contour8() + z = [2 4 7 12 13 14 15 16 + 3 1 6 11 12 13 16 17 + 4 2 7 7 11 14 17 18 + 5 3 8 8 13 15 18 19 + 7 4 10 9 16 18 20 19 + 9 10 5 27 23 21 21 21 + 11 14 17 26 25 24 23 22] + + p1 = plot(contour(;z=z, line_smoothing=0)) + p2 = plot(contour(;z=z, line_smoothing=0.85)) + + p = [p1 p2] + + relayout!(p, title="Smoothing Contour Lines") + + p +end +contour8() +``` + +```@example contour +function contour9() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, contours_coloring="heatmap") + + layout = Layout(;title="Smooth Contour Coloring") + plot(data, layout) +end +contour9() +``` + +```@example contour +function contour10() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, colorscale="Jet", contours_coloring="lines") + + layout = Layout(;title="Contour Lines") + plot(data, layout) +end +contour10() +``` + +```@example contour +function contour11() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, + colorscale=[[0, "rgb(166,206,227)"], + [0.25, "rgb(31,120,180)"], + [0.45, "rgb(178,223,138)"], + [0.64, "rgb(51,160,44)"], + [0.85, "rgb(251,154,153)"], + [1, "rgb(227,26,28)"]]) + + layout = Layout(;title="Custom Contour Plot Colorscale") + + plot(data, layout) +end +contour11() +``` + +```@example contour +function contour12() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, + colorbar=attr(;title="Color Bar Title",titleside="right", + titlefont=attr(;size=14, + family="Arial, sans-serif"))) + + layout = Layout(;title="Colorbar with Title") + plot(data,layout) +end +contour12() +``` + +```@example contour +function contour13() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, + colorbar=attr(;thickness=75, thicknessmode="pixels", + len=0.9, lenmode="fraction", + outlinewidth=0)) + + layout = Layout(;title="Colorbar Size for Contour Plots") + plot(data,layout) +end +contour13() +``` + +```@example contour +function contour14() + z = [10 10.625 12.5 15.625 20 + 5.625 6.25 8.125 11.25 15.625 + 2.5 3.125 5. 8.125 12.5 + 0.625 1.25 3.125 6.25 10.625 + 0 0.625 2.5 5.625 10] + data = contour(;z=z, + colorbar=attr(;ticks="outside", dtick=1, + tickwidth=2, ticklen=10, + tickcolor="grey", showticklabels=true, + tickfont_size=15, xpad=50)) + + layout = Layout(;title="Styling Color Bar Ticks for Contour Plots") + plot(data,layout) +end +contour14() +``` + diff --git a/docs/src/examples/finance.md b/docs/src/examples/finance.md new file mode 100644 index 00000000..8a44248d --- /dev/null +++ b/docs/src/examples/finance.md @@ -0,0 +1,60 @@ +# Finance + +```@example finance +using PlotlyJS, HTTP, CSV +``` + +```@example finance +function ohlc1() + t = ohlc(open=[33.0, 33.3, 33.5, 33.0, 34.1], + high=[33.1, 33.3, 33.6, 33.2, 34.8], + low=[32.7, 32.7, 32.8, 32.6, 32.8], + close=[33.0, 32.9, 33.3, 33.1, 33.1]) + plot(t) +end +ohlc1() +``` + +```@example finance +function ohlc2() + function get_ohlc(ticker; kwargs...) + res = HTTP.get("https://www.quandl.com/api/v3/datasets/WIKI/$(ticker)/data.csv?start_date=2017-01-01") + df = CSV.read(res.body) + ohlc(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) + end + + p1 = plot(get_ohlc("AAPL", name="Apple"), Layout(title="Apple")) + p2 = plot(get_ohlc("GOOG", name="Google"), Layout(title="Google")) + + [p1 p2] +end +ohlc2() +``` + +```@example finance +function candlestick1() + t = candlestick(open=[33.0, 33.3, 33.5, 33.0, 34.1], + high=[33.1, 33.3, 33.6, 33.2, 34.8], + low=[32.7, 32.7, 32.8, 32.6, 32.8], + close=[33.0, 32.9, 33.3, 33.1, 33.1]) + plot(t) +end +candlestick1() +``` + +```@example finance +function candlestick2() + function get_candlestick(ticker; kwargs...) + res = HTTP.get("https://www.quandl.com/api/v3/datasets/WIKI/$(ticker)/data.csv?start_date=2017-01-01") + df = CSV.read(res.body) + candlestick(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) + end + + p1 = plot(get_candlestick("AAPL", name="Apple"), Layout(title="Apple")) + p2 = plot(get_candlestick("GOOG", name="Google"), Layout(title="Google")) + + [p1 p2] +end +candlestick2() +``` + diff --git a/docs/src/examples/heatmaps.md b/docs/src/examples/heatmaps.md new file mode 100644 index 00000000..de7310c9 --- /dev/null +++ b/docs/src/examples/heatmaps.md @@ -0,0 +1,26 @@ +# Heatmaps + +```@example heatmaps +using PlotlyJS, Random +Random.seed!(42) +``` + +```@example heatmaps +function heatmap1() + plot(heatmap(z=[1 20 30; 20 1 60; 30 60 1])) +end +heatmap1() +``` + +```@example heatmaps +function heatmap2() + trace = heatmap( + x=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], + y=["Morning", "Afternoon", "Evening"], + z=rand(1:30, 5, 3) + ) + plot(trace) +end +heatmap2() +``` + diff --git a/docs/src/examples/histograms.md b/docs/src/examples/histograms.md new file mode 100644 index 00000000..b432591b --- /dev/null +++ b/docs/src/examples/histograms.md @@ -0,0 +1,20 @@ +# Histograms + +```@example histograms +using PlotlyJS +``` + +```@example histograms +function two_hists() + x0 = randn(500) + x1 = x0 .+ 1 + + trace1 = histogram(x=x0, opacity=0.75) + trace2 = histogram(x=x1, opacity=0.75) + data = [trace1, trace2] + layout = Layout(barmode="overlay") + plot(data, layout) +end +two_hists() +``` + diff --git a/docs/src/examples/line_scatter.md b/docs/src/examples/line_scatter.md new file mode 100644 index 00000000..0527550b --- /dev/null +++ b/docs/src/examples/line_scatter.md @@ -0,0 +1,339 @@ +# Line Scatter + +```@example line_scatter +using PlotlyJS, DataFrames, CSV, Dates +``` + +```@example line_scatter +function linescatter1() + trace1 = scatter(;x=1:4, y=[10, 15, 13, 17], mode="markers") + trace2 = scatter(;x=2:5, y=[16, 5, 11, 9], mode="lines") + trace3 = scatter(;x=1:4, y=[12, 9, 15, 12], mode="lines+markers") + plot([trace1, trace2, trace3]) +end +linescatter1() +``` + +```@example line_scatter +function linescatter2() + trace1 = scatter(;x=1:5, y=[1, 6, 3, 6, 1], + mode="markers", name="Team A", + text=["A-1", "A-2", "A-3", "A-4", "A-5"], + marker_size=12) + + trace2 = scatter(;x=1:5+0.5, y=[4, 1, 7, 1, 4], + mode="markers", name= "Team B", + text=["B-a", "B-b", "B-c", "B-d", "B-e"]) + # setting marker.size this way is _equivalent_ to what we did for trace1 + trace2["marker"] = Dict(:size => 12) + + data = [trace1, trace2] + layout = Layout(;title="Data Labels Hover", xaxis_range=[0.75, 5.25], + yaxis_range=[0, 8]) + plot(data, layout) +end +linescatter2() +``` + +```@example line_scatter +function linescatter3() + trace1 = scatter(;x=1:5, y=[1, 6, 3, 6, 1], + mode="markers+text", name="Team A", + textposition="top center", + text=["A-1", "A-2", "A-3", "A-4", "A-5"], + marker_size=12, textfont_family="Raleway, sans-serif") + + trace2 = scatter(;x=1:5+0.5, y=[4, 1, 7, 1, 4], + mode="markers+text", name= "Team B", + textposition="bottom center", + text= ["B-a", "B-b", "B-c", "B-d", "B-e"], + marker_size=12, textfont_family="Times New Roman") + + data = [trace1, trace2] + + layout = Layout(;title="Data Labels on the Plot", xaxis_range=[0.75, 5.25], + yaxis_range=[0, 8], legend_y=0.5, legend_yref="paper", + legend=attr(family="Arial, sans-serif", size=20, + color="grey")) + plot(data, layout) +end +linescatter3() +``` + +```@example line_scatter +function linescatter4() + trace1 = scatter(;y=fill(5, 40), mode="markers", marker_size=40, + marker_color=0:39) + layout = Layout(title="Scatter Plot with a Color Dimension") + plot(trace1, layout) +end +linescatter4() +``` + +```@example line_scatter +function linescatter5() + + country = ["Switzerland (2011)", "Chile (2013)", "Japan (2014)", + "United States (2012)", "Slovenia (2014)", "Canada (2011)", + "Poland (2010)", "Estonia (2015)", "Luxembourg (2013)", + "Portugal (2011)"] + + votingPop = [40, 45.7, 52, 53.6, 54.1, 54.2, 54.5, 54.7, 55.1, 56.6] + regVoters = [49.1, 42, 52.7, 84.3, 51.7, 61.1, 55.3, 64.2, 91.1, 58.9] + + # notice use of `attr` function to make nested attributes + trace1 = scatter(;x=votingPop, y=country, mode="markers", + name="Percent of estimated voting age population", + marker=attr(color="rgba(156, 165, 196, 0.95)", + line_color="rgba(156, 165, 196, 1.0)", + line_width=1, size=16, symbol="circle")) + + trace2 = scatter(;x=regVoters, y=country, mode="markers", + name="Percent of estimated registered voters") + # also could have set the marker props above by using a dict + trace2["marker"] = Dict(:color => "rgba(204, 204, 204, 0.95)", + :line => Dict(:color=> "rgba(217, 217, 217, 1.0)", + :width=> 1), + :symbol => "circle", + :size => 16) + + data = [trace1, trace2] + layout = Layout(Dict{Symbol,Any}(:paper_bgcolor => "rgb(254, 247, 234)", + :plot_bgcolor => "rgb(254, 247, 234)"); + title="Votes cast for ten lowest voting age population in OECD countries", + width=600, height=600, hovermode="closest", + margin=Dict(:l => 140, :r => 40, :b => 50, :t => 80), + xaxis=attr(showgrid=false, showline=true, + linecolor="rgb(102, 102, 102)", + titlefont_color="rgb(204, 204, 204)", + tickfont_color="rgb(102, 102, 102)", + autotick=false, dtick=10, ticks="outside", + tickcolor="rgb(102, 102, 102)"), + legend=attr(font_size=10, yanchor="middle", + xanchor="right"), + ) + plot(data, layout) +end +linescatter5() +``` + +```@example line_scatter +function linescatter6() + trace1 = scatter(;x=[52698, 43117], y=[53, 31], + mode="markers", + name="North America", + text=["United States", "Canada"], + marker=attr(color="rgb(164, 194, 244)", size=12, + line=attr(color="white", width=0.5)) + ) + + trace2 = scatter(;x=[39317, 37236, 35650, 30066, 29570, 27159, 23557, 21046, 18007], + y=[33, 20, 13, 19, 27, 19, 49, 44, 38], + mode="markers", name="Europe", + marker_size=12, marker_color="rgb(255, 217, 102)", + text=["Germany", "Britain", "France", "Spain", "Italy", + "Czech Rep.", "Greece", "Poland", "Portugal"]) + + trace3 = scatter(;x=[42952, 37037, 33106, 17478, 9813, 5253, 4692, 3899], + y=[23, 42, 54, 89, 14, 99, 93, 70], + mode="markers", + name="Asia/Pacific", + marker_size=12, marker_color="rgb(234, 153, 153)", + text=["Australia", "Japan", "South Korea", "Malaysia", + "China", "Indonesia", "Philippines", "India"]) + + trace4 = scatter(;x=[19097, 18601, 15595, 13546, 12026, 7434, 5419], + y=[43, 47, 56, 80, 86, 93, 80], + mode="markers", name="Latin America", + marker_size=12, marker_color="rgb(142, 124, 195)", + text=["Chile", "Argentina", "Mexico", "Venezuela", + "Venezuela", "El Salvador", "Bolivia"]) + + data = [trace1, trace2, trace3, trace4] + + layout = Layout(;title="Quarter 1 Growth", + xaxis=attr(title="GDP per Capital", showgrid=false, zeroline=false), + yaxis=attr(title="Percent", zeroline=false)) + + plot(data, layout) +end +linescatter6() +``` + +```@example line_scatter +function batman() + # reference: https://github.com/alanedelman/18.337_2015/blob/master/Lecture01_0909/The%20Bat%20Curve.ipynb + σ(x) = @. √(1-x.^2) + el(x) = @. 3*σ(x/7) + s(x) = @. 4.2 - 0.5*x - 2.0*σ(0.5*x-0.5) + b(x) = @. σ(abs(2-x)-1) - x.^2/11 + 0.5x - 3 + c(x) = [1.7, 1.7, 2.6, 0.9] + + p(i, f; kwargs...) = scatter(;x=[-i; 0.0; i], y=[f(i); NaN; f(i)], + marker_color="black", showlegend=false, + kwargs...) + traces = vcat(p(3:0.1:7, el; name="wings 1"), + p(4:0.1:7, t->-el(t); name="wings 2"), + p(1:0.1:3, s; name="Shoulders"), + p(0:0.1:4, b; name="Bottom"), + p([0, 0.5, 0.8, 1], c; name="head")) + + plot(traces, Layout(title="Batman")) +end +batman() +``` + +```@example line_scatter +function dumbell() + # reference: https://plot.ly/r/dumbbell-plots/ + # read Data into dataframe + nm = tempname() + url = "https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv" + download(url, nm) + df = CSV.read(nm) + rm(nm) + + # sort dataframe by male earnings + df = sort(df, :Men, rev=false) + + men = scatter(;y=df[:School], x=df[:Men], mode="markers", name="Men", + marker=attr(color="blue", size=12)) + women = scatter(;y=df[:School], x=df[:Women], mode="markers", name="Women", + marker=attr(color="pink", size=12)) + + lines = map(eachrow(df)) do r + scatter(y=fill(r[:School], 2), x=[r[:Women], r[:Men]], mode="lines", + name=r[:School], showlegend=false, line_color="gray") + end + + data = Base.typed_vcat(GenericTrace, men, women, lines) + layout = Layout(width=650, height=650, margin_l=100, yaxis_title="School", + xaxis_title="Annual Salary (thousands)", + title="Gender earnings disparity") + + plot(data, layout) +end +dumbell() +``` + +```@example line_scatter +function errorbars1() + trace1 = scatter(;x=vcat(1:10, 10:-1:1), + y=vcat(2:11, 9:-1:0), + fill="tozerox", + fillcolor="rgba(0, 100, 80, 0.2)", + line_color="transparent", + name="Fair", + showlegend=false) + + trace2 = scatter(;x=vcat(1:10, 10:-1:1), + y=[5.5, 3.0, 5.5, 8.0, 6.0, 3.0, 8.0, 5.0, 6.0, 5.5, 4.75, + 5.0, 4.0, 7.0, 2.0, 4.0, 7.0, 4.4, 2.0, 4.5], + fill="tozerox", + fillcolor="rgba(0, 176, 246, 0.2)", + line_color="transparent", + name="Premium", + showlegend=false) + + trace3 = scatter(;x=vcat(1:10, 10:-1:1), + y=[11.0, 9.0, 7.0, 5.0, 3.0, 1.0, 3.0, 5.0, 3.0, 1.0, + -1.0, 1.0, 3.0, 1.0, -0.5, 1.0, 3.0, 5.0, 7.0, 9.], + fill="tozerox", + fillcolor="rgba(231, 107, 243, 0.2)", + line_color="transparent", + name="Fair", + showlegend=false) + + trace4 = scatter(;x=1:10, y=1:10, + line_color="rgb(00, 100, 80)", + mode="lines", + name="Fair") + + trace5 = scatter(;x=1:10, + y=[5.0, 2.5, 5.0, 7.5, 5.0, 2.5, 7.5, 4.5, 5.5, 5.], + line_color="rgb(0, 176, 246)", + mode="lines", + name="Premium") + + trace6 = scatter(;x=1:10, y=vcat(10:-2:0, [2, 4,2, 0]), + line_color="rgb(231, 107, 243)", + mode="lines", + name="Ideal") + data = [trace1, trace2, trace3, trace4, trace5, trace6] + layout = Layout(;paper_bgcolor="rgb(255, 255, 255)", + plot_bgcolor="rgb(229, 229, 229)", + + xaxis=attr(gridcolor="rgb(255, 255, 255)", + range=[1, 10], + showgrid=true, + showline=false, + showticklabels=true, + tickcolor="rgb(127, 127, 127)", + ticks="outside", + zeroline=false), + + yaxis=attr(gridcolor="rgb(255, 255, 255)", + showgrid=true, + showline=false, + showticklabels=true, + tickcolor="rgb(127, 127, 127)", + ticks="outside", + zeroline=false)) + + plot(data, layout) +end +errorbars1() +``` + +```@example line_scatter +function errorbars2() + function random_dates(d1::DateTime, d2::DateTime, n::Int) + map(Date, sort!(rand(d1:Dates.Hour(12):d2, n))) + end + + function _random_number(num, mul) + value = [] + j = 0 + rand = 0 + while j <= num+1 + rand = rand() * mul + append!(value, [rand]) + j += 1 + end + return value + end + + dates = random_dates(DateTime(2001, 1, 1), DateTime(2005, 12, 31), 50) + + trace1 = scatter(;x=dates, + y=20.0 .* rand(50), + line_width=0, + marker_color="444", + mode="lines", + name="Lower Bound") + + trace2 = scatter(;x=dates, + y=21.0 .* rand(50), + fill="tonexty", + fillcolor="rgba(68, 68, 68, 0.3)", + line_color="rgb(31, 119, 180)", + mode="lines", + name="Measurement") + + trace3 = scatter(;x=dates, + y=22.0 .* rand(50), + fill="tonexty", + fillcolor="rgba(68, 68, 68, 0.3)", + line_width=0, + marker_color="444", + mode="lines", + name="Upper Bound") + + data = [trace1, trace2, trace3] + t = "Continuous, variable value error bars
Notice the hover text!" + layout = Layout(;title=t, yaxis_title="Wind speed (m/s)") + plot(data, layout) +end +errorbars2() +``` + diff --git a/docs/src/examples/maps.md b/docs/src/examples/maps.md new file mode 100644 index 00000000..7839ceb8 --- /dev/null +++ b/docs/src/examples/maps.md @@ -0,0 +1,57 @@ +# Maps + +```@example maps +using PlotlyJS, DataFrames, CSV +``` + +```@example maps +function maps1() + marker = attr(size=[20, 30, 15, 10], + color=[10, 20, 40, 50], + cmin=0, + cmax=50, + colorscale="Greens", + colorbar=attr(title="Some rate", + ticksuffix="%", + showticksuffix="last"), + line_color="black") + trace = scattergeo(;mode="markers", locations=["FRA", "DEU", "RUS", "ESP"], + marker=marker, name="Europe Data") + layout = Layout(geo_scope="europe", geo_resolution=50, width=500, height=550, + margin=attr(l=0, r=0, t=10, b=0)) + plot(trace, layout) +end +maps1() +``` + +```@example maps +function maps2() + # read Data into dataframe + nm = tempname() + url = "https://raw.githubusercontent.com/plotly/datasets/master/2014_us_cities.csv" + download(url, nm) + df = CSV.read(nm) + rm(nm) + + trace = scattergeo(;locationmode="USA-states", + lat=df[:lat], + lon=df[:lon], + hoverinfo="text", + text=[string(x[:name], " pop: ", x[:pop]) for x in eachrow(df)], + marker_size=df[:pop]/50_000, + marker_line_color="black", marker_line_width=2) + geo = attr(scope="usa", + projection_type="albers usa", + showland=true, + landcolor="rgb(217, 217, 217)", + subunitwidth=1, + countrywidth=1, + subunitcolor="rgb(255,255,255)", + countrycolor="rgb(255,255,255)") + + layout = Layout(;title="2014 US City Populations", showlegend=false, geo=geo) + plot(trace, layout) +end +maps2() +``` + diff --git a/docs/src/examples/shapes.md b/docs/src/examples/shapes.md new file mode 100644 index 00000000..a1cf9753 --- /dev/null +++ b/docs/src/examples/shapes.md @@ -0,0 +1,182 @@ +# Shapes + +```@example shapes +using PlotlyJS, Distributions +``` + +```@example shapes +function house() + trace1 = scatter() + x0 = [2, 2, 5.5, 9, 9, 2, 5, 5, 6] + y0 = [1, 5.5, 9.5, 5.5, 1, 5.5, 1, 4, 4] + x1 = [2, 5.5, 9, 9, 2, 9, 5, 6, 6] + y1 = [5.5, 9.5, 5.5, 1, 1, 5.5, 4, 4, 1] + shapes = line(x0, x1, y0, y1; xref="x", yref="y") + plot([trace1], + Layout(;shapes=shapes, xaxis_range=(1, 10), yaxis_range=(0, 10))) +end +house() +``` + +```@example shapes +function house2() + trace1 = scatter() + _p = string("M 2 1 L 2 5.5 L 5.5 9.6 L 9 5.5 L 9 1 L 2 1 ", + "M 2 5.5 L 9 5.5 ", + "M 5 1 L 5 4 L 6 4 L 6 1 Z") + plot([trace1], + Layout(;shapes=[path(_p)], xaxis_range=(1, 10), yaxis_range=(0, 10))) +end +house2() +``` + +```@example shapes +function clusters() + x0 = rand(Normal(2, 0.45), 300) + y0 = rand(Normal(2, 0.45), 300) + x1 = rand(Normal(6, 0.4), 200) + y1 = rand(Normal(6, 0.4), 200) + x2 = rand(Normal(4, 0.3), 200) + y2 = rand(Normal(4, 0.3), 200) + + data = [scatter(;x=x0, y=y0, mode="markers"), + scatter(;x=x1, y=y1, mode="markers"), + scatter(;x=x2, y=y2, mode="markers"), + scatter(;x=x1, y=y0, mode="markers")] + + args = [(x0, y0, "blue"), (x1, y1, "orange"), (x2, y2, "green"), + (x1, y0, "red")] + shapes = [circle(x0=minimum(x), y0=minimum(y), + x1=maximum(x), y1=maximum(y); + opacity=0.2, fillcolor=c, line_color=c) + for (x, y, c) in args] + plot(data, Layout(;height=400, width=480, showlegend=false, shapes=shapes)) +end +clusters() +``` + +```@example shapes +function temperature() + x = ["2015-02-01", "2015-02-02", "2015-02-03", "2015-02-04", "2015-02-05", + "2015-02-06", "2015-02-07", "2015-02-08", "2015-02-09", "2015-02-10", + "2015-02-11", "2015-02-12", "2015-02-13", "2015-02-14", "2015-02-15", + "2015-02-16", "2015-02-17", "2015-02-18", "2015-02-19", "2015-02-20", + "2015-02-21", "2015-02-22", "2015-02-23", "2015-02-24", "2015-02-25", + "2015-02-26", "2015-02-27", "2015-02-28"] + y = rand(1:20, length(x)) + data = scatter(;x=x, y=y, name="temperature", mode="line") + + shapes = rect(["2015-02-04", "2015-02-20"], ["2015-02-06", "2015-02-22"], + 0, 1; fillcolor="#d3d3d3", opacity=0.2, line_width=0, + xref="x", yref="paper") + plot(data, Layout(shapes=shapes, width=500, height=500)) +end +temperature() +``` + +```@example shapes +function vlines1() + # one scalar argument produces one line. Need to wrap in an array because + # layout.shapes should be an array + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = [vline(2)] + plot([trace1], Layout(;shapes=shapes)) +end +vlines1() +``` + +```@example shapes +function vlines2() + # one argument draws a vertical line up the entire plot + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = vline([2, 6]) + plot([trace1], Layout(;shapes=shapes)) +end +vlines2() +``` + +```@example shapes +function vlines3() + # yref paper makes the 2nd and 3rd arguments on a (0, 1) scale vertically + # so 0.5 is 1/2 through the plot regardless of the values on y-axis + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = vline([2, 6], 0, 0.5; yref="paper") + plot([trace1], Layout(;shapes=shapes)) +end +vlines3() +``` + +```@example shapes +function vlines4() + # Whichever argument is a scalar is repeated + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = vline([2, 6], 0, [0.5, 0.75]; yref="paper") + plot([trace1], Layout(;shapes=shapes)) +end +vlines4() +``` + +```@example shapes +function vlines5() + # we can also set arbitrary line attributes line color and dash + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = vline([2, 6], 0, [0.5, 0.75]; yref="paper", + line_color="green", line_dash="dashdot") + plot([trace1], Layout(;shapes=shapes)) +end +vlines5() +``` + +```@example shapes +function hlines1() + # one scalar argument produces one line. Need to wrap in an array because + # layout.shapes should be an array + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = [hline(2)] + plot([trace1], Layout(;shapes=shapes)) +end +hlines1() +``` + +```@example shapes +function hlines2() + # one argument draws a horizontal line across the entire plot + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = hline([25, 81]) + plot([trace1], Layout(;shapes=shapes)) +end +hlines2() +``` + +```@example shapes +function hlines3() + # xref paper makes the 2nd and 3rd arguments on a (0, 1) scale horizontally + # so 0.5 is 1/2 through the plot regardless of the values on x-axis + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = hline([25, 81], 0, 0.5; xref="paper") + plot([trace1], Layout(;shapes=shapes)) +end +hlines3() +``` + +```@example shapes +function hlines4() + # Whichever argument is a scalar is repeated + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = hline([25, 81], 0, [0.5, 0.75]; xref="paper") + plot([trace1], Layout(;shapes=shapes)) +end +hlines4() +``` + +```@example shapes +function hlines5() + # we can also set arbitrary line attributes line color and dash + trace1 = scatter(;x=1:10, y=(1:10).^2) + shapes = hline([25, 81], 0, [0.5, 0.75]; xref="paper", + line_color="green", line_dash="dashdot") + plot([trace1], Layout(;shapes=shapes)) +end +hlines5() +``` + diff --git a/docs/src/examples/subplots.md b/docs/src/examples/subplots.md new file mode 100644 index 00000000..998aa902 --- /dev/null +++ b/docs/src/examples/subplots.md @@ -0,0 +1,70 @@ +# Subplots + +```@example subplots +using PlotlyJS, Dates +include("../../../examples/line_scatter.jl") +``` + +```@example subplots +function subplots1() + p1 = linescatter1() + p2 = linescatter2() + p = [p1 p2] + p +end +subplots1() +``` + +```@example subplots +function subplots2() + p1 = linescatter1() + p2 = linescatter2() + p = [p1, p2] + p +end +subplots2() +``` + +```@example subplots +function subplots3() + p1 = linescatter6() + p2 = linescatter2() + p3 = linescatter3() + p4 = batman() + p = [p1 p2; p3 p4] + p.plot.layout["showlegend"] = false + p.plot.layout["width"] = 1000 + p.plot.layout["height"] = 600 + p +end +subplots3() +``` + +```@example subplots +function subplots_withcomprehension() + hcat([plot(scatter(x = 1:5, y = rand(5))) for i in 1:3]...) +end +subplots_withcomprehension() +``` + +```@example subplots +function subplots_withsharedaxes() + data = [ + scatter(x=1:3, y=2:4), + scatter(x=20:10:40, y=fill(5, 3), xaxis="x2", yaxis="y"), + scatter(x=2:4, y=600:100:800, xaxis="x", yaxis="y3"), + scatter(x=4000:1000:6000, y=7000:1000:9000, xaxis="x4", yaxis="y4") + ] + layout = Layout( + xaxis_domain=[0, 0.45], + yaxis_domain=[0, 0.45], + xaxis4=attr(domain=[0.55, 1.0], anchor="y4"), + xaxis2_domain=[0.55, 1], + yaxis3_domain=[0.55, 1], + yaxis4=attr(domain=[0.55, 1], anchor="x4") + ) + plot(data, layout) +end +subplots_withsharedaxes() +``` + diff --git a/docs/src/examples/tables.md b/docs/src/examples/tables.md new file mode 100644 index 00000000..c24084d7 --- /dev/null +++ b/docs/src/examples/tables.md @@ -0,0 +1,118 @@ +# Tables + +```@example tables +using PlotlyJS, DataFrames, CSV +``` + +```@example tables +function table1() + values = [ + "Salaries" 1200000 1300000 1300000 1400000 + "Office" 20000 20000 20000 20000 + "Merchandise" 80000 70000 120000 90000 + "Legal" 2000 2000 2000 2000 + "TOTAL" 12120000 130902000 131222000 14102000 + ] + + trace = table( + header=attr( + values=["Expenses", "Q1", "Q2", "Q3", "Q4"], + align="center", line=attr(width=1, color="black"), + fill_color="grey", font=attr(family="Arial", size=12, color="white") + ), + cells=attr( + values=values, align="center", line=attr(color="black", width=1), + font=attr(family="Arial", size=11, color="black") + ) + ) + plot(trace) + +end +table1() +``` + +```@example tables +function table2() + values = [ + "Salaries" 1200000 1300000 1300000 1400000 + "Office" 20000 20000 20000 20000 + "Merchandise" 80000 70000 120000 90000 + "Legal" 2000 2000 2000 2000 + "TOTAL" 12120000 130902000 131222000 14102000 + ] + + trace = table( + header=attr( + values=["EXPENSES", "Q1", "Q2", "Q3", "Q4"], + align=["left", "center"], line=attr(width=1, color="#506784"), + fill_color="#119DFF", + font=attr(family="Arial", size=12, color="white") + ), + cells=attr( + values=values, align=["left", "center"], + line=attr(color="#506784", width=1), + font=attr(family="Arial", size=11, color="#506784"), + fill_color=["#25FEFD", "white"] + ) + ) + plot(trace) + +end +table2() +``` + +```@example tables +function table2a() + p1 = table1() + restyle!(p1, + header=attr( + align=["left", "center"], line_color="#506784", fill_color="#119DFF" + ), + cells=attr( + align=["left", "center"], line_color="#506784", + fill_color=["#25FEFD", "white"], font_color="#506784" + ) + ) + p1 +end +table2a() +``` + +```@example tables +function table3() + nm = tempname() + url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" + download(url, nm) + df = CSV.read(nm) + rm(nm) + + data = Array(df) + + trace = table( + columnwidth=[200, 500, 600, 600, 400, 400, 600, 600, 600], + # columnorder=0:9, + header=attr( + values=map(x-> replace(string(x), '_' => '-'), names(df)), + align="center", + line=attr(width=1, color="rgb(50, 50, 50)"), + fill_color=["rgb(235, 100, 230)"], + font=attr(family="Arial", size=12, color="white") + ), + cells=attr( + values=Array(df), + align=["center", "center"], + line=attr(width=1, color="black"), + fill_color=["rgba(228, 222, 249, 0.65)", "rgb(235, 193, 238)", "rgba(228, 222, 249, 0.65)"], + font=attr(family="Arial", size=10, color="black") + ) + ) + + layout = Layout( + title="Bitcoin mining stats for 180 days", + width=1200 + ) + plot(trace, layout) +end +table3() +``` + diff --git a/docs/src/examples/ternary.md b/docs/src/examples/ternary.md new file mode 100644 index 00000000..b106ed77 --- /dev/null +++ b/docs/src/examples/ternary.md @@ -0,0 +1,118 @@ +# Ternary + +```@example ternary +using PlotlyJS, JSON +``` + +```@example ternary +function ternary_markers() + function make_ax(title, tickangle) + attr(title=title, titlefont_size=20, tickangle=tickangle, + tickfont_size=15, tickcolor="rgba(0, 0, 0, 0)", ticklen=5, + showline=true, showgrid=true) + end + + raw_data = [ + Dict(:journalist=>75, :developer=>:25, :designer=>0, :label=>"point 1"), + Dict(:journalist=>70, :developer=>:10, :designer=>20, :label=>"point 2"), + Dict(:journalist=>75, :developer=>:20, :designer=>5, :label=>"point 3"), + Dict(:journalist=>5, :developer=>:60, :designer=>35, :label=>"point 4"), + Dict(:journalist=>10, :developer=>:80, :designer=>10, :label=>"point 5"), + Dict(:journalist=>10, :developer=>:90, :designer=>0, :label=>"point 6"), + Dict(:journalist=>20, :developer=>:70, :designer=>10, :label=>"point 7"), + Dict(:journalist=>10, :developer=>:20, :designer=>70, :label=>"point 8"), + Dict(:journalist=>15, :developer=>:5, :designer=>80, :label=>"point 9"), + Dict(:journalist=>10, :developer=>:10, :designer=>80, :label=>"point 10"), + Dict(:journalist=>20, :developer=>:10, :designer=>70, :label=>"point 11") + ] + + t = scatterternary( + mode="markers", + a=[_x[:journalist] for _x in raw_data], + b=[_x[:developer] for _x in raw_data], + c=[_x[:designer] for _x in raw_data], + text=[_x[:label] for _x in raw_data], + marker=attr(symbol=100, color="#DB7365", size=14, line_width=2) + ) + layout = Layout( + ternary=attr( + sum=100, + aaxis=make_ax("Journalist", 0), + baxis=make_ax("Developer", 45), + caxis=make_ax("Designer", -45), + bgcolor="#fff1e0", + ), annotations=attr( + showarrow=false, + text="Replica of Tom Pearson's block", + x=1.0, y=1.3, font_size=15 + ), + paper_bgcolor="#fff1e0" + ) + plot(t, layout) +end +ternary_markers() +``` + +```@example ternary +function filled_ternary() + function make_ax(title) + attr( + title=title, + ticksuffix="%", + min=0.01, + linewidth=2, + ticks="outside", + ticklen=8, + showgrid=true + ) + end + + fn = tempname() + download("https://gist.githubusercontent.com/davenquinn/988167471993bc2ece29/raw/f38d9cb3dd86e315e237fde5d65e185c39c931c2/data.json", fn) + raw_data = JSON.parsefile(fn) + rm(fn) + + colors = [ + "#8dd3c7", + "#ffffb3", + "#bebada", + "#fb8072", + "#80b1d3", + "#fdb462", + "#b3de69", + "#fccde5", + "#d9d9d9", + "#bc80bd", + "#ccebc5", + "#ffed6f" + ] + + traces = Array{GenericTrace,1}(undef, length(raw_data)) + for (i, (k, v)) in enumerate(raw_data) + traces[i] = scatterternary(mode="lines", name=k, + a=[_x["clay"] for _x in v], + b=[_x["sand"] for _x in v], + c=[_x["silt"] for _x in v], + line_color="#444", + fill="toself", + fillcolor=colors[i], + hoveron="fills+points" + ) + end + layout = Layout( + ternary=attr( + sum=100, + aaxis=make_ax("Clay"), + baxis=make_ax("Sand"), + caxis=make_ax("Slit")), + showlegend=false, + width=700, + annotations=[attr( + showarrow=false, x=0.15, y=1.1, text="Soil types fill plot" + )] + ) + plot(traces, layout) +end +filled_ternary() +``` + diff --git a/docs/src/examples/time_series.md b/docs/src/examples/time_series.md new file mode 100644 index 00000000..2c409b39 --- /dev/null +++ b/docs/src/examples/time_series.md @@ -0,0 +1,14 @@ +# Time Series + +```@example time_series +using PlotlyJS +``` + +```@example time_series +function datetimestrings() + x = ["2013-10-04 22:23:00", "2013-11-04 22:23:00", "2013-12-04 22:23:00"] + plot(scatter(x=x, y=[1 ,3, 6])) +end +datetimestrings() +``` + diff --git a/docs/src/examples/violin.md b/docs/src/examples/violin.md new file mode 100644 index 00000000..6af36717 --- /dev/null +++ b/docs/src/examples/violin.md @@ -0,0 +1,162 @@ +# Violin + +```@example violin +using PlotlyJS, RDatasets, DataFrames +``` + +```@example violin +function violin_box_overlay() + y = abs.(100 .* randn(300)) + data = [ + violin(x0="sample 1", name="violin", y=y, points="all"), + box(x0="sample 1", name="box", y=y, boxpoints=false) + ] + plot(data, Layout(legend=attr(x=0.95, xanchor="right"))) +end +violin_box_overlay() +``` + +```@example violin +function violin_grouped() + days = repeat(["day 1", "day 2"], inner=5) + y_kale = [0.2, 0.2, 0.6, 1, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3] + y_radish = [0.6, 0.7, 0.3, 0.6, 0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2] + y_carrot = [0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1, 0.3, 0.6, 0.8, 0.5] + colors = ["#3D9970", "#FF4136", "#FF851B"] + names = ["kale", "radishes", "carrots"] + ys = (y_kale, y_radish, y_carrot) + + data = [ + violin( + y=y, name=name, x=days, span=[0, nothing], jitter=0, points="all", + marker=attr(symbol="line-ew", color=color, line=attr(color=color, width=2)) + ) for (y, name, color) in zip(ys, names, colors) + ] + layout = Layout( + yaxis=attr(zeroline=false, title="normalized moisture"), + violinmode="group" + ) + plot(data, layout) +end +violin_grouped() +``` + +```@example violin +function violin_nonlinear() + p1 = plot( + violin( + x=["1798-01-01", "1798-04-04", "1798-05-05", + "1798-05-05", "1798-07-05", "1798-07-22", "1799-01-01"], + orientation="h", box_visible=true, xcalendar="discworld", + name="discworld dates" + ) + ) + p2 = plot( + violin( + x=["A", "B", "C", "C", "C", "D", "G"], + orientation="h", box_visible=true, xcalendar="discworld", + name="categories" + ), Layout(xaxis_categoryarray='A':'G') + ) + p = [p1; p2] + relayout!(p, showlegend=false, margin_l=100) + p +end +violin_nonlinear() +``` + +```@example violin +function violin_old_faithful() + y = [79, 54, 74, 62, 85, 55, 88, 85, 51, 85, 54, 84, 78, 47, 83, 52, 62, + 84, 52, 79, 51, 47, 78, 69, 74, 83, 55, 76, 78, 79, 73, 77, 66, 80, 74, 52, + 48, 80, 59, 90, 80, 58, 84, 58, 73, 83, 64, 53, 82, 59, 75, 90, 54, 80, 54, + 83, 71, 64, 77, 81, 59, 84, 48, 82, 60, 92, 78, 78, 65, 73, 82, 56, 79, 71, + 62, 76, 60, 78, 76, 83, 75, 82, 70, 65, 73, 88, 76, 80, 48, 86, 60, 90, 50, + 78, 63, 72, 84, 75, 51, 82, 62, 88, 49, 83, 81, 47, 84, 52, 86, 81, 75, 59, + 89, 79, 59, 81, 50, 85, 59, 87, 53, 69, 77, 56, 88, 81, 45, 82, 55, 90, 45, + 83, 56, 89, 46, 82, 51, 86, 53, 79, 81, 60, 82, 77, 76, 59, 80, 49, 96, 53, + 77, 77, 65, 81, 71, 70, 81, 93, 53, 89, 45, 86, 58, 78, 66, 76, 63, 88, 52, + 93, 49, 57, 77, 68, 81, 81, 73, 50, 85, 74, 55, 77, 83, 83, 51, 78, 84, 46, + 83, 55, 81, 57, 76, 84, 77, 81, 87, 77, 51, 78, 60, 82, 91, 53, 78, 46, 77, + 84, 49, 83, 71, 80, 49, 75, 64, 76, 53, 94, 55, 76, 50, 82, 54, 75, 78, 79, + 78, 78, 70, 79, 70, 54, 86, 50, 90, 54, 54, 77, 79, 64, 75, 47, 86, 63, 85, + 82, 57, 82, 67, 74, 54, 83, 73, 73, 88, 80, 71, 83, 56, 79, 78, 84, 58, 83, + 43, 60, 75, 81, 46, 90, 46, 74] + plot(violin(y=y, points="all", name="Old Faithful", meanline_visible=true)) +end +violin_old_faithful() +``` + +```@example violin +function violin_side_by_side() + # requires RDatasets and DataFrames + tips = dataset("reshape2", "tips") + parts = zip( + ("Female", "Male"), + ("positive", "negative"), + ("#bebada", "#8dd3c7"), + (1.0, -0.6) + ) + traces = GenericTrace[] + for (sex, side, color, pointpos) in parts + sub_tips = tips[tips[:Sex] .== sex, :] + sub_traces = violin(sub_tips, + group=:Day, + x=:TotalBill, y0=(df) -> df[1, :Day], + side=side, orientation="h", + marker=attr(line=attr(width=2, color=color), symbol="line-ns"), + line_color=color, + hoveron="points+kde", text=(df) -> "Sample length $(size(df, 1))", + scalemode="count", scalegroup=sex, legendgroup=sex, name=sex, + points="all", jitter=0, pointpos=pointpos, + span=[0], + box_visible=true, meanline_visible=true, + showlegend=false, + ) + sub_traces[1][:showlegend] = true + append!(traces, sub_traces) + end + # TODO: make the layout + layout = Layout( + hovermode="closest", violinmode="overlay", + title="Total bill distribution
scaled by number of bills per gender", + legend_tracegroupgap=0, violingap=0, violingroupgap=0, + yaxis=attr(showgrid=true, categoryarray=["Thur", "Fri", "Sat", "Sun"]), + ) + plot(traces, layout) +end +violin_side_by_side() +``` + +```@example violin +function violin_style() + y1 = vcat(abs.(20 .* rand(100)), rand(UInt16, 300) .* 500 ./ typemax(UInt16)) + y2 = [25.261999999999997, 66.5419, 98.2114, 0.09070629 ] + box = attr(fillcolor="black", line_color="black", width=0.01) + span = [0, nothing] + trace1 = violin( + bandwidth=5, points=false, y=y1, name="Radial Velocity", + span=span, line_color="#67353E", box=box + ) + trace2 = violin( + bandwidth=5, points=false, y=y2, name="Pulsar Timing", + span=span, line_color="#34ABA2", box=box + ) + + layout = Layout( + paper_bgcolor="#d3d3d3", plot_bgcolor="#d3d3d3", + showlegend=false, violingap=0, xaxis_side="top", + yaxis=attr( + showline=false, showticklabels=false, range=(-5, 550), + zeroline=false, visible=false, showgrid=false, + ), + annotations=[attr( + text="Orbital Period Estimations", font_size=20, + xref="paper", yref="paper", showarrow=false, + )] + ) + plot([trace1, trace2], layout) +end +violin_style() +``` + diff --git a/docs/index.md b/docs/src/index.md similarity index 81% rename from docs/index.md rename to docs/src/index.md index 5a23a45b..4dc8a67b 100644 --- a/docs/index.md +++ b/docs/src/index.md @@ -15,7 +15,7 @@ The goals of PlotlyJS.jl are: plotly graphics to files [_plotlyjs]: https://plot.ly/javascript -[_plotlyref]: https://plot.ly/javascript/reference +[_plotlyref]: https://plotly.com/javascriptreference ## Installation @@ -32,10 +32,11 @@ to download the latest release of the plotly.js javascript library. ### Saving figures -If you would like to save your figures to files in a format other than json and -html, you will need to install the [ORCA.jl](https://github.com/sglyon/ORCA.jl) -package. See [exporting -figures](http://spencerlyon.com/PlotlyJS.jl/manipulating_plots/#saving-figures) +PlotlyJS.jl comes with built-in support for saving figures to files via the +integration between PlotlyBase.jl (a dependency of PlotlyJS.jl) and Plotly's +kaleido tool. + +See [exporting figures](http://juliaplots.org/PlotlyJS.jl/manipulating_plots/#saving-figures) for more information. ### Plots.jl diff --git a/docs/src/manipulating_plots.md b/docs/src/manipulating_plots.md new file mode 100644 index 00000000..ab48629d --- /dev/null +++ b/docs/src/manipulating_plots.md @@ -0,0 +1,161 @@ + + +There are various methods defined on the `Plot` type. We will cover a few of +them here, but consult the (forthcoming) API docs for more exhaustive coverage. + +## Julia functions + +`Plot` and `SyncPlot` both have implementations of common Julia methods: + +- `size`: returns the `width` and `layout` attributes in the plot's layout +- `copy`: create a shallow copy of all traces in the plot and the layout, but +create a new `divid` + +## API functions + +All exported functions from the plotly.js +[API](https://plotly.com/javascriptplotlyjs-function-reference/) have been +exposed to Julia and operate on both `Plot` and `SyncPlot` instances. Each of +these functions has semantics that match the semantics of plotly.js + +In PlotlyJS.jl these functions are spelled: + +- [`restyle!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyrestyle): edit attributes on one or more traces +- [`relayout!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyrelayout): edit attributes on the layout +- [`update!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyupdate): combination of `restyle!` and `relayout!` +- [`react!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyreact): In place updating of all traces and layout in plot. More efficient than constructing an entirely new plot from scratch, but has the same effect. +- [`addtraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyaddtraces): add traces to a plot at specified indices +- [`deletetraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlydeletetraces): delete specific traces from a plot +- [`movetraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlymovetraces): reorder traces in a plot +- [`redraw!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyredraw): for a redraw of an entire plot +- [`purge!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlypurge): completely remove all data and layout from the chart +- [`extendtraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyextendtraces): Extend specific attributes of one or more traces with more data by appending to the end of the attribute +- [`prependtraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyprependtraces): Prepend additional data to specific attributes on one or more traces + + +When any of these routines is called on a `SyncPlot` the underlying `Plot` +object (in the `plot` field on the `SyncPlot`) is updated and the plotly.js +function is called. This is where `SyncPlot` gets its name: when modifying a +plot, it keeps the Julia object and the display in sync. + + + +For more details on which methods are available for each of the above functions +consult the docstrings or (forthcoming) API documentation. + +!!! note + Be especially careful when trying to use `restyle!`, `extendtraces!`, and + `prependtraces!` to set attributes that are arrays. The semantics are a bit + subtle. Check the docstring for details and examples + +## Subplots + +A common task is to construct subpots, or plots with more than one set of axes. +This is possible using the declarative plotly.js syntax, but can be tedious at +best. + +PlotlyJS.jl provides a conveient syntax for constructing what we will +call regular grids of subplots. By regular we mean a square grid of plots. + +To do this we will make a pun of the `vcat`, `hcat`, and `hvcat` functions from +`Base` and leverage the array construction syntax to build up our subplots. + +Suppose we are working with the following plots: + +```@repl subplots +using PlotlyJS # hide +p1 = Plot(scatter(;y=randn(3))) +p2 = Plot(histogram(;x=randn(50), nbinsx=4)) +p3 = Plot(scatter(;y=cumsum(randn(12)), name="Random Walk")) +p4 = Plot([scatter(;x=1:4, y=[0, 2, 3, 5], fill="tozeroy"), + scatter(;x=1:4, y=[3, 5, 1, 7], fill="tonexty")]) +``` + +If we wanted to combine `p1` and `p2` as subplots side-by-side, we would do + +```@example subplots +[p1 p2] +``` + +If instead we wanted two rows and one column we could + +```@example subplots +[p3, p4] +``` + +Finally, we can make a 2x2 grid of subplots: + +```@example subplots +[p1 p2 + p3 p4] +``` + +## Saving figures + + +Figures can be saved in a variety of formats using the `savefig` function. + +!!! note + Note that the docs below are shown for the `PlotlyBase.Plot` type, but are also defined for `PlotlyJS.SyncPlot`. Thus, you can use these methods after calling either `plot` or `Plot`. + +This function has a few methods: + +**1** + +```@docs +savefig(::Union{PlotlyBase.Plot}, ::String) +``` + +When using this method the format of the file is inferred based on the extension +of the second argument. The examples below show the possible export formats: + +```julia +savefig(p::Union{Plot,SyncPlot}, "output_filename.pdf") +savefig(p::Union{Plot,SyncPlot}, "output_filename.html") +savefig(p::Union{Plot,SyncPlot}, "output_filename.json") +savefig(p::Union{Plot,SyncPlot}, "output_filename.png") +savefig(p::Union{Plot,SyncPlot}, "output_filename.svg") +savefig(p::Union{Plot,SyncPlot}, "output_filename.jpeg") +savefig(p::Union{Plot,SyncPlot}, "output_filename.webp") +``` + +**2** + +```julia +savefig( + io::IO, + p::Plot; + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + format::String="png" +) +``` + +This method allows you to save a plot directly to an open IO stream. + +See the [`savefig(::IO, ::PlotlyBase.Plot)`](@ref) API docs for more information. + +**3** + +```julia +Base.show(::IO, ::MIME, ::Union{PlotlyBase.Plot}) +``` + +This method hooks into Julia's rich display system. + +Possible arguments for the second argument are shown in the examples below: + +```julia +savefig(io::IO, ::MIME"application/pdf", p::Union{Plot,SyncPlot}) +savefig(io::IO, ::MIME"image/png", p::Union{Plot,SyncPlot}) +savefig(io::IO, ::MIME"image/svg+xml", p::Union{Plot,SyncPlot}) +savefig(io::IO, ::MIME"image/eps", p::Union{Plot,SyncPlot}) +savefig(io::IO, ::MIME"image/jpeg", p::Union{Plot,SyncPlot}) +savefig(io::IO, ::MIME"application/json", p::Union{Plot,SyncPlot}) +savefig(io::IO, ::MIME"application/json; charset=UTF-8", p::Union{Plot,SyncPlot}) +``` + +!!! note + You can also save the json for a figure by calling + `savejson(p::Union{Plot,SyncPlot}, filename::String)`. diff --git a/docs/styles.md b/docs/src/styles.md similarity index 100% rename from docs/styles.md rename to docs/src/styles.md diff --git a/docs/syncplots.md b/docs/src/syncplots.md similarity index 53% rename from docs/syncplots.md rename to docs/src/syncplots.md index 253deab1..229657f0 100644 --- a/docs/syncplots.md +++ b/docs/src/syncplots.md @@ -1,3 +1,9 @@ +# Putting it Together + +```@meta +CurrentModule = PlotlyJS +``` + We will now look at how to combine traces and a layout to create a plot. We'll also discuss how to integrate with various frontends @@ -38,80 +44,30 @@ Notice that none of the recommended constructors have you pass the `divid` field manually. This is an internal field used to allow the display and unique identification of multiple plots in a single web page. -### Convenience methods +### [Convenience methods](@id constructors) There are also a number of convenience methods to the `Plot` function that will attempt to construct the traces for you. They have the following signatures -```julia -# Build a trace of type `kind` from x and y -- apply all kwargs to this trace -Plot(x::AbstractVector, y::AbstractVector, l::Layout=Layout(); kind="scatter", kwargs...) - -# Build one trace of type `kind` for each column of the matrix `y`. Repeat the -# `x` argument for all traces. Apply `kwargs` identically to all traces -Plot(x::AbstractVector, y::AbstractMatrix, l::Layout=Layout(); kind="scatter", kwargs...) - -# For `x` and `y` with the same number of columns, build one trace of type -# `kind` for each column pair, applying all `kwargs` identically do all traces -Plot(x::AbstractMatrix, y::AbstractMatrix, l::Layout=Layout(); kind="scatter", kwargs...) - -# For any array of eltype `_Scalar` (really data, see PlotlyJS._Scalar), call -# the method `Plot(1:size(y, 1), y, l; kwargs...)` described above -Plot{T<:_Scalar}(y::AbstractArray{T}, l::Layout=Layout(); kwargs...) - -# Create one trace by applying `f` at 50 evenly spaced points from `x0` to `x1` -Plot(f::Function, x0::Number, x1::Number, l::Layout=Layout(); kwargs...) - -# Create one trace for each function `f ∈ fs` by applying `f` at 50 evenly -# spaced points from `x0` to `x1` -Plot(fs::AbstractVector{Function}, x0::Number, x1::Number, l::Layout=Layout(); kwargs...) - -# Construct one or more traces using data from the DataFrame `df` when possible -# If `group` is a symbol and that symbol matches one of the column names of -# `df`, make one trace for each unique value in the column `df[group]` (see -# example below) -Plot(df::AbstractDataFrame, l::Layout=Layout(); group=nothing, kwargs...) - -# Use the column `df[x]` as the x value on each trace. Similar for `y` -Plot(df::AbstractDataFrame, x::Symbol, y::Symbol, l::Layout=Layout(); group=nothing, kwargs...) - -# Use the column `df[y]` as the y value on each trace -Plot(df::AbstractDataFrame, y::Symbol, l::Layout=Layout(); group=nothing, kwargs...) +```@docs +PlotlyBase.Plot ``` -For more information on how these methods work please see the docstring for the -`Plot` function by calling `?Plot` from the REPL. - Especially convenient is the `group` keyword argument when calling `Plot(::AbstractDataFrame, ... ; ...)`. Here is an example below: -```jlcon -julia> using RDatasets - -julia> iris = dataset("datasets", "iris"); - -julia> p = Plot(iris, x=:SepalLength, y=:SepalWidth, mode="markers", marker_size=8, group=:Species) -data: [ - "scatter with fields marker, mode, name, type, x, and y", - "scatter with fields marker, mode, name, type, x, and y", - "scatter with fields marker, mode, name, type, x, and y" -] - -layout: "layout with field margin" - +```@repl iris_group +using PlotlyJS # hide +using RDatasets +iris = dataset("datasets", "iris"); +p = Plot(iris, x=:SepalLength, y=:SepalWidth, mode="markers", marker_size=8, group=:Species) ``` which would result in the following plot -
- - +```@example iris_group +p +``` ## `SyncPlot`s @@ -145,12 +101,12 @@ plot (the `Plot` instance) in sync with a plot with a frontend. `plot` By leveraging WebIO.jl we can render our figures anywhere WebIO can render. At -time of writing this includes [Jupyter notebooks](http://jupyter.org/), +time of writing this includes [Jupyter notebooks](https://jupyter.org/), [Jupyterlab](https://github.com/jupyterlab/jupyterlab), [Mux.jl](https://github.com/JuliaWeb/Mux.jl) web apps, the -[Juno](http://junolab.org/) Julia environment inside the Atom text editor, and -Electron windows from [Blink.jl](https://github.com/JunoLab/Blink.jl). Please -see the [WebIO.jl readme]((https://github.com/JuliaGizmos/WebIO.jl)) for +[Juno](https://junolab.org/) Julia environment inside the Atom text editor, and +Electron windows from [Blink.jl](https://github.com/JuliaGizmos/Blink.jl). Please +see the [WebIO.jl readme](https://github.com/JuliaGizmos/WebIO.jl) for additional (and up to date!) information. When using PlotlyJS.jl at the Julia REPL a plot will automatically be displayed @@ -161,7 +117,7 @@ line. Alternatively you can call `display(p)`. In addition to being able to see our charts in many front-end environments, WebIO also provides a 2-way communication bridge between javascript and Julia. In fact, when a `SyncPlot` is constructed, we automatically get listeners for -all [plotly.js javascript events](https://plot.ly/javascript/plotlyjs-events/). +all [plotly.js javascript events](https://plotly.com/javascriptplotlyjs-events/). What's more is that we can hook up Julia functions as callbacks when those events are triggered. In the very contrived example below we have Julia print out details regarding points on a plot whenever a user hovers over them on the @@ -212,12 +168,12 @@ When calling `plot` the `options` keyword argument is given special treatment. It should be an instance of `AbstractDict` and its contents are passed as display options to the plotly.js library. For details on which options are supported, see the [plotly.js documentation on the -subject](https://plot.ly/javascript/configuration-options/). +subject](https://plotly.com/javascriptconfiguration-options/). As an example, if we were to execute the following code, we would see a static chart (no hover information or ability to zoom/pan) with 4 lines instead of an interactive one: -``` +```julia plot(rand(10, 4), options=Dict(:staticPlot => true)) ``` diff --git a/docs/theme/__init__.py b/docs/theme/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/theme/assets/fonts/icon.eot b/docs/theme/assets/fonts/icon.eot deleted file mode 100755 index 8f81638c2de436e1b5cc77b6a2693b2b347a0151..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2224 zcmaJDYiN^K^qhP1ZcHEMVbZM4%Vs7uwoQ|)E~(XOx7OBXnq))T&RAn>*Cw^Cqp}}H zWH6912NR|+2m5JcjIkeMjv=!Q9249yfx%!u#)^-T>W{&MHQBjeBBo>Pe4KmF^E>CB z@7#O8&r|?g2oV@;1cVDHB*W2-a$#G6b3^#>-#P#loPbHlK$=uKI0z}2f>SUHNmw9> z5fUU>fJL$rHa6%4A9RqW){j^bqzea^bdbuq5*;Zk-LE^Cdn?+_Wk$3IeMJy!S`Wh)UMyN+J zdS?0mGDhF6kI!%~<+qJq>2&vEpxeis4jnV-TbREq7%~}5A-CPp7U&N8yNm|C!pSZ= z>RMgx`%^o6Qv2I!?&%)eT36VWFT?1`lcUl3`6$Mm(PLi)Z77M4~2lu_KixyTMMWFbEgdpD<-HjI^xqTD%xRVN3f% z27EufM7BCq_F{-eA6ANNH2Jt&hXy?n=(b9Pj&yDA7Bp1}?(gblf$p{dxyryAvDrJc zt^F=*bbI@7kDasKZ>5j8H`V(+mJUPmWnFWsN4v+*4sUM2nLSNzr@QTW$GB0}ROgND*=9A% zw1)nnmfd#y?v|l`gH~p?ZtFkf)fup1^YGd6?&$gJGyIAekox zZ*nZ1`&86Qhw@P=Z(>&x;ARp0>8hS~9}KyeD>li(=rCx4^e?QEnx+3`oEyA6+GNZnmZ#7YHL z5IITs5QomaULXEb^rwKI?mhVE*tF(gTJylu*7C253QKlw|iZm6P z(d9W@r8&tvtF(;hi7G9p>(o@G6(o;TX$^Ek_QYf+{q!nMq!t!WWYV@yU&nvnzqQ7- z^ug5BsoCVh#%sLRU?7uTvQ4GZsfFZH>X_~5Y1`mrW+anI`(Qx2;FrKgKL9DZ>czF6 gge97fk?bg(rg2dERTv>l@iX9~idJf0Tk{R{Kaui$V*mgE diff --git a/docs/theme/assets/fonts/icon.svg b/docs/theme/assets/fonts/icon.svg deleted file mode 100755 index 86250e7b..00000000 --- a/docs/theme/assets/fonts/icon.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/theme/assets/fonts/icon.ttf b/docs/theme/assets/fonts/icon.ttf deleted file mode 100755 index b5ab5601bed7765790037c721c2ee1c7d444a7a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2072 zcmaJ>ZD^ZS6h7zPd^bx!mX9TkZNApHq|4go%g&_h)~(vEUF()a8EswGW$kL4bZsXc z{#b?xf`|$Z+`tL`T!ufyAL2xYE5gLVlqDbt{t(MPB;9@p4s7DNZ{D%&kLTsw`<$

vJhI<5Xe z^&QFMB)b;UtBYWSqa?48?8v4UGUKsFzmfbg(%Sf&xy$DPi zbfnwchv86wxm^ZkGPbc`Pb6wFS)yL2t0NqW1bfUTqsq-LxEk6$od+|!dou?+Y3~h9 zY;P#-DOO?Z^y#tj#l>+<>OGUe-8Hl1=4scviv7i!dF-^PzW_;|q^3}((HZq>k@AFj za`SOHRw-aIR%U7}ZV;|qiIO54r&n>b%tw?$r;Xb*d)E+ zLNcE$rBZdZYot1yCMT7`AXeUd%+%!=(zRk6$#NWpFMS^h;0NI)@-?8k52LgOu-0U= zCBVG~G#Lq?*De7A**d&!XpsRA_VlrEs3T0F3b4l=&MtlXfX6<*vvZ`^$=Tkwvd6qz z8iPJtmnr?Sp|w$G)EeJ75P4^Ki&gI)c_r2P(eIxe!uGI<-PJcMj4@A(P2KKs_Ky0u zY-`}I-b1@A;pd_gcHE*z#F6Dju3&7>Vf1w|G`p?(`K!fQwLxu;wu}Bk^=rD%Wq6eY zc~C6oNH~UGRY!LKyE`J?ZP;y&M5){Wr@4s+Fxq9d^dSupt=(pox{WSsVA7_dyGQ%T zkLHfS+_m?{LzCx6wl?A1z80_B+wr_>(yVA{@F(`|uv-;+)4*`sUZ-@(rOxUz_){IXb+m(ESuc#BROaaae4B#(WznI{#M;k znD=Nk8f^~`59wO>`-Z2YR;7NICpfCtZB^K&&Rt51V#M4rnyDoB(|4iA;f>}+;x z5otP{++V0d0sZLTyuwn%euOGiis-N8X;i3RN$~RmPl`F;uH@0}4XCtm2B;alSGl#i zTDf&^@W;=v^QH}3D}UNqE(z!PfayTO(nue&J!2t7nh~I_*9l`!Y*`4VjnRT zN2H^_cpFT>oA54t4&T6Sd;!12+jyTTn2qcrYZJUi-4XPpI!TZh1AHOZh9ZTG8Fll3 zj5+Cd%2+}8sEn2L{p)3{B7Lunbzp;&lo1tL(rCz1!wd{CB4bYaZW${GPsvybX0XUu zMf$jmbr6F5sp(u6PQf(fAe+i8EuYF|9o>O0NI?dcV3|y000$i$fUbJydVDxDb7nrh z1cxbT2F}1dq+zMvVKA3nam-}0nWgkf=7i(;S;x?HZZwz624GN1utF(jC^{>pO~VT9 cCrEc3&eA$0)i+9>qL=`6wATCjoC1DrZ;vj6}9 diff --git a/docs/theme/assets/fonts/icon.woff b/docs/theme/assets/fonts/icon.woff deleted file mode 100755 index ed0f20d5b80ab98072f3557225b3333e01b78670..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2148 zcmaJ?U2M};6hG(Qeym;Bb)z4&t6RTVr5$BkzZkY-Fqm#^Y(iTNVUx0zjk&dB8w&A( z8e?KYjQT(#L^1J^5+8grk{BY32}Tk$w26s{CdP%2q=N?^NL=f=|NfEk;{E5G`#WF% zbMEQ+-@ZLQGz18=8fKtT+PBtZfuCRFM|SoCU;}B73uHeVHCj?Ez9{;wK zTUn*D_W$R{332`_ehf+gc8O7y@KJ5YhY&;!$@L2j^^(8?0P8LMM)d{^a3azm(bMIS zfRu%hoooWzi3=|~D5MA-b&3&2aI9i2uExtracIOW6c|0?H$$~W zZ9y!=*Vf_)tPsDs7NdhB6d}+3tSBZMy=t#;i_#gmKVB}!H#Q{BF2%~_Sb0P64eD(k z3OrBm<)9XEQD?aJn4IA}hfUH8DkSsCQYuwfJIy)O;WRm^6b7;K<`bqa$B>Q{+ent< zD0~4L6~GU|%jBy^bw5Ul2e8&;vn9a2dNdgcpw}(|J=r?F?P!q!5BB!6aHum(p$f3a z9nNlD$DqePv7>9W&&k=|ce2O5P0c}{t=p7-Mc>w}HEN7+9*Dd@(qz@SM_)~Kee(OK zhp;1TV)t|{3S-REYEyT3oPA^drmcrvRh&Z~^%oU97IgGw;hGw@_ zw{WdEr`D^@(GJmHsD4A|xdN||AP+eZdXI)&A~eej51Z$iVC(RU|96Bn+}^DBZUFQ1>X@m8%S;;ip%T zC`Qa3qnS!_KYb@^(9x;gEzTCV29c)2$^C^Y6wr_U&8sX$|R8 z@T8dYZAu>9)`&_AXLP3y-LKp}d$w}>{?LzKVAm}hwpISJ-KyNBN%K)miDJY&YUw3m zx5+}J)FAUE5{XIzOY|hKUAvk}<+<;l66GmTOp2rQJq25wUUv)C$xc41+%-H(AWe5A zm8g_hNz^3KLmYYUjpo?jVm`(C<=%tOpY8ImEbel;MWjV>(tSr4mRQ8ao9dULW~r$} z7|D5}0$p)g+KbO*$tLVVmn8BLQE{}iV1#!1Z+QzofG^=&xP!a!YrKOGn1b2JF0vZn zb?S~-Ppgvznd#vxxi%CjWX!0W2V~4izeC0f!bfGSr0-uRV-@N9WUK`noTQAX(2%Bq zEH%tP52G^Xr0R1(LwEqj{ug`Uae@E< diff --git a/docs/theme/assets/images/favicon-e565ddfa3b.ico b/docs/theme/assets/images/favicon-e565ddfa3b.ico deleted file mode 100644 index e85006a3ce1c6fd81faa6d5a13095519c4a6fc96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcmd6lF-yZh9L1kl>(HSEK`2y^4yB6->f+$wD)=oNY!UheIt03Q=;qj=;8*Bap_4*& za8yAl;wmmx5Yyi^7dXN-WYdJ-{qNqpcez|5t#Fr0qTSYcPTG`I2PBk8r$~4kg^0zN zCJe(rhix3do!L$bZ+IuZ{i08x=JR3=e+M4pv0KsKA??{u_*EFfo|`p&t`Vf=jn{)F z1fKk9hWsmYwqWAP^JO*5u*R;*L&dX3H$%S7oB$f0{ISh{QVXuncnzN67WQH2`lip7 zhX+VI$6x$1+$8gMjh4+1l0N#8_0Fh=N#EwpKk{SeE!)SHFB@xQFX3y+8sF#_@!bDW eIdI-IC`$c%>bk?KbPeN9RHtL<1^)v~#xMt8oB^@` diff --git a/docs/theme/assets/images/favicon.ico b/docs/theme/assets/images/favicon.ico deleted file mode 100644 index e85006a3ce1c6fd81faa6d5a13095519c4a6fc96..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcmd6lF-yZh9L1kl>(HSEK`2y^4yB6->f+$wD)=oNY!UheIt03Q=;qj=;8*Bap_4*& za8yAl;wmmx5Yyi^7dXN-WYdJ-{qNqpcez|5t#Fr0qTSYcPTG`I2PBk8r$~4kg^0zN zCJe(rhix3do!L$bZ+IuZ{i08x=JR3=e+M4pv0KsKA??{u_*EFfo|`p&t`Vf=jn{)F z1fKk9hWsmYwqWAP^JO*5u*R;*L&dX3H$%S7oB$f0{ISh{QVXuncnzN67WQH2`lip7 zhX+VI$6x$1+$8gMjh4+1l0N#8_0Fh=N#EwpKk{SeE!)SHFB@xQFX3y+8sF#_@!bDW eIdI-IC`$c%>bk?KbPeN9RHtL<1^)v~#xMt8oB^@` diff --git a/docs/theme/assets/javascripts/application-dfb6964a49.js b/docs/theme/assets/javascripts/application-dfb6964a49.js deleted file mode 100644 index cfff0981..00000000 --- a/docs/theme/assets/javascripts/application-dfb6964a49.js +++ /dev/null @@ -1 +0,0 @@ -function pegasus(t,e){return e=new XMLHttpRequest,e.open("GET",t),t=[],e.onreadystatechange=e.then=function(n,o,i,r){if(n&&n.call&&(t=[,n,o]),4==e.readyState&&(i=t[0|e.status/200])){try{r=JSON.parse(e.responseText)}catch(s){r=null}i(r,e)}},e.send(),e}if("document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,o=arguments.length;for(n=0;o>n;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}():!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",o=t.Element[n],i=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,i=n.length;i>o;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=l[n]=[],d=function(){return new l(this)};if(a[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,o=e.length,i=!1;do t=e[n]+"",-1===c(this,t)&&(this.push(t),i=!0);while(++nc;c++)a[s[c]]=i(a[s[c]],a);n&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,o){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,o):i.call(e,t,n,o)},e.addEventListener=function(t,n,o){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),o):i.call(e,t,n,o)}),"function"==typeof e.onclick&&(r=e.onclick,e.addEventListener("click",function(t){r(t)},!1),e.onclick=null)}}var e=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!e,o=/iP(ad|hone|od)/.test(navigator.userAgent)&&!e,i=o&&/OS 4_\d(_\d)?/.test(navigator.userAgent),r=o&&/OS [6-7]_\d/.test(navigator.userAgent),s=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(o&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,o;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),o=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return n&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;o&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,r;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],o){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTimen||Math.abs(e.pageY-this.touchStartY)>n},t.prototype.onTouchMove=function(t){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,s,a,c,l,u=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,s=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,r&&(l=t.changedTouches[0],u=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||u,u.fastClickScrollParent=this.targetElement.fastClickScrollParent),a=u.tagName.toLowerCase(),"label"===a){if(e=this.findControl(u)){if(this.focus(u),n)return!1;u=e}}else if(this.needsFocus(u))return t.timeStamp-s>100||o&&window.top!==window&&"input"===a?(this.targetElement=null,!1):(this.focus(u),this.sendClick(u,t),o&&"select"===a||(this.targetElement=null,t.preventDefault()),!1);return o&&!i&&(c=u.fastClickScrollParent,c&&c.fastClickLastScrollTop!==c.scrollTop)?!0:(this.needsClick(u)||(t.preventDefault(),this.sendClick(u,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return this.targetElement?t.forwardedTouchEvent?!0:t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1):!0:!0},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail?!0:(e=this.onMouse(t),e||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,o,i,r;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(s&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction?!0:(r=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],r>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(-1!==e.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===t.style.touchAction||"manipulation"===t.style.touchAction)},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?(module.exports=t.attach,module.exports.FastClick=t):window.FastClick=t}(),function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.6.0",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.utils.asString=function(t){return void 0===t||null===t?"":t.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(e){return arguments.length&&null!=e&&void 0!=e?Array.isArray(e)?e.map(function(e){return t.utils.asString(e).toLowerCase()}):e.toString().trim().toLowerCase().split(t.tokenizer.seperator):[]},t.tokenizer.seperator=/[\s\-]+/,t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var o=t.Pipeline.registeredFunctions[e];if(!o)throw new Error("Cannot load un-registered function: "+e);n.add(o)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(e);if(-1==o)throw new Error("Cannot find existingFn");o+=1,this._stack.splice(o,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(e);if(-1==o)throw new Error("Cannot find existingFn");this._stack.splice(o,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,o=this._stack.length,i=0;n>i;i++){for(var r=t[i],s=0;o>s&&(r=this._stack[s](r,i,t),void 0!==r&&""!==r);s++);void 0!==r&&""!==r&&e.push(r)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var o=this.list;if(!o)return this.list=new t.Vector.Node(e,n,o),this.length++;if(en.idx?n=n.next:(o+=e.val*n.val,e=e.next,n=n.next);return o},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(r===t)return i;t>r&&(e=i),r>t&&(n=i),o=n-e,i=e+Math.floor(o/2),r=this.elements[i]}return r===t?i:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,o=n-e,i=e+Math.floor(o/2),r=this.elements[i];o>1;)t>r&&(e=i),r>t&&(n=i),o=n-e,i=e+Math.floor(o/2),r=this.elements[i];return r>t?i:t>r?i+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,o=0,i=0,r=this.length,s=e.length,a=this.elements,c=e.elements;;){if(o>r-1||i>s-1)break;a[o]!==c[i]?a[o]c[i]&&i++:(n.add(a[o]),o++,i++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,o;return this.length>=t.length?(e=this,n=t):(e=t,n=this),o=e.clone(),o.add.apply(o,n.toArray()),o},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var o={},i=new t.SortedSet,r=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(t.tokenizer(e[n.name]));o[n.name]=r,t.SortedSet.prototype.add.apply(i,r)},this),this.documentStore.set(r,i),t.SortedSet.prototype.add.apply(this.corpusTokens,i.toArray());for(var s=0;s0&&(o=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=o},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),o=new t.Vector,i=[],r=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*r,c=this,l=this.tokenStore.expand(e).reduce(function(n,i){var r=c.corpusTokens.indexOf(i),s=c.idf(i),l=1,u=new t.SortedSet;if(i!==e){var d=Math.max(3,i.length-e.length);l=1/Math.log(d)}r>-1&&o.insert(r,a*s*l);for(var h=c.tokenStore.get(i),f=Object.keys(h),p=f.length,m=0;p>m;m++)u.add(h[f[m]].ref);return n.union(u)},new t.SortedSet);i.push(l)},this);var a=i.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:o.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),o=n.length,i=new t.Vector,r=0;o>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[e].tf,c=this.idf(s);i.insert(this.corpusTokens.indexOf(s),a*c)}return i},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,o){return n[o]=t.SortedSet.load(e.store[o]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",o="[aeiouy]",i=n+"[^aeiouy]*",r=o+"[aeiou]*",s="^("+i+")?"+r+i,a="^("+i+")?"+r+i+"("+r+")?$",c="^("+i+")?"+r+i+r+i,l="^("+i+")?"+o,u=new RegExp(s),d=new RegExp(c),h=new RegExp(a),f=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,y=/.$/,w=/(at|bl|iz)$/,S=new RegExp("([^aeiouylsz])\\1$"),k=new RegExp("^"+i+o+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,x=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,b=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,T=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,C=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,A=new RegExp("^"+i+o+"[^aeiouwxy]$"),O=function(n){var o,i,r,s,a,c,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=g,s.test(n)){var O=s.exec(n);s=u,s.test(O[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var O=a.exec(n);o=O[1],a=f,a.test(o)&&(n=o,a=w,c=S,l=k,a.test(n)?n+="e":c.test(n)?(s=y,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=E,s.test(n)){var O=s.exec(n);o=O[1],n=o+"i"}if(s=x,s.test(n)){var O=s.exec(n);o=O[1],i=O[2],s=u,s.test(o)&&(n=o+t[i])}if(s=b,s.test(n)){var O=s.exec(n);o=O[1],i=O[2],s=u,s.test(o)&&(n=o+e[i])}if(s=T,a=C,s.test(n)){var O=s.exec(n);o=O[1],s=d,s.test(o)&&(n=o)}else if(a.test(n)){var O=a.exec(n);o=O[1]+O[2],a=d,a.test(o)&&(n=o)}if(s=L,s.test(n)){var O=s.exec(n);o=O[1],s=d,a=h,c=A,(s.test(o)||a.test(o)&&!c.test(o))&&(n=o)}return s=_,a=d,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return O}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.generateStopWordFilter=function(t){var e=t.reduce(function(t,e){return t[e]=e,t},{});return function(t){return t&&e[t]!==t?t:void 0}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,o=t.charAt(0),i=t.slice(1);return o in n||(n[o]={docs:{}}),0===i.length?(n[o].docs[e.ref]=e,void(this.length+=1)):this.add(i,e,n[o])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;nt){for(;" "!=this[t]&&--t>0;);return this.substring(0,t)+"…"}return this},HTMLElement.prototype.wrap=function(t){t.length||(t=[t]);for(var e=t.length-1;e>=0;e--){var n=e>0?this.cloneNode(!0):this,o=t[e],i=o.parentNode,r=o.nextSibling;n.appendChild(o),r?i.insertBefore(n,r):i.appendChild(n)}},document.addEventListener("DOMContentLoaded",function(){"use strict";Modernizr.addTest("ios",function(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}),Modernizr.addTest("standalone",function(){return!!navigator.standalone}),FastClick.attach(document.body);var t=document.getElementById("toggle-search"),e=(document.getElementById("reset-search"),document.querySelector(".drawer")),n=document.querySelectorAll(".anchor"),o=document.querySelector(".search .field"),i=document.querySelector(".query"),r=document.querySelector(".results .meta");Array.prototype.forEach.call(n,function(t){t.querySelector("a").addEventListener("click",function(){document.getElementById("toggle-drawer").checked=!1,document.body.classList.remove("toggle-drawer")})});var s=window.pageYOffset,a=function(){var t=window.pageYOffset+window.innerHeight,n=Math.max(0,window.innerHeight-e.offsetHeight);t>document.body.clientHeight-(96-n)?"absolute"!=e.style.position&&(e.style.position="absolute",e.style.top=null,e.style.bottom=0):e.offsetHeighte.offsetTop+e.offsetHeight?(e.style.position="fixed",e.style.top=null,e.style.bottom="-96px"):window.pageYOffsets?e.style.top&&(e.style.position="absolute",e.style.top=Math.max(0,s)+"px",e.style.bottom=null):e.style.bottom&&(e.style.position="absolute",e.style.top=t-e.offsetHeight+"px",e.style.bottom=null),s=Math.max(0,window.pageYOffset)},c=function(){var t=document.querySelector(".main");window.removeEventListener("scroll",a),matchMedia("only screen and (max-width: 959px)").matches?(e.style.position=null,e.style.top=null,e.style.bottom=null):e.offsetHeight+96o;o++)t1e4?n=(n/1e3).toFixed(0)+"k":n>1e3&&(n=(n/1e3).toFixed(1)+"k");var o=document.querySelector(".repo-stars .count");o.innerHTML=n},function(t,e){console.error(t,e.status)})}),"standalone"in window.navigator&&window.navigator.standalone){var node,remotes=!1;document.addEventListener("click",function(t){for(node=t.target;"A"!==node.nodeName&&"HTML"!==node.nodeName;)node=node.parentNode;"href"in node&&-1!==node.href.indexOf("http")&&(-1!==node.href.indexOf(document.location.host)||remotes)&&(t.preventDefault(),document.location.href=node.href)},!1)} \ No newline at end of file diff --git a/docs/theme/assets/javascripts/application.js b/docs/theme/assets/javascripts/application.js deleted file mode 100644 index cfff0981..00000000 --- a/docs/theme/assets/javascripts/application.js +++ /dev/null @@ -1 +0,0 @@ -function pegasus(t,e){return e=new XMLHttpRequest,e.open("GET",t),t=[],e.onreadystatechange=e.then=function(n,o,i,r){if(n&&n.call&&(t=[,n,o]),4==e.readyState&&(i=t[0|e.status/200])){try{r=JSON.parse(e.responseText)}catch(s){r=null}i(r,e)}},e.send(),e}if("document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,o=arguments.length;for(n=0;o>n;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}():!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",o=t.Element[n],i=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,i=n.length;i>o;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=l[n]=[],d=function(){return new l(this)};if(a[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,o=e.length,i=!1;do t=e[n]+"",-1===c(this,t)&&(this.push(t),i=!0);while(++nc;c++)a[s[c]]=i(a[s[c]],a);n&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,o){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,o):i.call(e,t,n,o)},e.addEventListener=function(t,n,o){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),o):i.call(e,t,n,o)}),"function"==typeof e.onclick&&(r=e.onclick,e.addEventListener("click",function(t){r(t)},!1),e.onclick=null)}}var e=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!e,o=/iP(ad|hone|od)/.test(navigator.userAgent)&&!e,i=o&&/OS 4_\d(_\d)?/.test(navigator.userAgent),r=o&&/OS [6-7]_\d/.test(navigator.userAgent),s=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(o&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,o;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),o=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return n&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;o&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,r;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],o){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTimen||Math.abs(e.pageY-this.touchStartY)>n},t.prototype.onTouchMove=function(t){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,s,a,c,l,u=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,s=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,r&&(l=t.changedTouches[0],u=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||u,u.fastClickScrollParent=this.targetElement.fastClickScrollParent),a=u.tagName.toLowerCase(),"label"===a){if(e=this.findControl(u)){if(this.focus(u),n)return!1;u=e}}else if(this.needsFocus(u))return t.timeStamp-s>100||o&&window.top!==window&&"input"===a?(this.targetElement=null,!1):(this.focus(u),this.sendClick(u,t),o&&"select"===a||(this.targetElement=null,t.preventDefault()),!1);return o&&!i&&(c=u.fastClickScrollParent,c&&c.fastClickLastScrollTop!==c.scrollTop)?!0:(this.needsClick(u)||(t.preventDefault(),this.sendClick(u,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return this.targetElement?t.forwardedTouchEvent?!0:t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1):!0:!0},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail?!0:(e=this.onMouse(t),e||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,o,i,r;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(s&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction?!0:(r=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],r>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(-1!==e.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===t.style.touchAction||"manipulation"===t.style.touchAction)},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?(module.exports=t.attach,module.exports.FastClick=t):window.FastClick=t}(),function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.6.0",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.utils.asString=function(t){return void 0===t||null===t?"":t.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(e){return arguments.length&&null!=e&&void 0!=e?Array.isArray(e)?e.map(function(e){return t.utils.asString(e).toLowerCase()}):e.toString().trim().toLowerCase().split(t.tokenizer.seperator):[]},t.tokenizer.seperator=/[\s\-]+/,t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var o=t.Pipeline.registeredFunctions[e];if(!o)throw new Error("Cannot load un-registered function: "+e);n.add(o)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(e);if(-1==o)throw new Error("Cannot find existingFn");o+=1,this._stack.splice(o,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(e);if(-1==o)throw new Error("Cannot find existingFn");this._stack.splice(o,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,o=this._stack.length,i=0;n>i;i++){for(var r=t[i],s=0;o>s&&(r=this._stack[s](r,i,t),void 0!==r&&""!==r);s++);void 0!==r&&""!==r&&e.push(r)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var o=this.list;if(!o)return this.list=new t.Vector.Node(e,n,o),this.length++;if(en.idx?n=n.next:(o+=e.val*n.val,e=e.next,n=n.next);return o},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(r===t)return i;t>r&&(e=i),r>t&&(n=i),o=n-e,i=e+Math.floor(o/2),r=this.elements[i]}return r===t?i:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,o=n-e,i=e+Math.floor(o/2),r=this.elements[i];o>1;)t>r&&(e=i),r>t&&(n=i),o=n-e,i=e+Math.floor(o/2),r=this.elements[i];return r>t?i:t>r?i+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,o=0,i=0,r=this.length,s=e.length,a=this.elements,c=e.elements;;){if(o>r-1||i>s-1)break;a[o]!==c[i]?a[o]c[i]&&i++:(n.add(a[o]),o++,i++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,o;return this.length>=t.length?(e=this,n=t):(e=t,n=this),o=e.clone(),o.add.apply(o,n.toArray()),o},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var o={},i=new t.SortedSet,r=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(t.tokenizer(e[n.name]));o[n.name]=r,t.SortedSet.prototype.add.apply(i,r)},this),this.documentStore.set(r,i),t.SortedSet.prototype.add.apply(this.corpusTokens,i.toArray());for(var s=0;s0&&(o=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=o},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),o=new t.Vector,i=[],r=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*r,c=this,l=this.tokenStore.expand(e).reduce(function(n,i){var r=c.corpusTokens.indexOf(i),s=c.idf(i),l=1,u=new t.SortedSet;if(i!==e){var d=Math.max(3,i.length-e.length);l=1/Math.log(d)}r>-1&&o.insert(r,a*s*l);for(var h=c.tokenStore.get(i),f=Object.keys(h),p=f.length,m=0;p>m;m++)u.add(h[f[m]].ref);return n.union(u)},new t.SortedSet);i.push(l)},this);var a=i.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:o.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),o=n.length,i=new t.Vector,r=0;o>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[e].tf,c=this.idf(s);i.insert(this.corpusTokens.indexOf(s),a*c)}return i},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,o){return n[o]=t.SortedSet.load(e.store[o]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",o="[aeiouy]",i=n+"[^aeiouy]*",r=o+"[aeiou]*",s="^("+i+")?"+r+i,a="^("+i+")?"+r+i+"("+r+")?$",c="^("+i+")?"+r+i+r+i,l="^("+i+")?"+o,u=new RegExp(s),d=new RegExp(c),h=new RegExp(a),f=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,y=/.$/,w=/(at|bl|iz)$/,S=new RegExp("([^aeiouylsz])\\1$"),k=new RegExp("^"+i+o+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,x=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,b=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,T=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,C=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,A=new RegExp("^"+i+o+"[^aeiouwxy]$"),O=function(n){var o,i,r,s,a,c,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=g,s.test(n)){var O=s.exec(n);s=u,s.test(O[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var O=a.exec(n);o=O[1],a=f,a.test(o)&&(n=o,a=w,c=S,l=k,a.test(n)?n+="e":c.test(n)?(s=y,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=E,s.test(n)){var O=s.exec(n);o=O[1],n=o+"i"}if(s=x,s.test(n)){var O=s.exec(n);o=O[1],i=O[2],s=u,s.test(o)&&(n=o+t[i])}if(s=b,s.test(n)){var O=s.exec(n);o=O[1],i=O[2],s=u,s.test(o)&&(n=o+e[i])}if(s=T,a=C,s.test(n)){var O=s.exec(n);o=O[1],s=d,s.test(o)&&(n=o)}else if(a.test(n)){var O=a.exec(n);o=O[1]+O[2],a=d,a.test(o)&&(n=o)}if(s=L,s.test(n)){var O=s.exec(n);o=O[1],s=d,a=h,c=A,(s.test(o)||a.test(o)&&!c.test(o))&&(n=o)}return s=_,a=d,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return O}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.generateStopWordFilter=function(t){var e=t.reduce(function(t,e){return t[e]=e,t},{});return function(t){return t&&e[t]!==t?t:void 0}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,o=t.charAt(0),i=t.slice(1);return o in n||(n[o]={docs:{}}),0===i.length?(n[o].docs[e.ref]=e,void(this.length+=1)):this.add(i,e,n[o])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;nt){for(;" "!=this[t]&&--t>0;);return this.substring(0,t)+"…"}return this},HTMLElement.prototype.wrap=function(t){t.length||(t=[t]);for(var e=t.length-1;e>=0;e--){var n=e>0?this.cloneNode(!0):this,o=t[e],i=o.parentNode,r=o.nextSibling;n.appendChild(o),r?i.insertBefore(n,r):i.appendChild(n)}},document.addEventListener("DOMContentLoaded",function(){"use strict";Modernizr.addTest("ios",function(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}),Modernizr.addTest("standalone",function(){return!!navigator.standalone}),FastClick.attach(document.body);var t=document.getElementById("toggle-search"),e=(document.getElementById("reset-search"),document.querySelector(".drawer")),n=document.querySelectorAll(".anchor"),o=document.querySelector(".search .field"),i=document.querySelector(".query"),r=document.querySelector(".results .meta");Array.prototype.forEach.call(n,function(t){t.querySelector("a").addEventListener("click",function(){document.getElementById("toggle-drawer").checked=!1,document.body.classList.remove("toggle-drawer")})});var s=window.pageYOffset,a=function(){var t=window.pageYOffset+window.innerHeight,n=Math.max(0,window.innerHeight-e.offsetHeight);t>document.body.clientHeight-(96-n)?"absolute"!=e.style.position&&(e.style.position="absolute",e.style.top=null,e.style.bottom=0):e.offsetHeighte.offsetTop+e.offsetHeight?(e.style.position="fixed",e.style.top=null,e.style.bottom="-96px"):window.pageYOffsets?e.style.top&&(e.style.position="absolute",e.style.top=Math.max(0,s)+"px",e.style.bottom=null):e.style.bottom&&(e.style.position="absolute",e.style.top=t-e.offsetHeight+"px",e.style.bottom=null),s=Math.max(0,window.pageYOffset)},c=function(){var t=document.querySelector(".main");window.removeEventListener("scroll",a),matchMedia("only screen and (max-width: 959px)").matches?(e.style.position=null,e.style.top=null,e.style.bottom=null):e.offsetHeight+96o;o++)t1e4?n=(n/1e3).toFixed(0)+"k":n>1e3&&(n=(n/1e3).toFixed(1)+"k");var o=document.querySelector(".repo-stars .count");o.innerHTML=n},function(t,e){console.error(t,e.status)})}),"standalone"in window.navigator&&window.navigator.standalone){var node,remotes=!1;document.addEventListener("click",function(t){for(node=t.target;"A"!==node.nodeName&&"HTML"!==node.nodeName;)node=node.parentNode;"href"in node&&-1!==node.href.indexOf("http")&&(-1!==node.href.indexOf(document.location.host)||remotes)&&(t.preventDefault(),document.location.href=node.href)},!1)} \ No newline at end of file diff --git a/docs/theme/assets/javascripts/modernizr-4a5cc7e01e.js b/docs/theme/assets/javascripts/modernizr-4a5cc7e01e.js deleted file mode 100644 index 6cfa3b1f..00000000 --- a/docs/theme/assets/javascripts/modernizr-4a5cc7e01e.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t,n){function r(e,t){return typeof e===t}function i(){var e,t,n,i,o,a,s;for(var l in x)if(x.hasOwnProperty(l)){if(e=[],t=x[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;nf;f++)if(h=e[f],g=_.style[h],l(h,"-")&&(h=m(h)),_.style[h]!==n){if(o||r(i,"undefined"))return a(),"pfx"==t?h:!0;try{_.style[h]=i}catch(y){}if(_.style[h]!=g)return a(),"pfx"==t?h:!0}return a(),!1}function g(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?s(i,n||t):i);return!1}function v(e,t,n,i,o){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+P.join(a+" ")+a).split(" ");return r(t,"string")||r(t,"undefined")?h(s,t,i,o):(s=(e+" "+A.join(a+" ")+a).split(" "),g(s,t,n))}function y(e,t,r){return v(e,n,n,t,r)}var x=[],E={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){x.push({name:e,fn:t,options:n})},addAsyncTest:function(e){x.push({name:null,fn:e})}},S=function(){};S.prototype=E,S=new S;var b,w=[],C=t.documentElement,T="svg"===C.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;b=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),E._l={},E.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),S.hasOwnProperty(e)&&setTimeout(function(){S._trigger(e,S[e])},0)},E._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=C.elements;return"string"==typeof e?e.split(" "):e}function i(e,t){var n=C.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),C.elements=n+" "+e,u(t)}function o(e){var t=w[e[S]];return t||(t={},b++,e[S]=b,w[b]=t),t}function a(e,n,r){if(n||(n=t),g)return n.createElement(e);r||(r=o(n));var i;return i=r.cache[e]?r.cache[e].cloneNode():E.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!i.canHaveChildren||x.test(e)||i.tagUrn?i:r.frag.appendChild(i)}function s(e,n){if(e||(e=t),g)return e.createDocumentFragment();n=n||o(e);for(var i=n.frag.cloneNode(),a=0,s=r(),l=s.length;l>a;a++)i.createElement(s[a]);return i}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return C.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(C,t.frag)}function u(e){e||(e=t);var r=o(e);return!C.shivCSS||h||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),g||l(e,r),e}function c(e){for(var t,n=e.getElementsByTagName("*"),i=n.length,o=RegExp("^(?:"+r().join("|")+")$","i"),a=[];i--;)t=n[i],o.test(t.nodeName)&&a.push(t.applyElement(f(t)));return a}function f(e){for(var t,n=e.attributes,r=n.length,i=e.ownerDocument.createElement(N+":"+e.nodeName);r--;)t=n[r],t.specified&&i.setAttribute(t.nodeName,t.nodeValue);return i.style.cssText=e.style.cssText,i}function d(e){for(var t,n=e.split("{"),i=n.length,o=RegExp("(^|[\\s,>+~])("+r().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),a="$1"+N+"\\:$2";i--;)t=n[i]=n[i].split("}"),t[t.length-1]=t[t.length-1].replace(o,a),n[i]=t.join("}");return n.join("{")}function p(e){for(var t=e.length;t--;)e[t].removeNode()}function m(e){function t(){clearTimeout(a._removeSheetTimer),r&&r.removeNode(!0),r=null}var r,i,a=o(e),s=e.namespaces,l=e.parentWindow;return!_||e.printShived?e:("undefined"==typeof s[N]&&s.add(N),l.attachEvent("onbeforeprint",function(){t();for(var o,a,s,l=e.styleSheets,u=[],f=l.length,p=Array(f);f--;)p[f]=l[f];for(;s=p.pop();)if(!s.disabled&&T.test(s.media)){try{o=s.imports,a=o.length}catch(m){a=0}for(f=0;a>f;f++)p.push(o[f]);try{u.push(s.cssText)}catch(m){}}u=d(u.reverse().join("")),i=c(e),r=n(e,u)}),l.attachEvent("onafterprint",function(){p(i),clearTimeout(a._removeSheetTimer),a._removeSheetTimer=setTimeout(t,500)}),e.printShived=!0,e)}var h,g,v="3.7.3",y=e.html5||{},x=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,E=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,S="_html5shiv",b=0,w={};!function(){try{var e=t.createElement("a");e.innerHTML="",h="hidden"in e,g=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){h=!0,g=!0}}();var C={elements:y.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:v,shivCSS:y.shivCSS!==!1,supportsUnknownElements:g,shivMethods:y.shivMethods!==!1,type:"default",shivDocument:u,createElement:a,createDocumentFragment:s,addElements:i};e.html5=C,u(t);var T=/^$|\b(?:all|print)\b/,N="html5shiv",_=!g&&function(){var n=t.documentElement;return!("undefined"==typeof t.namespaces||"undefined"==typeof t.parentWindow||"undefined"==typeof n.applyElement||"undefined"==typeof n.removeNode||"undefined"==typeof e.attachEvent)}();C.type+=" print",C.shivPrint=m,m(t),"object"==typeof module&&module.exports&&(module.exports=C)}("undefined"!=typeof e?e:this,t);var N={elem:u("modernizr")};S._q.push(function(){delete N.elem});var _={style:N.elem.style};S._q.unshift(function(){delete _.style});var z=(E.testProp=function(e,t,r){return h([e],n,t,r)},function(){function e(e,t){var i;return e?(t&&"string"!=typeof t||(t=u(t||"div")),e="on"+e,i=e in t,!i&&r&&(t.setAttribute||(t=u("div")),t.setAttribute(e,""),i="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),i):!1}var r=!("onblur"in t.documentElement);return e}());E.hasEvent=z,S.addTest("inputsearchevent",z("search"));var k=E.testStyles=f,$=function(){var e=navigator.userAgent,t=e.match(/applewebkit\/([0-9]+)/gi)&&parseFloat(RegExp.$1),n=e.match(/w(eb)?osbrowser/gi),r=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,i=533>t&&e.match(/android/gi);return n||i||r}();$?S.addTest("fontface",!1):k('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),i=r.sheet||r.styleSheet,o=i?i.cssRules&&i.cssRules[0]?i.cssRules[0].cssText:i.cssText||"":"",a=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);S.addTest("fontface",a)});var j="Moz O ms Webkit",P=E._config.usePrefixes?j.split(" "):[];E._cssomPrefixes=P;var A=E._config.usePrefixes?j.toLowerCase().split(" "):[];E._domPrefixes=A,E.testAllProps=v,E.testAllProps=y;var R="CSS"in e&&"supports"in e.CSS,F="supportsCSS"in e;S.addTest("supports",R||F),S.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=S._config.usePrefixes;if(e&&(!t||"webkitPerspective"in C.style)){var n,r="#modernizr{width:0;height:0}";S.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",k(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),S.addTest("json","JSON"in e&&"parse"in JSON&&"stringify"in JSON),S.addTest("checked",function(){return k("#modernizr {position:absolute} #modernizr input {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}",function(e){var t=u("input");return t.setAttribute("type","checkbox"),t.setAttribute("checked","checked"),e.appendChild(t),20===t.offsetLeft})}),S.addTest("target",function(){var t=e.document;if(!("querySelectorAll"in t))return!1;try{return t.querySelectorAll(":target"),!0}catch(n){return!1}}),S.addTest("contains",r(String.prototype.contains,"function")),i(),o(w),delete E.addTest,delete E.addAsyncTest;for(var M=0;M #mq-test-1 { width: 42px; }',r.insertBefore(o,i),n=42===a.offsetWidth,r.removeChild(o),{matches:n,media:e}}}(e.document)}(this),function(e){"use strict";function t(){E(!0)}var n={};e.respond=n,n.update=function(){};var r=[],i=function(){var t=!1;try{t=new e.XMLHttpRequest}catch(n){t=new e.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}(),o=function(e,t){var n=i();n&&(n.open("GET",e,!0),n.onreadystatechange=function(){4!==n.readyState||200!==n.status&&304!==n.status||t(n.responseText)},4!==n.readyState&&n.send(null))};if(n.ajax=o,n.queue=r,n.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},n.mediaQueriesSupported=e.matchMedia&&null!==e.matchMedia("only all")&&e.matchMedia("only all").matches,!n.mediaQueriesSupported){var a,s,l,u=e.document,c=u.documentElement,f=[],d=[],p=[],m={},h=30,g=u.getElementsByTagName("head")[0]||c,v=u.getElementsByTagName("base")[0],y=g.getElementsByTagName("link"),x=function(){var e,t=u.createElement("div"),n=u.body,r=c.style.fontSize,i=n&&n.style.fontSize,o=!1;return t.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=o=u.createElement("body"),n.style.background="none"),c.style.fontSize="100%",n.style.fontSize="100%",n.appendChild(t),o&&c.insertBefore(n,c.firstChild),e=t.offsetWidth,o?c.removeChild(n):n.removeChild(t),c.style.fontSize=r,i&&(n.style.fontSize=i),e=l=parseFloat(e)},E=function(t){var n="clientWidth",r=c[n],i="CSS1Compat"===u.compatMode&&r||u.body[n]||r,o={},m=y[y.length-1],v=(new Date).getTime();if(t&&a&&h>v-a)return e.clearTimeout(s),void(s=e.setTimeout(E,h));a=v;for(var S in f)if(f.hasOwnProperty(S)){var b=f[S],w=b.minw,C=b.maxw,T=null===w,N=null===C,_="em";w&&(w=parseFloat(w)*(w.indexOf(_)>-1?l||x():1)),C&&(C=parseFloat(C)*(C.indexOf(_)>-1?l||x():1)),b.hasquery&&(T&&N||!(T||i>=w)||!(N||C>=i))||(o[b.media]||(o[b.media]=[]),o[b.media].push(d[b.rules]))}for(var z in p)p.hasOwnProperty(z)&&p[z]&&p[z].parentNode===g&&g.removeChild(p[z]);p.length=0;for(var k in o)if(o.hasOwnProperty(k)){var $=u.createElement("style"),j=o[k].join("\n");$.type="text/css",$.media=k,g.insertBefore($,m.nextSibling),$.styleSheet?$.styleSheet.cssText=j:$.appendChild(u.createTextNode(j)),p.push($)}},S=function(e,t,r){var i=e.replace(n.regex.keyframes,"").match(n.regex.media),o=i&&i.length||0;t=t.substring(0,t.lastIndexOf("/"));var a=function(e){return e.replace(n.regex.urls,"$1"+t+"$2$3")},s=!o&&r;t.length&&(t+="/"),s&&(o=1);for(var l=0;o>l;l++){var u,c,p,m;s?(u=r,d.push(a(e))):(u=i[l].match(n.regex.findStyles)&&RegExp.$1,d.push(RegExp.$2&&a(RegExp.$2))),p=u.split(","),m=p.length;for(var h=0;m>h;h++)c=p[h],f.push({media:c.split("(")[0].match(n.regex.only)&&RegExp.$2||"all",rules:d.length-1,hasquery:c.indexOf("(")>-1,minw:c.match(n.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:c.match(n.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}E()},b=function(){if(r.length){var t=r.shift();o(t.href,function(n){S(n,t.href,t.media),m[t.href]=!0,e.setTimeout(function(){b()},0)})}},w=function(){for(var t=0;tf;f++)if(h=e[f],g=_.style[h],l(h,"-")&&(h=m(h)),_.style[h]!==n){if(o||r(i,"undefined"))return a(),"pfx"==t?h:!0;try{_.style[h]=i}catch(y){}if(_.style[h]!=g)return a(),"pfx"==t?h:!0}return a(),!1}function g(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?s(i,n||t):i);return!1}function v(e,t,n,i,o){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+P.join(a+" ")+a).split(" ");return r(t,"string")||r(t,"undefined")?h(s,t,i,o):(s=(e+" "+A.join(a+" ")+a).split(" "),g(s,t,n))}function y(e,t,r){return v(e,n,n,t,r)}var x=[],E={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){x.push({name:e,fn:t,options:n})},addAsyncTest:function(e){x.push({name:null,fn:e})}},S=function(){};S.prototype=E,S=new S;var b,w=[],C=t.documentElement,T="svg"===C.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;b=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),E._l={},E.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),S.hasOwnProperty(e)&&setTimeout(function(){S._trigger(e,S[e])},0)},E._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=C.elements;return"string"==typeof e?e.split(" "):e}function i(e,t){var n=C.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),C.elements=n+" "+e,u(t)}function o(e){var t=w[e[S]];return t||(t={},b++,e[S]=b,w[b]=t),t}function a(e,n,r){if(n||(n=t),g)return n.createElement(e);r||(r=o(n));var i;return i=r.cache[e]?r.cache[e].cloneNode():E.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!i.canHaveChildren||x.test(e)||i.tagUrn?i:r.frag.appendChild(i)}function s(e,n){if(e||(e=t),g)return e.createDocumentFragment();n=n||o(e);for(var i=n.frag.cloneNode(),a=0,s=r(),l=s.length;l>a;a++)i.createElement(s[a]);return i}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return C.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(C,t.frag)}function u(e){e||(e=t);var r=o(e);return!C.shivCSS||h||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),g||l(e,r),e}function c(e){for(var t,n=e.getElementsByTagName("*"),i=n.length,o=RegExp("^(?:"+r().join("|")+")$","i"),a=[];i--;)t=n[i],o.test(t.nodeName)&&a.push(t.applyElement(f(t)));return a}function f(e){for(var t,n=e.attributes,r=n.length,i=e.ownerDocument.createElement(N+":"+e.nodeName);r--;)t=n[r],t.specified&&i.setAttribute(t.nodeName,t.nodeValue);return i.style.cssText=e.style.cssText,i}function d(e){for(var t,n=e.split("{"),i=n.length,o=RegExp("(^|[\\s,>+~])("+r().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),a="$1"+N+"\\:$2";i--;)t=n[i]=n[i].split("}"),t[t.length-1]=t[t.length-1].replace(o,a),n[i]=t.join("}");return n.join("{")}function p(e){for(var t=e.length;t--;)e[t].removeNode()}function m(e){function t(){clearTimeout(a._removeSheetTimer),r&&r.removeNode(!0),r=null}var r,i,a=o(e),s=e.namespaces,l=e.parentWindow;return!_||e.printShived?e:("undefined"==typeof s[N]&&s.add(N),l.attachEvent("onbeforeprint",function(){t();for(var o,a,s,l=e.styleSheets,u=[],f=l.length,p=Array(f);f--;)p[f]=l[f];for(;s=p.pop();)if(!s.disabled&&T.test(s.media)){try{o=s.imports,a=o.length}catch(m){a=0}for(f=0;a>f;f++)p.push(o[f]);try{u.push(s.cssText)}catch(m){}}u=d(u.reverse().join("")),i=c(e),r=n(e,u)}),l.attachEvent("onafterprint",function(){p(i),clearTimeout(a._removeSheetTimer),a._removeSheetTimer=setTimeout(t,500)}),e.printShived=!0,e)}var h,g,v="3.7.3",y=e.html5||{},x=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,E=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,S="_html5shiv",b=0,w={};!function(){try{var e=t.createElement("a");e.innerHTML="",h="hidden"in e,g=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){h=!0,g=!0}}();var C={elements:y.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:v,shivCSS:y.shivCSS!==!1,supportsUnknownElements:g,shivMethods:y.shivMethods!==!1,type:"default",shivDocument:u,createElement:a,createDocumentFragment:s,addElements:i};e.html5=C,u(t);var T=/^$|\b(?:all|print)\b/,N="html5shiv",_=!g&&function(){var n=t.documentElement;return!("undefined"==typeof t.namespaces||"undefined"==typeof t.parentWindow||"undefined"==typeof n.applyElement||"undefined"==typeof n.removeNode||"undefined"==typeof e.attachEvent)}();C.type+=" print",C.shivPrint=m,m(t),"object"==typeof module&&module.exports&&(module.exports=C)}("undefined"!=typeof e?e:this,t);var N={elem:u("modernizr")};S._q.push(function(){delete N.elem});var _={style:N.elem.style};S._q.unshift(function(){delete _.style});var z=(E.testProp=function(e,t,r){return h([e],n,t,r)},function(){function e(e,t){var i;return e?(t&&"string"!=typeof t||(t=u(t||"div")),e="on"+e,i=e in t,!i&&r&&(t.setAttribute||(t=u("div")),t.setAttribute(e,""),i="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),i):!1}var r=!("onblur"in t.documentElement);return e}());E.hasEvent=z,S.addTest("inputsearchevent",z("search"));var k=E.testStyles=f,$=function(){var e=navigator.userAgent,t=e.match(/applewebkit\/([0-9]+)/gi)&&parseFloat(RegExp.$1),n=e.match(/w(eb)?osbrowser/gi),r=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,i=533>t&&e.match(/android/gi);return n||i||r}();$?S.addTest("fontface",!1):k('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),i=r.sheet||r.styleSheet,o=i?i.cssRules&&i.cssRules[0]?i.cssRules[0].cssText:i.cssText||"":"",a=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);S.addTest("fontface",a)});var j="Moz O ms Webkit",P=E._config.usePrefixes?j.split(" "):[];E._cssomPrefixes=P;var A=E._config.usePrefixes?j.toLowerCase().split(" "):[];E._domPrefixes=A,E.testAllProps=v,E.testAllProps=y;var R="CSS"in e&&"supports"in e.CSS,F="supportsCSS"in e;S.addTest("supports",R||F),S.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=S._config.usePrefixes;if(e&&(!t||"webkitPerspective"in C.style)){var n,r="#modernizr{width:0;height:0}";S.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",k(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),S.addTest("json","JSON"in e&&"parse"in JSON&&"stringify"in JSON),S.addTest("checked",function(){return k("#modernizr {position:absolute} #modernizr input {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}",function(e){var t=u("input");return t.setAttribute("type","checkbox"),t.setAttribute("checked","checked"),e.appendChild(t),20===t.offsetLeft})}),S.addTest("target",function(){var t=e.document;if(!("querySelectorAll"in t))return!1;try{return t.querySelectorAll(":target"),!0}catch(n){return!1}}),S.addTest("contains",r(String.prototype.contains,"function")),i(),o(w),delete E.addTest,delete E.addAsyncTest;for(var M=0;M #mq-test-1 { width: 42px; }',r.insertBefore(o,i),n=42===a.offsetWidth,r.removeChild(o),{matches:n,media:e}}}(e.document)}(this),function(e){"use strict";function t(){E(!0)}var n={};e.respond=n,n.update=function(){};var r=[],i=function(){var t=!1;try{t=new e.XMLHttpRequest}catch(n){t=new e.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}(),o=function(e,t){var n=i();n&&(n.open("GET",e,!0),n.onreadystatechange=function(){4!==n.readyState||200!==n.status&&304!==n.status||t(n.responseText)},4!==n.readyState&&n.send(null))};if(n.ajax=o,n.queue=r,n.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},n.mediaQueriesSupported=e.matchMedia&&null!==e.matchMedia("only all")&&e.matchMedia("only all").matches,!n.mediaQueriesSupported){var a,s,l,u=e.document,c=u.documentElement,f=[],d=[],p=[],m={},h=30,g=u.getElementsByTagName("head")[0]||c,v=u.getElementsByTagName("base")[0],y=g.getElementsByTagName("link"),x=function(){var e,t=u.createElement("div"),n=u.body,r=c.style.fontSize,i=n&&n.style.fontSize,o=!1;return t.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=o=u.createElement("body"),n.style.background="none"),c.style.fontSize="100%",n.style.fontSize="100%",n.appendChild(t),o&&c.insertBefore(n,c.firstChild),e=t.offsetWidth,o?c.removeChild(n):n.removeChild(t),c.style.fontSize=r,i&&(n.style.fontSize=i),e=l=parseFloat(e)},E=function(t){var n="clientWidth",r=c[n],i="CSS1Compat"===u.compatMode&&r||u.body[n]||r,o={},m=y[y.length-1],v=(new Date).getTime();if(t&&a&&h>v-a)return e.clearTimeout(s),void(s=e.setTimeout(E,h));a=v;for(var S in f)if(f.hasOwnProperty(S)){var b=f[S],w=b.minw,C=b.maxw,T=null===w,N=null===C,_="em";w&&(w=parseFloat(w)*(w.indexOf(_)>-1?l||x():1)),C&&(C=parseFloat(C)*(C.indexOf(_)>-1?l||x():1)),b.hasquery&&(T&&N||!(T||i>=w)||!(N||C>=i))||(o[b.media]||(o[b.media]=[]),o[b.media].push(d[b.rules]))}for(var z in p)p.hasOwnProperty(z)&&p[z]&&p[z].parentNode===g&&g.removeChild(p[z]);p.length=0;for(var k in o)if(o.hasOwnProperty(k)){var $=u.createElement("style"),j=o[k].join("\n");$.type="text/css",$.media=k,g.insertBefore($,m.nextSibling),$.styleSheet?$.styleSheet.cssText=j:$.appendChild(u.createTextNode(j)),p.push($)}},S=function(e,t,r){var i=e.replace(n.regex.keyframes,"").match(n.regex.media),o=i&&i.length||0;t=t.substring(0,t.lastIndexOf("/"));var a=function(e){return e.replace(n.regex.urls,"$1"+t+"$2$3")},s=!o&&r;t.length&&(t+="/"),s&&(o=1);for(var l=0;o>l;l++){var u,c,p,m;s?(u=r,d.push(a(e))):(u=i[l].match(n.regex.findStyles)&&RegExp.$1,d.push(RegExp.$2&&a(RegExp.$2))),p=u.split(","),m=p.length;for(var h=0;m>h;h++)c=p[h],f.push({media:c.split("(")[0].match(n.regex.only)&&RegExp.$2||"all",rules:d.length-1,hasquery:c.indexOf("(")>-1,minw:c.match(n.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:c.match(n.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}E()},b=function(){if(r.length){var t=r.shift();o(t.href,function(n){S(n,t.href,t.media),m[t.href]=!0,e.setTimeout(function(){b()},0)})}},w=function(){for(var t=0;tli:before{content:"\e602";display:block;float:left;font-family:Icon;font-size:16px;width:1.2em;margin-left:-1.2em;vertical-align:-.1em}.article p>code{white-space:nowrap}.article hr{margin-top:1.5em}.article img{max-width:100%}.article pre{padding:16px;margin:1.5em -16px 0;line-height:1.5em;overflow:auto;-webkit-overflow-scrolling:touch}.article table{margin:3em 0 1.5em;font-size:13px}.no-js .article table{display:inline-block;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.article table th{min-width:100px;font-size:12px;text-align:left}.article table td,.article table th{padding:12px 16px;white-space:nowrap}.article .data{margin:1.5em -16px;padding:1.5em 0;overflow:auto;-webkit-overflow-scrolling:touch;text-align:center}.article .data table{display:inline-block;margin:0 16px;text-align:left}.footer{position:absolute;bottom:0;left:0;right:0;padding:0 4px}.copyright{margin:1.5em 0}.pagination{max-width:1184px;height:92px;padding:4px 0;margin-left:auto;margin-right:auto;overflow:hidden}.pagination a{display:block;height:100%}.pagination .next,.pagination .previous{position:relative;float:left;height:100%}.pagination .previous{width:25%}.pagination .previous .direction,.pagination .previous .stretch{display:none}.pagination .next{width:75%;text-align:right}.pagination .page{display:table;position:absolute;bottom:4px}.pagination .direction{display:block;position:absolute;bottom:40px;width:100%;font-size:15px;line-height:20px;padding:0 52px}.pagination .stretch{padding:0 4px}.pagination .stretch .title{font-size:18px;padding:11px 0 13px}.admonition{margin:20px -16px 0;padding:20px 16px}.admonition>:first-child{margin-top:0}.admonition .admonition-title{font-size:20px}.admonition .admonition-title:before{content:"\e611";display:block;float:left;font-family:Icon;font-size:24px;vertical-align:-.1em;margin-right:5px}.admonition.warning .admonition-title:before{content:"\e610"}.article h3{font-weight:700}.article h4{font-weight:400;font-style:italic}.article h2 a,.article h3 a,.article h4 a,.article h5 a,.article h6 a{font-weight:400;font-style:normal}.bar{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1)}#toggle-search:checked~.header .bar,.toggle-search .bar{-webkit-transform:translate3d(0,-56px,0);transform:translate3d(0,-56px,0)}.bar.search .button-reset{-webkit-transform:scale(.5);transform:scale(.5);-webkit-transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:0}.bar.search.non-empty .button-reset{-webkit-transform:scale(1);transform:scale(1);opacity:1}.results{-webkit-transition:opacity .3s .1s,width 0s .4s,height 0s .4s;transition:opacity .3s .1s,width 0s .4s,height 0s .4s}#toggle-search:checked~.main .results,.toggle-search .results{-webkit-transition:opacity .4s,width 0s,height 0s;transition:opacity .4s,width 0s,height 0s}.results .list a{-webkit-transition:background .25s;transition:background .25s}.no-csstransforms3d .bar.default{display:table}.no-csstransforms3d .bar.search{display:none;margin-top:0}.no-csstransforms3d #toggle-search:checked~.header .bar.default,.no-csstransforms3d .toggle-search .bar.default{display:none}.no-csstransforms3d #toggle-search:checked~.header .bar.search,.no-csstransforms3d .toggle-search .bar.search{display:table}.bar.search{opacity:0}.bar.search .query{background:transparent;color:rgba(0,0,0,.87)}.bar.search .query::-webkit-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-moz-placeholder,.bar.search .query::-moz-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-ms-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .button .icon:active{background:rgba(0,0,0,.12)}.results{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05);background:#fff;color:rgba(0,0,0,.87);opacity:0}#toggle-search:checked~.main .results,.toggle-search .results{opacity:1}.results .meta{background:#2d2d2d;color:#fff}.results .list a{border-bottom:1px solid rgba(0,0,0,.12)}.results .list a:last-child{border-bottom:none}.results .list a:active{background:rgba(0,0,0,.12)}.result span{color:rgba(0,0,0,.54)}#toggle-search:checked~.header,.toggle-search .header{background:#fff;color:rgba(0,0,0,.54)}#toggle-search:checked~.header:before,.toggle-search .header:before{background:rgba(0,0,0,.54)}#toggle-search:checked~.header .bar.default,.toggle-search .header .bar.default{opacity:0}#toggle-search:checked~.header .bar.search,.toggle-search .header .bar.search{opacity:1}.bar.search{margin-top:8px}.bar.search .query{font-size:18px;padding:13px 0;margin:0;width:100%;height:48px}.bar.search .query::-ms-clear{display:none}.results{position:fixed;top:0;left:0;width:0;height:100%;z-index:1;overflow-y:scroll;-webkit-overflow-scrolling:touch}.results .scrollable{top:56px}#toggle-search:checked~.main .results,.toggle-search .results{width:100%;overflow-y:visible}.results .meta{font-weight:700}.results .meta strong{display:block;font-size:11px;max-width:1200px;margin-left:auto;margin-right:auto;padding:16px}.results .list a{display:block}.result{max-width:1200px;margin-left:auto;margin-right:auto;padding:12px 16px 16px}.result h1{line-height:24px}.result h1,.result span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.result span{font-size:12px}.no-csstransforms3d .results{display:none}.no-csstransforms3d #toggle-search:checked~.main .results,.no-csstransforms3d .toggle-search .results{display:block;overflow:auto}.meta{text-transform:uppercase;font-weight:700}@media only screen and (min-width:960px){.backdrop{background:#f2f2f2}.backdrop-paper:after{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05)}.button-menu{display:none}.drawer{float:left;height:auto;margin-bottom:96px;padding-top:80px}.drawer,.drawer .scrollable{position:static}.article{margin-left:262px}.footer{z-index:4}.copyright{margin-bottom:64px}.results{height:auto;top:64px}.results .scrollable{position:static;max-height:413px}}@media only screen and (max-width:959px){#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{width:100%;height:100%}.drawer{-webkit-transform:translate3d(-262px,0,0);transform:translate3d(-262px,0,0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),-webkit-transform .25s cubic-bezier(.4,0,.2,1)}.no-csstransforms3d .drawer{display:none}.drawer{background:#fff}.project{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);background:#2d2d2d;color:#fff}.drawer{position:fixed;z-index:4}#toggle-search:checked~.main .results,.drawer,.toggle-search .results{height:100%}}@media only screen and (min-width:720px){.header{height:64px;padding:8px}.header .stretch{padding:0 16px}.header .stretch .title{font-size:20px;padding:12px 0}.project .name{margin:26px 0 0 5px}.article .wrapper{padding:128px 24px 96px}.article .data{margin:1.5em -24px}.article .data table{margin:0 24px}.article h2{padding-top:100px;margin-top:-64px}.ios.standalone .article h2{padding-top:28px;margin-top:8px}.article h3,.article h4{padding-top:84px;margin-top:-64px}.ios.standalone .article h3,.ios.standalone .article h4{padding-top:20px;margin-top:0}.article pre{padding:1.5em 24px;margin:1.5em -24px 0}.footer{padding:0 8px}.pagination{height:96px;padding:8px 0}.pagination .direction{padding:0 56px;bottom:40px}.pagination .stretch{padding:0 8px}.admonition{margin:20px -24px 0;padding:20px 24px}.bar.search .query{font-size:20px;padding:12px 0}.results .scrollable{top:64px}.results .meta strong{padding:16px 24px}.result{padding:16px 24px 20px}}@media only screen and (min-width:1200px){.header{width:100%}.drawer .scrollable .wrapper hr{width:48px}}@media only screen and (orientation:portrait){.ios.standalone .header{height:76px;padding-top:24px}.ios.standalone .header:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .drawer .scrollable{top:124px}.ios.standalone .project{padding-top:20px}.ios.standalone .project:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .article{position:absolute;top:76px;right:0;bottom:0;left:0}.ios.standalone .results .scrollable{top:76px}}@media only screen and (orientation:portrait) and (min-width:720px){.ios.standalone .header{height:84px;padding-top:28px}.ios.standalone .results .scrollable{top:84px}}@media only screen and (max-width:719px){.bar .path{display:none}}@media only screen and (max-width:479px){.button-github,.button-twitter{display:none}}@media only screen and (min-width:720px) and (max-width:959px){.header .stretch{padding:0 24px}}@media only screen and (min-width:480px){.pagination .next,.pagination .previous{width:50%}.pagination .previous .direction{display:block}.pagination .previous .stretch{display:table}}@media print{.drawer,.footer,.header,.headerlink{display:none}.article .wrapper{padding-top:0}.article pre,.article pre *{color:rgba(0,0,0,.87)!important}.article pre{border:1px solid rgba(0,0,0,.12)}.article table{border-radius:none;box-shadow:none}.article table th{color:#2d2d2d}} \ No newline at end of file diff --git a/docs/theme/assets/stylesheets/application.css b/docs/theme/assets/stylesheets/application.css deleted file mode 100644 index be360f0b..00000000 --- a/docs/theme/assets/stylesheets/application.css +++ /dev/null @@ -1 +0,0 @@ -html{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}*,:after,:before{box-sizing:inherit;-moz-box-sizing:inherit;-webkit-box-sizing:inherit}html{font-size:62.5%;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,main,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0}ul{list-style:none}table{border-collapse:collapse;border-spacing:0}td{text-align:left;font-weight:400;vertical-align:middle}button{outline:0;padding:0;background:transparent;border:none;font-size:inherit}input{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;appearance:none;outline:none;border:none}a{text-decoration:none;color:inherit}a,button,input,label{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-tap-highlight-color:transparent}h1,h2,h3,h4,h5,h6{font-weight:inherit}pre{background:rgba(0,0,0,.05)}pre,pre code{color:rgba(0,0,0,.87)}.c,.c1,.cm,.o{color:rgba(0,0,0,.54)}.k,.kn{color:#a71d5d}.kd,.kt,.n.f{color:#0086b3}.s,.s1{color:#183691}.bp,.mi{color:#9575cd}.icon{font-family:Icon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-search:before{content:"\e600"}.icon-back:before{content:"\e601"}.icon-link:before{content:"\e602"}.icon-close:before{content:"\e603"}.icon-menu:before{content:"\e604"}.icon-forward:before{content:"\e605"}.icon-twitter:before{content:"\e606"}.icon-github:before{content:"\e607"}.icon-download:before{content:"\e608"}.icon-star:before{content:"\e609"}.icon-warning:before{content:"\e610"}.icon-note:before{content:"\e611"}a{-webkit-transition:color .25s;transition:color .25s}.overlay{-webkit-transition:opacity .25s,width 0s .25s,height 0s .25s;transition:opacity .25s,width 0s .25s,height 0s .25s}#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{-webkit-transition:opacity .25s,width 0s,height 0s;transition:opacity .25s,width 0s,height 0s}.js .header{-webkit-transition:background .6s,color .6s;transition:background .6s,color .6s}.js .header:before{-webkit-transition:background .6s;transition:background .6s}.button .icon{-webkit-transition:background .25s;transition:background .25s}body{color:rgba(0,0,0,.87)}@supports (-webkit-appearance:none){body{background:#2d2d2d}}.ios body{background:#fff}hr{border:0;border-top:1px solid rgba(0,0,0,.12)}.toggle-button{cursor:pointer;color:inherit}.backdrop,.backdrop-paper:after{background:#fff}.overlay{background:rgba(0,0,0,.54);opacity:0}#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{opacity:1}.header{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);background:#2d2d2d;color:#fff}.ios.standalone .header:before{background:rgba(0,0,0,.12)}.bar .path{color:hsla(0,0%,100%,.7)}.button .icon{border-radius:100%}.button .icon:active{background:hsla(0,0%,100%,.12)}html{height:100%}body{position:relative;min-height:100%}hr{display:block;height:1px;padding:0;margin:0}.locked{height:100%;overflow:hidden}.scrollable{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;-webkit-overflow-scrolling:touch}.scrollable .wrapper{height:100%}.ios .scrollable .wrapper{margin-bottom:2px}.toggle{display:none}.toggle-button{display:block}.backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}.backdrop-paper{max-width:1200px;height:100%;margin-left:auto;margin-right:auto}.backdrop-paper:after{content:" ";display:block;height:100%;margin-left:262px}.overlay{width:0;height:0;z-index:3}.header,.overlay{position:fixed;top:0}.header{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;left:0;z-index:2;height:56px;padding:4px;overflow:hidden}.ios.standalone .header{position:absolute}.bar{display:table;max-width:1184px;margin-left:auto;margin-right:auto}.bar a{display:block}.no-js .bar .button-search{display:none}.bar .path .icon:before{vertical-align:-1.5px}.button{display:table-cell;vertical-align:top;width:1%}.button button{margin:0;padding:0}.button button:active:before{position:relative;top:0;left:0}.button .icon{display:inline-block;font-size:24px;padding:8px;margin:4px}.stretch{display:table;table-layout:fixed;width:100%}.header .stretch{padding:0 20px}.stretch .title{display:table-cell;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.header .stretch .title{font-size:18px;padding:13px 0}.main{max-width:1200px;margin-left:auto;margin-right:auto}body,input{font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.no-fontface body,.no-fontface input,body,input{font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.no-fontface code,.no-fontface pre,code,pre{font-family:Courier New,Courier,monospace}#toggle-drawer:checked~.main .drawer,.toggle-drawer .drawer{-webkit-transform:translateZ(0);transform:translateZ(0)}.no-csstransforms3d #toggle-drawer:checked~.main .drawer,.no-csstransforms3d .toggle-drawer .drawer{display:block}.project{-webkit-transition:none;transition:none}.project .logo img{-webkit-transition:box-shadow .4s;transition:box-shadow .4s}.repo a{-webkit-transition:box-shadow .4s,opacity .4s;transition:box-shadow .4s,opacity .4s}.drawer .toc a.current,.drawer .toc a:focus,.drawer .toc a:hover{color:#2d2d2d}.drawer .anchor a{border-left:2px solid #2d2d2d}.drawer .section{color:rgba(0,0,0,.54)}.ios.standalone .project:before{background:rgba(0,0,0,.12)}.project .logo img{background:#fff;border-radius:100%}.project:focus .logo img,.project:hover .logo img{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05)}.repo a{background:#8959a8;color:#fff;border-radius:3px}.repo a:focus,.repo a:hover{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05);opacity:.8}.repo a .count{background:rgba(0,0,0,.26);color:#fff;border-radius:0 3px 3px 0}.repo a .count:before{border-width:15px 5px 15px 0;border-color:transparent rgba(0,0,0,.26);border-style:solid}.drawer{width:262px;font-size:13px;line-height:1em}.ios .drawer{overflow:scroll;-webkit-overflow-scrolling:touch}.drawer .toc li a{display:block;padding:14.5px 24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drawer .toc li.anchor a{margin-left:12px;padding:10px 24px 10px 12px}.drawer .toc li ul{margin-left:12px}.drawer .current+ul{margin-bottom:9px}.drawer .section{display:block;padding:14.5px 24px}.drawer .scrollable{top:104px;z-index:-1}.drawer .scrollable .wrapper{height:auto;min-height:100%}.drawer .scrollable .wrapper hr{margin:12px 0;margin-right:auto}.drawer .scrollable .wrapper .toc{margin:12px 0}.project{display:block}.project .banner{display:table;width:100%;height:104px;padding:20px}.project .logo{display:table-cell;width:64px;padding-right:12px}.project .logo img{display:block;width:64px;height:64px}.project .name{display:table-cell;padding-left:4px;font-size:14px;line-height:1.25em;vertical-align:middle}.project .logo+.name{font-size:12px}.repo{margin:24px 0;text-align:center}.repo li{display:inline-block;padding-right:12px;white-space:nowrap}.repo li:last-child{padding-right:0}.repo a{display:inline-block;padding:0 10px 0 6px;font-size:12px;line-height:30px;height:30px}.repo a .icon{font-size:18px;vertical-align:-3px}.repo a .count{display:inline-block;position:relative;padding:0 8px 0 4px;margin:0 -10px 0 8px;font-size:12px}.repo a .count:before{content:" ";display:block;position:absolute;top:0;left:-5px}.no-js .repo a .count{display:none}.drawer .toc li a{font-weight:700}.drawer .toc li.anchor a{font-weight:400}.drawer .section,.repo a{font-weight:700}.repo a{text-transform:uppercase}.repo a .count{text-transform:none;font-weight:700}pre span{-webkit-transition:color .25s;transition:color .25s}.copyright a{-webkit-transition:color .25s;transition:color .25s}.ios.standalone .article{background:-webkit-linear-gradient(top,#fff 50%,#2d2d2d 0);background:linear-gradient(180deg,#fff 50%,#2d2d2d 0)}.ios.standalone .article .wrapper{background:-webkit-linear-gradient(top,#fff 50%,#fff 0);background:linear-gradient(180deg,#fff 50%,#fff 0)}.article a,.article code,.article h1,.article h2{color:#2d2d2d}.article h1{border-bottom:1px solid rgba(0,0,0,.12)}.article a{border-bottom:1px dotted}.article a:focus,.article a:hover{color:#8959a8}.article .headerlink{color:rgba(0,0,0,.26);border:none}.article table{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);border-radius:3px}.article table th{background:#626262;color:#fff}.article table th:first-child{border-top-left-radius:3px}.article table th:last-child{border-top-right-radius:3px}.article table td{border-top:1px solid rgba(0,0,0,.05)}.footer{background:#2d2d2d;color:#fff}.footer a{border:none}.copyright{color:rgba(0,0,0,.54)}.pagination a .button,.pagination a .title{color:#fff}.pagination .direction{color:hsla(0,0%,100%,.7)}.admonition{background:#29b6f6;color:#fff}.admonition pre{background:hsla(0,0%,100%,.3)}.admonition.warning{background:#e84e40}.admonition a,.admonition a:hover{color:#fff}.article{font-size:14px;line-height:1.7em}.article:after{content:" ";display:block;clear:both}.article .wrapper{padding:116px 16px 92px}.ios.standalone .article{position:absolute;top:56px;right:0;bottom:0;left:0;overflow:auto;-webkit-overflow-scrolling:touch}.ios.standalone .article .wrapper{position:relative;min-height:100%;padding-top:60px;margin-bottom:2px}.article h1{font-size:24px;line-height:1.333334em;padding:20px 0 42px}.article h2{font-size:20px;line-height:1.4em;padding-top:92px;margin-top:-56px}.ios.standalone .article h2{padding-top:36px;margin:0}.article h3,.article h4{font-size:14px;padding-top:76px;margin-top:-56px}.ios.standalone .article h3,.ios.standalone .article h4{padding-top:20px;margin-top:0}.article .headerlink{float:right;margin-left:20px;font-size:14px}h1 .article .headerlink{display:none}.article ol,.article p,.article ul{margin-top:1.5em}.article li,.article li ol,.article li ul{margin-top:.75em}.article li{margin-left:18px}.article li p{display:inline}.article ul>li:before{content:"\e602";display:block;float:left;font-family:Icon;font-size:16px;width:1.2em;margin-left:-1.2em;vertical-align:-.1em}.article p>code{white-space:nowrap}.article hr{margin-top:1.5em}.article img{max-width:100%}.article pre{padding:16px;margin:1.5em -16px 0;line-height:1.5em;overflow:auto;-webkit-overflow-scrolling:touch}.article table{margin:3em 0 1.5em;font-size:13px}.no-js .article table{display:inline-block;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.article table th{min-width:100px;font-size:12px;text-align:left}.article table td,.article table th{padding:12px 16px;white-space:nowrap}.article .data{margin:1.5em -16px;padding:1.5em 0;overflow:auto;-webkit-overflow-scrolling:touch;text-align:center}.article .data table{display:inline-block;margin:0 16px;text-align:left}.footer{position:absolute;bottom:0;left:0;right:0;padding:0 4px}.copyright{margin:1.5em 0}.pagination{max-width:1184px;height:92px;padding:4px 0;margin-left:auto;margin-right:auto;overflow:hidden}.pagination a{display:block;height:100%}.pagination .next,.pagination .previous{position:relative;float:left;height:100%}.pagination .previous{width:25%}.pagination .previous .direction,.pagination .previous .stretch{display:none}.pagination .next{width:75%;text-align:right}.pagination .page{display:table;position:absolute;bottom:4px}.pagination .direction{display:block;position:absolute;bottom:40px;width:100%;font-size:15px;line-height:20px;padding:0 52px}.pagination .stretch{padding:0 4px}.pagination .stretch .title{font-size:18px;padding:11px 0 13px}.admonition{margin:20px -16px 0;padding:20px 16px}.admonition>:first-child{margin-top:0}.admonition .admonition-title{font-size:20px}.admonition .admonition-title:before{content:"\e611";display:block;float:left;font-family:Icon;font-size:24px;vertical-align:-.1em;margin-right:5px}.admonition.warning .admonition-title:before{content:"\e610"}.article h3{font-weight:700}.article h4{font-weight:400;font-style:italic}.article h2 a,.article h3 a,.article h4 a,.article h5 a,.article h6 a{font-weight:400;font-style:normal}.bar{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1)}#toggle-search:checked~.header .bar,.toggle-search .bar{-webkit-transform:translate3d(0,-56px,0);transform:translate3d(0,-56px,0)}.bar.search .button-reset{-webkit-transform:scale(.5);transform:scale(.5);-webkit-transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:0}.bar.search.non-empty .button-reset{-webkit-transform:scale(1);transform:scale(1);opacity:1}.results{-webkit-transition:opacity .3s .1s,width 0s .4s,height 0s .4s;transition:opacity .3s .1s,width 0s .4s,height 0s .4s}#toggle-search:checked~.main .results,.toggle-search .results{-webkit-transition:opacity .4s,width 0s,height 0s;transition:opacity .4s,width 0s,height 0s}.results .list a{-webkit-transition:background .25s;transition:background .25s}.no-csstransforms3d .bar.default{display:table}.no-csstransforms3d .bar.search{display:none;margin-top:0}.no-csstransforms3d #toggle-search:checked~.header .bar.default,.no-csstransforms3d .toggle-search .bar.default{display:none}.no-csstransforms3d #toggle-search:checked~.header .bar.search,.no-csstransforms3d .toggle-search .bar.search{display:table}.bar.search{opacity:0}.bar.search .query{background:transparent;color:rgba(0,0,0,.87)}.bar.search .query::-webkit-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-moz-placeholder,.bar.search .query::-moz-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-ms-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .button .icon:active{background:rgba(0,0,0,.12)}.results{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05);background:#fff;color:rgba(0,0,0,.87);opacity:0}#toggle-search:checked~.main .results,.toggle-search .results{opacity:1}.results .meta{background:#2d2d2d;color:#fff}.results .list a{border-bottom:1px solid rgba(0,0,0,.12)}.results .list a:last-child{border-bottom:none}.results .list a:active{background:rgba(0,0,0,.12)}.result span{color:rgba(0,0,0,.54)}#toggle-search:checked~.header,.toggle-search .header{background:#fff;color:rgba(0,0,0,.54)}#toggle-search:checked~.header:before,.toggle-search .header:before{background:rgba(0,0,0,.54)}#toggle-search:checked~.header .bar.default,.toggle-search .header .bar.default{opacity:0}#toggle-search:checked~.header .bar.search,.toggle-search .header .bar.search{opacity:1}.bar.search{margin-top:8px}.bar.search .query{font-size:18px;padding:13px 0;margin:0;width:100%;height:48px}.bar.search .query::-ms-clear{display:none}.results{position:fixed;top:0;left:0;width:0;height:100%;z-index:1;overflow-y:scroll;-webkit-overflow-scrolling:touch}.results .scrollable{top:56px}#toggle-search:checked~.main .results,.toggle-search .results{width:100%;overflow-y:visible}.results .meta{font-weight:700}.results .meta strong{display:block;font-size:11px;max-width:1200px;margin-left:auto;margin-right:auto;padding:16px}.results .list a{display:block}.result{max-width:1200px;margin-left:auto;margin-right:auto;padding:12px 16px 16px}.result h1{line-height:24px}.result h1,.result span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.result span{font-size:12px}.no-csstransforms3d .results{display:none}.no-csstransforms3d #toggle-search:checked~.main .results,.no-csstransforms3d .toggle-search .results{display:block;overflow:auto}.meta{text-transform:uppercase;font-weight:700}@media only screen and (min-width:960px){.backdrop{background:#f2f2f2}.backdrop-paper:after{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05)}.button-menu{display:none}.drawer{float:left;height:auto;margin-bottom:96px;padding-top:80px}.drawer,.drawer .scrollable{position:static}.article{margin-left:262px}.footer{z-index:4}.copyright{margin-bottom:64px}.results{height:auto;top:64px}.results .scrollable{position:static;max-height:413px}}@media only screen and (max-width:959px){#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{width:100%;height:100%}.drawer{-webkit-transform:translate3d(-262px,0,0);transform:translate3d(-262px,0,0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),-webkit-transform .25s cubic-bezier(.4,0,.2,1)}.no-csstransforms3d .drawer{display:none}.drawer{background:#fff}.project{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);background:#2d2d2d;color:#fff}.drawer{position:fixed;z-index:4}#toggle-search:checked~.main .results,.drawer,.toggle-search .results{height:100%}}@media only screen and (min-width:720px){.header{height:64px;padding:8px}.header .stretch{padding:0 16px}.header .stretch .title{font-size:20px;padding:12px 0}.project .name{margin:26px 0 0 5px}.article .wrapper{padding:128px 24px 96px}.article .data{margin:1.5em -24px}.article .data table{margin:0 24px}.article h2{padding-top:100px;margin-top:-64px}.ios.standalone .article h2{padding-top:28px;margin-top:8px}.article h3,.article h4{padding-top:84px;margin-top:-64px}.ios.standalone .article h3,.ios.standalone .article h4{padding-top:20px;margin-top:0}.article pre{padding:1.5em 24px;margin:1.5em -24px 0}.footer{padding:0 8px}.pagination{height:96px;padding:8px 0}.pagination .direction{padding:0 56px;bottom:40px}.pagination .stretch{padding:0 8px}.admonition{margin:20px -24px 0;padding:20px 24px}.bar.search .query{font-size:20px;padding:12px 0}.results .scrollable{top:64px}.results .meta strong{padding:16px 24px}.result{padding:16px 24px 20px}}@media only screen and (min-width:1200px){.header{width:100%}.drawer .scrollable .wrapper hr{width:48px}}@media only screen and (orientation:portrait){.ios.standalone .header{height:76px;padding-top:24px}.ios.standalone .header:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .drawer .scrollable{top:124px}.ios.standalone .project{padding-top:20px}.ios.standalone .project:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .article{position:absolute;top:76px;right:0;bottom:0;left:0}.ios.standalone .results .scrollable{top:76px}}@media only screen and (orientation:portrait) and (min-width:720px){.ios.standalone .header{height:84px;padding-top:28px}.ios.standalone .results .scrollable{top:84px}}@media only screen and (max-width:719px){.bar .path{display:none}}@media only screen and (max-width:479px){.button-github,.button-twitter{display:none}}@media only screen and (min-width:720px) and (max-width:959px){.header .stretch{padding:0 24px}}@media only screen and (min-width:480px){.pagination .next,.pagination .previous{width:50%}.pagination .previous .direction{display:block}.pagination .previous .stretch{display:table}}@media print{.drawer,.footer,.header,.headerlink{display:none}.article .wrapper{padding-top:0}.article pre,.article pre *{color:rgba(0,0,0,.87)!important}.article pre{border:1px solid rgba(0,0,0,.12)}.article table{border-radius:none;box-shadow:none}.article table th{color:#2d2d2d}} \ No newline at end of file diff --git a/docs/theme/assets/stylesheets/palettes-2d6c5d2926.css b/docs/theme/assets/stylesheets/palettes-2d6c5d2926.css deleted file mode 100644 index 576fdb72..00000000 --- a/docs/theme/assets/stylesheets/palettes-2d6c5d2926.css +++ /dev/null @@ -1 +0,0 @@ -@supports (-webkit-appearance:none){.palette-primary-red{background:#e84e40}}.palette-primary-red .footer,.palette-primary-red .header{background:#e84e40}.palette-primary-red .drawer .toc a.current,.palette-primary-red .drawer .toc a:focus,.palette-primary-red .drawer .toc a:hover{color:#e84e40}.palette-primary-red .drawer .anchor a{border-left:2px solid #e84e40}.ios.standalone .palette-primary-red .article{background:-webkit-linear-gradient(top,#fff 50%,#e84e40 0);background:linear-gradient(180deg,#fff 50%,#e84e40 0)}.palette-primary-red .article a,.palette-primary-red .article code,.palette-primary-red .article h1,.palette-primary-red .article h2{color:#e84e40}.palette-primary-red .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-red .article table th{background:#ee7a70}.palette-primary-red .results .meta{background:#e84e40}@supports (-webkit-appearance:none){.palette-primary-pink{background:#e91e63}}.palette-primary-pink .footer,.palette-primary-pink .header{background:#e91e63}.palette-primary-pink .drawer .toc a.current,.palette-primary-pink .drawer .toc a:focus,.palette-primary-pink .drawer .toc a:hover{color:#e91e63}.palette-primary-pink .drawer .anchor a{border-left:2px solid #e91e63}.ios.standalone .palette-primary-pink .article{background:-webkit-linear-gradient(top,#fff 50%,#e91e63 0);background:linear-gradient(180deg,#fff 50%,#e91e63 0)}.palette-primary-pink .article a,.palette-primary-pink .article code,.palette-primary-pink .article h1,.palette-primary-pink .article h2{color:#e91e63}.palette-primary-pink .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-pink .article table th{background:#ef568a}.palette-primary-pink .results .meta{background:#e91e63}@supports (-webkit-appearance:none){.palette-primary-purple{background:#ab47bc}}.palette-primary-purple .footer,.palette-primary-purple .header{background:#ab47bc}.palette-primary-purple .drawer .toc a.current,.palette-primary-purple .drawer .toc a:focus,.palette-primary-purple .drawer .toc a:hover{color:#ab47bc}.palette-primary-purple .drawer .anchor a{border-left:2px solid #ab47bc}.ios.standalone .palette-primary-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#ab47bc 0);background:linear-gradient(180deg,#fff 50%,#ab47bc 0)}.palette-primary-purple .article a,.palette-primary-purple .article code,.palette-primary-purple .article h1,.palette-primary-purple .article h2{color:#ab47bc}.palette-primary-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-purple .article table th{background:#c075cd}.palette-primary-purple .results .meta{background:#ab47bc}@supports (-webkit-appearance:none){.palette-primary-deep-purple{background:#7e57c2}}.palette-primary-deep-purple .footer,.palette-primary-deep-purple .header{background:#7e57c2}.palette-primary-deep-purple .drawer .toc a.current,.palette-primary-deep-purple .drawer .toc a:focus,.palette-primary-deep-purple .drawer .toc a:hover{color:#7e57c2}.palette-primary-deep-purple .drawer .anchor a{border-left:2px solid #7e57c2}.ios.standalone .palette-primary-deep-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#7e57c2 0);background:linear-gradient(180deg,#fff 50%,#7e57c2 0)}.palette-primary-deep-purple .article a,.palette-primary-deep-purple .article code,.palette-primary-deep-purple .article h1,.palette-primary-deep-purple .article h2{color:#7e57c2}.palette-primary-deep-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-purple .article table th{background:#9e81d1}.palette-primary-deep-purple .results .meta{background:#7e57c2}@supports (-webkit-appearance:none){.palette-primary-indigo{background:#3f51b5}}.palette-primary-indigo .footer,.palette-primary-indigo .header{background:#3f51b5}.palette-primary-indigo .drawer .toc a.current,.palette-primary-indigo .drawer .toc a:focus,.palette-primary-indigo .drawer .toc a:hover{color:#3f51b5}.palette-primary-indigo .drawer .anchor a{border-left:2px solid #3f51b5}.ios.standalone .palette-primary-indigo .article{background:-webkit-linear-gradient(top,#fff 50%,#3f51b5 0);background:linear-gradient(180deg,#fff 50%,#3f51b5 0)}.palette-primary-indigo .article a,.palette-primary-indigo .article code,.palette-primary-indigo .article h1,.palette-primary-indigo .article h2{color:#3f51b5}.palette-primary-indigo .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-indigo .article table th{background:#6f7dc8}.palette-primary-indigo .results .meta{background:#3f51b5}@supports (-webkit-appearance:none){.palette-primary-blue{background:#2196f3}}.palette-primary-blue .footer,.palette-primary-blue .header{background:#2196f3}.palette-primary-blue .drawer .toc a.current,.palette-primary-blue .drawer .toc a:focus,.palette-primary-blue .drawer .toc a:hover{color:#2196f3}.palette-primary-blue .drawer .anchor a{border-left:2px solid #2196f3}.ios.standalone .palette-primary-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#2196f3 0);background:linear-gradient(180deg,#fff 50%,#2196f3 0)}.palette-primary-blue .article a,.palette-primary-blue .article code,.palette-primary-blue .article h1,.palette-primary-blue .article h2{color:#2196f3}.palette-primary-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue .article table th{background:#59b0f6}.palette-primary-blue .results .meta{background:#2196f3}@supports (-webkit-appearance:none){.palette-primary-light-blue{background:#03a9f4}}.palette-primary-light-blue .footer,.palette-primary-light-blue .header{background:#03a9f4}.palette-primary-light-blue .drawer .toc a.current,.palette-primary-light-blue .drawer .toc a:focus,.palette-primary-light-blue .drawer .toc a:hover{color:#03a9f4}.palette-primary-light-blue .drawer .anchor a{border-left:2px solid #03a9f4}.ios.standalone .palette-primary-light-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#03a9f4 0);background:linear-gradient(180deg,#fff 50%,#03a9f4 0)}.palette-primary-light-blue .article a,.palette-primary-light-blue .article code,.palette-primary-light-blue .article h1,.palette-primary-light-blue .article h2{color:#03a9f4}.palette-primary-light-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-blue .article table th{background:#42bff7}.palette-primary-light-blue .results .meta{background:#03a9f4}@supports (-webkit-appearance:none){.palette-primary-cyan{background:#00bcd4}}.palette-primary-cyan .footer,.palette-primary-cyan .header{background:#00bcd4}.palette-primary-cyan .drawer .toc a.current,.palette-primary-cyan .drawer .toc a:focus,.palette-primary-cyan .drawer .toc a:hover{color:#00bcd4}.palette-primary-cyan .drawer .anchor a{border-left:2px solid #00bcd4}.ios.standalone .palette-primary-cyan .article{background:-webkit-linear-gradient(top,#fff 50%,#00bcd4 0);background:linear-gradient(180deg,#fff 50%,#00bcd4 0)}.palette-primary-cyan .article a,.palette-primary-cyan .article code,.palette-primary-cyan .article h1,.palette-primary-cyan .article h2{color:#00bcd4}.palette-primary-cyan .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-cyan .article table th{background:#40cddf}.palette-primary-cyan .results .meta{background:#00bcd4}@supports (-webkit-appearance:none){.palette-primary-teal{background:#009688}}.palette-primary-teal .footer,.palette-primary-teal .header{background:#009688}.palette-primary-teal .drawer .toc a.current,.palette-primary-teal .drawer .toc a:focus,.palette-primary-teal .drawer .toc a:hover{color:#009688}.palette-primary-teal .drawer .anchor a{border-left:2px solid #009688}.ios.standalone .palette-primary-teal .article{background:-webkit-linear-gradient(top,#fff 50%,#009688 0);background:linear-gradient(180deg,#fff 50%,#009688 0)}.palette-primary-teal .article a,.palette-primary-teal .article code,.palette-primary-teal .article h1,.palette-primary-teal .article h2{color:#009688}.palette-primary-teal .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-teal .article table th{background:#40b0a6}.palette-primary-teal .results .meta{background:#009688}@supports (-webkit-appearance:none){.palette-primary-green{background:#259b24}}.palette-primary-green .footer,.palette-primary-green .header{background:#259b24}.palette-primary-green .drawer .toc a.current,.palette-primary-green .drawer .toc a:focus,.palette-primary-green .drawer .toc a:hover{color:#259b24}.palette-primary-green .drawer .anchor a{border-left:2px solid #259b24}.ios.standalone .palette-primary-green .article{background:-webkit-linear-gradient(top,#fff 50%,#259b24 0);background:linear-gradient(180deg,#fff 50%,#259b24 0)}.palette-primary-green .article a,.palette-primary-green .article code,.palette-primary-green .article h1,.palette-primary-green .article h2{color:#259b24}.palette-primary-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-green .article table th{background:#5cb45b}.palette-primary-green .results .meta{background:#259b24}@supports (-webkit-appearance:none){.palette-primary-light-green{background:#7cb342}}.palette-primary-light-green .footer,.palette-primary-light-green .header{background:#7cb342}.palette-primary-light-green .drawer .toc a.current,.palette-primary-light-green .drawer .toc a:focus,.palette-primary-light-green .drawer .toc a:hover{color:#7cb342}.palette-primary-light-green .drawer .anchor a{border-left:2px solid #7cb342}.ios.standalone .palette-primary-light-green .article{background:-webkit-linear-gradient(top,#fff 50%,#7cb342 0);background:linear-gradient(180deg,#fff 50%,#7cb342 0)}.palette-primary-light-green .article a,.palette-primary-light-green .article code,.palette-primary-light-green .article h1,.palette-primary-light-green .article h2{color:#7cb342}.palette-primary-light-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-green .article table th{background:#9dc671}.palette-primary-light-green .results .meta{background:#7cb342}@supports (-webkit-appearance:none){.palette-primary-lime{background:#c0ca33}}.palette-primary-lime .footer,.palette-primary-lime .header{background:#c0ca33}.palette-primary-lime .drawer .toc a.current,.palette-primary-lime .drawer .toc a:focus,.palette-primary-lime .drawer .toc a:hover{color:#c0ca33}.palette-primary-lime .drawer .anchor a{border-left:2px solid #c0ca33}.ios.standalone .palette-primary-lime .article{background:-webkit-linear-gradient(top,#fff 50%,#c0ca33 0);background:linear-gradient(180deg,#fff 50%,#c0ca33 0)}.palette-primary-lime .article a,.palette-primary-lime .article code,.palette-primary-lime .article h1,.palette-primary-lime .article h2{color:#c0ca33}.palette-primary-lime .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-lime .article table th{background:#d0d766}.palette-primary-lime .results .meta{background:#c0ca33}@supports (-webkit-appearance:none){.palette-primary-yellow{background:#f9a825}}.palette-primary-yellow .footer,.palette-primary-yellow .header{background:#f9a825}.palette-primary-yellow .drawer .toc a.current,.palette-primary-yellow .drawer .toc a:focus,.palette-primary-yellow .drawer .toc a:hover{color:#f9a825}.palette-primary-yellow .drawer .anchor a{border-left:2px solid #f9a825}.ios.standalone .palette-primary-yellow .article{background:-webkit-linear-gradient(top,#fff 50%,#f9a825 0);background:linear-gradient(180deg,#fff 50%,#f9a825 0)}.palette-primary-yellow .article a,.palette-primary-yellow .article code,.palette-primary-yellow .article h1,.palette-primary-yellow .article h2{color:#f9a825}.palette-primary-yellow .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-yellow .article table th{background:#fbbe5c}.palette-primary-yellow .results .meta{background:#f9a825}@supports (-webkit-appearance:none){.palette-primary-amber{background:#ffb300}}.palette-primary-amber .footer,.palette-primary-amber .header{background:#ffb300}.palette-primary-amber .drawer .toc a.current,.palette-primary-amber .drawer .toc a:focus,.palette-primary-amber .drawer .toc a:hover{color:#ffb300}.palette-primary-amber .drawer .anchor a{border-left:2px solid #ffb300}.ios.standalone .palette-primary-amber .article{background:-webkit-linear-gradient(top,#fff 50%,#ffb300 0);background:linear-gradient(180deg,#fff 50%,#ffb300 0)}.palette-primary-amber .article a,.palette-primary-amber .article code,.palette-primary-amber .article h1,.palette-primary-amber .article h2{color:#ffb300}.palette-primary-amber .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-amber .article table th{background:#ffc640}.palette-primary-amber .results .meta{background:#ffb300}@supports (-webkit-appearance:none){.palette-primary-orange{background:#fb8c00}}.palette-primary-orange .footer,.palette-primary-orange .header{background:#fb8c00}.palette-primary-orange .drawer .toc a.current,.palette-primary-orange .drawer .toc a:focus,.palette-primary-orange .drawer .toc a:hover{color:#fb8c00}.palette-primary-orange .drawer .anchor a{border-left:2px solid #fb8c00}.ios.standalone .palette-primary-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#fb8c00 0);background:linear-gradient(180deg,#fff 50%,#fb8c00 0)}.palette-primary-orange .article a,.palette-primary-orange .article code,.palette-primary-orange .article h1,.palette-primary-orange .article h2{color:#fb8c00}.palette-primary-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-orange .article table th{background:#fca940}.palette-primary-orange .results .meta{background:#fb8c00}@supports (-webkit-appearance:none){.palette-primary-deep-orange{background:#ff7043}}.palette-primary-deep-orange .footer,.palette-primary-deep-orange .header{background:#ff7043}.palette-primary-deep-orange .drawer .toc a.current,.palette-primary-deep-orange .drawer .toc a:focus,.palette-primary-deep-orange .drawer .toc a:hover{color:#ff7043}.palette-primary-deep-orange .drawer .anchor a{border-left:2px solid #ff7043}.ios.standalone .palette-primary-deep-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#ff7043 0);background:linear-gradient(180deg,#fff 50%,#ff7043 0)}.palette-primary-deep-orange .article a,.palette-primary-deep-orange .article code,.palette-primary-deep-orange .article h1,.palette-primary-deep-orange .article h2{color:#ff7043}.palette-primary-deep-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-orange .article table th{background:#ff9472}.palette-primary-deep-orange .results .meta{background:#ff7043}@supports (-webkit-appearance:none){.palette-primary-brown{background:#795548}}.palette-primary-brown .footer,.palette-primary-brown .header{background:#795548}.palette-primary-brown .drawer .toc a.current,.palette-primary-brown .drawer .toc a:focus,.palette-primary-brown .drawer .toc a:hover{color:#795548}.palette-primary-brown .drawer .anchor a{border-left:2px solid #795548}.ios.standalone .palette-primary-brown .article{background:-webkit-linear-gradient(top,#fff 50%,#795548 0);background:linear-gradient(180deg,#fff 50%,#795548 0)}.palette-primary-brown .article a,.palette-primary-brown .article code,.palette-primary-brown .article h1,.palette-primary-brown .article h2{color:#795548}.palette-primary-brown .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-brown .article table th{background:#9b8076}.palette-primary-brown .results .meta{background:#795548}@supports (-webkit-appearance:none){.palette-primary-grey{background:#757575}}.palette-primary-grey .footer,.palette-primary-grey .header{background:#757575}.palette-primary-grey .drawer .toc a.current,.palette-primary-grey .drawer .toc a:focus,.palette-primary-grey .drawer .toc a:hover{color:#757575}.palette-primary-grey .drawer .anchor a{border-left:2px solid #757575}.ios.standalone .palette-primary-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#757575 0);background:linear-gradient(180deg,#fff 50%,#757575 0)}.palette-primary-grey .article a,.palette-primary-grey .article code,.palette-primary-grey .article h1,.palette-primary-grey .article h2{color:#757575}.palette-primary-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-grey .article table th{background:#989898}.palette-primary-grey .results .meta{background:#757575}@supports (-webkit-appearance:none){.palette-primary-blue-grey{background:#546e7a}}.palette-primary-blue-grey .footer,.palette-primary-blue-grey .header{background:#546e7a}.palette-primary-blue-grey .drawer .toc a.current,.palette-primary-blue-grey .drawer .toc a:focus,.palette-primary-blue-grey .drawer .toc a:hover{color:#546e7a}.palette-primary-blue-grey .drawer .anchor a{border-left:2px solid #546e7a}.ios.standalone .palette-primary-blue-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#546e7a 0);background:linear-gradient(180deg,#fff 50%,#546e7a 0)}.palette-primary-blue-grey .article a,.palette-primary-blue-grey .article code,.palette-primary-blue-grey .article h1,.palette-primary-blue-grey .article h2{color:#546e7a}.palette-primary-blue-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue-grey .article table th{background:#7f929b}.palette-primary-blue-grey .results .meta{background:#546e7a}.palette-accent-red .article a:focus,.palette-accent-red .article a:hover{color:#ff2d6f}.palette-accent-red .repo a{background:#ff2d6f}.palette-accent-pink .article a:focus,.palette-accent-pink .article a:hover{color:#f50057}.palette-accent-pink .repo a{background:#f50057}.palette-accent-purple .article a:focus,.palette-accent-purple .article a:hover{color:#e040fb}.palette-accent-purple .repo a{background:#e040fb}.palette-accent-deep-purple .article a:focus,.palette-accent-deep-purple .article a:hover{color:#7c4dff}.palette-accent-deep-purple .repo a{background:#7c4dff}.palette-accent-indigo .article a:focus,.palette-accent-indigo .article a:hover{color:#536dfe}.palette-accent-indigo .repo a{background:#536dfe}.palette-accent-blue .article a:focus,.palette-accent-blue .article a:hover{color:#448aff}.palette-accent-blue .repo a{background:#448aff}.palette-accent-light-blue .article a:focus,.palette-accent-light-blue .article a:hover{color:#0091ea}.palette-accent-light-blue .repo a{background:#0091ea}.palette-accent-cyan .article a:focus,.palette-accent-cyan .article a:hover{color:#00b8d4}.palette-accent-cyan .repo a{background:#00b8d4}.palette-accent-teal .article a:focus,.palette-accent-teal .article a:hover{color:#00bfa5}.palette-accent-teal .repo a{background:#00bfa5}.palette-accent-green .article a:focus,.palette-accent-green .article a:hover{color:#12c700}.palette-accent-green .repo a{background:#12c700}.palette-accent-light-green .article a:focus,.palette-accent-light-green .article a:hover{color:#64dd17}.palette-accent-light-green .repo a{background:#64dd17}.palette-accent-lime .article a:focus,.palette-accent-lime .article a:hover{color:#aeea00}.palette-accent-lime .repo a{background:#aeea00}.palette-accent-yellow .article a:focus,.palette-accent-yellow .article a:hover{color:#ffd600}.palette-accent-yellow .repo a{background:#ffd600}.palette-accent-amber .article a:focus,.palette-accent-amber .article a:hover{color:#ffab00}.palette-accent-amber .repo a{background:#ffab00}.palette-accent-orange .article a:focus,.palette-accent-orange .article a:hover{color:#ff9100}.palette-accent-orange .repo a{background:#ff9100}.palette-accent-deep-orange .article a:focus,.palette-accent-deep-orange .article a:hover{color:#ff6e40}.palette-accent-deep-orange .repo a{background:#ff6e40}@media only screen and (max-width:959px){.palette-primary-red .project{background:#e84e40}.palette-primary-pink .project{background:#e91e63}.palette-primary-purple .project{background:#ab47bc}.palette-primary-deep-purple .project{background:#7e57c2}.palette-primary-indigo .project{background:#3f51b5}.palette-primary-blue .project{background:#2196f3}.palette-primary-light-blue .project{background:#03a9f4}.palette-primary-cyan .project{background:#00bcd4}.palette-primary-teal .project{background:#009688}.palette-primary-green .project{background:#259b24}.palette-primary-light-green .project{background:#7cb342}.palette-primary-lime .project{background:#c0ca33}.palette-primary-yellow .project{background:#f9a825}.palette-primary-amber .project{background:#ffb300}.palette-primary-orange .project{background:#fb8c00}.palette-primary-deep-orange .project{background:#ff7043}.palette-primary-brown .project{background:#795548}.palette-primary-grey .project{background:#757575}.palette-primary-blue-grey .project{background:#546e7a}} \ No newline at end of file diff --git a/docs/theme/assets/stylesheets/palettes.css b/docs/theme/assets/stylesheets/palettes.css deleted file mode 100644 index 576fdb72..00000000 --- a/docs/theme/assets/stylesheets/palettes.css +++ /dev/null @@ -1 +0,0 @@ -@supports (-webkit-appearance:none){.palette-primary-red{background:#e84e40}}.palette-primary-red .footer,.palette-primary-red .header{background:#e84e40}.palette-primary-red .drawer .toc a.current,.palette-primary-red .drawer .toc a:focus,.palette-primary-red .drawer .toc a:hover{color:#e84e40}.palette-primary-red .drawer .anchor a{border-left:2px solid #e84e40}.ios.standalone .palette-primary-red .article{background:-webkit-linear-gradient(top,#fff 50%,#e84e40 0);background:linear-gradient(180deg,#fff 50%,#e84e40 0)}.palette-primary-red .article a,.palette-primary-red .article code,.palette-primary-red .article h1,.palette-primary-red .article h2{color:#e84e40}.palette-primary-red .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-red .article table th{background:#ee7a70}.palette-primary-red .results .meta{background:#e84e40}@supports (-webkit-appearance:none){.palette-primary-pink{background:#e91e63}}.palette-primary-pink .footer,.palette-primary-pink .header{background:#e91e63}.palette-primary-pink .drawer .toc a.current,.palette-primary-pink .drawer .toc a:focus,.palette-primary-pink .drawer .toc a:hover{color:#e91e63}.palette-primary-pink .drawer .anchor a{border-left:2px solid #e91e63}.ios.standalone .palette-primary-pink .article{background:-webkit-linear-gradient(top,#fff 50%,#e91e63 0);background:linear-gradient(180deg,#fff 50%,#e91e63 0)}.palette-primary-pink .article a,.palette-primary-pink .article code,.palette-primary-pink .article h1,.palette-primary-pink .article h2{color:#e91e63}.palette-primary-pink .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-pink .article table th{background:#ef568a}.palette-primary-pink .results .meta{background:#e91e63}@supports (-webkit-appearance:none){.palette-primary-purple{background:#ab47bc}}.palette-primary-purple .footer,.palette-primary-purple .header{background:#ab47bc}.palette-primary-purple .drawer .toc a.current,.palette-primary-purple .drawer .toc a:focus,.palette-primary-purple .drawer .toc a:hover{color:#ab47bc}.palette-primary-purple .drawer .anchor a{border-left:2px solid #ab47bc}.ios.standalone .palette-primary-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#ab47bc 0);background:linear-gradient(180deg,#fff 50%,#ab47bc 0)}.palette-primary-purple .article a,.palette-primary-purple .article code,.palette-primary-purple .article h1,.palette-primary-purple .article h2{color:#ab47bc}.palette-primary-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-purple .article table th{background:#c075cd}.palette-primary-purple .results .meta{background:#ab47bc}@supports (-webkit-appearance:none){.palette-primary-deep-purple{background:#7e57c2}}.palette-primary-deep-purple .footer,.palette-primary-deep-purple .header{background:#7e57c2}.palette-primary-deep-purple .drawer .toc a.current,.palette-primary-deep-purple .drawer .toc a:focus,.palette-primary-deep-purple .drawer .toc a:hover{color:#7e57c2}.palette-primary-deep-purple .drawer .anchor a{border-left:2px solid #7e57c2}.ios.standalone .palette-primary-deep-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#7e57c2 0);background:linear-gradient(180deg,#fff 50%,#7e57c2 0)}.palette-primary-deep-purple .article a,.palette-primary-deep-purple .article code,.palette-primary-deep-purple .article h1,.palette-primary-deep-purple .article h2{color:#7e57c2}.palette-primary-deep-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-purple .article table th{background:#9e81d1}.palette-primary-deep-purple .results .meta{background:#7e57c2}@supports (-webkit-appearance:none){.palette-primary-indigo{background:#3f51b5}}.palette-primary-indigo .footer,.palette-primary-indigo .header{background:#3f51b5}.palette-primary-indigo .drawer .toc a.current,.palette-primary-indigo .drawer .toc a:focus,.palette-primary-indigo .drawer .toc a:hover{color:#3f51b5}.palette-primary-indigo .drawer .anchor a{border-left:2px solid #3f51b5}.ios.standalone .palette-primary-indigo .article{background:-webkit-linear-gradient(top,#fff 50%,#3f51b5 0);background:linear-gradient(180deg,#fff 50%,#3f51b5 0)}.palette-primary-indigo .article a,.palette-primary-indigo .article code,.palette-primary-indigo .article h1,.palette-primary-indigo .article h2{color:#3f51b5}.palette-primary-indigo .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-indigo .article table th{background:#6f7dc8}.palette-primary-indigo .results .meta{background:#3f51b5}@supports (-webkit-appearance:none){.palette-primary-blue{background:#2196f3}}.palette-primary-blue .footer,.palette-primary-blue .header{background:#2196f3}.palette-primary-blue .drawer .toc a.current,.palette-primary-blue .drawer .toc a:focus,.palette-primary-blue .drawer .toc a:hover{color:#2196f3}.palette-primary-blue .drawer .anchor a{border-left:2px solid #2196f3}.ios.standalone .palette-primary-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#2196f3 0);background:linear-gradient(180deg,#fff 50%,#2196f3 0)}.palette-primary-blue .article a,.palette-primary-blue .article code,.palette-primary-blue .article h1,.palette-primary-blue .article h2{color:#2196f3}.palette-primary-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue .article table th{background:#59b0f6}.palette-primary-blue .results .meta{background:#2196f3}@supports (-webkit-appearance:none){.palette-primary-light-blue{background:#03a9f4}}.palette-primary-light-blue .footer,.palette-primary-light-blue .header{background:#03a9f4}.palette-primary-light-blue .drawer .toc a.current,.palette-primary-light-blue .drawer .toc a:focus,.palette-primary-light-blue .drawer .toc a:hover{color:#03a9f4}.palette-primary-light-blue .drawer .anchor a{border-left:2px solid #03a9f4}.ios.standalone .palette-primary-light-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#03a9f4 0);background:linear-gradient(180deg,#fff 50%,#03a9f4 0)}.palette-primary-light-blue .article a,.palette-primary-light-blue .article code,.palette-primary-light-blue .article h1,.palette-primary-light-blue .article h2{color:#03a9f4}.palette-primary-light-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-blue .article table th{background:#42bff7}.palette-primary-light-blue .results .meta{background:#03a9f4}@supports (-webkit-appearance:none){.palette-primary-cyan{background:#00bcd4}}.palette-primary-cyan .footer,.palette-primary-cyan .header{background:#00bcd4}.palette-primary-cyan .drawer .toc a.current,.palette-primary-cyan .drawer .toc a:focus,.palette-primary-cyan .drawer .toc a:hover{color:#00bcd4}.palette-primary-cyan .drawer .anchor a{border-left:2px solid #00bcd4}.ios.standalone .palette-primary-cyan .article{background:-webkit-linear-gradient(top,#fff 50%,#00bcd4 0);background:linear-gradient(180deg,#fff 50%,#00bcd4 0)}.palette-primary-cyan .article a,.palette-primary-cyan .article code,.palette-primary-cyan .article h1,.palette-primary-cyan .article h2{color:#00bcd4}.palette-primary-cyan .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-cyan .article table th{background:#40cddf}.palette-primary-cyan .results .meta{background:#00bcd4}@supports (-webkit-appearance:none){.palette-primary-teal{background:#009688}}.palette-primary-teal .footer,.palette-primary-teal .header{background:#009688}.palette-primary-teal .drawer .toc a.current,.palette-primary-teal .drawer .toc a:focus,.palette-primary-teal .drawer .toc a:hover{color:#009688}.palette-primary-teal .drawer .anchor a{border-left:2px solid #009688}.ios.standalone .palette-primary-teal .article{background:-webkit-linear-gradient(top,#fff 50%,#009688 0);background:linear-gradient(180deg,#fff 50%,#009688 0)}.palette-primary-teal .article a,.palette-primary-teal .article code,.palette-primary-teal .article h1,.palette-primary-teal .article h2{color:#009688}.palette-primary-teal .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-teal .article table th{background:#40b0a6}.palette-primary-teal .results .meta{background:#009688}@supports (-webkit-appearance:none){.palette-primary-green{background:#259b24}}.palette-primary-green .footer,.palette-primary-green .header{background:#259b24}.palette-primary-green .drawer .toc a.current,.palette-primary-green .drawer .toc a:focus,.palette-primary-green .drawer .toc a:hover{color:#259b24}.palette-primary-green .drawer .anchor a{border-left:2px solid #259b24}.ios.standalone .palette-primary-green .article{background:-webkit-linear-gradient(top,#fff 50%,#259b24 0);background:linear-gradient(180deg,#fff 50%,#259b24 0)}.palette-primary-green .article a,.palette-primary-green .article code,.palette-primary-green .article h1,.palette-primary-green .article h2{color:#259b24}.palette-primary-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-green .article table th{background:#5cb45b}.palette-primary-green .results .meta{background:#259b24}@supports (-webkit-appearance:none){.palette-primary-light-green{background:#7cb342}}.palette-primary-light-green .footer,.palette-primary-light-green .header{background:#7cb342}.palette-primary-light-green .drawer .toc a.current,.palette-primary-light-green .drawer .toc a:focus,.palette-primary-light-green .drawer .toc a:hover{color:#7cb342}.palette-primary-light-green .drawer .anchor a{border-left:2px solid #7cb342}.ios.standalone .palette-primary-light-green .article{background:-webkit-linear-gradient(top,#fff 50%,#7cb342 0);background:linear-gradient(180deg,#fff 50%,#7cb342 0)}.palette-primary-light-green .article a,.palette-primary-light-green .article code,.palette-primary-light-green .article h1,.palette-primary-light-green .article h2{color:#7cb342}.palette-primary-light-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-green .article table th{background:#9dc671}.palette-primary-light-green .results .meta{background:#7cb342}@supports (-webkit-appearance:none){.palette-primary-lime{background:#c0ca33}}.palette-primary-lime .footer,.palette-primary-lime .header{background:#c0ca33}.palette-primary-lime .drawer .toc a.current,.palette-primary-lime .drawer .toc a:focus,.palette-primary-lime .drawer .toc a:hover{color:#c0ca33}.palette-primary-lime .drawer .anchor a{border-left:2px solid #c0ca33}.ios.standalone .palette-primary-lime .article{background:-webkit-linear-gradient(top,#fff 50%,#c0ca33 0);background:linear-gradient(180deg,#fff 50%,#c0ca33 0)}.palette-primary-lime .article a,.palette-primary-lime .article code,.palette-primary-lime .article h1,.palette-primary-lime .article h2{color:#c0ca33}.palette-primary-lime .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-lime .article table th{background:#d0d766}.palette-primary-lime .results .meta{background:#c0ca33}@supports (-webkit-appearance:none){.palette-primary-yellow{background:#f9a825}}.palette-primary-yellow .footer,.palette-primary-yellow .header{background:#f9a825}.palette-primary-yellow .drawer .toc a.current,.palette-primary-yellow .drawer .toc a:focus,.palette-primary-yellow .drawer .toc a:hover{color:#f9a825}.palette-primary-yellow .drawer .anchor a{border-left:2px solid #f9a825}.ios.standalone .palette-primary-yellow .article{background:-webkit-linear-gradient(top,#fff 50%,#f9a825 0);background:linear-gradient(180deg,#fff 50%,#f9a825 0)}.palette-primary-yellow .article a,.palette-primary-yellow .article code,.palette-primary-yellow .article h1,.palette-primary-yellow .article h2{color:#f9a825}.palette-primary-yellow .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-yellow .article table th{background:#fbbe5c}.palette-primary-yellow .results .meta{background:#f9a825}@supports (-webkit-appearance:none){.palette-primary-amber{background:#ffb300}}.palette-primary-amber .footer,.palette-primary-amber .header{background:#ffb300}.palette-primary-amber .drawer .toc a.current,.palette-primary-amber .drawer .toc a:focus,.palette-primary-amber .drawer .toc a:hover{color:#ffb300}.palette-primary-amber .drawer .anchor a{border-left:2px solid #ffb300}.ios.standalone .palette-primary-amber .article{background:-webkit-linear-gradient(top,#fff 50%,#ffb300 0);background:linear-gradient(180deg,#fff 50%,#ffb300 0)}.palette-primary-amber .article a,.palette-primary-amber .article code,.palette-primary-amber .article h1,.palette-primary-amber .article h2{color:#ffb300}.palette-primary-amber .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-amber .article table th{background:#ffc640}.palette-primary-amber .results .meta{background:#ffb300}@supports (-webkit-appearance:none){.palette-primary-orange{background:#fb8c00}}.palette-primary-orange .footer,.palette-primary-orange .header{background:#fb8c00}.palette-primary-orange .drawer .toc a.current,.palette-primary-orange .drawer .toc a:focus,.palette-primary-orange .drawer .toc a:hover{color:#fb8c00}.palette-primary-orange .drawer .anchor a{border-left:2px solid #fb8c00}.ios.standalone .palette-primary-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#fb8c00 0);background:linear-gradient(180deg,#fff 50%,#fb8c00 0)}.palette-primary-orange .article a,.palette-primary-orange .article code,.palette-primary-orange .article h1,.palette-primary-orange .article h2{color:#fb8c00}.palette-primary-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-orange .article table th{background:#fca940}.palette-primary-orange .results .meta{background:#fb8c00}@supports (-webkit-appearance:none){.palette-primary-deep-orange{background:#ff7043}}.palette-primary-deep-orange .footer,.palette-primary-deep-orange .header{background:#ff7043}.palette-primary-deep-orange .drawer .toc a.current,.palette-primary-deep-orange .drawer .toc a:focus,.palette-primary-deep-orange .drawer .toc a:hover{color:#ff7043}.palette-primary-deep-orange .drawer .anchor a{border-left:2px solid #ff7043}.ios.standalone .palette-primary-deep-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#ff7043 0);background:linear-gradient(180deg,#fff 50%,#ff7043 0)}.palette-primary-deep-orange .article a,.palette-primary-deep-orange .article code,.palette-primary-deep-orange .article h1,.palette-primary-deep-orange .article h2{color:#ff7043}.palette-primary-deep-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-orange .article table th{background:#ff9472}.palette-primary-deep-orange .results .meta{background:#ff7043}@supports (-webkit-appearance:none){.palette-primary-brown{background:#795548}}.palette-primary-brown .footer,.palette-primary-brown .header{background:#795548}.palette-primary-brown .drawer .toc a.current,.palette-primary-brown .drawer .toc a:focus,.palette-primary-brown .drawer .toc a:hover{color:#795548}.palette-primary-brown .drawer .anchor a{border-left:2px solid #795548}.ios.standalone .palette-primary-brown .article{background:-webkit-linear-gradient(top,#fff 50%,#795548 0);background:linear-gradient(180deg,#fff 50%,#795548 0)}.palette-primary-brown .article a,.palette-primary-brown .article code,.palette-primary-brown .article h1,.palette-primary-brown .article h2{color:#795548}.palette-primary-brown .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-brown .article table th{background:#9b8076}.palette-primary-brown .results .meta{background:#795548}@supports (-webkit-appearance:none){.palette-primary-grey{background:#757575}}.palette-primary-grey .footer,.palette-primary-grey .header{background:#757575}.palette-primary-grey .drawer .toc a.current,.palette-primary-grey .drawer .toc a:focus,.palette-primary-grey .drawer .toc a:hover{color:#757575}.palette-primary-grey .drawer .anchor a{border-left:2px solid #757575}.ios.standalone .palette-primary-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#757575 0);background:linear-gradient(180deg,#fff 50%,#757575 0)}.palette-primary-grey .article a,.palette-primary-grey .article code,.palette-primary-grey .article h1,.palette-primary-grey .article h2{color:#757575}.palette-primary-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-grey .article table th{background:#989898}.palette-primary-grey .results .meta{background:#757575}@supports (-webkit-appearance:none){.palette-primary-blue-grey{background:#546e7a}}.palette-primary-blue-grey .footer,.palette-primary-blue-grey .header{background:#546e7a}.palette-primary-blue-grey .drawer .toc a.current,.palette-primary-blue-grey .drawer .toc a:focus,.palette-primary-blue-grey .drawer .toc a:hover{color:#546e7a}.palette-primary-blue-grey .drawer .anchor a{border-left:2px solid #546e7a}.ios.standalone .palette-primary-blue-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#546e7a 0);background:linear-gradient(180deg,#fff 50%,#546e7a 0)}.palette-primary-blue-grey .article a,.palette-primary-blue-grey .article code,.palette-primary-blue-grey .article h1,.palette-primary-blue-grey .article h2{color:#546e7a}.palette-primary-blue-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue-grey .article table th{background:#7f929b}.palette-primary-blue-grey .results .meta{background:#546e7a}.palette-accent-red .article a:focus,.palette-accent-red .article a:hover{color:#ff2d6f}.palette-accent-red .repo a{background:#ff2d6f}.palette-accent-pink .article a:focus,.palette-accent-pink .article a:hover{color:#f50057}.palette-accent-pink .repo a{background:#f50057}.palette-accent-purple .article a:focus,.palette-accent-purple .article a:hover{color:#e040fb}.palette-accent-purple .repo a{background:#e040fb}.palette-accent-deep-purple .article a:focus,.palette-accent-deep-purple .article a:hover{color:#7c4dff}.palette-accent-deep-purple .repo a{background:#7c4dff}.palette-accent-indigo .article a:focus,.palette-accent-indigo .article a:hover{color:#536dfe}.palette-accent-indigo .repo a{background:#536dfe}.palette-accent-blue .article a:focus,.palette-accent-blue .article a:hover{color:#448aff}.palette-accent-blue .repo a{background:#448aff}.palette-accent-light-blue .article a:focus,.palette-accent-light-blue .article a:hover{color:#0091ea}.palette-accent-light-blue .repo a{background:#0091ea}.palette-accent-cyan .article a:focus,.palette-accent-cyan .article a:hover{color:#00b8d4}.palette-accent-cyan .repo a{background:#00b8d4}.palette-accent-teal .article a:focus,.palette-accent-teal .article a:hover{color:#00bfa5}.palette-accent-teal .repo a{background:#00bfa5}.palette-accent-green .article a:focus,.palette-accent-green .article a:hover{color:#12c700}.palette-accent-green .repo a{background:#12c700}.palette-accent-light-green .article a:focus,.palette-accent-light-green .article a:hover{color:#64dd17}.palette-accent-light-green .repo a{background:#64dd17}.palette-accent-lime .article a:focus,.palette-accent-lime .article a:hover{color:#aeea00}.palette-accent-lime .repo a{background:#aeea00}.palette-accent-yellow .article a:focus,.palette-accent-yellow .article a:hover{color:#ffd600}.palette-accent-yellow .repo a{background:#ffd600}.palette-accent-amber .article a:focus,.palette-accent-amber .article a:hover{color:#ffab00}.palette-accent-amber .repo a{background:#ffab00}.palette-accent-orange .article a:focus,.palette-accent-orange .article a:hover{color:#ff9100}.palette-accent-orange .repo a{background:#ff9100}.palette-accent-deep-orange .article a:focus,.palette-accent-deep-orange .article a:hover{color:#ff6e40}.palette-accent-deep-orange .repo a{background:#ff6e40}@media only screen and (max-width:959px){.palette-primary-red .project{background:#e84e40}.palette-primary-pink .project{background:#e91e63}.palette-primary-purple .project{background:#ab47bc}.palette-primary-deep-purple .project{background:#7e57c2}.palette-primary-indigo .project{background:#3f51b5}.palette-primary-blue .project{background:#2196f3}.palette-primary-light-blue .project{background:#03a9f4}.palette-primary-cyan .project{background:#00bcd4}.palette-primary-teal .project{background:#009688}.palette-primary-green .project{background:#259b24}.palette-primary-light-green .project{background:#7cb342}.palette-primary-lime .project{background:#c0ca33}.palette-primary-yellow .project{background:#f9a825}.palette-primary-amber .project{background:#ffb300}.palette-primary-orange .project{background:#fb8c00}.palette-primary-deep-orange .project{background:#ff7043}.palette-primary-brown .project{background:#795548}.palette-primary-grey .project{background:#757575}.palette-primary-blue-grey .project{background:#546e7a}} \ No newline at end of file diff --git a/docs/theme/base.html b/docs/theme/base.html deleted file mode 100644 index 17e1175b..00000000 --- a/docs/theme/base.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - {% block htmltitle %} - {% if page_title %} - {{ page_title }} - {{ site_name }} - {% elif page_description %} - {{ site_name }} - {{ page_description }} - {% else %} - {{ site_name }} - {% endif %} - {% if page_description %} - - {% endif %} - {% if canonical_url %} - - {% endif %} - {% if site_author %} - - {% endif %} - {% endblock %} - - - - - - - {% if config.extra.logo %} - - {% endif %} - {% set icon = icon | default("assets/images/favicon-e565ddfa3b.ico") %} - - - - - {% if config.extra.palette %} - - {% endif %} - {% if config.extra.font != "none" %} - {% set text = config.extra.get("font", {}).text | default("Ubuntu") %} - {% set code = config.extra.get("font", {}).code | default("Ubuntu Mono") %} - {% set font = text + ':400,700|' + code | replace(' ', '+') %} - - - {% endif %} - {% for path in extra_javascript %} - - {% endfor %} - {% for path in extra_css %} - - {% endfor %} - - {% block extrahead %}{% endblock %} - - {% set palette = config.extra.get("palette", {}) %} - {% set primary = palette.primary | replace(' ', '-') | lower %} - {% set accent = palette.accent | replace(' ', '-') | lower %} - - {% if repo_name == "GitHub" and repo_url %} - {% set repo_id = repo_url | replace("https://github.com/", "") %} - {% if repo_id[-1:] == "/" %} - {% set repo_id = repo_id[:-1] %} - {% endif %} - {% endif %} -

-
-
- - - -
- {% include "header.html" %} -
-
- {% set h1 = "\x3ch1 id=" in content %} -
- {% include "drawer.html" %} -
-
-
- {% if not h1 %} -

{{ page_title | default(site_name, true)}}

- {% endif %} - {{ content }} - - {% block footer %} -
- {% include "footer.html" %} -
- {% endblock %} -
-
-
-
-
-
-
-
-
-
-
- - - {% if google_analytics %} - - {% endif %} - - \ No newline at end of file diff --git a/docs/theme/drawer.html b/docs/theme/drawer.html deleted file mode 100644 index 718dd0bc..00000000 --- a/docs/theme/drawer.html +++ /dev/null @@ -1,69 +0,0 @@ - \ No newline at end of file diff --git a/docs/theme/footer.html b/docs/theme/footer.html deleted file mode 100644 index 660b28f6..00000000 --- a/docs/theme/footer.html +++ /dev/null @@ -1,42 +0,0 @@ -{% if include_next_prev %} - -{% endif %} \ No newline at end of file diff --git a/docs/theme/header.html b/docs/theme/header.html deleted file mode 100644 index aa418e22..00000000 --- a/docs/theme/header.html +++ /dev/null @@ -1,54 +0,0 @@ - \ No newline at end of file diff --git a/docs/theme/manifest.json b/docs/theme/manifest.json deleted file mode 100644 index 560aebf8..00000000 --- a/docs/theme/manifest.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "assets/images/favicon.ico": "assets/images/favicon-e565ddfa3b.ico", - "assets/javascripts/application.js": "assets/javascripts/application-dfb6964a49.js", - "assets/javascripts/modernizr.js": "assets/javascripts/modernizr-4a5cc7e01e.js", - "assets/stylesheets/application.css": "assets/stylesheets/application-21e06ffc21.css", - "assets/stylesheets/palettes.css": "assets/stylesheets/palettes-2d6c5d2926.css" -} \ No newline at end of file diff --git a/docs/theme/nav.html b/docs/theme/nav.html deleted file mode 100644 index d4641b8b..00000000 --- a/docs/theme/nav.html +++ /dev/null @@ -1,32 +0,0 @@ -{% if nav_item.children %} -
  • - {{ nav_item.title }} -
      - {% for nav_item in nav_item.children %} - {% include "nav.html" %} - {% endfor %} -
    -
  • -{% else %} -
  • - - {{ nav_item.title }} - - {% if nav_item == current_page %} - {% if h1 %} - {% set toc = (toc | first).children %} - {% endif %} - {% if toc %} - - {% endif %} - {% endif %} -
  • -{% endif %} \ No newline at end of file diff --git a/docs/update_theme b/docs/update_theme deleted file mode 100755 index 1633ce84..00000000 --- a/docs/update_theme +++ /dev/null @@ -1,2 +0,0 @@ -rm -rf theme -cp -R /Users/sglyon/src/Python/mkdocs-material/material/ theme diff --git a/examples/3d.jl b/examples/3d.jl index c6489291..2257bf3a 100644 --- a/examples/3d.jl +++ b/examples/3d.jl @@ -1,4 +1,4 @@ -using PlotlyJS +using PlotlyJS, DataFrames, RDatasets, Colors, Distributions, LinearAlgebra function random_line() n = 400 @@ -130,8 +130,8 @@ function multiple_surface() [9, 9.01, 9, 9.2, 9.23, 9.2], [8.99, 8.99, 8.98, 9.18, 9.2, 9.19], [8.93, 8.97, 8.97, 9.18, 9.2, 9.18]] - z2 = map(x->x+1, z1) - z3 = map(x->x-1, z1) + z2 = map(x->x.+1, z1) + z3 = map(x->x.-1, z1) trace1 = surface(z=z1, colorscale="Viridis") trace2 = surface(z=z2, showscale=false, opacity=0.9, colorscale="Viridis") trace3 = surface(z=z3, showscale=false, opacity=0.9, colorscale="Viridis") @@ -139,8 +139,6 @@ function multiple_surface() end function clustering_alpha_shapes() - @eval using DataFrames, RDatasets, Colors - # load data iris = dataset("datasets", "iris") nms = unique(iris[:Species]) @@ -182,7 +180,6 @@ function clustering_alpha_shapes() end function scatter_3d() - @eval using Distributions Σ = fill(0.5, 3, 3) + Diagonal([0.5, 0.5, 0.5]) obs1 = rand(MvNormal(zeros(3), Σ), 200)' obs2 = rand(MvNormal(zeros(3), 0.5Σ), 100)' diff --git a/examples/box_plots.jl b/examples/box_plots.jl index 22880fba..295777f1 100644 --- a/examples/box_plots.jl +++ b/examples/box_plots.jl @@ -204,7 +204,7 @@ function box10() colors = ["hsl($i, 50%, 50%)" for i in range(0, stop=360, length=n_box)] gen_y_data(i) = - 3.5*sin(pi*i/n_box) + i/n_box + (1.5+0.5*cos(pi*i/n_box)).*rand(10) + (3.5*sin(pi*i/n_box) + i/n_box) .+ (1.5+0.5*cos(pi*i/n_box)).*rand(10) ys = Array[gen_y_data(i) for i in 1:n_box] diff --git a/examples/finance.jl b/examples/finance.jl index 1053a2f0..61ed3fd0 100644 --- a/examples/finance.jl +++ b/examples/finance.jl @@ -1,4 +1,4 @@ -using PlotlyJS +using PlotlyJS, HTTP, CSV function ohlc1() t = ohlc(open=[33.0, 33.3, 33.5, 33.0, 34.1], @@ -9,10 +9,9 @@ function ohlc1() end function ohlc2() - # uses Quandl.jl - function get_ohlc(ticker; kwargs...) - df = quandlget("WIKI/$(ticker)", format="DataFrame") + res = HTTP.get("https://www.quandl.com/api/v3/datasets/WIKI/$(ticker)/data.csv?start_date=2017-01-01") + df = CSV.read(res.body) ohlc(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end @@ -31,10 +30,9 @@ function candlestick1() end function candlestick2() - # uses Quandl.jl - function get_candlestick(ticker; kwargs...) - df = quandlget("WIKI/$(ticker)", format="DataFrame") + res = HTTP.get("https://www.quandl.com/api/v3/datasets/WIKI/$(ticker)/data.csv?start_date=2017-01-01") + df = CSV.read(res.body) candlestick(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end diff --git a/examples/heatmaps.jl b/examples/heatmaps.jl index 2fd110d8..f3698ccb 100644 --- a/examples/heatmaps.jl +++ b/examples/heatmaps.jl @@ -1,4 +1,4 @@ -using PlotlyJS +using PlotlyJS, Random Random.seed!(42) function heatmap1() diff --git a/examples/histograms.jl b/examples/histograms.jl index b8766a05..e9a528fa 100644 --- a/examples/histograms.jl +++ b/examples/histograms.jl @@ -2,7 +2,7 @@ using PlotlyJS function two_hists() x0 = randn(500) - x1 = x0+1 + x1 = x0 .+ 1 trace1 = histogram(x=x0, opacity=0.75) trace2 = histogram(x=x1, opacity=0.75) diff --git a/examples/line_scatter.jl b/examples/line_scatter.jl index 9f7192cc..d0c7fc0b 100644 --- a/examples/line_scatter.jl +++ b/examples/line_scatter.jl @@ -1,4 +1,4 @@ -using PlotlyJS +using PlotlyJS, DataFrames, CSV, Dates function linescatter1() trace1 = scatter(;x=1:4, y=[10, 15, 13, 17], mode="markers") @@ -140,10 +140,10 @@ end function batman() # reference: https://github.com/alanedelman/18.337_2015/blob/master/Lecture01_0909/The%20Bat%20Curve.ipynb - σ(x) = √(1-x.^2) - el(x) = 3*σ(x/7) - s(x) = 4.2 - 0.5*x - 2.0*σ(0.5*x-0.5) - b(x) = σ(abs(2-x)-1) - x.^2/11 + 0.5x - 3 + σ(x) = @. √(1-x.^2) + el(x) = @. 3*σ(x/7) + s(x) = @. 4.2 - 0.5*x - 2.0*σ(0.5*x-0.5) + b(x) = @. σ(abs(2-x)-1) - x.^2/11 + 0.5x - 3 c(x) = [1.7, 1.7, 2.6, 0.9] p(i, f; kwargs...) = scatter(;x=[-i; 0.0; i], y=[f(i); NaN; f(i)], @@ -160,17 +160,15 @@ end function dumbell() # reference: https://plot.ly/r/dumbbell-plots/ - @eval using DataFrames - # read Data into dataframe nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv" download(url, nm) - df = readtable(nm) + df = CSV.read(nm) rm(nm) # sort dataframe by male earnings - df = sort(df, cols=[:Men], rev=false) + df = sort(df, :Men, rev=false) men = scatter(;y=df[:School], x=df[:Men], mode="markers", name="Men", marker=attr(color="blue", size=12)) diff --git a/examples/maps.jl b/examples/maps.jl index 0b3863ce..c5f72185 100644 --- a/examples/maps.jl +++ b/examples/maps.jl @@ -1,4 +1,4 @@ -using PlotlyJS +using PlotlyJS, DataFrames, CSV function maps1() marker = attr(size=[20, 30, 15, 10], @@ -18,13 +18,11 @@ function maps1() end function maps2() - @eval using DataFrames - # read Data into dataframe nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/2014_us_cities.csv" download(url, nm) - df = readtable(nm) + df = CSV.read(nm) rm(nm) trace = scattergeo(;locationmode="USA-states", diff --git a/examples/shapes.jl b/examples/shapes.jl index 87a7c1cf..8fcc331f 100644 --- a/examples/shapes.jl +++ b/examples/shapes.jl @@ -1,4 +1,4 @@ -using PlotlyJS +using PlotlyJS, Distributions function house() trace1 = scatter() @@ -21,7 +21,6 @@ function house2() end function clusters() - @eval using Distributions x0 = rand(Normal(2, 0.45), 300) y0 = rand(Normal(2, 0.45), 300) x1 = rand(Normal(6, 0.4), 200) diff --git a/examples/tables.jl b/examples/tables.jl index 9c8a3dd0..09170784 100644 --- a/examples/tables.jl +++ b/examples/tables.jl @@ -1,5 +1,4 @@ -using PlotlyJS -using DataFrames +using PlotlyJS, DataFrames, CSV function table1() values = [ @@ -72,7 +71,7 @@ function table3() nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" download(url, nm) - df = readtable(nm) + df = CSV.read(nm) rm(nm) data = Array(df) diff --git a/examples/ternary.jl b/examples/ternary.jl index 4f1e8d07..2012daef 100644 --- a/examples/ternary.jl +++ b/examples/ternary.jl @@ -1,4 +1,4 @@ -using PlotlyJS +using PlotlyJS, JSON function ternary_markers() function make_ax(title, tickangle) @@ -23,10 +23,10 @@ function ternary_markers() t = scatterternary( mode="markers", - a=[_[:journalist] for _ in raw_data], - b=[_[:developer] for _ in raw_data], - c=[_[:designer] for _ in raw_data], - text=[_[:label] for _ in raw_data], + a=[_x[:journalist] for _x in raw_data], + b=[_x[:developer] for _x in raw_data], + c=[_x[:designer] for _x in raw_data], + text=[_x[:label] for _x in raw_data], marker=attr(symbol=100, color="#DB7365", size=14, line_width=2) ) layout = Layout( @@ -79,12 +79,12 @@ function filled_ternary() "#ffed6f" ] - traces = Array(GenericTrace, length(raw_data)) + traces = Array{GenericTrace,1}(undef, length(raw_data)) for (i, (k, v)) in enumerate(raw_data) traces[i] = scatterternary(mode="lines", name=k, - a=[_["clay"] for _ in v], - b=[_["sand"] for _ in v], - c=[_["silt"] for _ in v], + a=[_x["clay"] for _x in v], + b=[_x["sand"] for _x in v], + c=[_x["silt"] for _x in v], line_color="#444", fill="toself", fillcolor=colors[i], diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 0e5f46d4..00000000 --- a/mkdocs.yml +++ /dev/null @@ -1,50 +0,0 @@ -site_name: PlotlyJS.jl -site_description: Julia + plotly.js -site_author: Spencer Lyon -theme_dir: 'docs/theme' - -repo_url: https://github.com/sglyon/PlotlyJS.jl - -pages: -- Home: index.md -- User Guide: - - Preliminaries: basics.md - - Building Blocks: building_traces_layouts.md - - Putting it together: syncplots.md - - Working with plots: manipulating_plots.md - - Styles: styles.md - - Contributing: contributing.md -- Examples: - - examples/3d.md - - examples/area.md - - examples/bar.md - - examples/box_plots.md - - examples/contour.md - - examples/finance.md - - examples/heatmaps.md - - examples/histograms.md - - examples/line_scatter.md - - examples/maps.md - - examples/shapes.md - - examples/subplots.md - - examples/tables.md - - examples/ternary.md - - examples/time_series.md - - examples/violin.md - -markdown_extensions: - - codehilite - - toc: - permalink: ¶ - - admonition - -google_analytics: ['UA-36732392-3', 'auto'] - -extra: - version: '0.9.0' - author: - github: 'sglyon' -extra_css: [css/github.css] -extra_javascript: ["https://cdn.plot.ly/plotly-latest.min.js"] - -copyright: Copyright © 2016 Spencer Lyon diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 67a188dc..b30cd449 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -45,41 +45,22 @@ function docs() Blink.content!(w, "html", open(f->read(f, String), schema_path), fade=false, async=false) end -function PlotlyBase.savefig(p::Union{Plot,SyncPlot}, fn::AbstractString, args...) - ext = split(fn, ".")[end] - if ext == "json" - return savejson(p, fn) - elseif ext == "html" - return savehtml(p, fn, args...) +PlotlyBase.savefig(p::SyncPlot, a...; k...) = savefig(p.plot, a...; k...) +PlotlyBase.savefig(io::IO, p::SyncPlot, a...; k...) = savefig(io, p.plot, a...; k...) + +for (mime, fmt) in PlotlyBase._KALEIDO_MIMES + @eval function Base.show( + io::IO, ::MIME{Symbol($mime)}, plt::SyncPlot, + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + ) + savefig(io, plt.plot, format = $fmt) end - has_orca = haskey(Pkg.installed(), "ORCA") - if has_orca - error("Please call `using ORCA` to save figures") - end - - if Base.isinteractive() - msg = "Saving figures requires the ORCA package." - msg *= " Would you like to install it? (Y/n) " - print(msg) - answer = readline() - if length(answer) == 0 - answer = "y" - end - if lowercase(answer)[1] == 'y' - println("here!!") - println("Ok. Installing ORCA now...") - Pkg.add("ORCA") - @info("Please call `using ORCA` and try saving your plot again") - return - end - end - msg = "Please install ORCA separately, then call `using ORCA` and try again" - error(msg) end -function __init__() - @require ORCA="47be7bcc-f1a6-5447-8b36-7eeeff7534fd" include("savefig_orca.jl") +function __init__() _build_log = joinpath(_pkg_root, "deps", "build.log") if occursin("Warning:", read(_build_log, String)) @warn("Warnings were generated during the last build of PlotlyJS: please check the build log at $_build_log") diff --git a/src/savefig_orca.jl b/src/savefig_orca.jl deleted file mode 100644 index 57d16065..00000000 --- a/src/savefig_orca.jl +++ /dev/null @@ -1,4 +0,0 @@ -PlotlyBase.savefig(p::SyncPlot, a...; k...) = savefig(p.plot, a...; k...) -PlotlyBase.savefig(io::IO, p::SyncPlot, a...; k...) = savefig(io, p.plot, a...; k...) - -# TODO: overload mime methods once they are implemented via ORCA server From 8492ecd3883bac9ae66e17690cede6326ed20743 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 16:19:59 -0400 Subject: [PATCH 15/83] ENH: add PlotlyBase to docs/Project.toml --- docs/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Project.toml b/docs/Project.toml index 1059bb46..2e6622c8 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -9,6 +9,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5" PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" From 5d9a60f46285c65edc292dd747b66b8c07364f2d Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 16:40:59 -0400 Subject: [PATCH 16/83] ENH: add deploy instruction to docs/make.jl --- docs/make.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/make.jl b/docs/make.jl index 30e438f4..2cda6cc1 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -144,3 +144,7 @@ makedocs( #=deploydocs( repo = "" )=# + +deploydocs( + repo = "github.com/JuliaPlots/PlotlyJS.jl.git", +) From 5192080bb654310e44527e87767f16bd64ac47c0 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 16:52:31 -0400 Subject: [PATCH 17/83] Update Project.toml --- Project.toml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Project.toml b/Project.toml index 2a7e5e52..858ae76c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,11 +1,10 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.14.0" +version = "0.15.0" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" -Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" JSExpr = "97c1335a-c9c5-57fe-bc5d-ec35cebe8660" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" @@ -18,15 +17,14 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df" WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" [compat] -Blink = "≥ 0.8.0" -Compat = "≥ 0.69.0" +Blink = "0.12" JSExpr = "0.5" -JSON = "≥ 0.7.0" +JSON = "0.20, 0.21" PlotlyBase = "0.4" -Reexport = "≥ 0.2.0" +Reexport = "0.2" Requires = "1.0" -WebIO = "≥ 0.8.6" -julia = "≥ 1.3.0" +WebIO = "0.8" +julia = "1.3, 1.4, 1.5" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From bd23d5321624cd32a492851725487627ef806c16 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 19 Aug 2020 21:40:16 -0400 Subject: [PATCH 18/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 858ae76c..0e426947 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.15.0" +version = "0.14.0" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" From 6ed23e0c22287339109fa927aaae8101801f38ec Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 20 Aug 2020 15:36:17 -0400 Subject: [PATCH 19/83] wip: try to make docs deploy work --- .github/workflows/deploy_docs.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index de5c6b95..e5a96786 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -8,14 +8,17 @@ on: - v* jobs: - docdeploy: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: julia-actions/julia-buildpkg@latest + - uses: julia-actions/setup-julia@latest + with: + version: '1.4' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy env: - PYTHON: "" - - uses: julia-actions/julia-docdeploy@releases/v1 - env: - DOCUMENTER_KEY: ${{ secrets.JLPKGBUTLER_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.COMPATHELPER_PRIV }} + run: julia --project=docs/ docs/make.jl From 54b3ec01738ddf93ad320c62d8bb653b216b480a Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 20 Aug 2020 15:41:30 -0400 Subject: [PATCH 20/83] DOC: more doc stuffs --- .github/workflows/deploy_docs.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index e5a96786..b749a687 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -1,24 +1,17 @@ -name: Deploy documentation - +name: Documenter on: push: - branches: - - master - tags: - - v* + branches: [master] + tags: [v*] + pull_request: jobs: - build: + docdeploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest - with: - version: '1.4' - - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Build and deploy + - uses: julia-actions/julia-buildpkg@latest + - uses: julia-actions/julia-docdeploy@latest env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.COMPATHELPER_PRIV }} - run: julia --project=docs/ docs/make.jl + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 6dc25b992e00c328f48b992e11cb3d01cfbfacea Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 20 Aug 2020 16:17:36 -0400 Subject: [PATCH 21/83] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4474ea6a..4a83a763 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Julia interface to [plotly.js][_plotlyjs] visualization library. This package constructs plotly graphics using all local resources. To interact or save graphics to the Plotly cloud, use the [`Plotly`](https://github.com/plotly/Plotly.jl) package. -Check out the [docs](http://juliaplots.github.io/PlotlyJS.jl/)! +Check out the [docs](http://juliaplots.org/PlotlyJS.jl/stable)! From c4418ccc2537d1954913af351da9fbd71a55175b Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 25 Aug 2020 21:07:47 -0400 Subject: [PATCH 22/83] Check for build log before reading it closes #346 --- src/PlotlyJS.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index b30cd449..e974d402 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -62,7 +62,7 @@ end function __init__() _build_log = joinpath(_pkg_root, "deps", "build.log") - if occursin("Warning:", read(_build_log, String)) + if isfile(_build_log) && occursin("Warning:", read(_build_log, String)) @warn("Warnings were generated during the last build of PlotlyJS: please check the build log at $_build_log") end From 353f4d950e26da8b7c0118955a12ccff168e4396 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 3 Sep 2020 09:46:49 -0400 Subject: [PATCH 23/83] Update index.md --- docs/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/index.md b/docs/src/index.md index 4dc8a67b..43cb5e77 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -36,7 +36,7 @@ PlotlyJS.jl comes with built-in support for saving figures to files via the integration between PlotlyBase.jl (a dependency of PlotlyJS.jl) and Plotly's kaleido tool. -See [exporting figures](http://juliaplots.org/PlotlyJS.jl/manipulating_plots/#saving-figures) +See [exporting figures](http://juliaplots.org/PlotlyJS.jl/stable/manipulating_plots/#Saving-figures) for more information. ### Plots.jl From f2566e0836c2a145fd48b5dcd48e1418975d1341 Mon Sep 17 00:00:00 2001 From: Eric Xia Date: Tue, 10 Nov 2020 14:09:44 -0800 Subject: [PATCH 24/83] minor typo fixes (#356) --- docs/src/syncplots.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/syncplots.md b/docs/src/syncplots.md index 229657f0..ee5d63f1 100644 --- a/docs/src/syncplots.md +++ b/docs/src/syncplots.md @@ -6,7 +6,7 @@ CurrentModule = PlotlyJS We will now look at how to combine traces and a layout to create a plot. -We'll also discuss how to integrate with various frontends +We'll also discuss how to integrate with various frontends. ## `Plot` @@ -20,7 +20,7 @@ mutable struct Plot{TT<:AbstractTrace} end ``` -Given one or more `AbstractTrace`s and optionally a `layout`, we construct a +Given one or more `AbstractTrace`s and optionally a `Layout`, we construct a `Plot` object with any of the following constructors ```julia From 8210092521df3c8953df75b284ab77e35c4ca994 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Sat, 28 Nov 2020 18:05:50 -0700 Subject: [PATCH 25/83] Switch to Julia Artifacts for JS dependencies (#358) * Switch to Julia Artifacts for JS dependencies * Try fixing sha256 hashes * Switch to tarball artifact * Fix :schema accesses --- Artifacts.toml | 6 ++++++ deps/build.jl | 18 ------------------ deps/find_attr_groups.jl | 7 ++++--- deps/generate_artifacts.jl | 22 ++++++++++++++++++++++ deps/make_schema_docs.jl | 7 ++++--- deps/update_deps.sh | 2 -- src/PlotlyJS.jl | 3 ++- src/display.jl | 5 ++++- 8 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 Artifacts.toml create mode 100644 deps/generate_artifacts.jl delete mode 100755 deps/update_deps.sh diff --git a/Artifacts.toml b/Artifacts.toml new file mode 100644 index 00000000..38cb09aa --- /dev/null +++ b/Artifacts.toml @@ -0,0 +1,6 @@ +[plotly-artifacts] +git-tree-sha1 = "0fcbca3e2dac59d4a0f4f3b3fc2de36efe0ca4a1" + + [[plotly-artifacts.download]] + sha256 = "499fa5e6a60b280c17513b13fbe5b99f37b96870446319bc27a37a137445ea6b" + url = "https://github.com/thomasjm/PlotlyJS.jl/releases/download/v0.14/plotly.js-artifacts-1.57.1.tar.gz" diff --git a/deps/build.jl b/deps/build.jl index 8e286c63..28eb1df9 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -4,24 +4,6 @@ const _pkg_assets = joinpath(_pkg_root,"assets") !isdir(_pkg_assets) && mkdir(_pkg_assets) -function datadown(thepath, thefile, theurl) - filepath = joinpath(thepath, thefile) - try - download(theurl, filepath) - catch - if isfile(filepath) - @warn("Failed to update $thefile, but you already have it. Things might continue to work, but if you would like to make sure you have the latest version of $thefile, use may use your web-browser to download it from $theurl and place it in $_pkg_deps.") - else - error("Failed to download $thefile from $theurl. You may use your web-browser to download it from $theurl and place it in $_pkg_deps.") - end - end -end - -datadown(_pkg_deps, "plotschema.json", - "https://api.plot.ly/v2/plot-schema?sha1") -datadown(_pkg_assets, "plotly-latest.min.js", - "https://cdn.plot.ly/plotly-latest.min.js") - include("make_schema_docs.jl") include("find_attr_groups.jl") AttrGroups.main() diff --git a/deps/find_attr_groups.jl b/deps/find_attr_groups.jl index d53356ab..28cde4bf 100644 --- a/deps/find_attr_groups.jl +++ b/deps/find_attr_groups.jl @@ -2,6 +2,7 @@ module AttrGroups using JSON using DelimitedFiles +using Pkg.Artifacts _symbol_dict(x) = x _symbol_dict(d::AbstractDict) = @@ -9,7 +10,7 @@ _symbol_dict(d::AbstractDict) = function main() - data = _symbol_dict(JSON.parsefile(joinpath(@__DIR__, "plotschema.json"))) + data = _symbol_dict(JSON.parsefile(joinpath(artifact"plotly-artifacts", "plot-schema.json"))) nms = Set{Symbol}() function add_to_names!(d::AbstractDict) @@ -20,8 +21,8 @@ function main() add_to_names!(s::Symbol) = push!(nms, s) add_to_names!(x) = nothing - add_to_names!(data[:schema][:layout][:layoutAttributes]) - for (_, v) in data[:schema][:traces] + add_to_names!(data[:layout][:layoutAttributes]) + for (_, v) in data[:traces] add_to_names!(v) end diff --git a/deps/generate_artifacts.jl b/deps/generate_artifacts.jl new file mode 100644 index 00000000..41e146e5 --- /dev/null +++ b/deps/generate_artifacts.jl @@ -0,0 +1,22 @@ +# This script gets run once, on a developer's machine, to generate artifacts +using Pkg.Artifacts + +artifacts_toml = joinpath(dirname(@__DIR__), "Artifacts.toml") + +rm(artifacts_toml) + +plotschema_url = "https://api.plot.ly/v2/plot-schema?sha1" +plotschema_hash = create_artifact() do artifact_dir + download(plotschema_url, joinpath(artifact_dir, "plotschema.json")) +end +bind_artifact!(artifacts_toml, "plotschema", plotschema_hash; download_info = [ + (plotschema_url, plotschema_hash) +]) + +plotly_url = "https://cdn.plot.ly/plotly-latest.min.js" +plotly_hash = create_artifact() do artifact_dir + download(plotly_url, joinpath(artifact_dir, "plotly-latest.min.js")) +end +bind_artifact!(artifacts_toml, "plotly", plotly_hash; download_info = [ + (plotly_url, plotly_hash) +]) diff --git a/deps/make_schema_docs.jl b/deps/make_schema_docs.jl index f27a5be3..c15cda86 100644 --- a/deps/make_schema_docs.jl +++ b/deps/make_schema_docs.jl @@ -3,6 +3,7 @@ module PlotlyJSSchemaDocsGenerator import Markdown using Markdown: MD using JSON +using Pkg.Artifacts # methods to re-construct a plot from JSON _symbol_dict(x) = x @@ -71,15 +72,15 @@ struct Schema layout::TraceSchema function Schema() - _path = joinpath(dirname(@__FILE__), "plotschema.json") + _path = joinpath(artifact"plotly-artifacts", "plot-schema.json") schema = _symbol_dict(JSON.parse(read(_path, String))) traces = Dict{Symbol,TraceSchema}() - for (k, v) in schema[:schema][:traces] + for (k, v) in schema[:traces] traces[k] = TraceSchema(k, v) end - layout = TraceSchema(:layout, schema[:schema][:layout], :layoutAttributes) + layout = TraceSchema(:layout, schema[:layout], :layoutAttributes) new(traces, layout) end end diff --git a/deps/update_deps.sh b/deps/update_deps.sh deleted file mode 100755 index 9a6b3f4f..00000000 --- a/deps/update_deps.sh +++ /dev/null @@ -1,2 +0,0 @@ -curl -X GET "https://api.plot.ly/v2/plot-schema?sha1" -o plotschema.json -curl https://cdn.plot.ly/plotly-latest.min.js -o plotly-latest.min.js diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index e974d402..cff903c3 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -17,13 +17,14 @@ using WebIO using JSExpr using JSExpr: @var, @new using Blink +using Pkg.Artifacts using Requires export plot # globals for this package const _pkg_root = dirname(dirname(@__FILE__)) -const _js_path = joinpath(_pkg_root, "assets", "plotly-latest.min.js") +const _js_path = joinpath(artifact"plotly-artifacts", "plotly.min.js") const _js_cdn_path = "https://cdn.plot.ly/plotly-latest.min.js" const _mathjax_cdn_path = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_SVG" diff --git a/src/display.jl b/src/display.jl index 1342e50e..3e1f90ed 100644 --- a/src/display.jl +++ b/src/display.jl @@ -1,3 +1,6 @@ + +using Pkg.Artifacts + # ----------------------------------------- # # SyncPlot -- sync Plot object with display # # ----------------------------------------- # @@ -26,7 +29,7 @@ function SyncPlot( # setup scope deps = [ - "Plotly" => joinpath(@__DIR__, "..", "assets", "plotly-latest.min.js"), + "Plotly" => joinpath(artifact"plotly-artifacts", "plotly.min.js"), joinpath(@__DIR__, "..", "assets", "plotly_webio.bundle.js") ] scope = Scope(imports=deps) From d596c866988a461a257abb00b8ae7e5ada2f28f2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Jan 2021 22:56:13 -0500 Subject: [PATCH 26/83] CompatHelper: bump compat for "PlotlyBase" to "0.5" (#364) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 0e426947..d946989a 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5" JSON = "0.20, 0.21" -PlotlyBase = "0.4" +PlotlyBase = "0.4, 0.5" Reexport = "0.2" Requires = "1.0" WebIO = "0.8" From a565768c32c1a4e8bec08f7385391fe30078a138 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Tue, 16 Mar 2021 14:24:43 +0100 Subject: [PATCH 27/83] Include 1.0 in Reexport compat bound (#367) --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d946989a..6c143f7f 100644 --- a/Project.toml +++ b/Project.toml @@ -21,7 +21,7 @@ Blink = "0.12" JSExpr = "0.5" JSON = "0.20, 0.21" PlotlyBase = "0.4, 0.5" -Reexport = "0.2" +Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" julia = "1.3, 1.4, 1.5" From 40c8c9310bdf94b7ad989993a8a1c7b5527575d5 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 16 Mar 2021 09:27:36 -0400 Subject: [PATCH 28/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6c143f7f..f71b2cf6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.14.0" +version = "0.14.1" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" From 631eeb106a241ee1cd83fea41a4309397391ecad Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Jun 2021 00:59:59 +0000 Subject: [PATCH 29/83] CompatHelper: bump compat for "JSExpr" to "1" --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index f71b2cf6..0c03e22c 100644 --- a/Project.toml +++ b/Project.toml @@ -18,7 +18,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" [compat] Blink = "0.12" -JSExpr = "0.5" +JSExpr = "0.5, 1" JSON = "0.20, 0.21" PlotlyBase = "0.4, 0.5" Reexport = "0.2, 1" From 810d322dccd59d85d24e5f4ad0ac974ccec8b4d1 Mon Sep 17 00:00:00 2001 From: Jonas Krimmer <30567171+jonas-kr@users.noreply.github.com> Date: Fri, 18 Jun 2021 17:32:35 +0200 Subject: [PATCH 30/83] Generate artifacts using gh-actions (#372) * Generate single artifact * Create artifacts.yml * Remove erroneous - * Correct path * Use archive_artifact correctly * Add tag_name * Correctly generate artifact * Update Artifacts.toml after generating artifacts * Rename * Update Artifacts.toml * Remove old tag before release * Update Artifacts.toml * Use ncipollo/release-action Allows to replace tags * Update Artifacts.toml * Fix deprecation in ncipollo/release-action * Update Artifacts.toml * Fix typo * Update Artifacts.toml * Hopefully enable update of release artifacts * Update Artifacts.toml * Obtain schema correctly * Obtain schema correctly * Rename to plotly.min.js * Update Artifacts.toml * Rename for JuliaPlots repo * Rename for JuliaPlots repo * Update Artifacts.toml * Do not update Artifact.toml automatically Compute SHA256 instead * Revert "Do not update Artifact.toml automatically" This reverts commit 21116a08f61b6a6507b3fbfa38410f4fe5b5f0a1. * Update Artifacts.toml * Update Artifacts.toml * Download artifacts directly without checksum Probably won't work... * Revert "Download artifacts directly without checksum" This reverts commit 038c23cf7898745e1c712f1646021837b894fdd3. * Update Artifacts.toml * Blink.AtomShell.install() not needed anymore * Prepare artifact versioning * Bump julia version * Update Artifacts.toml for artifact version latest * Introduce artifact versioning * Fix bash string interpolation * Update Artifacts.toml for artifact version 1.58.4 * String interpolation in artifact release * Hopefully fix env usage * Update Artifacts.toml for artifact version 1.58.4 * Allow manual triggering * Fix artifact download link * Update Artifacts.toml for artifact version 1.58.4 * Get rid of try ... catch * Bump version number * Repo specifier in generate_artifacts * Repo specifier * Update Artifacts.toml for artifact version 1.58.4 * Update Artifacts.toml for artifact version 1.58.4 Co-authored-by: github-actions[bot] --- .github/workflows/artifacts.yml | 57 +++++++++++++++++++++++++++++++ .github/workflows/deploy_docs.yml | 1 + Artifacts.toml | 6 ++-- Project.toml | 2 +- README.md | 11 +----- deps/find_attr_groups.jl | 2 +- deps/generate_artifacts.jl | 32 +++++++++-------- deps/make_schema_docs.jl | 2 +- 8 files changed, 82 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/artifacts.yml diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml new file mode 100644 index 00000000..8a64bed6 --- /dev/null +++ b/.github/workflows/artifacts.yml @@ -0,0 +1,57 @@ +# This is a basic workflow to help you get started with Actions + +name: Artifacts + +# Controls when the action will run. +on: + # Allows you to run this workflow manually from the Actions tab, do not run automatically + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "gen-artifacts" + gen-artifacts: + # The type of runner that the job will run on + runs-on: ubuntu-latest + # The plotly version. Bumping this environment variable should do the trick + env: + PLOTLY_VER: 1.58.4 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: "Checkout" + uses: actions/checkout@v2 + with: + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + + - name: "Set up Julia" + uses: julia-actions/setup-julia@v1 + with: + version: 1.6.0 + + - name: "Get artifact" + run: | + cd $GITHUB_WORKSPACE + julia -e 'include(joinpath(pwd(),"deps","generate_artifacts.jl")); generate_artifacts("'"$PLOTLY_VER"'","'"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"'")' + + - name: "Commit updated Artifacts.toml" + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -m "Update Artifacts.toml for artifact version $PLOTLY_VER" "Artifacts.toml" + + - name: "Push changes" + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + + - name: "Release" + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: "plotly-artifacts-${{ env.PLOTLY_VER }}.tar.gz" + replacesArtifacts: true + token: ${{ secrets.GITHUB_TOKEN }} + tag: "plotly-artifacts-${{ env.PLOTLY_VER }}" diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index b749a687..f1a83b84 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -4,6 +4,7 @@ on: branches: [master] tags: [v*] pull_request: + workflow_dispatch: jobs: docdeploy: diff --git a/Artifacts.toml b/Artifacts.toml index 38cb09aa..43ffbff8 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,6 +1,6 @@ [plotly-artifacts] -git-tree-sha1 = "0fcbca3e2dac59d4a0f4f3b3fc2de36efe0ca4a1" +git-tree-sha1 = "4fa45e1c116c49318fa3d60adb843b5db5c13069" [[plotly-artifacts.download]] - sha256 = "499fa5e6a60b280c17513b13fbe5b99f37b96870446319bc27a37a137445ea6b" - url = "https://github.com/thomasjm/PlotlyJS.jl/releases/download/v0.14/plotly.js-artifacts-1.57.1.tar.gz" + sha256 = "c945e3724a3969e58dee5a9f00e80a256a5c098e0b4ac8c5838c5a538e186c9d" + url = "https://github.com/jonas-kr/PlotlyJS.jl/releases/download/plotly-artifacts-1.58.4/plotly-artifacts-1.58.4.tar.gz" diff --git a/Project.toml b/Project.toml index f71b2cf6..34363c4a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.14.1" +version = "0.15" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" diff --git a/README.md b/README.md index 4a83a763..841a83c1 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,7 @@ Check out the [docs](http://juliaplots.org/PlotlyJS.jl/stable)! ## Installation -If you intend to use the [Electron display](http://juliaplots.github.io/PlotlyJS.jl/syncplots/#electronplot) or any of its features (recommended) you will need to enter the following at the Julia REPL: - -```julia -using Blink -Blink.AtomShell.install() -``` - -Note that this is a one time process. - -Also, if you have issues building this package because of installation of the MbedTLS package please see [this issue](https://github.com/sglyon/PlotlyJS.jl/issues/83). +If you have issues building this package because of installation of the MbedTLS package please see [this issue](https://github.com/sglyon/PlotlyJS.jl/issues/83). ### Jupyterlab diff --git a/deps/find_attr_groups.jl b/deps/find_attr_groups.jl index 28cde4bf..27aaabe2 100644 --- a/deps/find_attr_groups.jl +++ b/deps/find_attr_groups.jl @@ -10,7 +10,7 @@ _symbol_dict(d::AbstractDict) = function main() - data = _symbol_dict(JSON.parsefile(joinpath(artifact"plotly-artifacts", "plot-schema.json"))) + data = _symbol_dict(JSON.parsefile(joinpath(artifact"plotly-artifacts", "plot-schema.json")))[:schema] nms = Set{Symbol}() function add_to_names!(d::AbstractDict) diff --git a/deps/generate_artifacts.jl b/deps/generate_artifacts.jl index 41e146e5..49730cab 100644 --- a/deps/generate_artifacts.jl +++ b/deps/generate_artifacts.jl @@ -1,22 +1,24 @@ # This script gets run once, on a developer's machine, to generate artifacts using Pkg.Artifacts +using Downloads -artifacts_toml = joinpath(dirname(@__DIR__), "Artifacts.toml") +function generate_artifacts(ver="latest",repo="https://github.com/JuliaPlots/PlotlyJS.jl") + artifacts_toml = joinpath(dirname(@__DIR__), "Artifacts.toml") -rm(artifacts_toml) + # if Artifacts.toml does not exist we also do not have to remove it + isfile(artifacts_toml) && rm(artifacts_toml) -plotschema_url = "https://api.plot.ly/v2/plot-schema?sha1" -plotschema_hash = create_artifact() do artifact_dir - download(plotschema_url, joinpath(artifact_dir, "plotschema.json")) -end -bind_artifact!(artifacts_toml, "plotschema", plotschema_hash; download_info = [ - (plotschema_url, plotschema_hash) -]) + plotschema_url = "https://api.plot.ly/v2/plot-schema?sha1" + plotly_url = "https://cdn.plot.ly/plotly-$ver.min.js" + + plotlyartifacts_hash = create_artifact() do artifact_dir + Downloads.download(plotschema_url, joinpath(artifact_dir, "plot-schema.json")) + Downloads.download(plotly_url, joinpath(artifact_dir, "plotly.min.js")) + end + + tarball_hash = archive_artifact(plotlyartifacts_hash, "plotly-artifacts-$ver.tar.gz") -plotly_url = "https://cdn.plot.ly/plotly-latest.min.js" -plotly_hash = create_artifact() do artifact_dir - download(plotly_url, joinpath(artifact_dir, "plotly-latest.min.js")) + bind_artifact!(artifacts_toml, "plotly-artifacts", plotlyartifacts_hash; download_info = [ + ("$repo/releases/download/plotly-artifacts-$ver/plotly-artifacts-$ver.tar.gz", tarball_hash) + ]) end -bind_artifact!(artifacts_toml, "plotly", plotly_hash; download_info = [ - (plotly_url, plotly_hash) -]) diff --git a/deps/make_schema_docs.jl b/deps/make_schema_docs.jl index c15cda86..370e844f 100644 --- a/deps/make_schema_docs.jl +++ b/deps/make_schema_docs.jl @@ -73,7 +73,7 @@ struct Schema function Schema() _path = joinpath(artifact"plotly-artifacts", "plot-schema.json") - schema = _symbol_dict(JSON.parse(read(_path, String))) + schema = _symbol_dict(JSON.parse(read(_path, String)))[:schema] traces = Dict{Symbol,TraceSchema}() for (k, v) in schema[:traces] From a01a110082b89bc99f6ebe0f955c16d2e60c974f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 18 Jun 2021 15:33:26 +0000 Subject: [PATCH 31/83] Update Artifacts.toml for artifact version 1.58.4 --- Artifacts.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 43ffbff8..abb621c6 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -2,5 +2,5 @@ git-tree-sha1 = "4fa45e1c116c49318fa3d60adb843b5db5c13069" [[plotly-artifacts.download]] - sha256 = "c945e3724a3969e58dee5a9f00e80a256a5c098e0b4ac8c5838c5a538e186c9d" - url = "https://github.com/jonas-kr/PlotlyJS.jl/releases/download/plotly-artifacts-1.58.4/plotly-artifacts-1.58.4.tar.gz" + sha256 = "a1bb98f5a1b277ff6c62340d075ed4c0f1ea7589ec0d77d5046c36e021820909" + url = "https://github.com/JuliaPlots/PlotlyJS.jl/releases/download/plotly-artifacts-1.58.4/plotly-artifacts-1.58.4.tar.gz" From 31b588532bf2d59a9c97d153f29e798058e272f4 Mon Sep 17 00:00:00 2001 From: Michele Zaffalon Date: Mon, 21 Jun 2021 10:40:52 +0200 Subject: [PATCH 32/83] Corect wrong link to plotly javascript documentation --- docs/src/manipulating_plots.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/src/manipulating_plots.md b/docs/src/manipulating_plots.md index ab48629d..9757a1dc 100644 --- a/docs/src/manipulating_plots.md +++ b/docs/src/manipulating_plots.md @@ -14,23 +14,23 @@ create a new `divid` ## API functions All exported functions from the plotly.js -[API](https://plotly.com/javascriptplotlyjs-function-reference/) have been +[API](https://plotly.com/javascript/plotlyjs-function-reference/) have been exposed to Julia and operate on both `Plot` and `SyncPlot` instances. Each of these functions has semantics that match the semantics of plotly.js In PlotlyJS.jl these functions are spelled: -- [`restyle!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyrestyle): edit attributes on one or more traces -- [`relayout!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyrelayout): edit attributes on the layout -- [`update!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyupdate): combination of `restyle!` and `relayout!` -- [`react!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyreact): In place updating of all traces and layout in plot. More efficient than constructing an entirely new plot from scratch, but has the same effect. -- [`addtraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyaddtraces): add traces to a plot at specified indices -- [`deletetraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlydeletetraces): delete specific traces from a plot -- [`movetraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlymovetraces): reorder traces in a plot -- [`redraw!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyredraw): for a redraw of an entire plot -- [`purge!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlypurge): completely remove all data and layout from the chart -- [`extendtraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyextendtraces): Extend specific attributes of one or more traces with more data by appending to the end of the attribute -- [`prependtraces!`](https://plotly.com/javascriptplotlyjs-function-reference/#plotlyprependtraces): Prepend additional data to specific attributes on one or more traces +- [`restyle!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyrestyle): edit attributes on one or more traces +- [`relayout!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyrelayout): edit attributes on the layout +- [`update!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyupdate): combination of `restyle!` and `relayout!` +- [`react!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyreact): In place updating of all traces and layout in plot. More efficient than constructing an entirely new plot from scratch, but has the same effect. +- [`addtraces!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyaddtraces): add traces to a plot at specified indices +- [`deletetraces!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlydeletetraces): delete specific traces from a plot +- [`movetraces!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlymovetraces): reorder traces in a plot +- [`redraw!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyredraw): for a redraw of an entire plot +- [`purge!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlypurge): completely remove all data and layout from the chart +- [`extendtraces!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyextendtraces): Extend specific attributes of one or more traces with more data by appending to the end of the attribute +- [`prependtraces!`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyprependtraces): Prepend additional data to specific attributes on one or more traces When any of these routines is called on a `SyncPlot` the underlying `Plot` From 21ccb279e0ba6f4589bfef1e9d42d22da8ad4d82 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 24 Jun 2021 11:04:51 -0400 Subject: [PATCH 33/83] remove options from SyncPlot constructor to favor Plot.config --- src/display.jl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/display.jl b/src/display.jl index 3e1f90ed..8623434e 100644 --- a/src/display.jl +++ b/src/display.jl @@ -7,7 +7,6 @@ using Pkg.Artifacts mutable struct SyncPlot plot::PlotlyBase.Plot scope::Scope - options::Dict window::Union{Nothing,Blink.Window} end @@ -21,7 +20,6 @@ Base.show(io::IO, mm::MIME"application/prs.juno.plotpane+html", p::SyncPlot) = s function SyncPlot( p::Plot; - options::AbstractDict=Dict("showLink"=> false), kwargs... ) lowered = JSON.lower(p) @@ -50,7 +48,7 @@ function SyncPlot( scope["__get_gd_contents"] = Observable("") onjs(scope["_toImage"], @js function (options) - this.Plotly.toImage(this.plotElem, options).then(function(data) + this.Plotly.toImage(this.plotElem, options).then(function (data) $(scope["image"])[] = data end) end) @@ -100,7 +98,10 @@ function SyncPlot( # Draw plot in container Plotly.newPlot( - gd, $(lowered[:data]), $(lowered[:layout]), $(options) + gd, + $(lowered[:data]), + $(lowered[:layout]), + $(lowered[:config]), ) # hook into plotly events @@ -141,16 +142,16 @@ function SyncPlot( # to us on(scope["image"]) do x end - SyncPlot(p, scope, options, nothing) + SyncPlot(p, scope, nothing) end -function plot(args...; options=Dict(), kwargs...) - SyncPlot(Plot(args...; kwargs...); options=options) +function plot(args...; kwargs...) + SyncPlot(Plot(args...; kwargs...)) end # Add some basic Julia API methods on SyncPlot that just forward onto the Plot Base.size(sp::SyncPlot) = size(sp.plot) -Base.copy(sp::SyncPlot) = SyncPlot(copy(sp.plot), options=copy(sp.options)) +Base.copy(sp::SyncPlot) = SyncPlot(copy(sp.plot)) Base.display(::PlotlyJSDisplay, p::SyncPlot) = display_blink(p::SyncPlot) From 5f7ec63d702906f8ddf131d603a512b417fe8a62 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 24 Jun 2021 12:27:08 -0400 Subject: [PATCH 34/83] depend on plotlybase 0.5 --- docs/Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Project.toml b/docs/Project.toml index 2e6622c8..6764ea93 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -15,4 +15,4 @@ RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] -PlotlyBase = "0.4.1" +PlotlyBase = "0.5" From c8262f628d392fcd45f6aef618a6468f95cdf405 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 24 Jun 2021 12:28:15 -0400 Subject: [PATCH 35/83] renderer config via env var and use PlotlyBase.to_html --- src/PlotlyJS.jl | 51 ++++++++++++++++++++++++++-- src/display.jl | 90 ++++++++++--------------------------------------- 2 files changed, 66 insertions(+), 75 deletions(-) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index cff903c3..dfcd6f5d 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -10,7 +10,7 @@ import PlotlyBase: restyle!, relayout!, update!, addtraces!, deletetraces!, movetraces!, redraw!, extendtraces!, prependtraces!, purge!, to_image, download_image, restyle, relayout, update, addtraces, deletetraces, movetraces, redraw, - extendtraces, prependtraces, prep_kwargs, sizes, savefig, _tovec, html_body, + extendtraces, prependtraces, prep_kwargs, sizes, savefig, _tovec, react, react! using WebIO @@ -43,7 +43,7 @@ function docs() end w = Blink.Window() wait(w.content) - Blink.content!(w, "html", open(f->read(f, String), schema_path), fade=false, async=false) + Blink.content!(w, "html", open(f -> read(f, String), schema_path), fade=false, async=false) end PlotlyBase.savefig(p::SyncPlot, a...; k...) = savefig(p.plot, a...; k...) @@ -56,10 +56,21 @@ for (mime, fmt) in PlotlyBase._KALEIDO_MIMES height::Union{Nothing,Int}=nothing, scale::Union{Nothing,Real}=nothing, ) - savefig(io, plt.plot, format = $fmt) + savefig(io, plt.plot, format=$fmt) end end +@enum RENDERERS BLINK IJULIA BROWSER DOCS + +const DEFAULT_RENDERER = Ref(BLINK) + +function set_default_renderer(s::RENDERERS) + global DEFAULT_RENDERER + DEFAULT_RENDERER[] = s +end + +@inline get_renderer() = DEFAULT_RENDERER[] + function __init__() _build_log = joinpath(_pkg_root, "deps", "build.log") @@ -72,6 +83,25 @@ function __init__() include(joinpath(_pkg_root, "deps", "build.jl")) end + # set default renderer + # First check env var + env_val = get(ENV, "PLOTLY_RENDERER_JULIA", missing) + if !ismissing(env_val) + env_symbol = Symbol(uppercase(env_val)) + options = Dict(v => k for (k, v) in collect(Base.Enums.namemap(PlotlyJS.RENDERERS))) + renderer_int = get(options, env_symbol, missing) + if ismissing(renderer_int) + @warn "Unknown value for env var `PLOTLY_RENDERER_JULIA` \"$(env_val)\", known options are $(string.(keys(options)))" + else + set_default_renderer(RENDERERS(renderer_int)) + end + else + # we have no env-var + # check IJULIA + isdefined(Main, :IJulia) && Main.IJulia.inited && set_default_renderer(IJULIA) + end + + # set up display insert!(Base.Multimedia.displays, findlast(x -> x isa Base.TextDisplay || x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotlyJSDisplay()) atreplinit(i -> begin @@ -80,6 +110,21 @@ function __init__() end insert!(Base.Multimedia.displays, findlast(x -> x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotlyJSDisplay()) end) + + @require IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" begin + + function IJulia.display_dict(p::SyncPlot) + Dict( + "application/vnd.plotly.v1+json" => JSON.lower(p), + "text/plain" => sprint(show, "text/plain", p), + "text/html" => let + buf = IOBuffer() + show(buf, MIME("text/html"), p) + String(resize!(buf.data, buf.size)) + end + ) + end + end end end # module diff --git a/src/display.jl b/src/display.jl index 8623434e..187640db 100644 --- a/src/display.jl +++ b/src/display.jl @@ -1,4 +1,3 @@ - using Pkg.Artifacts # ----------------------------------------- # @@ -15,7 +14,14 @@ Base.getindex(p::SyncPlot, key) = p.scope[key] # look up Observables @WebIO.register_renderable(SyncPlot) do plot return WebIO.render(plot.scope) end -Base.show(io::IO, mm::MIME"text/html", p::SyncPlot) = show(io, mm, p.scope) + +function Base.show(io::IO, mm::MIME"text/html", p::SyncPlot) + # if we are rendering docs -- short circuit and display html + if get_renderer() == DOCS + return show(io, mm, p.plot, full_html=false, include_plotlyjs="require") + end + show(io, mm, p.scope) +end Base.show(io::IO, mm::MIME"application/prs.juno.plotpane+html", p::SyncPlot) = show(io, mm, p.scope) function SyncPlot( @@ -158,7 +164,10 @@ Base.display(::PlotlyJSDisplay, p::SyncPlot) = display_blink(p::SyncPlot) function display_blink(p::SyncPlot) sizeBuffer = 1.15 plotSize = size(p.plot) - windowOptions = Dict("width"=>floor(Int,plotSize[1]*sizeBuffer), "height"=>floor(Int,plotSize[2]*sizeBuffer)) + windowOptions = Dict( + "width" => floor(Int, plotSize[1] * sizeBuffer), + "height" => floor(Int, plotSize[2] * sizeBuffer) + ) p.window = Blink.Window(windowOptions) Blink.body!(p.window, p.scope) end @@ -184,9 +193,10 @@ end function restyle!( plt::SyncPlot, ind::Union{Int,AbstractVector{Int}}, update::AbstractDict=Dict(); - kwargs...) - restyle!(plt.plot, ind, update; kwargs...) - send_command(plt.scope, :restyle, merge(update, prep_kwargs(kwargs)), ind .- 1) + kwargs... + ) + restyle!(plt.plot, ind, update; kwargs...) + send_command(plt.scope, :restyle, merge(update, prep_kwargs(kwargs)), ind .- 1) end function restyle!(plt::SyncPlot, update::AbstractDict=Dict(); kwargs...) @@ -228,7 +238,7 @@ end function addtraces!(plt::SyncPlot, i::Int, traces::AbstractTrace...) addtraces!(plt.plot, i, traces...) - send_command(plt.scope, :addTraces, traces, i-1) + send_command(plt.scope, :addTraces, traces, i - 1) end function deletetraces!(plt::SyncPlot, inds::Int...) @@ -330,71 +340,7 @@ for f in (:extendtraces!, :prependtraces!) end -# ----------------------- # -# Other display functions # -# ----------------------- # - -const js_default = Ref(:local) - -function PlotlyBase.savehtml(io::IO, p::SyncPlot, js::Symbol=js_default[]) - - if js == :local - script_txt = "" - elseif js == :remote - script_txt = "" - elseif js == :embed - script_txt = "" - else - msg = """ - Unknown value for argument js: $js. - Possible choices are `:local`, `:remote`, `:embed` - """ - throw(ArgumentError(msg)) - end - - print(io, """ - - - $script_txt - - - $(PlotlyBase.html_body(p.plot)) - - - """) - -end - -PlotlyBase.savehtml(p::SyncPlot, fn::AbstractString, js::Symbol=js_default[]) = - open(f -> savehtml(f, p, js), fn, "w") - -""" - PlotlyBase.savehtml(io::IO, p::Union{Plot,SyncPlot}, js::Symbol=js_default[]) - PlotlyBase.savehtml(p::Union{Plot,SyncPlot}, fn::AbstractString, js::Symbol=js_default[]) - -Save plot to standalone html file suitable for including in a website or -opening in a browser - -Can either be written to an arbitrary IO stream, or saved to a file noted with -a string `fn`. - -The `js` argument can be one of - -- `:local`: Reference the local plotly.js file included in this Julia package - Pros: small file size, offline viewing. Cons: Can't share with others or - move to different machine.. -- `:remote`: Reference plotly.js from a CDN. Pros small file size, move to - other machine. Cons: need internet access to fetch from CDN -- `:embed`: Embed the entirety of your local copy of plotly.js in the - outputted file. Pros: offline viewing, move to other machine. Con: large - file size (adds about 2.7 MB) - -The default is `:local` -""" -PlotlyBase.savehtml - - -for mime in ["text/plain", "application/vnd.plotly.v1+json"] +for mime in ["text/plain", "application/vnd.plotly.v1+json", "application/prs.juno.plotpane+html"] function Base.show(io::IO, m::MIME{Symbol(mime)}, p::SyncPlot, args...) show(io, m, p.plot, args...) end From af84d6c15aa670fbee4a0394d69e15ad7711eb40 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 24 Jun 2021 18:35:56 -0400 Subject: [PATCH 36/83] update version --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 34363c4a..bc5648b6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.15" +version = "0.16.0" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" @@ -20,7 +20,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5" JSON = "0.20, 0.21" -PlotlyBase = "0.4, 0.5" +PlotlyBase = "0.6" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" From 216a41582c818fd2e03be9009a3c77d21520336b Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 25 Jun 2021 12:20:05 -0400 Subject: [PATCH 37/83] add example datasets --- datasets/carshare.csv | 250 ++++++ datasets/election.csv | 59 ++ datasets/election.geojson | 60 ++ datasets/experiment.csv | 101 +++ datasets/gapminder.csv | 1705 ++++++++++++++++++++++++++++++++++++ datasets/iris.csv | 151 ++++ datasets/medals.csv | 4 + datasets/stocks.csv | 106 +++ datasets/tips.csv | 245 ++++++ datasets/wind.csv | 129 +++ deps/generate_artifacts.jl | 6 +- src/PlotlyJS.jl | 41 +- src/display.jl | 2 - 13 files changed, 2853 insertions(+), 6 deletions(-) create mode 100644 datasets/carshare.csv create mode 100644 datasets/election.csv create mode 100644 datasets/election.geojson create mode 100644 datasets/experiment.csv create mode 100644 datasets/gapminder.csv create mode 100644 datasets/iris.csv create mode 100644 datasets/medals.csv create mode 100644 datasets/stocks.csv create mode 100644 datasets/tips.csv create mode 100644 datasets/wind.csv diff --git a/datasets/carshare.csv b/datasets/carshare.csv new file mode 100644 index 00000000..791f0a6b --- /dev/null +++ b/datasets/carshare.csv @@ -0,0 +1,250 @@ +centroid_lat,centroid_lon,car_hours,peak_hour +45.471548505146174,-73.58868408217266,1772.7499999995052,2 +45.54386506674422,-73.56245583980697,986.3333333335024,23 +45.4876395818664,-73.64276703077329,354.74999999998914,20 +45.52286967122903,-73.5956772508181,560.166666666642,23 +45.45397130964701,-73.73894559925054,2836.666666667356,19 +45.57312570194822,-73.53990236454271,1022.7500000001857,1 +45.53005389171565,-73.62803605045727,835.7500000001006,18 +45.49919320522112,-73.56194373919256,1888.3333333327334,14 +45.551300651627535,-73.61171191446698,1030.75000000018,2 +45.553809920339894,-73.57720679008477,1841.1666666661097,1 +45.47448282698679,-73.63054396371925,1966.166666665996,2 +45.53249580289159,-73.57956985159979,1532.9999999997233,3 +45.565456427575675,-73.64201176723445,834.1666666667666,21 +45.502981092849524,-73.62748995674825,289.0000000000041,11 +45.56711856838078,-73.58439300639695,273.58333333334093,1 +45.480026123563874,-73.58239204679343,594.8333333333244,5 +45.448903185047335,-73.59297686556374,1020.9166666668515,6 +45.503030898950044,-73.5790295367978,1428.4999999998183,15 +45.609667861846745,-73.54023161013792,670.7500000000256,0 +45.478348275451104,-73.57856784133362,489.4999999999585,14 +45.51951352944332,-73.5793289407554,1426.3333333331536,2 +45.56903061932889,-73.52573081459546,422.49999999997374,23 +45.53626021131554,-73.56209061086564,1624.7499999996398,3 +45.56857291481607,-73.56084340953332,732.7500000000538,20 +45.546145398119506,-73.59114755541647,1969.6666666659928,3 +45.54488834188077,-73.63562160484223,1657.9999999996096,2 +45.54515565293561,-73.6172218179539,665.5833333333566,5 +45.47817195218011,-73.56778840803071,805.08333333342,3 +45.58212955989256,-73.5214125066963,217.75000000000728,9 +45.531215706332375,-73.60636943656155,1332.583333333239,5 +45.55267826328372,-73.60186065688765,630.5000000000073,10 +45.52915993898732,-73.61182738988052,559.9999999999752,11 +45.52404418524071,-73.57255202228934,456.16666666663275,3 +45.50851711032711,-73.56361361279802,1185.8333333333724,13 +45.4880586878363,-73.62175707085048,1112.6666666667722,20 +45.50689566111847,-73.63992985736493,1016.5833333335162,13 +45.57894266654677,-73.5722622021108,1367.249999999874,9 +45.46892041666329,-73.61587858172172,1767.9999999995096,4 +45.538661649923796,-73.65684895574016,2291.9999999996985,11 +45.58530574012526,-73.556671023514,552.8333333333053,17 +45.46252493114867,-73.591450603879,1397.9166666665128,1 +45.50814302347108,-73.61443790111136,997.7500000001743,16 +45.552242186431826,-73.5567248443471,926.1666666668084,10 +45.533068241362294,-73.58586652140238,323.166666666663,19 +45.529617524254725,-73.59016001500189,833.0833333334327,5 +45.561726663480314,-73.61316030479036,1394.416666666516,10 +45.45886520703704,-73.65393428057348,601.7499999999942,16 +45.51827128926588,-73.53518132112849,1724.4999999995491,20 +45.46330588193452,-73.63201646596775,1061.5833333334854,2 +45.45722580199571,-73.6471457252509,325.74999999999574,20 +45.580421260240946,-73.62450277147559,1271.5833333332944,8 +45.512201564512644,-73.62439363857663,1951.0833333326764,3 +45.548176804195634,-73.57230388575367,961.4166666668244,2 +45.527921207745315,-73.61477370856916,507.83333333328767,12 +45.58971117459708,-73.5124596370787,679.6666666666963,1 +45.530662983670226,-73.61566624177722,734.833333333388,21 +45.497803678776116,-73.64552238789666,1057.4166666668225,20 +45.539789045655915,-73.5647843753964,262.8333333333434,7 +45.52977286764973,-73.57271916651166,1302.7499999999327,3 +45.57635821927521,-73.55658769397526,345.8333333333245,19 +45.592896967066345,-73.56283021327646,1543.3333333330472,7 +45.54282395560971,-73.53978288809766,630.7500000000074,0 +45.45146052808264,-73.60077524293251,1164.5833333333917,19 +45.50017958704209,-73.57356239315693,1676.9999999995923,11 +45.559598360083115,-73.53735411019554,1282.5833333332844,23 +45.51405331206955,-73.6328226471968,1019.000000000184,0 +45.52098513669111,-73.5859649617064,1719.1666666662206,1 +45.51969025678738,-73.56818790168714,681.5000000000305,21 +45.47196677288637,-73.645100544613,287.66666666667106,20 +45.4940320553664,-73.61062703452248,1559.3333333330327,5 +45.57383095629989,-73.60414320228709,627.4166666666725,0 +45.47270552917877,-73.60760805947412,1863.7499999994225,11 +45.58204625444414,-73.5329739761722,867.2500000001149,20 +45.4810627259832,-73.56087334817683,2413.4999999999195,9 +45.60751580853944,-73.51375636627016,1322.3333333332482,0 +45.50429652950133,-73.56520883274013,3274.0000000014848,13 +45.459862270272,-73.58285531458276,1558.9166666663664,4 +45.550869209779385,-73.617846092248,1902.416666666054,3 +45.52515960693799,-73.6047044738415,1609.1666666663207,3 +45.507436867392705,-73.57429268607511,2773.250000000574,13 +45.54836167081622,-73.58539717879967,1940.6666666660192,4 +45.53036120501041,-73.62029730985503,1597.4999999996646,11 +45.49339463589723,-73.62504495384513,162.500000000001,20 +45.49643413195211,-73.55267239661161,1929.0833333326964,13 +45.561211827035706,-73.5902004112542,847.0000000001057,19 +45.55537527937125,-73.56930840912791,1522.7499999997326,2 +45.52524090241434,-73.59981458158266,635.3333333333428,13 +45.542945623835706,-73.62128455035952,2057.166666665938,4 +45.465546068371886,-73.62067736676947,845.9166666667719,23 +45.51646059071524,-73.55492741665876,2022.9166666659444,15 +45.53280566796844,-73.64048496482262,1598.7499999996635,9 +45.47963265657448,-73.62987341664497,566.8333333333117,4 +45.45591463685107,-73.63946019785875,1714.1666666662252,3 +45.54630844232351,-73.60685622581383,680.50000000003,8 +45.49848094816177,-73.61967423595867,1043.2500000001687,11 +45.528525372523454,-73.60153035519421,673.3333333333601,11 +45.56579154043406,-73.59801021780002,1105.7500000001119,5 +45.53765718184978,-73.58232714569509,1382.9999999998597,2 +45.47455332862991,-73.637521859517,531.4999999999623,1 +45.5279051561684,-73.5845589383217,635.0000000000093,2 +45.494951534596034,-73.55953118048146,2376.833333333186,16 +45.465088224907866,-73.65258509641737,462.41666666663133,18 +45.59654571636812,-73.52593434063824,1315.6666666665876,0 +45.491523525524194,-73.63722045431894,504.4166666666218,18 +45.517922919617476,-73.58980729398637,741.2500000000576,4 +45.467778431014075,-73.63595141045859,867.3333333334483,4 +45.51117458455963,-73.57114931189177,875.5833333334521,12 +45.549158998788705,-73.63292319176229,2188.1666666661763,7 +45.535767560039695,-73.59674218487977,1172.8333333333842,4 +45.49044848119951,-73.64754965162766,332.4999999999942,2 +45.538238804018775,-73.60597173479003,1351.7499999998881,3 +45.5277041052173,-73.57565350409223,966.25000000016,2 +45.534777091929946,-73.5728803879145,981.750000000167,2 +45.48934750923581,-73.57095543068031,1714.3333333328917,12 +45.45408718820735,-73.5871111898369,813.833333333424,4 +45.472649739508654,-73.5826189686433,863.7500000001133,1 +45.556594441979996,-73.53214371066534,1202.1666666666908,5 +45.483089972430825,-73.63467979451553,665.0833333333563,10 +45.49619305656642,-73.58337891052282,2433.83333333329,15 +45.55742769063361,-73.60077343846366,1189.0000000000362,21 +45.49971820106133,-73.6544874970073,2298.583333333044,20 +45.48523078626532,-73.61782510513464,1414.9166666664973,0 +45.45863614550253,-73.64348260405826,476.49999999996146,23 +45.50110763484297,-73.63443884623427,766.3333333334024,12 +45.50643446059914,-73.55280978474548,2338.2499999997826,14 +45.52764608144713,-73.59350797166334,1170.500000000053,13 +45.48910798882796,-73.6314622358004,716.0000000000462,4 +45.52543292800497,-73.62642522019199,1228.083333333334,20 +45.60326418430284,-73.53716899543986,511.83333333328676,19 +45.478224670915985,-73.6131691288042,1357.3333333332164,2 +45.56923339719061,-73.56970219899235,1144.0833333334103,20 +45.46715978062781,-73.64277864672295,292.5000000000033,6 +45.543842954244646,-73.58224236729227,1069.0833333334785,9 +45.47954227936379,-73.54759113967883,1552.333333333039,12 +45.47510964560248,-73.56317906950511,1029.9166666668475,4 +45.54858377217711,-73.57887887297544,2752.83333333387,2 +45.54415239549018,-73.59658041602985,2077.1666666659744,3 +45.61087892678886,-73.53187026901544,1167.8333333333887,20 +45.481028563111394,-73.62384266869233,658.2500000000199,6 +45.52753294236388,-73.58132388945315,741.7500000000579,3 +45.50713730344406,-73.63043341873463,520.4166666666239,4 +45.54445300313406,-73.54776346337367,2127.4999999993993,5 +45.53978806387313,-73.54278601036688,1093.2500000001232,6 +45.53344000001958,-73.5547199999811,1590.4166666663377,5 +45.467466375494865,-73.59078190259488,696.4166666667039,21 +45.53453717264379,-73.59256240577943,1286.8333333332805,5 +45.53658915333014,-73.62157941242943,1489.1666666664298,18 +45.534297593562314,-73.61041764596348,1796.91666666615,5 +45.52410832338415,-73.58731842223665,1298.2499999999368,2 +45.47265626277289,-73.62370107695057,921.583333333473,20 +45.50559257327809,-73.62277637402323,605.5833333333293,12 +45.51901074555018,-73.57542843260613,1245.1666666666517,1 +45.52540175130616,-73.61022133725439,1261.9166666666365,4 +45.54048050327387,-73.63688048862373,1705.4999999995664,21 +45.48335540200465,-73.58250497434213,1363.999999999877,16 +45.54220224528534,-73.61142929406647,790.9166666667469,7 +45.519876273318,-73.5829101943345,1067.7500000001464,3 +45.55095552442233,-73.59145464281357,1320.4999999999166,5 +45.51670639951611,-73.57855556771429,1317.416666666586,16 +45.53834507417609,-73.57053862449274,1404.3333333331736,1 +45.54348593525155,-73.57027313720633,648.6666666666822,2 +45.499335181599186,-73.62608825396849,309.7499999999994,2 +45.57484789346844,-73.5635392336782,484.9999999999595,9 +45.47790745068288,-73.62640937405116,439.33333333330324,4 +45.54237585056225,-73.55538289355314,814.1666666667575,5 +45.46417997825538,-73.62592082119164,1264.4166666666342,5 +45.48897149612501,-73.62783793313959,655.583333333352,5 +45.570596118677166,-73.52828137402979,342.66666666665856,0 +45.549545481512375,-73.56715045890071,626.5000000000055,2 +45.56161463008111,-73.57406730167698,1059.9166666668202,2 +45.48012052331579,-73.57250207253963,321.66666666666333,14 +45.546769706786165,-73.53904284095108,676.4166666666948,3 +45.47728503507936,-73.58122340486779,201.91666666667214,10 +45.582073874173176,-73.54826893987729,1223.916666666671,21 +45.539031747248764,-73.60093377104955,1687.4166666662495,2 +45.510890621674776,-73.57633721593862,1112.583333333439,15 +45.51923221924688,-73.57244658989525,466.7499999999637,21 +45.55028382655888,-73.60783357287939,785.0833333334109,3 +45.554677131421606,-73.54632265433347,1800.833333332813,4 +45.509217063208105,-73.61862500763353,1364.5833333332098,5 +45.54493929194947,-73.62750959017946,2299.7499999997126,3 +45.55102553790574,-73.56330138226609,1038.7500000001728,2 +45.464276604795955,-73.64748824071867,722.8333333333826,4 +45.53566818785226,-73.56861361257508,1706.999999999565,3 +45.5222319477743,-73.60012669507964,1231.7499999999973,3 +45.53831624591015,-73.57466650421921,967.833333333494,3 +45.47689750165655,-73.58830635134413,1386.5833333331898,2 +45.55427699436827,-73.62166601126063,192.41666666667106,17 +45.54393996853523,-73.57394431922157,291.3333333333369,2 +45.54733066622103,-73.60149624886525,1370.9166666665374,5 +45.531729900907436,-73.5764851307457,605.4999999999959,1 +45.524053726921764,-73.5653588020603,194.08333333333792,22 +45.52567648569128,-73.59003684764208,538.7499999999656,0 +45.455662882205324,-73.64576984962405,33.24999999999985,19 +45.514928037931,-73.5716441021712,1792.749999999487,11 +45.52875593668882,-73.57904510571099,737.0833333333891,2 +45.45893633874722,-73.59639171903568,1153.7500000000682,1 +45.523397216893244,-73.60671288562885,886.0000000001235,21 +45.53380644488978,-73.58376257412169,955.6666666668218,1 +45.51698913885445,-73.58364027226557,1071.2500000001432,22 +45.47417720458765,-73.59403776813,748.2500000000608,4 +45.52430638232658,-73.58198744370928,1487.8333333330977,10 +45.57221159337733,-73.54796924219626,835.7500000001006,20 +45.531432181288466,-73.56470160854694,889.0000000001248,2 +45.52029302323953,-73.59161297526235,1337.4166666665678,2 +45.5428521988577,-73.60552201275355,1137.3333333334165,3 +45.51177396205147,-73.63749469512531,966.25000000016,20 +45.476699804159765,-73.61960578900425,1034.0000000001771,12 +45.52527451544683,-73.5938625905676,1499.6666666664203,11 +45.52904526725249,-73.56435515803537,503.58333333328864,2 +45.54589006890641,-73.613329142374,894.9166666667942,3 +45.54129653265394,-73.58761174867594,1749.4166666661931,3 +45.52641793678303,-73.59653658066382,1879.749999999408,12 +45.506014494884326,-73.62601031881215,635.1666666666761,8 +45.56249120965429,-73.58319715388312,777.0833333334073,3 +45.518606229301774,-73.59475241426874,1202.9166666666902,20 +45.52203370353778,-73.57113021855815,560.4999999999754,3 +45.52409679671165,-73.57841797764475,790.3333333334133,15 +45.52247779646763,-73.57478446870938,797.5833333334166,20 +45.53961066076051,-73.62661841692122,1156.5000000000657,3 +45.58895991968114,-73.53758992480975,1462.9166666664537,20 +45.54559560319731,-73.5672399814485,1168.0833333333885,1 +45.537473700456566,-73.57729937169172,456.24999999996606,5 +45.57342046906779,-73.6327727768197,1019.7500000001843,0 +45.53557355419221,-73.57917172211978,1167.1666666667227,2 +45.50192689559106,-73.62989603799815,478.08333333329443,5 +45.55114485440528,-73.53770269990456,1599.7499999996626,3 +45.53782697365083,-73.61519170037559,1578.0833333330156,5 +45.52940323053624,-73.58716197505838,494.49999999995737,18 +45.55301895367002,-73.58388794985183,1705.1666666662334,8 +45.55058908283418,-73.57424335824136,947.6666666668182,1 +45.496190836971444,-73.62436735080055,114.49999999999785,13 +45.5389132118943,-73.5792013969,759.4166666667326,2 +45.535798184139765,-73.58664104188827,1567.6666666663584,2 +45.5313114537718,-73.58372215024325,547.9999999999698,3 +45.52036705536745,-73.59761235604635,978.3333333334988,0 +45.48313978581276,-73.57653648384526,673.08333333336,23 +45.55297824741078,-73.59484359129024,1354.6666666665521,5 +45.55430120710761,-73.56162491267922,1355.1666666665517,2 +45.57092278674684,-73.57715490720366,898.0000000001289,10 +45.53361097030694,-73.60106645724453,701.6666666667063,11 +45.522279670736744,-73.5684337774366,873.1666666667843,21 +45.57044282123756,-73.52518192920604,235.41666666667595,7 +45.48626024282493,-73.63860168141315,998.6666666668414,18 +45.54717058947268,-73.55625786283633,951.4166666668199,3 +45.546481863801525,-73.5749389146122,795.4166666667489,2 +45.495523127814025,-73.62772501663683,425.749999999973,8 +45.52119924708915,-73.581789228748,1044.8333333335006,17 +45.53256430507208,-73.5675347056023,694.9166666667032,5 \ No newline at end of file diff --git a/datasets/election.csv b/datasets/election.csv new file mode 100644 index 00000000..d2d4743c --- /dev/null +++ b/datasets/election.csv @@ -0,0 +1,59 @@ +district,Coderre,Bergeron,Joly,total,winner,result,district_id +101-Bois-de-Liesse,2481,1829,3024,7334,Joly,plurality,101 +102-Cap-Saint-Jacques,2525,1163,2675,6363,Joly,plurality,102 +11-Sault-au-Récollet,3348,2770,2532,8650,Coderre,plurality,11 +111-Mile-End,1734,4782,2514,9030,Bergeron,majority,111 +112-DeLorimier,1770,5933,3044,10747,Bergeron,majority,112 +113-Jeanne-Mance,1455,3599,2316,7370,Bergeron,plurality,113 +12-Saint-Sulpice,3252,2521,2543,8316,Coderre,plurality,12 +121-La Pointe-aux-Prairies,5456,1760,3330,10546,Coderre,majority,121 +122-Pointe-aux-Trembles,4734,1879,2852,9465,Coderre,majority,122 +123-Rivière-des-Prairies,5737,958,1656,8351,Coderre,majority,123 +13-Ahuntsic,2979,3430,2873,9282,Bergeron,plurality,13 +131-Saint-Édouard,1827,6408,2815,11050,Bergeron,majority,131 +132-Étienne-Desmarteau,2331,5748,2788,10867,Bergeron,majority,132 +133-Vieux-Rosemont,2670,4962,3234,10866,Bergeron,plurality,133 +134-Marie-Victorin,3673,3155,2431,9259,Coderre,plurality,134 +14-Bordeaux-Cartierville,3612,1554,2081,7247,Coderre,plurality,14 +141-Côte-de-Liesse,4308,1320,3959,9587,Coderre,plurality,141 +142-Norman-McLaren,4104,1459,2822,8385,Coderre,plurality,142 +151-Saint-Léonard-Est,3931,882,1641,6454,Coderre,majority,151 +152-Saint-Léonard-Ouest,5387,1184,1908,8479,Coderre,majority,152 +161-Saint-HenriPetite-BourgognePointe-Saint-Charles,2432,3368,3578,9378,Joly,plurality,161 +162-Saint-PaulÉmard,2566,2092,2438,7096,Coderre,plurality,162 +171-ChamplainL'Île-des-Soeurs,3347,2562,3291,9200,Coderre,plurality,171 +172-Desmarchais-Crawford,2476,2631,2849,7956,Joly,plurality,172 +181-Peter-McGill,1451,754,1894,4099,Joly,plurality,181 +182-Saint-Jacques,1906,2169,2282,6357,Joly,plurality,182 +183-Sainte-Marie,1347,2827,2271,6445,Bergeron,plurality,183 +191-Saint-Michel,3668,984,1220,5872,Coderre,majority,191 +192-François-Perrault,2878,2666,2039,7583,Coderre,plurality,192 +193-Villeray,2201,5819,2782,10802,Bergeron,majority,193 +194-Parc-Extension,2420,1793,1402,5615,Coderre,plurality,194 +21-Ouest,2184,691,1076,3951,Coderre,majority,21 +22-Est,1589,708,1172,3469,Coderre,plurality,22 +23-Centre,2526,851,1286,4663,Coderre,majority,23 +31-Darlington,1873,1182,1232,4287,Coderre,plurality,31 +32-Côte-des-Neiges,1644,1950,1578,5172,Bergeron,plurality,32 +33-Snowdon,1548,1503,1636,4687,Joly,plurality,33 +34-Notre-Dame-de-Grâce,1773,2653,3262,7688,Joly,plurality,34 +35-Loyola,2040,1437,2648,6125,Joly,plurality,35 +41-du Canal,1165,832,1266,3263,Joly,plurality,41 +42-J.-Émery-Provost,1193,653,1157,3003,Coderre,plurality,42 +43-Fort-Rolland,1325,1205,1908,4438,Joly,plurality,43 +51-Sault-Saint-Louis,4201,1642,3717,9560,Coderre,plurality,51 +52-Cecil-P.-Newman,3536,1330,2943,7809,Coderre,plurality,52 +61-Pierre-Foretier,631,258,998,1887,Joly,majority,61 +62-Denis-Benjamin-Viger,595,226,1068,1889,Joly,majority,62 +63-Jacques-Bizard,518,224,690,1432,Joly,plurality,63 +64-Sainte-Geneviève,332,131,326,789,Coderre,plurality,64 +71-Tétreaultville,3694,2589,3454,9737,Coderre,plurality,71 +72-MaisonneuveLongue-Pointe,2746,3250,3139,9135,Bergeron,plurality,72 +73-Hochelaga,1546,3679,2675,7900,Bergeron,plurality,73 +74-Louis-Riel,3509,2178,2338,8025,Coderre,plurality,74 +81-Marie-Clarac,6591,1085,1435,9111,Coderre,majority,81 +82-Ovide-Clermont,6229,780,1051,8060,Coderre,majority,82 +91-Claude-Ryan,996,643,423,2062,Coderre,plurality,91 +92-Joseph-Beaubien,540,833,592,1965,Bergeron,plurality,92 +93-Robert-Bourassa,446,465,419,1330,Bergeron,plurality,93 +94-Jeanne-Sauvé,491,698,489,1678,Bergeron,plurality,94 diff --git a/datasets/election.geojson b/datasets/election.geojson new file mode 100644 index 00000000..19049fbc --- /dev/null +++ b/datasets/election.geojson @@ -0,0 +1,60 @@ +{"type":"FeatureCollection", "features": [ +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-73.6363215300962,45.5759177646435],[-73.6362833815582,45.5758266113331],[-73.6446417578686,45.5658132919643],[-73.6453511352974,45.5647725775888],[-73.648867564748,45.5586898267402],[-73.6513170845065,45.5545659435652],[-73.6515658357324,45.5554439857955],[-73.6660837831645,45.5596724837829],[-73.6706609041685,45.5610978251999],[-73.6676019919116,45.5632340862888],[-73.6645385824068,45.5642716484367],[-73.663663123697,45.5654269638586],[-73.663336397858,45.5666288247853],[-73.6637764768649,45.5678900619231],[-73.6625073244826,45.5688479494114],[-73.6624620526633,45.5708304456346],[-73.6620201425015,45.5713925326191],[-73.6616100197742,45.5737924780218],[-73.6612199500215,45.5747171555678],[-73.6625087613399,45.5748980132699],[-73.6639172423219,45.5730041908097],[-73.6654358660443,45.5729040009532],[-73.6661069174428,45.5737928224235],[-73.6657870687343,45.574385118162],[-73.6636711124334,45.577018676761],[-73.6620928771361,45.578161887933],[-73.6611738698168,45.5798517041392],[-73.660404649744,45.5806752214364],[-73.659760079306,45.5804007503503],[-73.6604711314507,45.5793767269523],[-73.660479658497,45.5787710701802],[-73.6613549575147,45.5780184952852],[-73.6617871566128,45.5758213640561],[-73.6607445476436,45.5764832852254],[-73.6608243059909,45.5774702934068],[-73.6592236423267,45.5793785624903],[-73.6570262958283,45.5810509513563],[-73.6552694168748,45.5819333817794],[-73.6543058972308,45.5836262624158],[-73.652557313063,45.5826892716542],[-73.6363215300962,45.5759177646435]]],[[[-73.6561004885273,45.5841347974261],[-73.656376117147,45.5845383929424],[-73.6559939844354,45.585868003125],[-73.6552168328229,45.5855392416017],[-73.6561004885273,45.5841347974261]]]]},"properties":{"district": "11-Sault-au-Récollet"},"id":"11"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6217484540132,45.5544783077209],[-73.6235005117779,45.5536358848324],[-73.6278096771011,45.5513024018691],[-73.6301686544477,45.5503989164938],[-73.6325600663803,45.5499795021129],[-73.6342899238824,45.5494628161417],[-73.6363671046978,45.548169415833],[-73.6398673671325,45.5441488267699],[-73.6407295659042,45.5429686686779],[-73.6485543103777,45.5308320827376],[-73.6510270564502,45.5263874543882],[-73.6555330494037,45.5277342274232],[-73.6698852350516,45.5318835785726],[-73.6726124365382,45.5322997327559],[-73.6747555535799,45.5323081056009],[-73.6764129283619,45.5321264506516],[-73.683124268159,45.5305991300384],[-73.6807721370907,45.534331320177],[-73.6785046215606,45.5379069417581],[-73.6752852955733,45.5369404343695],[-73.6740837310465,45.5378868187786],[-73.6687347480061,45.5363337408676],[-73.667891862525,45.5387409623539],[-73.664945183105,45.5382590909533],[-73.6646235398403,45.5394847807605],[-73.662249203322,45.543633408253],[-73.6616100449503,45.5441416421638],[-73.6604302515405,45.5460790656787],[-73.6568659704249,45.5450525873044],[-73.6513170845065,45.5545659435652],[-73.648867564748,45.5586898267402],[-73.6453511352974,45.5647725775888],[-73.6240413737876,45.5555253903511],[-73.6217484540132,45.5544783077209]]]},"properties":{"district": "12-Saint-Sulpice"},"id":"12"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6513170845065,45.5545659435652],[-73.6568659704249,45.5450525873044],[-73.6604302515405,45.5460790656787],[-73.6616100449503,45.5441416421638],[-73.662249203322,45.543633408253],[-73.6646235398403,45.5394847807605],[-73.664945183105,45.5382590909533],[-73.667891862525,45.5387409623539],[-73.6687347480061,45.5363337408676],[-73.6740837310465,45.5378868187786],[-73.6752852955733,45.5369404343695],[-73.6785046215606,45.5379069417581],[-73.6807721370907,45.534331320177],[-73.6920199187781,45.5394683031028],[-73.702520410412,45.5431766227664],[-73.7042065154565,45.5438906316964],[-73.7043014929187,45.5441905861876],[-73.7027027602765,45.5451406840713],[-73.7023335988111,45.5457621950639],[-73.7012226911876,45.5459702396396],[-73.7004635154173,45.5466167282154],[-73.6996123824321,45.5464852570484],[-73.6992033294858,45.5475781625301],[-73.6968595536907,45.5481581755357],[-73.6949311086011,45.5474604427764],[-73.6924688517172,45.5472280284581],[-73.6891281157722,45.5477334249253],[-73.6879273316976,45.5481318231022],[-73.6865595013798,45.5491308196528],[-73.6852748086046,45.5488162600605],[-73.6827845213391,45.5489146412483],[-73.6801283681886,45.549462773374],[-73.6791182211476,45.5500801562043],[-73.6772981030339,45.5516675115113],[-73.6765545558035,45.552766523393],[-73.6744642269172,45.5548591969672],[-73.6730096784532,45.5582339830541],[-73.6706609041685,45.5610978251999],[-73.6660837831645,45.5596724837829],[-73.6515658357324,45.5554439857955],[-73.6513170845065,45.5545659435652]]]},"properties":{"district": "13-Ahuntsic"},"id":"13"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.7043014929187,45.5441905861876],[-73.7042065154565,45.5438906316964],[-73.702520410412,45.5431766227664],[-73.6920199187781,45.5394683031028],[-73.6807721370907,45.534331320177],[-73.683124268159,45.5305991300384],[-73.685195685208,45.5301022578388],[-73.6870922504792,45.5286619976995],[-73.6897803429098,45.5288476157777],[-73.6939612003867,45.528347826243],[-73.6963296087078,45.5276805484038],[-73.7091218538247,45.5230954877394],[-73.7112612170074,45.5243023856458],[-73.7131122096208,45.5251637887575],[-73.7145584630039,45.5239315629596],[-73.7172924358234,45.5256928911099],[-73.7185119695016,45.5247508136954],[-73.7217031155859,45.5267447688191],[-73.7280602953464,45.5213554616816],[-73.7317546325275,45.5236815365784],[-73.7358987648866,45.5207291683311],[-73.7285097856203,45.5160943522463],[-73.7350991221023,45.5137867482303],[-73.7550630650544,45.5065238038199],[-73.7551669017747,45.5064862077527],[-73.7612752776246,45.5104175090183],[-73.7638683329059,45.5120860463668],[-73.762390301954,45.5126791739444],[-73.7600609683013,45.5141288858482],[-73.7568442082942,45.5171884494623],[-73.7548593171474,45.5180889539846],[-73.752606980088,45.5185523798859],[-73.749151955166,45.519018390863],[-73.7452110015187,45.5215286261207],[-73.7437662661847,45.5231373686573],[-73.7411211602605,45.526837900694],[-73.7394306858002,45.5285277381045],[-73.7360589393138,45.5302671129156],[-73.7343347000828,45.5309824138834],[-73.7311072638005,45.5320095049916],[-73.7283844986554,45.533203827821],[-73.7249729419404,45.5359178137401],[-73.7231098233772,45.5369689627545],[-73.7202103870331,45.5381794076214],[-73.7181375140605,45.5387109207903],[-73.7158043157039,45.5388996570908],[-73.7135388429561,45.5396848689224],[-73.7111454931799,45.541340948266],[-73.7091038651233,45.5430898357363],[-73.7078456046825,45.5423008892929],[-73.7069875096913,45.5436077713277],[-73.705614345008,45.5441267025504],[-73.7043014929187,45.5441905861876]]]},"properties":{"district": "14-Bordeaux-Cartierville"},"id":"14"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5576871015794,45.5932166140624],[-73.5694206600629,45.5971486400825],[-73.5696609688417,45.5965806032278],[-73.5726733802096,45.5977479911912],[-73.5745938220503,45.5986717630315],[-73.576232424293,45.5992577290381],[-73.5771288919308,45.599852413767],[-73.5889961999073,45.6050220349527],[-73.5971103983983,45.6085989887758],[-73.6013378366857,45.6104025414741],[-73.6028907661658,45.6112216102358],[-73.601559767966,45.6118073578371],[-73.6023660828945,45.6125718329314],[-73.5984976040034,45.6140840514745],[-73.5954830428467,45.6158123480652],[-73.5740068269183,45.6304929149516],[-73.5683379250343,45.6341956640577],[-73.5514095863784,45.6269444197056],[-73.5481773494253,45.6255197854529],[-73.5585223912755,45.6137280036474],[-73.5640615699407,45.6074316710882],[-73.564986439275,45.60561620283],[-73.5662995431109,45.6039974029119],[-73.5631517029922,45.6031634368599],[-73.5614050931716,45.6025489377902],[-73.5567925816714,45.6005393547562],[-73.5589887922886,45.5979945383903],[-73.5595164040348,45.5961661000645],[-73.5564557704867,45.5951543577536],[-73.5576871015794,45.5932166140624]]]},"properties":{"district": "21-Ouest"},"id":"21"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5452799498143,45.5959627917351],[-73.5491007054645,45.5975302159963],[-73.5479841638628,45.5989434662401],[-73.5468145864499,45.6013644519429],[-73.5461968110206,45.6046211322422],[-73.549913736884,45.605150517886],[-73.5533688744189,45.605412630486],[-73.5524302953106,45.6080081462088],[-73.5507759763854,45.6103339985918],[-73.5585223912755,45.6137280036474],[-73.5481773494253,45.6255197854529],[-73.5358870172169,45.620207093019],[-73.5374747721378,45.6166252950092],[-73.5375256945614,45.6160673327401],[-73.5381703589619,45.6139517855176],[-73.5437218072693,45.6149096422408],[-73.5452777806501,45.6141657083913],[-73.5462767505068,45.6127238289344],[-73.5444977198785,45.6121760838565],[-73.5453373826653,45.6107633861198],[-73.5441363974969,45.6102716461918],[-73.5412098839782,45.6095033241271],[-73.5416434070878,45.6081797015109],[-73.540900931842,45.6078533012629],[-73.5416213388458,45.606939681157],[-73.5375401492111,45.6052359766051],[-73.5365038947396,45.6026457300995],[-73.5365958888719,45.602162446611],[-73.5394321608651,45.6030910243993],[-73.5421763850909,45.6042454438226],[-73.5429289535666,45.6032316351511],[-73.539729971205,45.6018186221009],[-73.5407418924341,45.6006998521118],[-73.5447576674512,45.6019410417126],[-73.5451108447268,45.6000061818095],[-73.5445859643042,45.5999308464328],[-73.5442050076359,45.5981948225546],[-73.5438572127564,45.5980784963673],[-73.5452799498143,45.5959627917351]]]},"properties":{"district": "22-Est"},"id":"22"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5576871015794,45.5932166140624],[-73.5564557704867,45.5951543577536],[-73.5595164040348,45.5961661000645],[-73.5589887922886,45.5979945383903],[-73.5567925816714,45.6005393547562],[-73.5614050931716,45.6025489377902],[-73.5631517029922,45.6031634368599],[-73.5662995431109,45.6039974029119],[-73.564986439275,45.60561620283],[-73.5640615699407,45.6074316710882],[-73.5585223912755,45.6137280036474],[-73.5507759763854,45.6103339985918],[-73.5524302953106,45.6080081462088],[-73.5533688744189,45.605412630486],[-73.549913736884,45.605150517886],[-73.5461968110206,45.6046211322422],[-73.5468145864499,45.6013644519429],[-73.5479841638628,45.5989434662401],[-73.5491007054645,45.5975302159963],[-73.5452799498143,45.5959627917351],[-73.5455045323429,45.5956272275911],[-73.545930102715,45.5949937733284],[-73.5473484500099,45.5955355370728],[-73.5481396292151,45.5946360429193],[-73.5465394629102,45.5940712033384],[-73.5489394765731,45.5903029802044],[-73.5576871015794,45.5932166140624]]]},"properties":{"district": "23-Centre"},"id":"23"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6207592308166,45.5138993727882],[-73.6236560898078,45.5106541632808],[-73.624384898555,45.5091582170891],[-73.6260875230251,45.507277208983],[-73.6279506225702,45.5061120243158],[-73.628749836468,45.5048079525531],[-73.6304494685866,45.5028490467289],[-73.6256440443835,45.500662130816],[-73.6331323407225,45.49234917306],[-73.6480439724158,45.4990451424615],[-73.6458072174417,45.5016289991394],[-73.6422399591459,45.5054987858353],[-73.6423036889254,45.5062221151428],[-73.6415508188144,45.5069829054595],[-73.6416660769228,45.5076101030023],[-73.6385805807369,45.5112159439382],[-73.6365911851412,45.5146566965285],[-73.6357295158589,45.5143963845137],[-73.6346269691423,45.5156528191911],[-73.6289040380069,45.5140823858644],[-73.6267223236567,45.5165801475772],[-73.6207592308166,45.5138993727882]]]},"properties":{"district": "31-Darlington"},"id":"31"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5956108742759,45.504064067218],[-73.5941401789655,45.5033436344744],[-73.594737745289,45.5028667176493],[-73.5977240363362,45.5016310280474],[-73.5997960499359,45.5001439911523],[-73.6009279740317,45.4988800346583],[-73.6033750499038,45.4967309718248],[-73.6044775189475,45.4952226776326],[-73.6068399722065,45.4952769144878],[-73.6083680626652,45.493592693099],[-73.6093606035265,45.4939788081012],[-73.6115925457235,45.4916920833656],[-73.6147351668377,45.4930299583055],[-73.6184160919695,45.4889467204633],[-73.618423454854,45.4881800607925],[-73.6153515138627,45.4867956883177],[-73.6169038962737,45.4851011880198],[-73.6331323407225,45.49234917306],[-73.6256440443835,45.500662130816],[-73.6304494685866,45.5028490467289],[-73.628749836468,45.5048079525531],[-73.6279506225702,45.5061120243158],[-73.6260875230251,45.507277208983],[-73.624384898555,45.5091582170891],[-73.6236560898078,45.5106541632808],[-73.6207592308166,45.5138993727882],[-73.6176645335398,45.5125000231349],[-73.617959519301,45.5121686212918],[-73.61888001694,45.5111346532789],[-73.6169256431203,45.5102737338336],[-73.6178928803835,45.5091750557282],[-73.6160933747766,45.5082725969653],[-73.6189454361275,45.5051234940594],[-73.6182356279483,45.504722156916],[-73.6130513861854,45.5104478685544],[-73.6063535452531,45.5074911306599],[-73.6061344132343,45.5068772235294],[-73.6035337540631,45.5057001623398],[-73.6024762927983,45.5068574351344],[-73.5993805679324,45.5053898653966],[-73.5987846893921,45.5056180649425],[-73.5956108742759,45.504064067218]]]},"properties":{"district": "32-Côte-des-Neiges"},"id":"32"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6458072174417,45.5016289991394],[-73.6480439724158,45.4990451424615],[-73.6331323407225,45.49234917306],[-73.6169038962737,45.4851011880198],[-73.6171481421592,45.4848346166979],[-73.6143642141962,45.4835868912093],[-73.6159143530659,45.4828328944331],[-73.6178740199084,45.4828487105026],[-73.6188871149392,45.4826094451865],[-73.6212759199926,45.4802684345737],[-73.6225662166532,45.4809098124242],[-73.6236079242847,45.479859834089],[-73.6247644644914,45.4792722536745],[-73.6274376104247,45.4787022686984],[-73.6296262215988,45.478422071886],[-73.6309839979771,45.4790336481084],[-73.6303804074798,45.4796761714723],[-73.6511475576679,45.4890232837666],[-73.6486185977978,45.4918874029923],[-73.6505027283703,45.4926843456098],[-73.6558244313911,45.4867907549359],[-73.6554964724779,45.4865593791057],[-73.6559518311015,45.4851214751334],[-73.6560231568666,45.4789400952457],[-73.6611067166692,45.4811529055447],[-73.6618618884249,45.4803203895973],[-73.6695855765435,45.483802365291],[-73.6746342471328,45.4819683440264],[-73.6763145414839,45.4831298265322],[-73.6776271543493,45.4823345919293],[-73.677264286648,45.4836591822082],[-73.6751680903633,45.4912833590877],[-73.6678730495106,45.4869534898132],[-73.6660964808822,45.4866186123515],[-73.665349200462,45.4870183659149],[-73.6562276688947,45.49432722353],[-73.6637510731136,45.4992450684359],[-73.6617471598017,45.4992191258018],[-73.6623623016746,45.5022066512214],[-73.6605369493135,45.5024306141327],[-73.6600841825714,45.50331916613],[-73.659999506549,45.5047080114556],[-73.6566453499119,45.5037588241059],[-73.6516126661051,45.504311872331],[-73.6458072174417,45.5016289991394]]]},"properties":{"district": "33-Snowdon"},"id":"33"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6143642141962,45.4835868912093],[-73.6123997707291,45.4826898974257],[-73.6143764334436,45.4805885224868],[-73.6054346259738,45.4765925587108],[-73.605024536716,45.4770080719998],[-73.5985471562789,45.4740708829885],[-73.5951347718664,45.4764466331536],[-73.5966486659517,45.4732210790839],[-73.5995923966142,45.4714885118876],[-73.6015380888098,45.4698449656495],[-73.6025897276388,45.4690525247808],[-73.6031619796725,45.4691032161751],[-73.6056266168094,45.4676031109374],[-73.6058459619009,45.4672881102352],[-73.6116004847967,45.4647691120724],[-73.6121904900053,45.4648542087469],[-73.6157015928197,45.4632907897894],[-73.6167538282606,45.4637150194085],[-73.6260868871444,45.4678594502274],[-73.626514031426,45.4682540051731],[-73.6317531402478,45.4705324186308],[-73.6328791824832,45.4692477650227],[-73.6375349663401,45.4712784001916],[-73.636638362928,45.4717833758261],[-73.6429334550997,45.4745543212637],[-73.6397624769414,45.4766952953752],[-73.6393702983563,45.4768105158646],[-73.6354876412699,45.4768957315274],[-73.6324931664858,45.477871983287],[-73.6296262215988,45.478422071886],[-73.6274376104247,45.4787022686984],[-73.6247644644914,45.4792722536745],[-73.6236079242847,45.479859834089],[-73.6225662166532,45.4809098124242],[-73.6212759199926,45.4802684345737],[-73.6188871149392,45.4826094451865],[-73.6178740199084,45.4828487105026],[-73.6159143530659,45.4828328944331],[-73.6143642141962,45.4835868912093]]]},"properties":{"district": "34-Notre-Dame-de-Grâce"},"id":"34"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6157015928197,45.4632907897894],[-73.6182352042185,45.4622268121902],[-73.6200562870233,45.4616683026575],[-73.6243236842049,45.4586553508057],[-73.6262003043123,45.4574918787775],[-73.6314544395632,45.4527593013115],[-73.6350181512615,45.4509158064615],[-73.6351722497066,45.4507225431116],[-73.6579831562151,45.4595353374805],[-73.6571683135528,45.4601081011059],[-73.6581848068946,45.4614565130998],[-73.6556103303451,45.4629114310011],[-73.652126146378,45.4676895103383],[-73.650271326417,45.4688055451965],[-73.6491060800072,45.4705082201931],[-73.6456903840605,45.4732294857318],[-73.6429334550997,45.4745543212637],[-73.636638362928,45.4717833758261],[-73.6375349663401,45.4712784001916],[-73.6328791824832,45.4692477650227],[-73.6317531402478,45.4705324186308],[-73.626514031426,45.4682540051731],[-73.6260868871444,45.4678594502274],[-73.6167538282606,45.4637150194085],[-73.6157015928197,45.4632907897894]]]},"properties":{"district": "35-Loyola"},"id":"35"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6827804258142,45.4635658825978],[-73.680902143784,45.4623754221733],[-73.6819797751037,45.4611465117243],[-73.6828103840958,45.4609562889736],[-73.6837901612144,45.4594789107516],[-73.6850645006026,45.4581450364168],[-73.6872613190858,45.45743059602],[-73.6874478222607,45.4558195821286],[-73.6872205285223,45.4552707229765],[-73.6763900162006,45.4523637929963],[-73.67377108286,45.4530336717393],[-73.6720573706002,45.4528472783153],[-73.6708095323057,45.454567942777],[-73.6685657847746,45.4567309452231],[-73.6569820780073,45.4523202088578],[-73.6448369147901,45.4475941198865],[-73.6433550395347,45.4477889354918],[-73.6432919538684,45.4483609262331],[-73.6389029083366,45.4466926413334],[-73.6367835977829,45.447838031415],[-73.6320301276656,45.4495010416609],[-73.6290926270452,45.4483946176344],[-73.6320762130349,45.4466558317026],[-73.6351699979365,45.445393422083],[-73.6392793914912,45.4438396460105],[-73.6470945537851,45.4407073290916],[-73.648051977364,45.4402561224796],[-73.6537698617598,45.4370900482024],[-73.6593235959903,45.4348597630844],[-73.6621186235209,45.433443013701],[-73.6659361085031,45.4320787105657],[-73.665989308902,45.4284342302665],[-73.6689564175307,45.4291767414944],[-73.6731193300976,45.4280636694712],[-73.6759423999609,45.4276813808521],[-73.6833563260685,45.4282185950861],[-73.6865003978824,45.4283124979178],[-73.6878687931234,45.4286162358336],[-73.6882161207604,45.4292815314123],[-73.6856210014114,45.4290337944536],[-73.6824907873074,45.4293268197374],[-73.6802412950549,45.4292313975545],[-73.675637946869,45.4284197115606],[-73.6730699666729,45.4286396172162],[-73.6691630663163,45.429896298712],[-73.6694459537283,45.4304807516148],[-73.6730208497195,45.4292965595349],[-73.6750647146261,45.4289965544438],[-73.6767010508474,45.4291739328909],[-73.6788386194388,45.4302144484015],[-73.6788136864397,45.4304304732339],[-73.6733659453582,45.4293230346261],[-73.6691401095123,45.4307511873639],[-73.6696391042462,45.4309484342688],[-73.6714905342855,45.4303967061942],[-73.6716716548405,45.4310983881409],[-73.6737798875814,45.4309332101671],[-73.6775256263951,45.431305335836],[-73.6792911320404,45.4318695414462],[-73.6820917599341,45.4323959865103],[-73.6847244511365,45.4323557615008],[-73.6843819981847,45.4331481730083],[-73.6862880355843,45.433675955614],[-73.6893786382238,45.43297800821],[-73.6919766084407,45.4328477403871],[-73.6920222789549,45.4344181753399],[-73.6924064617963,45.4372834135916],[-73.6919192684033,45.4375875837079],[-73.6922359492324,45.4397539275822],[-73.6790976648257,45.4399597709378],[-73.6718763889968,45.4401679518281],[-73.6702870397047,45.440019142569],[-73.6635037895282,45.4400929494508],[-73.6629212228917,45.4401596573971],[-73.6629008949467,45.4422188385912],[-73.6635315763833,45.4422179374171],[-73.6636442247504,45.4445171206371],[-73.6650313754737,45.4449769741284],[-73.6688238611265,45.4465533440431],[-73.6703899048248,45.4470018886664],[-73.6723760891366,45.4472832888363],[-73.6862003751106,45.4475701793018],[-73.6929749468618,45.4479566183894],[-73.6931235366321,45.44814625489],[-73.6960704968967,45.4482114291558],[-73.6970275555854,45.4488217409105],[-73.6970986158494,45.4534198522438],[-73.6970604739367,45.4567907245283],[-73.6967667127171,45.4587187165095],[-73.6956922188653,45.4626538256577],[-73.6956163827684,45.4640262681568],[-73.69619836572,45.4654974169452],[-73.6947785817616,45.4645178045181],[-73.6933043566279,45.4703396575946],[-73.6827804258142,45.4635658825978]]]},"properties":{"district": "41-du Canal"},"id":"41"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6922359492324,45.4397539275822],[-73.6930646838521,45.4455152024534],[-73.6929749468618,45.4479566183894],[-73.6862003751106,45.4475701793018],[-73.6723760891366,45.4472832888363],[-73.6703899048248,45.4470018886664],[-73.6688238611265,45.4465533440431],[-73.6650313754737,45.4449769741284],[-73.6636442247504,45.4445171206371],[-73.6635315763833,45.4422179374171],[-73.6629008949467,45.4422188385912],[-73.6629212228917,45.4401596573971],[-73.6635037895282,45.4400929494508],[-73.6702870397047,45.440019142569],[-73.6718763889968,45.4401679518281],[-73.6790976648257,45.4399597709378],[-73.6922359492324,45.4397539275822]]]},"properties":{"district": "42-J.-Émery-Provost"},"id":"42"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6929749468618,45.4479566183894],[-73.6930646838521,45.4455152024534],[-73.6922359492324,45.4397539275822],[-73.6919192684033,45.4375875837079],[-73.6924064617963,45.4372834135916],[-73.6920222789549,45.4344181753399],[-73.6919766084407,45.4328477403871],[-73.6932876958108,45.4324224970616],[-73.694195347338,45.4324839527568],[-73.6949136010573,45.4332296803625],[-73.6988288457718,45.4344466726102],[-73.7010791173413,45.434694716853],[-73.7030235835285,45.4351501569008],[-73.7052464981121,45.4348762919984],[-73.7084847193563,45.4361211648559],[-73.7108619082078,45.4360808035114],[-73.7131770697603,45.436535476583],[-73.7141004237697,45.4373526055584],[-73.7197027055463,45.4383497204873],[-73.7205977591364,45.438420079974],[-73.7206259030039,45.439094891288],[-73.7192721714824,45.4393943883616],[-73.7222362640027,45.4487922160595],[-73.7206936272739,45.4487451257208],[-73.722831053433,45.4557427179281],[-73.7245717150603,45.4610335488204],[-73.7198081628308,45.4644866016957],[-73.7170519619499,45.4666015017259],[-73.7125173690129,45.4699350201585],[-73.7080097103994,45.47334246671],[-73.7047665432935,45.4712980390786],[-73.69619836572,45.4654974169452],[-73.6956163827684,45.4640262681568],[-73.6956922188653,45.4626538256577],[-73.6967667127171,45.4587187165095],[-73.6970604739367,45.4567907245283],[-73.6970986158494,45.4534198522438],[-73.6970275555854,45.4488217409105],[-73.6960704968967,45.4482114291558],[-73.6931235366321,45.44814625489],[-73.6929749468618,45.4479566183894]]]},"properties":{"district": "43-Fort-Rolland"},"id":"43"}, +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-73.5878943026224,45.4214667320274],[-73.5863736733671,45.4214319841574],[-73.5869474028608,45.4206395990966],[-73.5878943026224,45.4214667320274]]],[[[-73.5725281473542,45.4260939579768],[-73.5704318906483,45.4257263831213],[-73.5705580062435,45.4244124795508],[-73.5739539624556,45.4219626672329],[-73.5766876209735,45.4212859978906],[-73.5793575905544,45.4208612013169],[-73.5824241611882,45.4207510361274],[-73.5840593827098,45.4204618626093],[-73.585056506724,45.4207940136185],[-73.586554348269,45.4226195923359],[-73.5860576024637,45.4236638110559],[-73.584295514885,45.4245289791408],[-73.5827488367791,45.424251218775],[-73.5809343733788,45.424360511388],[-73.5784175573386,45.4248212373305],[-73.5770508918231,45.425290048099],[-73.5731288926102,45.4262015674713],[-73.5725281473542,45.4260939579768]]],[[[-73.5765170514597,45.4274230889043],[-73.5749707241727,45.4273611190412],[-73.5723756663881,45.4267869197677],[-73.5752500087582,45.4259752044009],[-73.5797854469441,45.4251621784139],[-73.5803981192377,45.4246848695548],[-73.5816888803182,45.4247468599426],[-73.5837470045383,45.4252493371248],[-73.5811925680258,45.4261690319939],[-73.5773858946539,45.42731451108],[-73.5765170514597,45.4274230889043]]],[[[-73.5993656298056,45.437522488597],[-73.5837871545249,45.4350036826887],[-73.5864937818087,45.4330669729378],[-73.5889455796285,45.4317602654679],[-73.5892899771004,45.4312921174991],[-73.5917282376663,45.4295893857394],[-73.5930673492969,45.4278875931486],[-73.5941659028554,45.4276167102135],[-73.5970103055467,45.4244378040521],[-73.6024582557665,45.4197537949939],[-73.6050240641787,45.418374641288],[-73.6071441080738,45.4178597046428],[-73.6089187571527,45.4171291621745],[-73.6111012955212,45.4159032271],[-73.6144997511617,45.4158098763183],[-73.6157904203163,45.4159075684946],[-73.6190093657475,45.4154992857685],[-73.6211671693205,45.4148130602082],[-73.6256397226365,45.4151411168221],[-73.6290762426954,45.4149482971955],[-73.6295864341622,45.4145878316083],[-73.6326788478802,45.4147641808428],[-73.6324382282295,45.4157003113135],[-73.6338310649383,45.4157616841636],[-73.6373466145775,45.4154299316521],[-73.6378211847585,45.4157853047214],[-73.6349821404871,45.4216213986168],[-73.630914321986,45.4207058504903],[-73.629580513036,45.4205264796284],[-73.6269794842437,45.4219064890514],[-73.6221765288238,45.4233556809216],[-73.6235576102796,45.4251452650735],[-73.625860660556,45.4262630893683],[-73.6213932515199,45.4290799524068],[-73.6189096270924,45.431198716026],[-73.6153394945845,45.4349173246406],[-73.6147722148194,45.4363801178349],[-73.6185038157741,45.4371719975162],[-73.6203669519898,45.4381561591494],[-73.6292793360419,45.4422437520764],[-73.6304212122284,45.4412800353944],[-73.6319594346838,45.4420660970196],[-73.6341339482992,45.4434436213567],[-73.6334152486196,45.4438343169323],[-73.6348120456809,45.444546590121],[-73.6351699979365,45.445393422083],[-73.6320762130349,45.4466558317026],[-73.6290926270452,45.4483946176344],[-73.6288149375869,45.4482900651074],[-73.6269986444794,45.4501430927141],[-73.6255515041789,45.4513172221793],[-73.622324477466,45.4535901866228],[-73.6201147014597,45.4548257159799],[-73.6136079881888,45.4576954341346],[-73.6068239912076,45.4545470690524],[-73.6048092799479,45.4489130784869],[-73.6052123848584,45.4479821667775],[-73.6094089858961,45.4442773154325],[-73.6104503124607,45.4429793199455],[-73.6118008558715,45.4394499728596],[-73.5996082895714,45.4375187309259],[-73.5993656298056,45.437522488597]]]]},"properties":{"district": "51-Sault-Saint-Louis"},"id":"51"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6373466145775,45.4154299316521],[-73.6398482479311,45.4154574940498],[-73.6413054445293,45.4157165943723],[-73.6441055865314,45.4165049565242],[-73.6469598857207,45.418436018764],[-73.6496982979192,45.4199531866296],[-73.6528057037257,45.4208669233735],[-73.6563386875677,45.4231117299686],[-73.6574132128538,45.4235151379827],[-73.6590899773487,45.4245026614551],[-73.6597563681528,45.4251856881017],[-73.6622132461692,45.4263249714976],[-73.6626617007921,45.4267473070838],[-73.6639788872218,45.4270423138518],[-73.665989308902,45.4284342302665],[-73.6659361085031,45.4320787105657],[-73.6621186235209,45.433443013701],[-73.6593235959903,45.4348597630844],[-73.6537698617598,45.4370900482024],[-73.648051977364,45.4402561224796],[-73.6470945537851,45.4407073290916],[-73.6392793914912,45.4438396460105],[-73.6351699979365,45.445393422083],[-73.6348120456809,45.444546590121],[-73.6334152486196,45.4438343169323],[-73.6341339482992,45.4434436213567],[-73.6319594346838,45.4420660970196],[-73.6304212122284,45.4412800353944],[-73.6292793360419,45.4422437520764],[-73.6203669519898,45.4381561591494],[-73.6185038157741,45.4371719975162],[-73.6147722148194,45.4363801178349],[-73.6153394945845,45.4349173246406],[-73.6189096270924,45.431198716026],[-73.6213932515199,45.4290799524068],[-73.625860660556,45.4262630893683],[-73.6235576102796,45.4251452650735],[-73.6221765288238,45.4233556809216],[-73.6269794842437,45.4219064890514],[-73.629580513036,45.4205264796284],[-73.630914321986,45.4207058504903],[-73.6349821404871,45.4216213986168],[-73.6378211847585,45.4157853047214],[-73.6373466145775,45.4154299316521]]]},"properties":{"district": "52-Cecil-P.-Newman"},"id":"52"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.8688974470136,45.4882449524107],[-73.871602833053,45.4905720481716],[-73.8694139090223,45.4919469541754],[-73.870532930773,45.4928625205596],[-73.8716913646707,45.4933306815312],[-73.872233047857,45.4949468141821],[-73.8714042058561,45.4965567000138],[-73.872571305249,45.4969659674767],[-73.871134091344,45.4990564163597],[-73.8701130707197,45.5000549627491],[-73.8690288298613,45.5007201896345],[-73.8722903935919,45.503568954282],[-73.8716174921312,45.5042888396132],[-73.8756305607743,45.5078228770541],[-73.8783878189261,45.5059406633388],[-73.8803094438111,45.5042458334118],[-73.8803341428118,45.5033993667444],[-73.879759682167,45.5029518530572],[-73.8770152857708,45.501806378212],[-73.8789156358527,45.5017299402712],[-73.879779371889,45.5004798588748],[-73.8810568286333,45.4999384356033],[-73.8830127770248,45.4996741535333],[-73.884412047715,45.4990183531015],[-73.8853262749786,45.4998100023704],[-73.8840175555813,45.5020031308338],[-73.8845885513537,45.503100834689],[-73.8882584256138,45.5047130635017],[-73.8902948397667,45.5048242389134],[-73.8931298332185,45.5045492632818],[-73.8938090092703,45.5051466368411],[-73.8930883375795,45.5061095241892],[-73.8912989165002,45.5060276552235],[-73.8907763512179,45.5069642008183],[-73.8894862335895,45.5075924382318],[-73.8893630543063,45.5086347066791],[-73.8880808924888,45.5083547817147],[-73.8870687665439,45.5091995603904],[-73.8852521620131,45.5102059725257],[-73.8881290541888,45.5127359235277],[-73.8890287067442,45.5122302528857],[-73.8911436774502,45.5127840458479],[-73.8937551506541,45.5125006850816],[-73.8953141801776,45.5130744053201],[-73.896331119406,45.5139759395892],[-73.8972364759115,45.5131483697101],[-73.8989649328704,45.5146837440746],[-73.9002254469086,45.5131179581327],[-73.9008379207362,45.5136630574361],[-73.9005919569215,45.5144536068957],[-73.9021261241608,45.5155955053506],[-73.9009914493894,45.5161347116661],[-73.9020712706953,45.5167877731109],[-73.9020876361723,45.5172918560237],[-73.8999623185899,45.5172091442281],[-73.8983416967041,45.5160989860003],[-73.8970501718221,45.5162744685233],[-73.896506711813,45.5172571885447],[-73.8931760247634,45.5179232635692],[-73.8918830801879,45.5186858504077],[-73.89060443538,45.5188882146005],[-73.8899347125325,45.5182876407975],[-73.8875283162043,45.5182958298662],[-73.8871271342177,45.5195300009394],[-73.8860195052025,45.5203975900766],[-73.8849337116296,45.5207252282394],[-73.8820294235971,45.5209418712909],[-73.8801807487187,45.5201561927542],[-73.8790398509879,45.5199080044884],[-73.8757241818541,45.5198469639429],[-73.8712540724591,45.51942970446],[-73.8693729830596,45.5195167954401],[-73.867959836772,45.5187475084215],[-73.8660852612371,45.518916733747],[-73.8650447273518,45.5192607308197],[-73.8636752254303,45.5192742783684],[-73.8642825006245,45.5181743422849],[-73.8612862477059,45.5160062120045],[-73.8573480782361,45.5146328898613],[-73.8576368219668,45.5137501468995],[-73.8563777974017,45.5129982318504],[-73.8561039739004,45.5121981492155],[-73.8550238065929,45.5113916654122],[-73.8556577823538,45.5104448573143],[-73.8585654378245,45.508816075481],[-73.8591760216501,45.5082382022867],[-73.8597941402612,45.5068235473577],[-73.8595897032533,45.5048715239796],[-73.8603509384135,45.5038432949756],[-73.8628677193202,45.5031873776418],[-73.8634772725348,45.5024655856932],[-73.863229031203,45.4996768609889],[-73.8624925888829,45.4985813745818],[-73.8617450446894,45.4983353640287],[-73.8610656712915,45.4975420638734],[-73.8614902756333,45.4959120252572],[-73.8631347750672,45.4949799702698],[-73.8643010381037,45.4932934742402],[-73.8637682240978,45.4920174491202],[-73.8642488213344,45.4911520725992],[-73.8664440380781,45.4903261139859],[-73.8688974470136,45.4882449524107]]]},"properties":{"district": "61-Pierre-Foretier"},"id":"61"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.871602833053,45.4905720481716],[-73.8758099807102,45.4943016403121],[-73.8832708288195,45.4900124335721],[-73.893915982267,45.4991295138785],[-73.8978204833524,45.5021042916793],[-73.8993079427873,45.5021890950386],[-73.901198690394,45.5019296796061],[-73.9032166411352,45.5013944047771],[-73.9072471667436,45.4990521662397],[-73.9097687478128,45.498420306124],[-73.910763113645,45.4979785583287],[-73.9131442528934,45.5001505549281],[-73.9117306033429,45.5014828251295],[-73.9105682077776,45.502919788446],[-73.9125029822642,45.5046603019441],[-73.9125904080641,45.5059790139203],[-73.9115367282405,45.5071346344323],[-73.9098260610793,45.5077167397986],[-73.9095376253027,45.5082630419981],[-73.9075790301516,45.5084626314966],[-73.9064637954127,45.5082146250766],[-73.9052902228377,45.5087497533613],[-73.9048304811418,45.5093648655927],[-73.9028980165401,45.5106748854948],[-73.9025706032313,45.513213659007],[-73.9021033388663,45.5139081604197],[-73.9026005080814,45.5156160928628],[-73.9021261241608,45.5155955053506],[-73.9005919569215,45.5144536068957],[-73.9008379207362,45.5136630574361],[-73.9002254469086,45.5131179581327],[-73.8989649328704,45.5146837440746],[-73.8972364759115,45.5131483697101],[-73.896331119406,45.5139759395892],[-73.8953141801776,45.5130744053201],[-73.8937551506541,45.5125006850816],[-73.8911436774502,45.5127840458479],[-73.8890287067442,45.5122302528857],[-73.8881290541888,45.5127359235277],[-73.8852521620131,45.5102059725257],[-73.8870687665439,45.5091995603904],[-73.8880808924888,45.5083547817147],[-73.8893630543063,45.5086347066791],[-73.8894862335895,45.5075924382318],[-73.8907763512179,45.5069642008183],[-73.8912989165002,45.5060276552235],[-73.8930883375795,45.5061095241892],[-73.8938090092703,45.5051466368411],[-73.8931298332185,45.5045492632818],[-73.8902948397667,45.5048242389134],[-73.8882584256138,45.5047130635017],[-73.8845885513537,45.503100834689],[-73.8840175555813,45.5020031308338],[-73.8853262749786,45.4998100023704],[-73.884412047715,45.4990183531015],[-73.8830127770248,45.4996741535333],[-73.8810568286333,45.4999384356033],[-73.879779371889,45.5004798588748],[-73.8789156358527,45.5017299402712],[-73.8770152857708,45.501806378212],[-73.879759682167,45.5029518530572],[-73.8803341428118,45.5033993667444],[-73.8803094438111,45.5042458334118],[-73.8783878189261,45.5059406633388],[-73.8756305607743,45.5078228770541],[-73.8716174921312,45.5042888396132],[-73.8722903935919,45.503568954282],[-73.8690288298613,45.5007201896345],[-73.8701130707197,45.5000549627491],[-73.871134091344,45.4990564163597],[-73.872571305249,45.4969659674767],[-73.8714042058561,45.4965567000138],[-73.872233047857,45.4949468141821],[-73.8716913646707,45.4933306815312],[-73.870532930773,45.4928625205596],[-73.8694139090223,45.4919469541754],[-73.871602833053,45.4905720481716]]]},"properties":{"district": "62-Denis-Benjamin-Viger"},"id":"62"}, +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-73.876179389015,45.484463443982],[-73.8748623836763,45.4845487678604],[-73.8746531555376,45.4838655945021],[-73.8752754756586,45.4831976914281],[-73.875332125701,45.4820996763162],[-73.8773551113916,45.4823719006883],[-73.8773585206136,45.4838386904758],[-73.8770492982827,45.4844695752153],[-73.876179389015,45.484463443982]]],[[[-73.871602833053,45.4905720481716],[-73.8688974470136,45.4882449524107],[-73.8709851008353,45.487059190004],[-73.8725145833884,45.4854652904542],[-73.8761955543809,45.4864641220707],[-73.8773897323982,45.4856292741431],[-73.8778041545601,45.4844850797772],[-73.8785921129696,45.4837086183771],[-73.8781898959115,45.4828731025615],[-73.8784365392884,45.4814954771698],[-73.8796440398513,45.4803396456993],[-73.8808564171004,45.4799307290984],[-73.8818738698332,45.4790634862107],[-73.8828567898793,45.4787722169973],[-73.8847419788084,45.4776140567433],[-73.8874400837697,45.4756252617452],[-73.8890406450115,45.4740361165489],[-73.8896093964888,45.473044339843],[-73.8920158379205,45.4714793088166],[-73.8939883829402,45.4719134901468],[-73.8962921181107,45.4721394139777],[-73.8981449394396,45.4719079872095],[-73.8992850543273,45.4721559893786],[-73.9014271769693,45.4712486357827],[-73.9038056762196,45.4712042547101],[-73.9051695937615,45.4705605613393],[-73.9045774306121,45.4700226989345],[-73.9028488295322,45.4697318295333],[-73.9012801121118,45.4703403082789],[-73.8996924472568,45.4700938928558],[-73.8993825392247,45.469663097207],[-73.8999775060713,45.4688151666323],[-73.9017348723624,45.4677561646305],[-73.9023924422294,45.468509706018],[-73.9043441969034,45.4696096448133],[-73.9084347070547,45.4693341104744],[-73.9120964530199,45.4682153872984],[-73.9126431874804,45.4694449753644],[-73.9136278859403,45.4694413239075],[-73.9154106009438,45.4701278046013],[-73.9159006769417,45.4706838913767],[-73.9168728992832,45.4707163448971],[-73.9159791650457,45.4726632836215],[-73.9164275963913,45.4727606419858],[-73.9171840487468,45.4712821683374],[-73.9179119052825,45.4711355184565],[-73.9186742261816,45.4721675623649],[-73.9196472003342,45.4740176773167],[-73.9200930017441,45.4737730563005],[-73.921822149022,45.4741086594329],[-73.9226284972793,45.4752714551831],[-73.924738453321,45.4775172443067],[-73.9253150364798,45.4776590879844],[-73.9266000233535,45.476745452941],[-73.9277434225804,45.477398128666],[-73.9295423138299,45.4767974221727],[-73.9302919142255,45.4778114366407],[-73.9314189351491,45.4779961715469],[-73.9326541103686,45.4772716425334],[-73.9335030743869,45.4762245897937],[-73.9350412733002,45.4766507100519],[-73.9370692452005,45.4762391230436],[-73.9406266477915,45.4761163385087],[-73.942911201225,45.475477638423],[-73.9443213415212,45.4758861323891],[-73.9441879968396,45.4768134931837],[-73.9428248046939,45.478697804247],[-73.9416119001885,45.4794240216934],[-73.9405851561781,45.4789960185208],[-73.9387460246999,45.4793540720446],[-73.9383403023619,45.4798235952081],[-73.9385185477879,45.4813526185292],[-73.9403810268872,45.4823442895009],[-73.9410419166311,45.4834215699972],[-73.942256795601,45.483380875313],[-73.9426871284147,45.4827943413787],[-73.9436978356457,45.482808418644],[-73.9433844250482,45.4836104864635],[-73.9412104480622,45.4837088979371],[-73.941186300091,45.4855356756957],[-73.9409258043702,45.4865805138247],[-73.940155183621,45.4878253029672],[-73.9400375236355,45.4891394779763],[-73.939084522942,45.4899799926108],[-73.9355316222878,45.4921352533586],[-73.9349775409211,45.4932801876613],[-73.9328555975538,45.4935401391563],[-73.9323151123675,45.4931193083499],[-73.9298370141484,45.4936595300698],[-73.9291104700923,45.4940132354185],[-73.9270348943367,45.4936430419454],[-73.925473026234,45.4952145713303],[-73.9244092344479,45.4966763272855],[-73.9244257212294,45.4971711381462],[-73.9233876507023,45.4982360094313],[-73.9226520258841,45.4995263547275],[-73.9218373692027,45.5000962326717],[-73.9209670436555,45.5000814447197],[-73.918541557808,45.5008552086516],[-73.9174837992266,45.5014440345453],[-73.9145252844175,45.5010948373465],[-73.9134946418312,45.5018904208046],[-73.9127623770829,45.5032518742003],[-73.9125029822642,45.5046603019441],[-73.9105682077776,45.502919788446],[-73.9117306033429,45.5014828251295],[-73.9131442528934,45.5001505549281],[-73.910763113645,45.4979785583287],[-73.9097687478128,45.498420306124],[-73.9072471667436,45.4990521662397],[-73.9032166411352,45.5013944047771],[-73.901198690394,45.5019296796061],[-73.8993079427873,45.5021890950386],[-73.8978204833524,45.5021042916793],[-73.893915982267,45.4991295138785],[-73.8832708288195,45.4900124335721],[-73.8758099807102,45.4943016403121],[-73.871602833053,45.4905720481716]]]]},"properties":{"district": "63-Jacques-Bizard"},"id":"63"}, +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-73.8795251463835,45.4721694456373],[-73.8770259047514,45.4733055656905],[-73.8771362722445,45.474146820144],[-73.8758315302677,45.4744852213893],[-73.8761694823241,45.475285050858],[-73.8753710533004,45.4763945070991],[-73.8754013038998,45.4771052655959],[-73.8745581040502,45.4791867014648],[-73.873401680597,45.4803243146019],[-73.8714778204625,45.4814913213621],[-73.8706822810873,45.4830686993857],[-73.8688129680033,45.4847754445001],[-73.8690502967072,45.4858455083571],[-73.8658510539776,45.4876644845598],[-73.8647484711707,45.4872900384824],[-73.8624368975074,45.4879093508046],[-73.8598077012489,45.4888850004049],[-73.8587614558506,45.4873090890375],[-73.8613316931676,45.4851413285652],[-73.8624629228902,45.4840039194648],[-73.8650419471552,45.4821657726431],[-73.8728715855598,45.4756017517064],[-73.871209821762,45.4733162451191],[-73.8733213850942,45.4725990666647],[-73.8782862116718,45.4705088548296],[-73.8795251463835,45.4721694456373]]],[[[-73.8598857733827,45.4911029074784],[-73.8591675296752,45.4908171897388],[-73.8600571674373,45.4898965476815],[-73.8612991016732,45.4900456152652],[-73.8605639387492,45.4911097682054],[-73.8598857733827,45.4911029074784]]]]},"properties":{"district": "64-Sainte-Geneviève"},"id":"64"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.505845657669,45.5915064148139],[-73.5103359282538,45.5921124591547],[-73.5206880075519,45.5952083313336],[-73.5204207506441,45.5957326455424],[-73.5227698757162,45.5964405193219],[-73.5231408135446,45.5957591991736],[-73.533521772969,45.5988762603839],[-73.5369160899836,45.5931626565659],[-73.5411715382662,45.5939767034301],[-73.5423606148624,45.5943108573749],[-73.5455045323429,45.5956272275911],[-73.5452799498143,45.5959627917351],[-73.5438572127564,45.5980784963673],[-73.5442050076359,45.5981948225546],[-73.5445859643042,45.5999308464328],[-73.5451108447268,45.6000061818095],[-73.5447576674512,45.6019410417126],[-73.5407418924341,45.6006998521118],[-73.539729971205,45.6018186221009],[-73.5429289535666,45.6032316351511],[-73.5421763850909,45.6042454438226],[-73.5394321608651,45.6030910243993],[-73.5365958888719,45.602162446611],[-73.5365038947396,45.6026457300995],[-73.5375401492111,45.6052359766051],[-73.5416213388458,45.606939681157],[-73.540900931842,45.6078533012629],[-73.5416434070878,45.6081797015109],[-73.5412098839782,45.6095033241271],[-73.5441363974969,45.6102716461918],[-73.5453373826653,45.6107633861198],[-73.5444977198785,45.6121760838565],[-73.5462767505068,45.6127238289344],[-73.5452777806501,45.6141657083913],[-73.5437218072693,45.6149096422408],[-73.5381703589619,45.6139517855176],[-73.5375256945614,45.6160673327401],[-73.5252332402243,45.6137951013372],[-73.5145702896503,45.6119902043961],[-73.5073926872162,45.6107104987953],[-73.507104042043,45.6103305736701],[-73.5088445389914,45.6059056683277],[-73.5094016237031,45.6029289790696],[-73.5089844073373,45.5984312397903],[-73.5085623510741,45.5964354408978],[-73.5073994472774,45.5937585441643],[-73.505845657669,45.5915064148139]]]},"properties":{"district": "71-Tétreaultville"},"id":"71"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.505845657669,45.5915064148139],[-73.5052335547608,45.5914035841385],[-73.5040074172822,45.5877509637108],[-73.50548477383,45.5842108995057],[-73.5046727489859,45.5839523001102],[-73.5060139625714,45.5806625893987],[-73.5058561540639,45.5806068926751],[-73.5091666956111,45.5757730349861],[-73.5141197194594,45.5708695926608],[-73.5190039768335,45.5682773867463],[-73.5197939453882,45.5669670591355],[-73.5180270972663,45.5661485153046],[-73.5253430489297,45.5574887203531],[-73.5250635489053,45.5568993328574],[-73.5236813870747,45.5568097261785],[-73.521480081669,45.5591100901826],[-73.5209547766993,45.5588573091504],[-73.5218702090576,45.5578763137034],[-73.5209413390244,45.5570999459563],[-73.5191167026398,45.5588496230043],[-73.518595216105,45.5586040300451],[-73.522051635704,45.5552304196808],[-73.5269225613603,45.549446926412],[-73.5335765932332,45.5515757481653],[-73.5389816134656,45.5533773670715],[-73.5382239872366,45.5549283797349],[-73.5486183023616,45.5582491708623],[-73.5460296824187,45.562265422129],[-73.5459659905086,45.5625254142127],[-73.5456328946765,45.5629337545645],[-73.5413632157982,45.5709610549351],[-73.5386884000436,45.5749269433291],[-73.5320531965098,45.5852349268307],[-73.540035463506,45.5878529169711],[-73.5369160899836,45.5931626565659],[-73.533521772969,45.5988762603839],[-73.5231408135446,45.5957591991736],[-73.5227698757162,45.5964405193219],[-73.5204207506441,45.5957326455424],[-73.5206880075519,45.5952083313336],[-73.5103359282538,45.5921124591547],[-73.505845657669,45.5915064148139]]]},"properties":{"district": "72-MaisonneuveLongue-Pointe"},"id":"72"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5269225613603,45.549446926412],[-73.5289560474797,45.5470320263359],[-73.5277739913219,45.547187016061],[-73.5277290513663,45.5464490003045],[-73.5313590128093,45.5457750092113],[-73.5321039500724,45.5447229718789],[-73.5291969726971,45.5451540050291],[-73.5296700173696,45.5442239930694],[-73.5329650126455,45.5436089818848],[-73.5339429567644,45.5424780308809],[-73.5315039994787,45.5426720333775],[-73.5316359736222,45.5420080334177],[-73.5344850464319,45.5413149877237],[-73.5404589754615,45.5356759920904],[-73.5417879567955,45.529933001055],[-73.5428587889529,45.5304546205586],[-73.5439636509721,45.5334697006227],[-73.5473499781753,45.5376709059424],[-73.5482541001656,45.5383569002539],[-73.550216365092,45.5389758922042],[-73.5592280432661,45.5399028690768],[-73.5552605710227,45.5474166761255],[-73.5545655421497,45.55467023726],[-73.5542787320438,45.5568764086233],[-73.5546496932451,45.5649641797921],[-73.5544730757919,45.5652953442798],[-73.5459659905086,45.5625254142127],[-73.5460296824187,45.562265422129],[-73.5486183023616,45.5582491708623],[-73.5382239872366,45.5549283797349],[-73.5389816134656,45.5533773670715],[-73.5335765932332,45.5515757481653],[-73.5269225613603,45.549446926412]]]},"properties":{"district": "73-Hochelaga"},"id":"73"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5455045323429,45.5956272275911],[-73.5423606148624,45.5943108573749],[-73.5411715382662,45.5939767034301],[-73.5369160899836,45.5931626565659],[-73.540035463506,45.5878529169711],[-73.5320531965098,45.5852349268307],[-73.5386884000436,45.5749269433291],[-73.5413632157982,45.5709610549351],[-73.5456328946765,45.5629337545645],[-73.5459659905086,45.5625254142127],[-73.5544730757919,45.5652953442798],[-73.5489772535198,45.5734435433853],[-73.5557298683366,45.5757065336466],[-73.5584435150771,45.578098690279],[-73.5683754804235,45.5814045757918],[-73.5648413846768,45.5830623920281],[-73.566054883333,45.5843176844033],[-73.563949176176,45.5849798671748],[-73.5642198577817,45.5854079588427],[-73.5642246834943,45.5872483268508],[-73.5663609324088,45.5883396268265],[-73.5686767639537,45.5922969983003],[-73.5690474086577,45.5937353194892],[-73.5687432258054,45.5949521683749],[-73.5696609688417,45.5965806032278],[-73.5694206600629,45.5971486400825],[-73.5576871015794,45.5932166140624],[-73.5489394765731,45.5903029802044],[-73.5465394629102,45.5940712033384],[-73.5481396292151,45.5946360429193],[-73.5473484500099,45.5955355370728],[-73.545930102715,45.5949937733284],[-73.5455045323429,45.5956272275911]]]},"properties":{"district": "74-Louis-Riel"},"id":"74"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6202427208594,45.5951205335532],[-73.6296215435427,45.5838130726522],[-73.6288186186035,45.5832571469721],[-73.631962332515,45.579640175342],[-73.6327012962769,45.5799802985646],[-73.6363215300962,45.5759177646435],[-73.652557313063,45.5826892716542],[-73.6543058972308,45.5836262624158],[-73.6531900096361,45.5859698880497],[-73.6526947978849,45.5876532157306],[-73.6523937374702,45.5900742122073],[-73.6505401287885,45.5918403260598],[-73.6490983475598,45.5943078055034],[-73.646028354957,45.5966872776611],[-73.6450204850692,45.598497300652],[-73.6434244270991,45.6009558130627],[-73.6432738605823,45.6022427894953],[-73.6418446065649,45.6048360555341],[-73.6415278334524,45.606276219979],[-73.6400469319338,45.6087976232294],[-73.6388534618155,45.6101933725153],[-73.6374274156649,45.6122509805631],[-73.6349651825723,45.6101401159366],[-73.6284179810453,45.603912893307],[-73.6227414555439,45.5985713755102],[-73.6209924104659,45.5968531497608],[-73.6216736698201,45.5964861898013],[-73.6202427208594,45.5951205335532]]]},"properties":{"district": "81-Marie-Clarac"},"id":"81"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6028907661658,45.6112216102358],[-73.6041139394664,45.6106174089674],[-73.6035616092243,45.6101078733853],[-73.6048043091085,45.6094292879636],[-73.6062298901187,45.610759685103],[-73.6079197060538,45.6094530924621],[-73.6092890313816,45.6081470965116],[-73.6125635803426,45.604373796832],[-73.61467650443,45.601820884038],[-73.6202427208594,45.5951205335532],[-73.6216736698201,45.5964861898013],[-73.6209924104659,45.5968531497608],[-73.6227414555439,45.5985713755102],[-73.6284179810453,45.603912893307],[-73.6349651825723,45.6101401159366],[-73.6374274156649,45.6122509805631],[-73.6357315212,45.6162353900055],[-73.6334060135125,45.6196665233391],[-73.6310514588113,45.6217838603777],[-73.6289543944547,45.6234221648674],[-73.6269636907653,45.6247707822286],[-73.6250472436735,45.6262897836938],[-73.6235959602566,45.6271766849645],[-73.6206953088035,45.6298453145986],[-73.6168081007299,45.6262083345707],[-73.6071490341973,45.6170493269392],[-73.6023660828945,45.6125718329314],[-73.601559767966,45.6118073578371],[-73.6028907661658,45.6112216102358]]]},"properties":{"district": "82-Ovide-Clermont"},"id":"82"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5989854515795,45.5160358124743],[-73.5986563507028,45.5163499572059],[-73.601437737118,45.5176238014654],[-73.6020308024605,45.5177034122021],[-73.613010925262,45.5225880512056],[-73.6108850612038,45.5249602486287],[-73.5966746401772,45.5186407402299],[-73.5982202946245,45.5169177573452],[-73.5969109664106,45.5161364855643],[-73.5989854515795,45.5160358124743]]]},"properties":{"district": "91-Claude-Ryan"},"id":"91"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5989854515795,45.5160358124743],[-73.6044730454934,45.5155769251068],[-73.6089843852315,45.5146703511952],[-73.6091799069916,45.5148927825],[-73.6186655613026,45.5191467549529],[-73.6148105187034,45.5234843904785],[-73.6155485100061,45.52374152426],[-73.6253373412254,45.518414467689],[-73.6244833769123,45.5195443162251],[-73.6208637881685,45.5236565043515],[-73.617235572865,45.5277835686717],[-73.6170925681517,45.5277209056734],[-73.6124143323658,45.525647330045],[-73.6108850612038,45.5249602486287],[-73.613010925262,45.5225880512056],[-73.6020308024605,45.5177034122021],[-73.601437737118,45.5176238014654],[-73.5986563507028,45.5163499572059],[-73.5989854515795,45.5160358124743]]]},"properties":{"district": "92-Joseph-Beaubien"},"id":"92"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5956108742759,45.504064067218],[-73.5987846893921,45.5056180649425],[-73.5993805679324,45.5053898653966],[-73.6024762927983,45.5068574351344],[-73.6035337540631,45.5057001623398],[-73.6061344132343,45.5068772235294],[-73.6063535452531,45.5074911306599],[-73.6130513861854,45.5104478685544],[-73.6182356279483,45.504722156916],[-73.6189454361275,45.5051234940594],[-73.6160933747766,45.5082725969653],[-73.6178928803835,45.5091750557282],[-73.6169256431203,45.5102737338336],[-73.61888001694,45.5111346532789],[-73.617959519301,45.5121686212918],[-73.6171142113946,45.5117885655948],[-73.6163442345691,45.5125462730753],[-73.615038686563,45.511951761593],[-73.6111115129373,45.5140796366228],[-73.6089843852315,45.5146703511952],[-73.6044730454934,45.5155769251068],[-73.5989854515795,45.5160358124743],[-73.5969109664106,45.5161364855643],[-73.5982202946245,45.5169177573452],[-73.5966746401772,45.5186407402299],[-73.5902604532774,45.5157813641729],[-73.5911992183544,45.5147110287094],[-73.5918451342772,45.5144729450241],[-73.5968586638591,45.5145623065118],[-73.5978614314752,45.5141637733071],[-73.598896296438,45.5131127563816],[-73.5969405107098,45.5130415385056],[-73.5969012890154,45.5117790625741],[-73.5949672180747,45.5109069459258],[-73.5935088435771,45.5105257693584],[-73.594191031848,45.5097864575692],[-73.591464574106,45.508070751295],[-73.5956108742759,45.504064067218]]]},"properties":{"district": "93-Robert-Bourassa"},"id":"93"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.617959519301,45.5121686212918],[-73.6176645335398,45.5125000231349],[-73.6207592308166,45.5138993727882],[-73.6267223236567,45.5165801475772],[-73.6253373412254,45.518414467689],[-73.6155485100061,45.52374152426],[-73.6148105187034,45.5234843904785],[-73.6186655613026,45.5191467549529],[-73.6091799069916,45.5148927825],[-73.6089843852315,45.5146703511952],[-73.6111115129373,45.5140796366228],[-73.615038686563,45.511951761593],[-73.6163442345691,45.5125462730753],[-73.6171142113946,45.5117885655948],[-73.617959519301,45.5121686212918]]]},"properties":{"district": "94-Jeanne-Sauvé"},"id":"94"}, +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-73.8187679895316,45.5140812084438],[-73.8182383369059,45.5132188436317],[-73.8194262685108,45.5128016511853],[-73.8210527525633,45.5129859861948],[-73.8211602697308,45.5138855228726],[-73.8187679895316,45.5140812084438]]],[[[-73.7612752776246,45.5104175090183],[-73.7551669017747,45.5064862077527],[-73.7550630650544,45.5065238038199],[-73.7516832079437,45.5044227485347],[-73.7530750881715,45.5037537247243],[-73.7547114610262,45.5033812068779],[-73.756652358581,45.5024589334263],[-73.7582371682807,45.5020414841587],[-73.7594306007504,45.5027766325504],[-73.7609994664832,45.5016752336666],[-73.7638615520544,45.5034953365559],[-73.764601206777,45.5029446682134],[-73.7653841918245,45.5034648112556],[-73.7671979733428,45.5027497284985],[-73.7692002551043,45.5040137486001],[-73.7709616412032,45.5034073001873],[-73.7725018897261,45.5025715611262],[-73.770851931212,45.5015263075263],[-73.7738796981111,45.5005112554049],[-73.7716579558132,45.4991257181769],[-73.7735738316828,45.4981363521851],[-73.7779880975343,45.5009521734749],[-73.780555316633,45.4997211145292],[-73.7811328878805,45.5000886664279],[-73.7828691809435,45.4992834417083],[-73.7866716942594,45.5016560785918],[-73.7833876826593,45.5031694957223],[-73.7921892811359,45.505162983993],[-73.790378705595,45.5039707845666],[-73.7971312330344,45.5007319392105],[-73.800845778582,45.4990215282087],[-73.8020719362353,45.500313400533],[-73.8090622022287,45.4969839281454],[-73.8103152495861,45.4968275421823],[-73.8148195197041,45.5014854076037],[-73.814130519647,45.5018291882481],[-73.8151983502239,45.5028700758232],[-73.8158749418108,45.5025712297953],[-73.8192989400152,45.5061341618076],[-73.8239273064692,45.5039359215182],[-73.8260247686459,45.5028472072531],[-73.8336495886976,45.4992478732958],[-73.8354476552771,45.4983089444422],[-73.835851882975,45.4987134333303],[-73.8376510464643,45.4977036685397],[-73.8352748755507,45.4946201233283],[-73.8359064469498,45.4941865754856],[-73.8445138674112,45.4899447538175],[-73.8461670237813,45.488985999861],[-73.8503699985263,45.4936842455575],[-73.853113099403,45.4984292547447],[-73.8558121436329,45.5017030001578],[-73.8554973469563,45.506068266442],[-73.8541507320505,45.5071387755787],[-73.8547842282295,45.5078848003326],[-73.8541503989792,45.5088568468323],[-73.8514364847285,45.5107998956924],[-73.8509728924279,45.5113681864054],[-73.8497265304179,45.5116149897809],[-73.8487575861648,45.5122208147549],[-73.8486390859537,45.5137509650076],[-73.8470767467479,45.515690388096],[-73.8459043806884,45.5165397868316],[-73.8447612809957,45.5165252439303],[-73.8416070645454,45.5171016749459],[-73.8379192636275,45.5168516646645],[-73.8362532214568,45.51650560879],[-73.8321180123678,45.5163557197529],[-73.8313656471532,45.5168348664122],[-73.8297408583824,45.5169655584571],[-73.8282028168338,45.5166190156169],[-73.8268661171387,45.5156510162477],[-73.8250222653614,45.5155213777536],[-73.8246734151281,45.5149644141917],[-73.8233629812572,45.5141042906802],[-73.8234733111558,45.5132581353231],[-73.8218473252627,45.5131637356642],[-73.8209366065744,45.5128154164364],[-73.8192176588039,45.5126139694502],[-73.8179057909873,45.5132557668608],[-73.8178065811604,45.5138229980126],[-73.8160507514445,45.5154287971508],[-73.814770537422,45.5156310808765],[-73.8131059190362,45.5155096653326],[-73.810217503155,45.5162914840575],[-73.8084551833961,45.5162217432523],[-73.8064888710304,45.5155636081875],[-73.8057027099487,45.5147919349551],[-73.8040410010469,45.5149672884696],[-73.801546777817,45.5149829442516],[-73.8001619454196,45.5148065602758],[-73.7995790764703,45.5135123735559],[-73.7995988098213,45.5123965010493],[-73.7992059489796,45.5107148435346],[-73.7978204799485,45.5101065121228],[-73.7969591683437,45.5093799021214],[-73.7939384028061,45.509297721884],[-73.79058311435,45.5088654314285],[-73.7870155334484,45.5094594051816],[-73.7852614432657,45.5093198098856],[-73.7829719822765,45.5095864846083],[-73.7806008657296,45.5088903884048],[-73.7769513427547,45.5084674192311],[-73.7745708564459,45.5084461679299],[-73.7719486126198,45.5087044209407],[-73.7697639799538,45.5095104479827],[-73.7673058990371,45.5093183322757],[-73.7625356657639,45.5100672469129],[-73.7612752776246,45.5104175090183]]]]},"properties":{"district": "101-Bois-de-Liesse"},"id":"101"}, +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-73.8461670237813,45.488985999861],[-73.850532069583,45.486758681857],[-73.8458397013725,45.4794951647217],[-73.8472019880053,45.4788779608994],[-73.8518367097832,45.4764514219245],[-73.8573573288562,45.4736627559579],[-73.8545371967343,45.4706120339916],[-73.8603908221258,45.4659954945452],[-73.859889484827,45.4655831049747],[-73.8669852747875,45.4613941823855],[-73.8659406037748,45.4600298096328],[-73.8814395340419,45.4526362439631],[-73.8847216555087,45.4524908762247],[-73.8890536732734,45.4491166876217],[-73.8915462525593,45.4480217199892],[-73.8938116724967,45.4465652096353],[-73.8981246578432,45.4475293470406],[-73.9003739737275,45.4471542652552],[-73.9000666991504,45.4467285005871],[-73.9015060886188,45.446358434947],[-73.9023709077117,45.4475251321732],[-73.9043599589048,45.4467892477034],[-73.9055608807492,45.4484676964261],[-73.9104202259452,45.4468936252547],[-73.9231679445166,45.4420154242323],[-73.9228839309917,45.4416385017936],[-73.9245143656332,45.4408765943703],[-73.924830550628,45.4404255381026],[-73.9348115551979,45.4490797759617],[-73.9369647858857,45.4508355286695],[-73.9367305115467,45.4519612579974],[-73.936084813848,45.45278257894],[-73.9363214019941,45.4536095287366],[-73.9384314066949,45.45366444434],[-73.93849022267,45.4546540611182],[-73.9401870518575,45.4558173634308],[-73.9432583349177,45.4561564624145],[-73.9444816415584,45.4572495419421],[-73.9470042484352,45.4577165755588],[-73.9475358331527,45.4586413391725],[-73.9466703677291,45.4591486916182],[-73.9457347700682,45.4588823651705],[-73.9452919598077,45.4594780510929],[-73.9438715446993,45.4593485885153],[-73.9418275850641,45.461228202182],[-73.9418734970443,45.4621908676335],[-73.9433996704037,45.4627518229434],[-73.9458662537823,45.4625712338861],[-73.9452835656909,45.4632754571652],[-73.9455865563861,45.4644081059436],[-73.9444336707811,45.464151615889],[-73.9428244875956,45.4644188471942],[-73.9420560006039,45.4659065384758],[-73.9397320642846,45.4663563878557],[-73.9401770020335,45.4676594913386],[-73.9394768022606,45.4680671581924],[-73.9395814637767,45.4700104369658],[-73.9382622094761,45.4714102256228],[-73.9356853954855,45.4722749319843],[-73.9346437792633,45.4731967435679],[-73.9329374951772,45.4725193630933],[-73.9323111235668,45.4725667323419],[-73.9299152373346,45.4737006039578],[-73.928842473854,45.4739115313467],[-73.9275236887696,45.4737184885069],[-73.9265293732015,45.4741631743875],[-73.925796243829,45.4736259485905],[-73.9248000500235,45.4721089475954],[-73.9222818122356,45.4705794857248],[-73.922965231979,45.4696141155523],[-73.9226524205748,45.4688324194201],[-73.9212201297683,45.4688467094977],[-73.9216571330551,45.4674143796986],[-73.921550552687,45.4668568126713],[-73.9195312526606,45.4635798400557],[-73.9178201887521,45.4621912996059],[-73.9148789978459,45.4619144443475],[-73.9126660861929,45.4603383473932],[-73.91114607451,45.4605598133876],[-73.9103819033438,45.4609764429342],[-73.9100549453511,45.4617335639878],[-73.9082146339227,45.4617969415567],[-73.9075688375165,45.4609865148744],[-73.9058658349117,45.4609563776965],[-73.9051876779266,45.4605991035458],[-73.9038323289561,45.4606219020727],[-73.9020889859002,45.4618068799119],[-73.9017130574761,45.4628880358479],[-73.9003152261538,45.4623259838994],[-73.899767819995,45.462669876326],[-73.8976775036577,45.4654577069673],[-73.8962483592814,45.4658946426154],[-73.8957916608649,45.4664270982997],[-73.8945384007686,45.4664224345534],[-73.8936214304942,45.4669655597388],[-73.8921732932478,45.4665295724673],[-73.8916127412336,45.4668464725107],[-73.8913265706041,45.4679902821467],[-73.8900901349216,45.4685793797869],[-73.8888217813327,45.4686035027193],[-73.8860812311329,45.4695648402732],[-73.8847899934361,45.4696321930072],[-73.8828866868638,45.4718612485547],[-73.8823610038276,45.4716560245278],[-73.8811747849457,45.4721459539451],[-73.8806356311152,45.471850773116],[-73.8795251463835,45.4721694456373],[-73.8782862116718,45.4705088548296],[-73.8733213850942,45.4725990666647],[-73.871209821762,45.4733162451191],[-73.8728715855598,45.4756017517064],[-73.8650419471552,45.4821657726431],[-73.8624629228902,45.4840039194648],[-73.8613316931676,45.4851413285652],[-73.8587614558506,45.4873090890375],[-73.8598077012489,45.4888850004049],[-73.8592579904622,45.4889452259737],[-73.8578565654384,45.4898674655412],[-73.8569952719841,45.4912379676731],[-73.8545791042202,45.4935760467931],[-73.8531479621556,45.4959201221199],[-73.8544902230577,45.4977606434992],[-73.8548560501467,45.4989743240793],[-73.8555516665994,45.4997100150003],[-73.8578400891255,45.4995048836594],[-73.8585024501129,45.4997829560785],[-73.8591539006867,45.5007425753891],[-73.8588895885858,45.501436262307],[-73.8580145103082,45.5020213087385],[-73.8578513100126,45.5031672055572],[-73.85712842707,45.5040318263201],[-73.8570843291783,45.505329258001],[-73.8555961994083,45.5077731597575],[-73.8547842282295,45.5078848003326],[-73.8541507320505,45.5071387755787],[-73.8554973469563,45.506068266442],[-73.8558121436329,45.5017030001578],[-73.853113099403,45.4984292547447],[-73.8503699985263,45.4936842455575],[-73.8461670237813,45.488985999861]]],[[[-73.8565163230435,45.5065638456799],[-73.8570490281172,45.5058063309797],[-73.8583878278331,45.5070438611748],[-73.8567674874305,45.5078408713637],[-73.8559107285537,45.5079515359158],[-73.8565163230435,45.5065638456799]]]]},"properties":{"district": "102-Cap-Saint-Jacques"},"id":"102"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5792047395127,45.5280064404383],[-73.581506814336,45.5255527662198],[-73.5893088980696,45.5167596569974],[-73.5902604532774,45.5157813641729],[-73.5966746401772,45.5186407402299],[-73.6108850612038,45.5249602486287],[-73.6124143323658,45.525647330045],[-73.6088433154766,45.5276253868022],[-73.6061835826899,45.5283650193777],[-73.6023604559616,45.5284000664849],[-73.5992862274652,45.5288774305058],[-73.5962116234987,45.5301487739359],[-73.5947764680621,45.5311589735711],[-73.5863837119054,45.5382742004886],[-73.5871054297936,45.5372069067238],[-73.5899093482658,45.5348049045751],[-73.5847595146863,45.5324079438366],[-73.5859421309178,45.5310790335786],[-73.5792047395127,45.5280064404383]]]},"properties":{"district": "111-Mile-End"},"id":"111"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5655614721314,45.5213643879447],[-73.5740572626836,45.5252747203744],[-73.5745923823609,45.5259374612073],[-73.5792047395127,45.5280064404383],[-73.5859421309178,45.5310790335786],[-73.5847595146863,45.5324079438366],[-73.5899093482658,45.5348049045751],[-73.5871054297936,45.5372069067238],[-73.5863837119054,45.5382742004886],[-73.5862704189394,45.5383757481773],[-73.5838512015266,45.5400861300747],[-73.5810607519196,45.5411249464667],[-73.5786195284797,45.5415422864787],[-73.5764926058406,45.5415739191208],[-73.5735822926994,45.5413565189643],[-73.5592280432661,45.5399028690768],[-73.5613401818778,45.5359226324552],[-73.5641429566138,45.5273492053093],[-73.5652383566418,45.5238165260966],[-73.5655614721314,45.5213643879447]]]},"properties":{"district": "112-De Lorimier"},"id":"112"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5734800018833,45.5049709717948],[-73.580113792401,45.5081921313855],[-73.5785542203746,45.5104511791594],[-73.5786781018666,45.5117608495828],[-73.582430798457,45.5136019767056],[-73.5893088980696,45.5167596569974],[-73.581506814336,45.5255527662198],[-73.5792047395127,45.5280064404383],[-73.5745923823609,45.5259374612073],[-73.5740572626836,45.5252747203744],[-73.5655614721314,45.5213643879447],[-73.5655904084691,45.5210639273018],[-73.571279665339,45.5083636436696],[-73.5729588302122,45.5055494196855],[-73.5734800018833,45.5049709717948]]]},"properties":{"district": "113-Jeanne-Mance"},"id":"113"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.4868984819315,45.6668163755988],[-73.4909285596849,45.6670796662378],[-73.4943692754526,45.6676107175883],[-73.5052117189194,45.6694506091685],[-73.5066485322791,45.66770609928],[-73.5086661140009,45.6660376032574],[-73.514071369879,45.663410883372],[-73.5226608995211,45.6590189476592],[-73.5409160537594,45.6501644528664],[-73.5441930168941,45.6487914226698],[-73.544738106063,45.6482242645147],[-73.5524611738286,45.6444112188767],[-73.5555002141554,45.6426177060947],[-73.5652962272313,45.6362003202316],[-73.5713393674169,45.6418436992789],[-73.5731131247475,45.6438386857375],[-73.5764976851296,45.641270099185],[-73.5866413495341,45.6508496604014],[-73.5898582112291,45.6537703909976],[-73.5838459058531,45.6567113166436],[-73.5767899673498,45.6602649640823],[-73.5719339731853,45.6626357744781],[-73.539067309963,45.678979317943],[-73.5369552091684,45.6802676902485],[-73.5352474248791,45.6816148433586],[-73.532629555028,45.6840504841943],[-73.5308427113654,45.6858730099174],[-73.5292925000853,45.6880318303705],[-73.5284527492428,45.6897324941851],[-73.5262321777264,45.695068712866],[-73.5248704855113,45.696745979989],[-73.5234829925507,45.6977084455985],[-73.521300714461,45.6988491350421],[-73.518072949079,45.7000844428825],[-73.5135468623237,45.7013546459954],[-73.5051625304534,45.7033317792418],[-73.498947493721,45.7045252458975],[-73.4954757567513,45.7049490135942],[-73.4932103740932,45.7047553331643],[-73.4921323200277,45.7041126467728],[-73.4909405407531,45.7027073672294],[-73.4900498047694,45.7021797732479],[-73.4887664394737,45.7021177409386],[-73.4856763927507,45.7030727269477],[-73.4829186491029,45.7036523330194],[-73.4803835661343,45.7046724098692],[-73.4783219605948,45.7052709191606],[-73.4766385432002,45.7054709950549],[-73.4751651064534,45.7048699119281],[-73.4745824263264,45.7033866618514],[-73.4749382311583,45.7024425674455],[-73.4763824131897,45.7006700752533],[-73.4784777403736,45.697652858064],[-73.4790042639298,45.6961901697848],[-73.4792384579055,45.6941308824961],[-73.4796140010016,45.6929943766718],[-73.4803640884928,45.6919258774639],[-73.483643872129,45.6885943328445],[-73.4851764024197,45.6867120396751],[-73.4857156558079,45.6857399456762],[-73.4866448398145,45.682296765324],[-73.486914072058,45.6801843677801],[-73.4872497030629,45.6755976940944],[-73.4873520249609,45.6730343323445],[-73.4868984819315,45.6668163755988]]]},"properties":{"district": "121-La Pointe-aux-Prairies"},"id":"121"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.544738106063,45.6482242645147],[-73.5441930168941,45.6487914226698],[-73.5409160537594,45.6501644528664],[-73.5226608995211,45.6590189476592],[-73.514071369879,45.663410883372],[-73.5086661140009,45.6660376032574],[-73.5066485322791,45.66770609928],[-73.5052117189194,45.6694506091685],[-73.4943692754526,45.6676107175883],[-73.4909285596849,45.6670796662378],[-73.4868984819315,45.6668163755988],[-73.4865306288933,45.6640279113745],[-73.486175917176,45.6627454155844],[-73.4851106606772,45.6602901608252],[-73.4846809037125,45.6588306383762],[-73.4832382097687,45.6554954757732],[-73.4821383232798,45.6536179248291],[-73.4787636354681,45.6491486823782],[-73.4780610185114,45.6476510142289],[-73.4774799728854,45.6454905837529],[-73.4872757738587,45.6469779321365],[-73.4879707187836,45.6443924831145],[-73.4878427542795,45.6430795950772],[-73.4879726577335,45.6412664739826],[-73.4872874543207,45.6393119798027],[-73.489854112659,45.6368295683212],[-73.4903943370184,45.6355618234685],[-73.4916720124889,45.6345001210246],[-73.4910397713222,45.6338422392127],[-73.491927215926,45.6328678840833],[-73.5098459767589,45.6358225966319],[-73.5202077969535,45.6374981237725],[-73.5214492864595,45.6377899174742],[-73.5431729267196,45.6475814296488],[-73.544738106063,45.6482242645147]]]},"properties":{"district": "122-Pointe-aux-Trembles"},"id":"122"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5652962272313,45.6362003202316],[-73.5683379250343,45.6341956640577],[-73.5740068269183,45.6304929149516],[-73.5954830428467,45.6158123480652],[-73.5984976040034,45.6140840514745],[-73.6023660828945,45.6125718329314],[-73.6071490341973,45.6170493269392],[-73.6168081007299,45.6262083345707],[-73.6206953088035,45.6298453145986],[-73.6241232556812,45.6330522649771],[-73.5943845703787,45.6513674636385],[-73.5898582112291,45.6537703909976],[-73.5866413495341,45.6508496604014],[-73.5764976851296,45.641270099185],[-73.5731131247475,45.6438386857375],[-73.5713393674169,45.6418436992789],[-73.5652962272313,45.6362003202316]]]},"properties":{"district": "123-Rivière-des-Prairies"},"id":"123"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5864681894816,45.538468592349],[-73.5862704189394,45.5383757481773],[-73.5863837119054,45.5382742004886],[-73.5947764680621,45.5311589735711],[-73.5962116234987,45.5301487739359],[-73.5992862274652,45.5288774305058],[-73.6023604559616,45.5284000664849],[-73.6061835826899,45.5283650193777],[-73.6088433154766,45.5276253868022],[-73.6124143323658,45.525647330045],[-73.6170925681517,45.5277209056734],[-73.6170629786343,45.5290836882431],[-73.6174856875378,45.5297416402976],[-73.6190955864224,45.5306548374863],[-73.6215351178101,45.5311083503899],[-73.6182756954315,45.5346855542873],[-73.6168611349556,45.5357046144078],[-73.6144250141163,45.5383032859687],[-73.6123252903368,45.5421333051385],[-73.6086846729618,45.5461409843801],[-73.6070387029669,45.5479557550382],[-73.6035398110948,45.5463469119155],[-73.5864681894816,45.538468592349]]]},"properties":{"district": "131-Saint-Édouard"},"id":"131"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5864681894816,45.538468592349],[-73.6035398110948,45.5463469119155],[-73.6019471163738,45.5481178990012],[-73.5975914187124,45.553207322408],[-73.5910006798707,45.5607570868859],[-73.5774327397367,45.5565544731088],[-73.5794549693978,45.5542318437368],[-73.5755593123915,45.5530615312237],[-73.5800875168702,45.5456157629748],[-73.5813297515111,45.5438139922411],[-73.5837910525824,45.541331668411],[-73.5864681894816,45.538468592349]]]},"properties":{"district": "132-Étienne-Desmarteau"},"id":"132"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5592280432661,45.5399028690768],[-73.5735822926994,45.5413565189643],[-73.5764926058406,45.5415739191208],[-73.5786195284797,45.5415422864787],[-73.5810607519196,45.5411249464667],[-73.5838512015266,45.5400861300747],[-73.5862704189394,45.5383757481773],[-73.5864681894816,45.538468592349],[-73.5837910525824,45.541331668411],[-73.5813297515111,45.5438139922411],[-73.5800875168702,45.5456157629748],[-73.5755593123915,45.5530615312237],[-73.5794549693978,45.5542318437368],[-73.5774327397367,45.5565544731088],[-73.573735635149,45.5607975285183],[-73.5588620237975,45.5560173236498],[-73.5545655421497,45.55467023726],[-73.5552605710227,45.5474166761255],[-73.5592280432661,45.5399028690768]]]},"properties":{"district": "133-Vieux-Rosemont"},"id":"133"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5694653361432,45.5816630209033],[-73.5683754804235,45.5814045757918],[-73.5584435150771,45.578098690279],[-73.5557298683366,45.5757065336466],[-73.5489772535198,45.5734435433853],[-73.5544730757919,45.5652953442798],[-73.5546496932451,45.5649641797921],[-73.5542787320438,45.5568764086233],[-73.5545655421497,45.55467023726],[-73.5588620237975,45.5560173236498],[-73.573735635149,45.5607975285183],[-73.5774327397367,45.5565544731088],[-73.5910006798707,45.5607570868859],[-73.5863094536503,45.5661499995185],[-73.5871520545273,45.566412729231],[-73.584731908233,45.5691066724291],[-73.5772385119147,45.5776818920023],[-73.578130955202,45.5780689341974],[-73.5752604702031,45.5805388907561],[-73.5739953109801,45.5819266091566],[-73.5709328233077,45.5809046758787],[-73.5705509760525,45.5814521659595],[-73.5694653361432,45.5816630209033]]]},"properties":{"district": "134-Marie-Victorin"},"id":"134"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.7091218538247,45.5230954877394],[-73.6918870159802,45.5123542857052],[-73.6881524418874,45.5100541386763],[-73.6827840991507,45.5143258168654],[-73.6744134053365,45.5090285090174],[-73.6696337564668,45.5063911079337],[-73.6673976326861,45.5049604588181],[-73.6660099573454,45.5044347648104],[-73.6644157884018,45.5050492992242],[-73.6646042365099,45.504734675849],[-73.6681641565442,45.501660999668],[-73.67484741122,45.4963374151867],[-73.680502634204,45.4920408059609],[-73.6825483439594,45.4907732405381],[-73.6860100016197,45.4896024241141],[-73.677264286648,45.4836591822082],[-73.6776271543493,45.4823345919293],[-73.6827804258142,45.4635658825978],[-73.6933043566279,45.4703396575946],[-73.6947785817616,45.4645178045181],[-73.69619836572,45.4654974169452],[-73.7047665432935,45.4712980390786],[-73.7080097103994,45.47334246671],[-73.7221390583544,45.4826358450705],[-73.7241021941398,45.4814064808358],[-73.7315756591541,45.4757155112906],[-73.7423991292426,45.4671531227456],[-73.74247528623,45.4670360365519],[-73.7505933570667,45.4606744381013],[-73.7626492898165,45.4684579890562],[-73.7623181805669,45.4687557278511],[-73.7684606113614,45.4749503791392],[-73.7661156464615,45.4767286467613],[-73.7690019457786,45.4785035754768],[-73.7741729540726,45.4818386741628],[-73.7681746120908,45.4847594283289],[-73.7678463791609,45.485678039566],[-73.7664813956616,45.486482172257],[-73.7666703097771,45.4885693048636],[-73.7671205072924,45.4890902137182],[-73.7645934137213,45.4903739088715],[-73.7681822983003,45.4944507802049],[-73.767927191601,45.4946223655038],[-73.7708534417468,45.4965141396676],[-73.7735738316828,45.4981363521851],[-73.7716579558132,45.4991257181769],[-73.7738796981111,45.5005112554049],[-73.770851931212,45.5015263075263],[-73.7725018897261,45.5025715611262],[-73.7709616412032,45.5034073001873],[-73.7692002551043,45.5040137486001],[-73.7671979733428,45.5027497284985],[-73.7653841918245,45.5034648112556],[-73.764601206777,45.5029446682134],[-73.7638615520544,45.5034953365559],[-73.7609994664832,45.5016752336666],[-73.7594306007504,45.5027766325504],[-73.7582371682807,45.5020414841587],[-73.756652358581,45.5024589334263],[-73.7547114610262,45.5033812068779],[-73.7530750881715,45.5037537247243],[-73.7516832079437,45.5044227485347],[-73.7550630650544,45.5065238038199],[-73.7350991221023,45.5137867482303],[-73.7285097856203,45.5160943522463],[-73.7358987648866,45.5207291683311],[-73.7317546325275,45.5236815365784],[-73.7280602953464,45.5213554616816],[-73.7217031155859,45.5267447688191],[-73.7185119695016,45.5247508136954],[-73.7172924358234,45.5256928911099],[-73.7145584630039,45.5239315629596],[-73.7131122096208,45.5251637887575],[-73.7112612170074,45.5243023856458],[-73.7091218538247,45.5230954877394]]]},"properties":{"district": "141-Côte-de-Liesse"},"id":"141"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6510270564502,45.5263874543882],[-73.6529551695687,45.5229726150982],[-73.6580588118226,45.5152954959574],[-73.6620316014577,45.509044066038],[-73.6644157884018,45.5050492992242],[-73.6660099573454,45.5044347648104],[-73.6673976326861,45.5049604588181],[-73.6696337564668,45.5063911079337],[-73.6744134053365,45.5090285090174],[-73.6827840991507,45.5143258168654],[-73.6881524418874,45.5100541386763],[-73.6918870159802,45.5123542857052],[-73.7091218538247,45.5230954877394],[-73.6963296087078,45.5276805484038],[-73.6939612003867,45.528347826243],[-73.6897803429098,45.5288476157777],[-73.6870922504792,45.5286619976995],[-73.685195685208,45.5301022578388],[-73.683124268159,45.5305991300384],[-73.6764129283619,45.5321264506516],[-73.6747555535799,45.5323081056009],[-73.6726124365382,45.5322997327559],[-73.6698852350516,45.5318835785726],[-73.6555330494037,45.5277342274232],[-73.6510270564502,45.5263874543882]]]},"properties":{"district": "142-Norman-McLaren"},"id":"142"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5696609688417,45.5965806032278],[-73.5687432258054,45.5949521683749],[-73.5690474086577,45.5937353194892],[-73.5686767639537,45.5922969983003],[-73.5663609324088,45.5883396268265],[-73.5642246834943,45.5872483268508],[-73.5642198577817,45.5854079588427],[-73.563949176176,45.5849798671748],[-73.566054883333,45.5843176844033],[-73.5648413846768,45.5830623920281],[-73.5683754804235,45.5814045757918],[-73.5694653361432,45.5816630209033],[-73.5732723109658,45.5829252463303],[-73.5742252628096,45.5830975713343],[-73.5790395581623,45.5832311484519],[-73.5817361693186,45.5828435232896],[-73.5850508708636,45.5817485572606],[-73.5872765077617,45.5817600646972],[-73.5896208961855,45.5825234015516],[-73.5927968176961,45.5840511668496],[-73.5944959844225,45.585037876555],[-73.5961671053026,45.5863788582573],[-73.5985181690096,45.5893118445279],[-73.6020871279873,45.5931683856944],[-73.6032485083726,45.5942192930034],[-73.6086990780645,45.5965789895409],[-73.6101417757025,45.5974474797099],[-73.6116347298964,45.5986698542549],[-73.6130354491493,45.6003781128039],[-73.61467650443,45.601820884038],[-73.6125635803426,45.604373796832],[-73.6092890313816,45.6081470965116],[-73.6079197060538,45.6094530924621],[-73.6062298901187,45.610759685103],[-73.6048043091085,45.6094292879636],[-73.6035616092243,45.6101078733853],[-73.6041139394664,45.6106174089674],[-73.6028907661658,45.6112216102358],[-73.6013378366857,45.6104025414741],[-73.5971103983983,45.6085989887758],[-73.5889961999073,45.6050220349527],[-73.5771288919308,45.599852413767],[-73.576232424293,45.5992577290381],[-73.5745938220503,45.5986717630315],[-73.5726733802096,45.5977479911912],[-73.5696609688417,45.5965806032278]]]},"properties":{"district": "151-Saint-Léonard-Est"},"id":"151"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5694653361432,45.5816630209033],[-73.5705509760525,45.5814521659595],[-73.5709328233077,45.5809046758787],[-73.5739953109801,45.5819266091566],[-73.5752604702031,45.5805388907561],[-73.578130955202,45.5780689341974],[-73.5772385119147,45.5776818920023],[-73.584731908233,45.5691066724291],[-73.5871520545273,45.566412729231],[-73.5874046777632,45.5664890958155],[-73.5986381445569,45.5714628841478],[-73.6016424297946,45.5727835347079],[-73.6005459884454,45.5740149891614],[-73.6023753660902,45.5742891313383],[-73.6043589520305,45.5755705351656],[-73.6113135304111,45.5785547523195],[-73.6148320474836,45.580191303428],[-73.6208358233192,45.5828408672289],[-73.623269111324,45.5839925896586],[-73.6242513055513,45.5846473290482],[-73.6267569494518,45.5854624669655],[-73.6280749026379,45.5838243220039],[-73.6288186186035,45.5832571469721],[-73.6296215435427,45.5838130726522],[-73.6202427208594,45.5951205335532],[-73.61467650443,45.601820884038],[-73.6130354491493,45.6003781128039],[-73.6116347298964,45.5986698542549],[-73.6101417757025,45.5974474797099],[-73.6086990780645,45.5965789895409],[-73.6032485083726,45.5942192930034],[-73.6020871279873,45.5931683856944],[-73.5985181690096,45.5893118445279],[-73.5961671053026,45.5863788582573],[-73.5944959844225,45.585037876555],[-73.5927968176961,45.5840511668496],[-73.5896208961855,45.5825234015516],[-73.5872765077617,45.5817600646972],[-73.5850508708636,45.5817485572606],[-73.5817361693186,45.5828435232896],[-73.5790395581623,45.5832311484519],[-73.5742252628096,45.5830975713343],[-73.5732723109658,45.5829252463303],[-73.5694653361432,45.5816630209033]]]},"properties":{"district": "152-Saint-Léonard-Ouest"},"id":"152"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5390758626817,45.4883382585102],[-73.5377390087046,45.4867781311819],[-73.5371875080419,45.4847716425103],[-73.5390896331107,45.4789579782257],[-73.5400605004001,45.4771849523131],[-73.5409045352268,45.4770676622637],[-73.544790989561,45.4746546504853],[-73.547897885736,45.4732945786535],[-73.5519632604747,45.4713851205092],[-73.5535995299322,45.4704935184097],[-73.5561183847095,45.4699434381887],[-73.5571517699907,45.4699658746605],[-73.5630845502664,45.4721519332886],[-73.5629773154921,45.472291406797],[-73.5680238353449,45.4742185784751],[-73.5698754985218,45.474526598925],[-73.5723445217071,45.4741023764959],[-73.5731337395658,45.4754020852012],[-73.5751431743146,45.4755655583636],[-73.5776045371727,45.4761591293053],[-73.5787522413781,45.4747754151352],[-73.5814009760351,45.4720006793341],[-73.5831499688592,45.4704494618721],[-73.586192167734,45.4685776819367],[-73.5902980753151,45.4669303074751],[-73.593418397905,45.4661730419256],[-73.5952982354664,45.4653094409894],[-73.5969113989909,45.4662290782584],[-73.6006750017194,45.4693265503939],[-73.6015380888098,45.4698449656495],[-73.5995923966142,45.4714885118876],[-73.5966486659517,45.4732210790839],[-73.5951347718664,45.4764466331536],[-73.5861251156067,45.4827228896224],[-73.5851119123332,45.4822361060294],[-73.5842729287511,45.4830658950147],[-73.5806528881796,45.4855782409323],[-73.5812577295116,45.4863226865868],[-73.5788051804801,45.4879299741214],[-73.5726247033677,45.4927252183027],[-73.5671882558807,45.4901263927885],[-73.5653550896585,45.4921968620631],[-73.5630011277184,45.4954107671203],[-73.561988917097,45.497173589984],[-73.5607477815647,45.4979125426916],[-73.5594748545018,45.4973055470605],[-73.5559728136711,45.4959454567625],[-73.5545777017417,45.4947339282606],[-73.5533130105218,45.4921853756885],[-73.5524160214136,45.4912899988865],[-73.5507109567109,45.4904150448375],[-73.5496180493079,45.4900890295113],[-73.5411879980439,45.4884799718781],[-73.5398824970348,45.4880751564896],[-73.5390758626817,45.4883382585102]]]},"properties":{"district": "161-Saint-HenriPetite-BourgognePointe-Saint-Charles"},"id":"161"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5803978450664,45.4607242060317],[-73.580383848446,45.45869859258],[-73.5808415940198,45.4566805659982],[-73.5822612868352,45.4543201865436],[-73.5841878662571,45.4525126975338],[-73.5873026203887,45.4501968887305],[-73.5895426922804,45.4479760865095],[-73.590317536462,45.4476444830976],[-73.5946364116012,45.4432356001591],[-73.5993656298056,45.437522488597],[-73.5996082895714,45.4375187309259],[-73.6118008558715,45.4394499728596],[-73.6104503124607,45.4429793199455],[-73.6094089858961,45.4442773154325],[-73.6052123848584,45.4479821667775],[-73.6048092799479,45.4489130784869],[-73.6068239912076,45.4545470690524],[-73.6136079881888,45.4576954341346],[-73.6201147014597,45.4548257159799],[-73.622324477466,45.4535901866228],[-73.6255515041789,45.4513172221793],[-73.6269986444794,45.4501430927141],[-73.6288149375869,45.4482900651074],[-73.6290926270452,45.4483946176344],[-73.6320301276656,45.4495010416609],[-73.6351722497066,45.4507225431116],[-73.6350181512615,45.4509158064615],[-73.6314544395632,45.4527593013115],[-73.6262003043123,45.4574918787775],[-73.6243236842049,45.4586553508057],[-73.6200562870233,45.4616683026575],[-73.6182352042185,45.4622268121902],[-73.6157015928197,45.4632907897894],[-73.6121904900053,45.4648542087469],[-73.6116004847967,45.4647691120724],[-73.6058459619009,45.4672881102352],[-73.6056266168094,45.4676031109374],[-73.6031619796725,45.4691032161751],[-73.6025897276388,45.4690525247808],[-73.6015380888098,45.4698449656495],[-73.6006750017194,45.4693265503939],[-73.5969113989909,45.4662290782584],[-73.5952982354664,45.4653094409894],[-73.593418397905,45.4661730419256],[-73.5902980753151,45.4669303074751],[-73.586192167734,45.4685776819367],[-73.5831499688592,45.4704494618721],[-73.5814009760351,45.4720006793341],[-73.5787522413781,45.4747754151352],[-73.5776045371727,45.4761591293053],[-73.5751431743146,45.4755655583636],[-73.5731337395658,45.4754020852012],[-73.5723445217071,45.4741023764959],[-73.5717046710668,45.4728345777635],[-73.5722263249864,45.4666080942859],[-73.5725692397967,45.4663779997673],[-73.5760636235492,45.4665267227639],[-73.57595438059,45.467731089093],[-73.5774466724098,45.4677934094142],[-73.5787521792962,45.467573327191],[-73.5788688512642,45.4664809032158],[-73.5806776025411,45.4665598624633],[-73.5810988106852,45.464472934997],[-73.5809592544789,45.4629192039784],[-73.5803978450664,45.4607242060317]]]},"properties":{"district": "162-Saint-PaulÉmard"},"id":"162"}, +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-73.561675647957,45.457026812229],[-73.5636503131163,45.4570986393357],[-73.5631589565038,45.4599505630657],[-73.5803978450664,45.4607242060317],[-73.5809592544789,45.4629192039784],[-73.5810988106852,45.464472934997],[-73.5806776025411,45.4665598624633],[-73.5788688512642,45.4664809032158],[-73.5787521792962,45.467573327191],[-73.5774466724098,45.4677934094142],[-73.57595438059,45.467731089093],[-73.5760636235492,45.4665267227639],[-73.5725692397967,45.4663779997673],[-73.5722263249864,45.4666080942859],[-73.5717046710668,45.4728345777635],[-73.5723445217071,45.4741023764959],[-73.5698754985218,45.474526598925],[-73.5680238353449,45.4742185784751],[-73.5629773154921,45.472291406797],[-73.5630845502664,45.4721519332886],[-73.5571517699907,45.4699658746605],[-73.5566742286267,45.4697998242277],[-73.5564729236705,45.4697250295537],[-73.5568919723525,45.4692509155842],[-73.5584979993156,45.4688652320405],[-73.5594741255912,45.4680886833354],[-73.5600314607336,45.4630762897765],[-73.5602070432843,45.4599716856435],[-73.5604361685249,45.458927727929],[-73.561675647957,45.457026812229]]],[[[-73.531939269639,45.4668762388698],[-73.533282030383,45.4668218592047],[-73.5391619813113,45.4629235420104],[-73.5399777236207,45.4591888832885],[-73.5484320046815,45.4470555292603],[-73.5539781715369,45.4450013623675],[-73.5598960265295,45.4441434701074],[-73.5620234184536,45.4489835563647],[-73.5598289224776,45.4530789952144],[-73.5597287567806,45.4550947277761],[-73.5567932176119,45.4601984189426],[-73.5563771935053,45.4660746682549],[-73.5556877795518,45.4672628311292],[-73.5517365614674,45.4676966587134],[-73.5498323828317,45.4691552202777],[-73.5458565074551,45.4710106620399],[-73.544425597308,45.472837915256],[-73.541638672543,45.4745667491612],[-73.539337021061,45.4752874231563],[-73.5374306118892,45.4744062177182],[-73.5344866609104,45.4708347638261],[-73.5344988591904,45.4699079767891],[-73.5334499941273,45.4695573443126],[-73.531939269639,45.4668762388698]]]]},"properties":{"district": "171-ChamplainL'Île-des-Soeurs"},"id":"171"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5837871545249,45.4350036826887],[-73.5993656298056,45.437522488597],[-73.5946364116012,45.4432356001591],[-73.590317536462,45.4476444830976],[-73.5895426922804,45.4479760865095],[-73.5873026203887,45.4501968887305],[-73.5841878662571,45.4525126975338],[-73.5822612868352,45.4543201865436],[-73.5808415940198,45.4566805659982],[-73.580383848446,45.45869859258],[-73.5803978450664,45.4607242060317],[-73.5631589565038,45.4599505630657],[-73.5636503131163,45.4570986393357],[-73.561675647957,45.457026812229],[-73.5644316339364,45.4531214887569],[-73.5653629828168,45.4514382552214],[-73.5666188947215,45.4498773089445],[-73.5684785830554,45.4481879229679],[-73.5692699550472,45.4471436069185],[-73.5705853638418,45.446107961992],[-73.5722579304274,45.444469116852],[-73.5739182313887,45.4433612189646],[-73.5756800507555,45.4416593600233],[-73.5779148011138,45.4400830529182],[-73.5837871545249,45.4350036826887]]]},"properties":{"district": "172-Desmarchais-Crawford"},"id":"172"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5734800018833,45.5049709717948],[-73.5674300859224,45.5019457643141],[-73.5651563545969,45.5009257536286],[-73.5607477815647,45.4979125426916],[-73.561988917097,45.497173589984],[-73.5630011277184,45.4954107671203],[-73.5653550896585,45.4921968620631],[-73.5671882558807,45.4901263927885],[-73.5726247033677,45.4927252183027],[-73.5788051804801,45.4879299741214],[-73.5812577295116,45.4863226865868],[-73.583103429338,45.4880924257338],[-73.5822957867321,45.4883263628527],[-73.5956809652028,45.4926003378767],[-73.5964675380297,45.491704867985],[-73.6012074615523,45.4937019439569],[-73.6009266859408,45.4942697485875],[-73.6045082688859,45.4947060857692],[-73.6068399722065,45.4952769144878],[-73.6044775189475,45.4952226776326],[-73.6033750499038,45.4967309718248],[-73.6009279740317,45.4988800346583],[-73.5997960499359,45.5001439911523],[-73.5977240363362,45.5016310280474],[-73.594737745289,45.5028667176493],[-73.5941401789655,45.5033436344744],[-73.5956108742759,45.504064067218],[-73.591464574106,45.508070751295],[-73.594191031848,45.5097864575692],[-73.5935088435771,45.5105257693584],[-73.5949672180747,45.5109069459258],[-73.5969012890154,45.5117790625741],[-73.5969405107098,45.5130415385056],[-73.598896296438,45.5131127563816],[-73.5978614314752,45.5141637733071],[-73.5968586638591,45.5145623065118],[-73.5918451342772,45.5144729450241],[-73.5911992183544,45.5147110287094],[-73.5902604532774,45.5157813641729],[-73.5893088980696,45.5167596569974],[-73.582430798457,45.5136019767056],[-73.5786781018666,45.5117608495828],[-73.5785542203746,45.5104511791594],[-73.580113792401,45.5081921313855],[-73.5734800018833,45.5049709717948]]]},"properties":{"district": "181-Peter-McGill"},"id":"181"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5448806808084,45.5191907535652],[-73.5464379266303,45.5162854363298],[-73.5468620115755,45.513857976795],[-73.5492190367874,45.5102959685844],[-73.5477210054261,45.5103219824598],[-73.5469030036515,45.5117340389128],[-73.54657799908,45.5129270270646],[-73.5456969917881,45.512357998283],[-73.5463640090514,45.5093239803744],[-73.549695020088,45.5092129682665],[-73.550625003396,45.5079019928894],[-73.5467100456003,45.5077980094498],[-73.5469790182482,45.5067930379886],[-73.5514338758453,45.5065970940784],[-73.5520469804644,45.5053720127641],[-73.5473670408895,45.5056550070783],[-73.5477130465639,45.5046509913685],[-73.552496564402,45.5042657932143],[-73.5528089694944,45.5031050102093],[-73.5479779947401,45.5032960364571],[-73.5483780292475,45.5021840045336],[-73.5528640439438,45.5019529839854],[-73.5523299208625,45.4996958153214],[-73.5495469612169,45.4995170102135],[-73.5501069846685,45.4916750357777],[-73.5489559611269,45.4916509673111],[-73.5478249505202,45.4998100412319],[-73.5461249747178,45.4997069784511],[-73.5466960251749,45.494926043877],[-73.5457370062228,45.4948960144495],[-73.5450679617308,45.4999819687279],[-73.5437740015677,45.5074910365882],[-73.5427789476457,45.5078289768043],[-73.542713028629,45.5014819775582],[-73.5425669725168,45.4977269821455],[-73.5411679652957,45.4913989983256],[-73.5390758626817,45.4883382585102],[-73.5398824970348,45.4880751564896],[-73.5411879980439,45.4884799718781],[-73.5496180493079,45.4900890295113],[-73.5507109567109,45.4904150448375],[-73.5524160214136,45.4912899988865],[-73.5533130105218,45.4921853756885],[-73.5545777017417,45.4947339282606],[-73.5559728136711,45.4959454567625],[-73.5594748545018,45.4973055470605],[-73.5607477815647,45.4979125426916],[-73.5651563545969,45.5009257536286],[-73.5674300859224,45.5019457643141],[-73.5734800018833,45.5049709717948],[-73.5729588302122,45.5055494196855],[-73.571279665339,45.5083636436696],[-73.5655904084691,45.5210639273018],[-73.5655614721314,45.5213643879447],[-73.5652383566418,45.5238165260966],[-73.5568838251035,45.5199246700318],[-73.5537687235941,45.5232551201153],[-73.5497109051325,45.521356149553],[-73.5448806808084,45.5191907535652]]]},"properties":{"district": "182-Saint-Jacques"},"id":"182"}, +{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-73.5274147442424,45.5235135910537],[-73.5251840405205,45.5163154069544],[-73.5190996853698,45.4964289566498],[-73.5196839019087,45.4963133966792],[-73.5192316055091,45.4951826206437],[-73.5235780132462,45.4965380018334],[-73.5262219855313,45.4982100373889],[-73.5284680362731,45.4999489748907],[-73.5298469696156,45.5015420394984],[-73.5305050225488,45.5047999722322],[-73.5301920008631,45.5074609662696],[-73.5284829714113,45.5111469746062],[-73.5295139475797,45.521700975721],[-73.5275250227419,45.5218729979917],[-73.5274147442424,45.5235135910537]]],[[[-73.5323979026789,45.5309116588315],[-73.5322539821252,45.5289053155386],[-73.532650406906,45.5287379966455],[-73.535473289372,45.5289601566106],[-73.5360719733226,45.5280409644584],[-73.535776948517,45.527560047342],[-73.5344149864457,45.5272360422621],[-73.5339490789414,45.5259734056912],[-73.5318552691702,45.5248370417729],[-73.5314333871381,45.5222881159041],[-73.5315020312839,45.5206100031596],[-73.5304254498686,45.5175627808954],[-73.5300105388493,45.5149954869969],[-73.530089354595,45.5141148861583],[-73.5320378226962,45.5082952174682],[-73.5331764353799,45.5063562405992],[-73.5349739836122,45.5062349788193],[-73.5356400145159,45.5066940066737],[-73.5374959977644,45.5096790170141],[-73.5387299917373,45.5139430070273],[-73.5384300301647,45.5176120247025],[-73.5393770324368,45.5206029708317],[-73.5399389592119,45.523607991237],[-73.5390530375969,45.5256939673896],[-73.5354039767675,45.5305800445252],[-73.5342920245728,45.5315010077074],[-73.5329380014176,45.53135795749],[-73.5323979026789,45.5309116588315]]],[[[-73.5448806808084,45.5191907535652],[-73.5497109051325,45.521356149553],[-73.5537687235941,45.5232551201153],[-73.5568838251035,45.5199246700318],[-73.5652383566418,45.5238165260966],[-73.5641429566138,45.5273492053093],[-73.5613401818778,45.5359226324552],[-73.5592280432661,45.5399028690768],[-73.550216365092,45.5389758922042],[-73.5482541001656,45.5383569002539],[-73.5473499781753,45.5376709059424],[-73.5439636509721,45.5334697006227],[-73.5428587889529,45.5304546205586],[-73.5417879567955,45.529933001055],[-73.542631029933,45.5272240023092],[-73.5433079570219,45.5259280339674],[-73.5450449609183,45.5202409952069],[-73.5448806808084,45.5191907535652]]]]},"properties":{"district": "183-Sainte-Marie"},"id":"183"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5986381445569,45.5714628841478],[-73.6027105259893,45.5669595870386],[-73.6076346034193,45.5613579100341],[-73.6093881709895,45.5598575160123],[-73.6142388370954,45.5543735967318],[-73.6161654573353,45.5519916303917],[-73.6217484540132,45.5544783077209],[-73.6240413737876,45.5555253903511],[-73.6453511352974,45.5647725775888],[-73.6446417578686,45.5658132919643],[-73.6362833815582,45.5758266113331],[-73.6363215300962,45.5759177646435],[-73.6327012962769,45.5799802985646],[-73.631962332515,45.579640175342],[-73.6288186186035,45.5832571469721],[-73.6280749026379,45.5838243220039],[-73.6267569494518,45.5854624669655],[-73.6242513055513,45.5846473290482],[-73.623269111324,45.5839925896586],[-73.6208358233192,45.5828408672289],[-73.6148320474836,45.580191303428],[-73.6113135304111,45.5785547523195],[-73.6043589520305,45.5755705351656],[-73.6023753660902,45.5742891313383],[-73.6005459884454,45.5740149891614],[-73.6016424297946,45.5727835347079],[-73.5986381445569,45.5714628841478]]]},"properties":{"district": "191-Saint-Michel"},"id":"191"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.5871520545273,45.566412729231],[-73.5863094536503,45.5661499995185],[-73.5910006798707,45.5607570868859],[-73.5975914187124,45.553207322408],[-73.6019471163738,45.5481178990012],[-73.6035398110948,45.5463469119155],[-73.6070387029669,45.5479557550382],[-73.6086846729618,45.5461409843801],[-73.6205880272051,45.5514560807313],[-73.6201064769685,45.5520190517324],[-73.6235005117779,45.5536358848324],[-73.6217484540132,45.5544783077209],[-73.6161654573353,45.5519916303917],[-73.6142388370954,45.5543735967318],[-73.6093881709895,45.5598575160123],[-73.6076346034193,45.5613579100341],[-73.6027105259893,45.5669595870386],[-73.5986381445569,45.5714628841478],[-73.5874046777632,45.5664890958155],[-73.5871520545273,45.566412729231]]]},"properties":{"district": "192-François-Perrault"},"id":"192"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6168611349556,45.5357046144078],[-73.618922206967,45.5366652760056],[-73.6407295659042,45.5429686686779],[-73.6398673671325,45.5441488267699],[-73.6363671046978,45.548169415833],[-73.6342899238824,45.5494628161417],[-73.6325600663803,45.5499795021129],[-73.6301686544477,45.5503989164938],[-73.6278096771011,45.5513024018691],[-73.6235005117779,45.5536358848324],[-73.6201064769685,45.5520190517324],[-73.6205880272051,45.5514560807313],[-73.6086846729618,45.5461409843801],[-73.6123252903368,45.5421333051385],[-73.6144250141163,45.5383032859687],[-73.6168611349556,45.5357046144078]]]},"properties":{"district": "193-Villeray"},"id":"193"}, +{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-73.6170925681517,45.5277209056734],[-73.617235572865,45.5277835686717],[-73.6208637881685,45.5236565043515],[-73.6221372911404,45.5240220054992],[-73.6227576775837,45.5233405909978],[-73.6485543103777,45.5308320827376],[-73.6407295659042,45.5429686686779],[-73.618922206967,45.5366652760056],[-73.6168611349556,45.5357046144078],[-73.6182756954315,45.5346855542873],[-73.6215351178101,45.5311083503899],[-73.6190955864224,45.5306548374863],[-73.6174856875378,45.5297416402976],[-73.6170629786343,45.5290836882431],[-73.6170925681517,45.5277209056734]]]},"properties":{"district": "194-Parc-Extension"},"id":"194"} +]} diff --git a/datasets/experiment.csv b/datasets/experiment.csv new file mode 100644 index 00000000..85bade8c --- /dev/null +++ b/datasets/experiment.csv @@ -0,0 +1,101 @@ +experiment_1,experiment_2,experiment_3,gender,group +96.87606524104424,93.41794186205836,73.03319261806172,male,control +87.30133583529452,129.60339543098098,66.05655384860344,female,control +97.69131206443265,106.18791583747864,103.42270945298878,male,treatment +102.97815237236064,93.8146817305033,56.99587018931086,female,treatment +87.10699272862477,107.01998547962671,72.14029211350231,male,control +106.650988962703,94.01726233779415,76.62440110809008,female,control +101.96789610675283,95.08891880671696,111.81685216636848,male,treatment +117.78402141130046,115.39140402812605,98.64938286937958,female,treatment +115.41235439928084,105.13793762581703,96.28039576038483,male,control +107.3273448045416,134.49892671396213,86.43129372481046,female,control +99.6172541280035,106.19263647197582,97.9614052031477,male,treatment +100.90801801849013,98.49773453074349,81.57649628140524,female,treatment +103.73322930003812,103.64300947168037,92.6733901151631,male,control +96.82862968379753,118.28851360684462,69.04800214309412,female,control +97.41300576349734,133.81460507676135,85.86631202379608,male,treatment +111.71546116211962,143.68589169199115,98.99685229883639,female,treatment +92.99825424103256,119.11313771972605,85.53334112377719,male,control +103.0370263885008,113.49030757386137,99.17539628161731,female,control +122.45771222849217,125.57402071454851,110.15293673867568,male,treatment +111.72093843245534,97.29321087218585,99.82865111091688,female,treatment +108.59703912851718,114.55578187212687,74.57665002405716,male,control +86.00067917492646,102.81483028450221,93.49099183412241,female,control +108.22082997242558,111.2655464432314,96.23192720552623,male,treatment +107.02254986229214,107.32317041909053,68.64741021134407,female,treatment +106.68567646477835,125.53691833259457,93.42960247255095,male,control +98.33722206969597,120.66187625946847,68.27452225629308,female,control +91.77160903135389,106.11835373702647,84.86622957834284,male,treatment +114.0102260806097,113.19411909266884,83.2783694811895,female,treatment +99.36447339671628,128.98211960060868,93.68353539266592,male,control +102.0848651185468,96.76265139283653,109.4336405768756,female,control +104.22003927060842,98.53000797317672,84.78250808783284,male,treatment +90.8419388241776,129.77868819843576,103.4072175445103,female,treatment +93.0952189075527,117.4908416284272,75.317582722818,male,control +120.28494035137345,128.10347266036626,115.58696867308669,female,control +112.79439507221173,108.65787818177574,80.0527938687015,male,treatment +97.38937970522906,93.97915042860835,106.28723796883119,female,treatment +105.60548763385378,100.31935141294606,98.61238234207067,male,control +106.3602628726801,99.20417350710404,70.37381577213912,female,control +101.58409349079014,106.43997407520592,69.8017451924211,male,treatment +79.627960848754,126.39982636138507,85.41912263305407,female,treatment +115.17452934540081,101.21513001268984,43.801175752611606,male,control +106.53182376731462,107.28672680975174,60.81179285463617,female,control +94.98263666330395,121.17167029299839,99.41949730696815,male,treatment +96.78131630120166,127.24938650893672,81.067194207433,female,treatment +90.53505148745876,106.4738708421859,81.38217435797954,male,control +97.3724477688896,103.45396742654022,64.5680823183638,female,control +102.07570100045706,110.42502823706357,82.10664726913008,male,treatment +113.34644089441548,114.28422515239595,114.0800090383604,female,treatment +99.16252467399494,115.87027487805348,56.947303712625924,male,control +115.19093327622593,102.76053814688797,76.81854612272282,female,control +101.20197149116704,88.65923075825724,84.19773610407385,male,treatment +102.15438485258845,112.09850718335584,96.88296557581286,female,treatment +104.84390950771103,92.46744327013313,143.84643208361138,male,control +88.86870748537869,99.895240748729,95.86144929579538,female,control +106.99313326342285,94.9336684921247,126.23854648453153,male,treatment +79.42957481543229,102.10062558140578,105.39919358542934,female,treatment +79.91007596007512,93.61647573375812,25.528902727455872,male,control +102.75674518465027,115.64019330406681,85.0183158666797,female,control +106.50911841835378,109.31644644934065,78.05352942296578,male,treatment +116.57613978851472,106.18926547435315,89.43052556366084,female,treatment +105.86488743479735,91.33176428280692,55.15574459592456,male,control +101.6406509148884,120.14042960264156,103.6598229404085,female,control +82.45375160201769,119.99866553631975,81.84612840166531,male,treatment +103.47113336815177,106.97465225615018,99.3315284278933,female,treatment +111.57539596013697,121.36550691186274,81.13130127077808,male,control +90.52597523831999,98.71650364377432,105.87651496636613,female,control +125.5204245339222,82.48071301855163,73.5436296499183,male,treatment +90.21247438443785,90.0325909853458,94.68164053424204,female,treatment +110.83333871580321,117.96705726440037,112.34804577447115,male,control +103.86151675950491,110.80555993405694,103.02493792432377,female,control +83.8308994934392,100.35633403365804,93.73716887483363,male,treatment +104.89507698266064,103.24063971281521,113.14609908248639,female,treatment +95.34256875179257,106.71264388984815,89.65914020129773,male,control +101.31272137457421,112.40253823162678,103.53238833817079,female,control +88.39280684001895,118.37686641258448,92.98480244323879,male,treatment +100.51923728271925,89.408981677046,91.39393639000463,female,treatment +94.49978699806825,112.74449166670784,122.96692500755687,male,control +115.28544529751144,113.71706929679969,103.10058008500462,female,control +88.02583256666699,124.43908197971109,92.48517759114259,male,treatment +108.21594141266115,133.07129566591016,110.21783771069181,female,treatment +103.97741353721,136.6736157228351,119.81130284877875,male,control +93.02648850216077,108.40115937104376,87.60512026902201,female,control +94.75344491514375,137.7421034460475,94.41014090268735,male,treatment +105.41326143638526,86.92391691963303,91.16612042676971,female,treatment +89.98571694680537,115.87117118675488,91.76224286416665,male,control +99.19797691786117,130.11109471859805,83.04163191003826,female,control +106.45557892554882,100.02567617575397,115.64157104921003,male,treatment +106.53740176869354,102.49887098636997,89.8283252286509,female,treatment +100.58494014361828,120.93374474771228,88.39586580661535,male,control +100.28481061716069,99.53759126542052,116.9537068983502,female,control +100.17749269798531,104.67370034744938,73.25099641056534,male,treatment +108.15167224711271,137.99435901344117,105.05479181425382,female,treatment +101.32052523203039,105.71129083938631,73.73084439286063,male,control +99.17755784625105,88.57072941909104,78.65504095998203,female,control +102.77062539939327,129.00227367829714,52.11112167838937,male,treatment +108.1569641420406,105.97154070236674,64.52402923016913,female,treatment +91.73999230125186,111.1253771258949,64.26099304241377,male,control +95.41034685726756,84.44832175269606,75.50599064359672,female,control +106.36240592567884,115.52238227700171,123.46968854252773,male,treatment +94.2692372873789,104.6510642690364,92.38748987804955,female,treatment diff --git a/datasets/gapminder.csv b/datasets/gapminder.csv new file mode 100644 index 00000000..74747fa6 --- /dev/null +++ b/datasets/gapminder.csv @@ -0,0 +1,1705 @@ +"country","continent","year","lifeExp","pop","gdpPercap","iso_alpha","iso_num" +"Afghanistan","Asia",1952,28.801,8425333,779.4453145,"AFG",4 +"Afghanistan","Asia",1957,30.332,9240934,820.8530296,"AFG",4 +"Afghanistan","Asia",1962,31.997,10267083,853.10071,"AFG",4 +"Afghanistan","Asia",1967,34.02,11537966,836.1971382,"AFG",4 +"Afghanistan","Asia",1972,36.088,13079460,739.9811058,"AFG",4 +"Afghanistan","Asia",1977,38.438,14880372,786.11336,"AFG",4 +"Afghanistan","Asia",1982,39.854,12881816,978.0114388,"AFG",4 +"Afghanistan","Asia",1987,40.822,13867957,852.3959448,"AFG",4 +"Afghanistan","Asia",1992,41.674,16317921,649.3413952,"AFG",4 +"Afghanistan","Asia",1997,41.763,22227415,635.341351,"AFG",4 +"Afghanistan","Asia",2002,42.129,25268405,726.7340548,"AFG",4 +"Afghanistan","Asia",2007,43.828,31889923,974.5803384,"AFG",4 +"Albania","Europe",1952,55.23,1282697,1601.056136,"ALB",8 +"Albania","Europe",1957,59.28,1476505,1942.284244,"ALB",8 +"Albania","Europe",1962,64.82,1728137,2312.888958,"ALB",8 +"Albania","Europe",1967,66.22,1984060,2760.196931,"ALB",8 +"Albania","Europe",1972,67.69,2263554,3313.422188,"ALB",8 +"Albania","Europe",1977,68.93,2509048,3533.00391,"ALB",8 +"Albania","Europe",1982,70.42,2780097,3630.880722,"ALB",8 +"Albania","Europe",1987,72,3075321,3738.932735,"ALB",8 +"Albania","Europe",1992,71.581,3326498,2497.437901,"ALB",8 +"Albania","Europe",1997,72.95,3428038,3193.054604,"ALB",8 +"Albania","Europe",2002,75.651,3508512,4604.211737,"ALB",8 +"Albania","Europe",2007,76.423,3600523,5937.029526,"ALB",8 +"Algeria","Africa",1952,43.077,9279525,2449.008185,"DZA",12 +"Algeria","Africa",1957,45.685,10270856,3013.976023,"DZA",12 +"Algeria","Africa",1962,48.303,11000948,2550.81688,"DZA",12 +"Algeria","Africa",1967,51.407,12760499,3246.991771,"DZA",12 +"Algeria","Africa",1972,54.518,14760787,4182.663766,"DZA",12 +"Algeria","Africa",1977,58.014,17152804,4910.416756,"DZA",12 +"Algeria","Africa",1982,61.368,20033753,5745.160213,"DZA",12 +"Algeria","Africa",1987,65.799,23254956,5681.358539,"DZA",12 +"Algeria","Africa",1992,67.744,26298373,5023.216647,"DZA",12 +"Algeria","Africa",1997,69.152,29072015,4797.295051,"DZA",12 +"Algeria","Africa",2002,70.994,31287142,5288.040382,"DZA",12 +"Algeria","Africa",2007,72.301,33333216,6223.367465,"DZA",12 +"Angola","Africa",1952,30.015,4232095,3520.610273,"AGO",24 +"Angola","Africa",1957,31.999,4561361,3827.940465,"AGO",24 +"Angola","Africa",1962,34,4826015,4269.276742,"AGO",24 +"Angola","Africa",1967,35.985,5247469,5522.776375,"AGO",24 +"Angola","Africa",1972,37.928,5894858,5473.288005,"AGO",24 +"Angola","Africa",1977,39.483,6162675,3008.647355,"AGO",24 +"Angola","Africa",1982,39.942,7016384,2756.953672,"AGO",24 +"Angola","Africa",1987,39.906,7874230,2430.208311,"AGO",24 +"Angola","Africa",1992,40.647,8735988,2627.845685,"AGO",24 +"Angola","Africa",1997,40.963,9875024,2277.140884,"AGO",24 +"Angola","Africa",2002,41.003,10866106,2773.287312,"AGO",24 +"Angola","Africa",2007,42.731,12420476,4797.231267,"AGO",24 +"Argentina","Americas",1952,62.485,17876956,5911.315053,"ARG",32 +"Argentina","Americas",1957,64.399,19610538,6856.856212,"ARG",32 +"Argentina","Americas",1962,65.142,21283783,7133.166023,"ARG",32 +"Argentina","Americas",1967,65.634,22934225,8052.953021,"ARG",32 +"Argentina","Americas",1972,67.065,24779799,9443.038526,"ARG",32 +"Argentina","Americas",1977,68.481,26983828,10079.02674,"ARG",32 +"Argentina","Americas",1982,69.942,29341374,8997.897412,"ARG",32 +"Argentina","Americas",1987,70.774,31620918,9139.671389,"ARG",32 +"Argentina","Americas",1992,71.868,33958947,9308.41871,"ARG",32 +"Argentina","Americas",1997,73.275,36203463,10967.28195,"ARG",32 +"Argentina","Americas",2002,74.34,38331121,8797.640716,"ARG",32 +"Argentina","Americas",2007,75.32,40301927,12779.37964,"ARG",32 +"Australia","Oceania",1952,69.12,8691212,10039.59564,"AUS",36 +"Australia","Oceania",1957,70.33,9712569,10949.64959,"AUS",36 +"Australia","Oceania",1962,70.93,10794968,12217.22686,"AUS",36 +"Australia","Oceania",1967,71.1,11872264,14526.12465,"AUS",36 +"Australia","Oceania",1972,71.93,13177000,16788.62948,"AUS",36 +"Australia","Oceania",1977,73.49,14074100,18334.19751,"AUS",36 +"Australia","Oceania",1982,74.74,15184200,19477.00928,"AUS",36 +"Australia","Oceania",1987,76.32,16257249,21888.88903,"AUS",36 +"Australia","Oceania",1992,77.56,17481977,23424.76683,"AUS",36 +"Australia","Oceania",1997,78.83,18565243,26997.93657,"AUS",36 +"Australia","Oceania",2002,80.37,19546792,30687.75473,"AUS",36 +"Australia","Oceania",2007,81.235,20434176,34435.36744,"AUS",36 +"Austria","Europe",1952,66.8,6927772,6137.076492,"AUT",40 +"Austria","Europe",1957,67.48,6965860,8842.59803,"AUT",40 +"Austria","Europe",1962,69.54,7129864,10750.72111,"AUT",40 +"Austria","Europe",1967,70.14,7376998,12834.6024,"AUT",40 +"Austria","Europe",1972,70.63,7544201,16661.6256,"AUT",40 +"Austria","Europe",1977,72.17,7568430,19749.4223,"AUT",40 +"Austria","Europe",1982,73.18,7574613,21597.08362,"AUT",40 +"Austria","Europe",1987,74.94,7578903,23687.82607,"AUT",40 +"Austria","Europe",1992,76.04,7914969,27042.01868,"AUT",40 +"Austria","Europe",1997,77.51,8069876,29095.92066,"AUT",40 +"Austria","Europe",2002,78.98,8148312,32417.60769,"AUT",40 +"Austria","Europe",2007,79.829,8199783,36126.4927,"AUT",40 +"Bahrain","Asia",1952,50.939,120447,9867.084765,"BHR",48 +"Bahrain","Asia",1957,53.832,138655,11635.79945,"BHR",48 +"Bahrain","Asia",1962,56.923,171863,12753.27514,"BHR",48 +"Bahrain","Asia",1967,59.923,202182,14804.6727,"BHR",48 +"Bahrain","Asia",1972,63.3,230800,18268.65839,"BHR",48 +"Bahrain","Asia",1977,65.593,297410,19340.10196,"BHR",48 +"Bahrain","Asia",1982,69.052,377967,19211.14731,"BHR",48 +"Bahrain","Asia",1987,70.75,454612,18524.02406,"BHR",48 +"Bahrain","Asia",1992,72.601,529491,19035.57917,"BHR",48 +"Bahrain","Asia",1997,73.925,598561,20292.01679,"BHR",48 +"Bahrain","Asia",2002,74.795,656397,23403.55927,"BHR",48 +"Bahrain","Asia",2007,75.635,708573,29796.04834,"BHR",48 +"Bangladesh","Asia",1952,37.484,46886859,684.2441716,"BGD",50 +"Bangladesh","Asia",1957,39.348,51365468,661.6374577,"BGD",50 +"Bangladesh","Asia",1962,41.216,56839289,686.3415538,"BGD",50 +"Bangladesh","Asia",1967,43.453,62821884,721.1860862,"BGD",50 +"Bangladesh","Asia",1972,45.252,70759295,630.2336265,"BGD",50 +"Bangladesh","Asia",1977,46.923,80428306,659.8772322,"BGD",50 +"Bangladesh","Asia",1982,50.009,93074406,676.9818656,"BGD",50 +"Bangladesh","Asia",1987,52.819,103764241,751.9794035,"BGD",50 +"Bangladesh","Asia",1992,56.018,113704579,837.8101643,"BGD",50 +"Bangladesh","Asia",1997,59.412,123315288,972.7700352,"BGD",50 +"Bangladesh","Asia",2002,62.013,135656790,1136.39043,"BGD",50 +"Bangladesh","Asia",2007,64.062,150448339,1391.253792,"BGD",50 +"Belgium","Europe",1952,68,8730405,8343.105127,"BEL",56 +"Belgium","Europe",1957,69.24,8989111,9714.960623,"BEL",56 +"Belgium","Europe",1962,70.25,9218400,10991.20676,"BEL",56 +"Belgium","Europe",1967,70.94,9556500,13149.04119,"BEL",56 +"Belgium","Europe",1972,71.44,9709100,16672.14356,"BEL",56 +"Belgium","Europe",1977,72.8,9821800,19117.97448,"BEL",56 +"Belgium","Europe",1982,73.93,9856303,20979.84589,"BEL",56 +"Belgium","Europe",1987,75.35,9870200,22525.56308,"BEL",56 +"Belgium","Europe",1992,76.46,10045622,25575.57069,"BEL",56 +"Belgium","Europe",1997,77.53,10199787,27561.19663,"BEL",56 +"Belgium","Europe",2002,78.32,10311970,30485.88375,"BEL",56 +"Belgium","Europe",2007,79.441,10392226,33692.60508,"BEL",56 +"Benin","Africa",1952,38.223,1738315,1062.7522,"BEN",204 +"Benin","Africa",1957,40.358,1925173,959.6010805,"BEN",204 +"Benin","Africa",1962,42.618,2151895,949.4990641,"BEN",204 +"Benin","Africa",1967,44.885,2427334,1035.831411,"BEN",204 +"Benin","Africa",1972,47.014,2761407,1085.796879,"BEN",204 +"Benin","Africa",1977,49.19,3168267,1029.161251,"BEN",204 +"Benin","Africa",1982,50.904,3641603,1277.897616,"BEN",204 +"Benin","Africa",1987,52.337,4243788,1225.85601,"BEN",204 +"Benin","Africa",1992,53.919,4981671,1191.207681,"BEN",204 +"Benin","Africa",1997,54.777,6066080,1232.975292,"BEN",204 +"Benin","Africa",2002,54.406,7026113,1372.877931,"BEN",204 +"Benin","Africa",2007,56.728,8078314,1441.284873,"BEN",204 +"Bolivia","Americas",1952,40.414,2883315,2677.326347,"BOL",68 +"Bolivia","Americas",1957,41.89,3211738,2127.686326,"BOL",68 +"Bolivia","Americas",1962,43.428,3593918,2180.972546,"BOL",68 +"Bolivia","Americas",1967,45.032,4040665,2586.886053,"BOL",68 +"Bolivia","Americas",1972,46.714,4565872,2980.331339,"BOL",68 +"Bolivia","Americas",1977,50.023,5079716,3548.097832,"BOL",68 +"Bolivia","Americas",1982,53.859,5642224,3156.510452,"BOL",68 +"Bolivia","Americas",1987,57.251,6156369,2753.69149,"BOL",68 +"Bolivia","Americas",1992,59.957,6893451,2961.699694,"BOL",68 +"Bolivia","Americas",1997,62.05,7693188,3326.143191,"BOL",68 +"Bolivia","Americas",2002,63.883,8445134,3413.26269,"BOL",68 +"Bolivia","Americas",2007,65.554,9119152,3822.137084,"BOL",68 +"Bosnia and Herzegovina","Europe",1952,53.82,2791000,973.5331948,"BIH",70 +"Bosnia and Herzegovina","Europe",1957,58.45,3076000,1353.989176,"BIH",70 +"Bosnia and Herzegovina","Europe",1962,61.93,3349000,1709.683679,"BIH",70 +"Bosnia and Herzegovina","Europe",1967,64.79,3585000,2172.352423,"BIH",70 +"Bosnia and Herzegovina","Europe",1972,67.45,3819000,2860.16975,"BIH",70 +"Bosnia and Herzegovina","Europe",1977,69.86,4086000,3528.481305,"BIH",70 +"Bosnia and Herzegovina","Europe",1982,70.69,4172693,4126.613157,"BIH",70 +"Bosnia and Herzegovina","Europe",1987,71.14,4338977,4314.114757,"BIH",70 +"Bosnia and Herzegovina","Europe",1992,72.178,4256013,2546.781445,"BIH",70 +"Bosnia and Herzegovina","Europe",1997,73.244,3607000,4766.355904,"BIH",70 +"Bosnia and Herzegovina","Europe",2002,74.09,4165416,6018.975239,"BIH",70 +"Bosnia and Herzegovina","Europe",2007,74.852,4552198,7446.298803,"BIH",70 +"Botswana","Africa",1952,47.622,442308,851.2411407,"BWA",72 +"Botswana","Africa",1957,49.618,474639,918.2325349,"BWA",72 +"Botswana","Africa",1962,51.52,512764,983.6539764,"BWA",72 +"Botswana","Africa",1967,53.298,553541,1214.709294,"BWA",72 +"Botswana","Africa",1972,56.024,619351,2263.611114,"BWA",72 +"Botswana","Africa",1977,59.319,781472,3214.857818,"BWA",72 +"Botswana","Africa",1982,61.484,970347,4551.14215,"BWA",72 +"Botswana","Africa",1987,63.622,1151184,6205.88385,"BWA",72 +"Botswana","Africa",1992,62.745,1342614,7954.111645,"BWA",72 +"Botswana","Africa",1997,52.556,1536536,8647.142313,"BWA",72 +"Botswana","Africa",2002,46.634,1630347,11003.60508,"BWA",72 +"Botswana","Africa",2007,50.728,1639131,12569.85177,"BWA",72 +"Brazil","Americas",1952,50.917,56602560,2108.944355,"BRA",76 +"Brazil","Americas",1957,53.285,65551171,2487.365989,"BRA",76 +"Brazil","Americas",1962,55.665,76039390,3336.585802,"BRA",76 +"Brazil","Americas",1967,57.632,88049823,3429.864357,"BRA",76 +"Brazil","Americas",1972,59.504,100840058,4985.711467,"BRA",76 +"Brazil","Americas",1977,61.489,114313951,6660.118654,"BRA",76 +"Brazil","Americas",1982,63.336,128962939,7030.835878,"BRA",76 +"Brazil","Americas",1987,65.205,142938076,7807.095818,"BRA",76 +"Brazil","Americas",1992,67.057,155975974,6950.283021,"BRA",76 +"Brazil","Americas",1997,69.388,168546719,7957.980824,"BRA",76 +"Brazil","Americas",2002,71.006,179914212,8131.212843,"BRA",76 +"Brazil","Americas",2007,72.39,190010647,9065.800825,"BRA",76 +"Bulgaria","Europe",1952,59.6,7274900,2444.286648,"BGR",100 +"Bulgaria","Europe",1957,66.61,7651254,3008.670727,"BGR",100 +"Bulgaria","Europe",1962,69.51,8012946,4254.337839,"BGR",100 +"Bulgaria","Europe",1967,70.42,8310226,5577.0028,"BGR",100 +"Bulgaria","Europe",1972,70.9,8576200,6597.494398,"BGR",100 +"Bulgaria","Europe",1977,70.81,8797022,7612.240438,"BGR",100 +"Bulgaria","Europe",1982,71.08,8892098,8224.191647,"BGR",100 +"Bulgaria","Europe",1987,71.34,8971958,8239.854824,"BGR",100 +"Bulgaria","Europe",1992,71.19,8658506,6302.623438,"BGR",100 +"Bulgaria","Europe",1997,70.32,8066057,5970.38876,"BGR",100 +"Bulgaria","Europe",2002,72.14,7661799,7696.777725,"BGR",100 +"Bulgaria","Europe",2007,73.005,7322858,10680.79282,"BGR",100 +"Burkina Faso","Africa",1952,31.975,4469979,543.2552413,"BFA",854 +"Burkina Faso","Africa",1957,34.906,4713416,617.1834648,"BFA",854 +"Burkina Faso","Africa",1962,37.814,4919632,722.5120206,"BFA",854 +"Burkina Faso","Africa",1967,40.697,5127935,794.8265597,"BFA",854 +"Burkina Faso","Africa",1972,43.591,5433886,854.7359763,"BFA",854 +"Burkina Faso","Africa",1977,46.137,5889574,743.3870368,"BFA",854 +"Burkina Faso","Africa",1982,48.122,6634596,807.1985855,"BFA",854 +"Burkina Faso","Africa",1987,49.557,7586551,912.0631417,"BFA",854 +"Burkina Faso","Africa",1992,50.26,8878303,931.7527731,"BFA",854 +"Burkina Faso","Africa",1997,50.324,10352843,946.2949618,"BFA",854 +"Burkina Faso","Africa",2002,50.65,12251209,1037.645221,"BFA",854 +"Burkina Faso","Africa",2007,52.295,14326203,1217.032994,"BFA",854 +"Burundi","Africa",1952,39.031,2445618,339.2964587,"BDI",108 +"Burundi","Africa",1957,40.533,2667518,379.5646281,"BDI",108 +"Burundi","Africa",1962,42.045,2961915,355.2032273,"BDI",108 +"Burundi","Africa",1967,43.548,3330989,412.9775136,"BDI",108 +"Burundi","Africa",1972,44.057,3529983,464.0995039,"BDI",108 +"Burundi","Africa",1977,45.91,3834415,556.1032651,"BDI",108 +"Burundi","Africa",1982,47.471,4580410,559.603231,"BDI",108 +"Burundi","Africa",1987,48.211,5126023,621.8188189,"BDI",108 +"Burundi","Africa",1992,44.736,5809236,631.6998778,"BDI",108 +"Burundi","Africa",1997,45.326,6121610,463.1151478,"BDI",108 +"Burundi","Africa",2002,47.36,7021078,446.4035126,"BDI",108 +"Burundi","Africa",2007,49.58,8390505,430.0706916,"BDI",108 +"Cambodia","Asia",1952,39.417,4693836,368.4692856,"KHM",116 +"Cambodia","Asia",1957,41.366,5322536,434.0383364,"KHM",116 +"Cambodia","Asia",1962,43.415,6083619,496.9136476,"KHM",116 +"Cambodia","Asia",1967,45.415,6960067,523.4323142,"KHM",116 +"Cambodia","Asia",1972,40.317,7450606,421.6240257,"KHM",116 +"Cambodia","Asia",1977,31.22,6978607,524.9721832,"KHM",116 +"Cambodia","Asia",1982,50.957,7272485,624.4754784,"KHM",116 +"Cambodia","Asia",1987,53.914,8371791,683.8955732,"KHM",116 +"Cambodia","Asia",1992,55.803,10150094,682.3031755,"KHM",116 +"Cambodia","Asia",1997,56.534,11782962,734.28517,"KHM",116 +"Cambodia","Asia",2002,56.752,12926707,896.2260153,"KHM",116 +"Cambodia","Asia",2007,59.723,14131858,1713.778686,"KHM",116 +"Cameroon","Africa",1952,38.523,5009067,1172.667655,"CMR",120 +"Cameroon","Africa",1957,40.428,5359923,1313.048099,"CMR",120 +"Cameroon","Africa",1962,42.643,5793633,1399.607441,"CMR",120 +"Cameroon","Africa",1967,44.799,6335506,1508.453148,"CMR",120 +"Cameroon","Africa",1972,47.049,7021028,1684.146528,"CMR",120 +"Cameroon","Africa",1977,49.355,7959865,1783.432873,"CMR",120 +"Cameroon","Africa",1982,52.961,9250831,2367.983282,"CMR",120 +"Cameroon","Africa",1987,54.985,10780667,2602.664206,"CMR",120 +"Cameroon","Africa",1992,54.314,12467171,1793.163278,"CMR",120 +"Cameroon","Africa",1997,52.199,14195809,1694.337469,"CMR",120 +"Cameroon","Africa",2002,49.856,15929988,1934.011449,"CMR",120 +"Cameroon","Africa",2007,50.43,17696293,2042.09524,"CMR",120 +"Canada","Americas",1952,68.75,14785584,11367.16112,"CAN",124 +"Canada","Americas",1957,69.96,17010154,12489.95006,"CAN",124 +"Canada","Americas",1962,71.3,18985849,13462.48555,"CAN",124 +"Canada","Americas",1967,72.13,20819767,16076.58803,"CAN",124 +"Canada","Americas",1972,72.88,22284500,18970.57086,"CAN",124 +"Canada","Americas",1977,74.21,23796400,22090.88306,"CAN",124 +"Canada","Americas",1982,75.76,25201900,22898.79214,"CAN",124 +"Canada","Americas",1987,76.86,26549700,26626.51503,"CAN",124 +"Canada","Americas",1992,77.95,28523502,26342.88426,"CAN",124 +"Canada","Americas",1997,78.61,30305843,28954.92589,"CAN",124 +"Canada","Americas",2002,79.77,31902268,33328.96507,"CAN",124 +"Canada","Americas",2007,80.653,33390141,36319.23501,"CAN",124 +"Central African Republic","Africa",1952,35.463,1291695,1071.310713,"CAF",140 +"Central African Republic","Africa",1957,37.464,1392284,1190.844328,"CAF",140 +"Central African Republic","Africa",1962,39.475,1523478,1193.068753,"CAF",140 +"Central African Republic","Africa",1967,41.478,1733638,1136.056615,"CAF",140 +"Central African Republic","Africa",1972,43.457,1927260,1070.013275,"CAF",140 +"Central African Republic","Africa",1977,46.775,2167533,1109.374338,"CAF",140 +"Central African Republic","Africa",1982,48.295,2476971,956.7529907,"CAF",140 +"Central African Republic","Africa",1987,50.485,2840009,844.8763504,"CAF",140 +"Central African Republic","Africa",1992,49.396,3265124,747.9055252,"CAF",140 +"Central African Republic","Africa",1997,46.066,3696513,740.5063317,"CAF",140 +"Central African Republic","Africa",2002,43.308,4048013,738.6906068,"CAF",140 +"Central African Republic","Africa",2007,44.741,4369038,706.016537,"CAF",140 +"Chad","Africa",1952,38.092,2682462,1178.665927,"TCD",148 +"Chad","Africa",1957,39.881,2894855,1308.495577,"TCD",148 +"Chad","Africa",1962,41.716,3150417,1389.817618,"TCD",148 +"Chad","Africa",1967,43.601,3495967,1196.810565,"TCD",148 +"Chad","Africa",1972,45.569,3899068,1104.103987,"TCD",148 +"Chad","Africa",1977,47.383,4388260,1133.98495,"TCD",148 +"Chad","Africa",1982,49.517,4875118,797.9081006,"TCD",148 +"Chad","Africa",1987,51.051,5498955,952.386129,"TCD",148 +"Chad","Africa",1992,51.724,6429417,1058.0643,"TCD",148 +"Chad","Africa",1997,51.573,7562011,1004.961353,"TCD",148 +"Chad","Africa",2002,50.525,8835739,1156.18186,"TCD",148 +"Chad","Africa",2007,50.651,10238807,1704.063724,"TCD",148 +"Chile","Americas",1952,54.745,6377619,3939.978789,"CHL",152 +"Chile","Americas",1957,56.074,7048426,4315.622723,"CHL",152 +"Chile","Americas",1962,57.924,7961258,4519.094331,"CHL",152 +"Chile","Americas",1967,60.523,8858908,5106.654313,"CHL",152 +"Chile","Americas",1972,63.441,9717524,5494.024437,"CHL",152 +"Chile","Americas",1977,67.052,10599793,4756.763836,"CHL",152 +"Chile","Americas",1982,70.565,11487112,5095.665738,"CHL",152 +"Chile","Americas",1987,72.492,12463354,5547.063754,"CHL",152 +"Chile","Americas",1992,74.126,13572994,7596.125964,"CHL",152 +"Chile","Americas",1997,75.816,14599929,10118.05318,"CHL",152 +"Chile","Americas",2002,77.86,15497046,10778.78385,"CHL",152 +"Chile","Americas",2007,78.553,16284741,13171.63885,"CHL",152 +"China","Asia",1952,44,556263527,400.448611,"CHN",156 +"China","Asia",1957,50.54896,637408000,575.9870009,"CHN",156 +"China","Asia",1962,44.50136,665770000,487.6740183,"CHN",156 +"China","Asia",1967,58.38112,754550000,612.7056934,"CHN",156 +"China","Asia",1972,63.11888,862030000,676.9000921,"CHN",156 +"China","Asia",1977,63.96736,943455000,741.2374699,"CHN",156 +"China","Asia",1982,65.525,1000281000,962.4213805,"CHN",156 +"China","Asia",1987,67.274,1084035000,1378.904018,"CHN",156 +"China","Asia",1992,68.69,1164970000,1655.784158,"CHN",156 +"China","Asia",1997,70.426,1230075000,2289.234136,"CHN",156 +"China","Asia",2002,72.028,1280400000,3119.280896,"CHN",156 +"China","Asia",2007,72.961,1318683096,4959.114854,"CHN",156 +"Colombia","Americas",1952,50.643,12350771,2144.115096,"COL",170 +"Colombia","Americas",1957,55.118,14485993,2323.805581,"COL",170 +"Colombia","Americas",1962,57.863,17009885,2492.351109,"COL",170 +"Colombia","Americas",1967,59.963,19764027,2678.729839,"COL",170 +"Colombia","Americas",1972,61.623,22542890,3264.660041,"COL",170 +"Colombia","Americas",1977,63.837,25094412,3815.80787,"COL",170 +"Colombia","Americas",1982,66.653,27764644,4397.575659,"COL",170 +"Colombia","Americas",1987,67.768,30964245,4903.2191,"COL",170 +"Colombia","Americas",1992,68.421,34202721,5444.648617,"COL",170 +"Colombia","Americas",1997,70.313,37657830,6117.361746,"COL",170 +"Colombia","Americas",2002,71.682,41008227,5755.259962,"COL",170 +"Colombia","Americas",2007,72.889,44227550,7006.580419,"COL",170 +"Comoros","Africa",1952,40.715,153936,1102.990936,"COM",174 +"Comoros","Africa",1957,42.46,170928,1211.148548,"COM",174 +"Comoros","Africa",1962,44.467,191689,1406.648278,"COM",174 +"Comoros","Africa",1967,46.472,217378,1876.029643,"COM",174 +"Comoros","Africa",1972,48.944,250027,1937.577675,"COM",174 +"Comoros","Africa",1977,50.939,304739,1172.603047,"COM",174 +"Comoros","Africa",1982,52.933,348643,1267.100083,"COM",174 +"Comoros","Africa",1987,54.926,395114,1315.980812,"COM",174 +"Comoros","Africa",1992,57.939,454429,1246.90737,"COM",174 +"Comoros","Africa",1997,60.66,527982,1173.618235,"COM",174 +"Comoros","Africa",2002,62.974,614382,1075.811558,"COM",174 +"Comoros","Africa",2007,65.152,710960,986.1478792,"COM",174 +"Congo, Dem. Rep.","Africa",1952,39.143,14100005,780.5423257,"COD",180 +"Congo, Dem. Rep.","Africa",1957,40.652,15577932,905.8602303,"COD",180 +"Congo, Dem. Rep.","Africa",1962,42.122,17486434,896.3146335,"COD",180 +"Congo, Dem. Rep.","Africa",1967,44.056,19941073,861.5932424,"COD",180 +"Congo, Dem. Rep.","Africa",1972,45.989,23007669,904.8960685,"COD",180 +"Congo, Dem. Rep.","Africa",1977,47.804,26480870,795.757282,"COD",180 +"Congo, Dem. Rep.","Africa",1982,47.784,30646495,673.7478181,"COD",180 +"Congo, Dem. Rep.","Africa",1987,47.412,35481645,672.774812,"COD",180 +"Congo, Dem. Rep.","Africa",1992,45.548,41672143,457.7191807,"COD",180 +"Congo, Dem. Rep.","Africa",1997,42.587,47798986,312.188423,"COD",180 +"Congo, Dem. Rep.","Africa",2002,44.966,55379852,241.1658765,"COD",180 +"Congo, Dem. Rep.","Africa",2007,46.462,64606759,277.5518587,"COD",180 +"Congo, Rep.","Africa",1952,42.111,854885,2125.621418,"COG",178 +"Congo, Rep.","Africa",1957,45.053,940458,2315.056572,"COG",178 +"Congo, Rep.","Africa",1962,48.435,1047924,2464.783157,"COG",178 +"Congo, Rep.","Africa",1967,52.04,1179760,2677.939642,"COG",178 +"Congo, Rep.","Africa",1972,54.907,1340458,3213.152683,"COG",178 +"Congo, Rep.","Africa",1977,55.625,1536769,3259.178978,"COG",178 +"Congo, Rep.","Africa",1982,56.695,1774735,4879.507522,"COG",178 +"Congo, Rep.","Africa",1987,57.47,2064095,4201.194937,"COG",178 +"Congo, Rep.","Africa",1992,56.433,2409073,4016.239529,"COG",178 +"Congo, Rep.","Africa",1997,52.962,2800947,3484.164376,"COG",178 +"Congo, Rep.","Africa",2002,52.97,3328795,3484.06197,"COG",178 +"Congo, Rep.","Africa",2007,55.322,3800610,3632.557798,"COG",178 +"Costa Rica","Americas",1952,57.206,926317,2627.009471,"CRI",188 +"Costa Rica","Americas",1957,60.026,1112300,2990.010802,"CRI",188 +"Costa Rica","Americas",1962,62.842,1345187,3460.937025,"CRI",188 +"Costa Rica","Americas",1967,65.424,1588717,4161.727834,"CRI",188 +"Costa Rica","Americas",1972,67.849,1834796,5118.146939,"CRI",188 +"Costa Rica","Americas",1977,70.75,2108457,5926.876967,"CRI",188 +"Costa Rica","Americas",1982,73.45,2424367,5262.734751,"CRI",188 +"Costa Rica","Americas",1987,74.752,2799811,5629.915318,"CRI",188 +"Costa Rica","Americas",1992,75.713,3173216,6160.416317,"CRI",188 +"Costa Rica","Americas",1997,77.26,3518107,6677.045314,"CRI",188 +"Costa Rica","Americas",2002,78.123,3834934,7723.447195,"CRI",188 +"Costa Rica","Americas",2007,78.782,4133884,9645.06142,"CRI",188 +"Cote d'Ivoire","Africa",1952,40.477,2977019,1388.594732,"CIV",384 +"Cote d'Ivoire","Africa",1957,42.469,3300000,1500.895925,"CIV",384 +"Cote d'Ivoire","Africa",1962,44.93,3832408,1728.869428,"CIV",384 +"Cote d'Ivoire","Africa",1967,47.35,4744870,2052.050473,"CIV",384 +"Cote d'Ivoire","Africa",1972,49.801,6071696,2378.201111,"CIV",384 +"Cote d'Ivoire","Africa",1977,52.374,7459574,2517.736547,"CIV",384 +"Cote d'Ivoire","Africa",1982,53.983,9025951,2602.710169,"CIV",384 +"Cote d'Ivoire","Africa",1987,54.655,10761098,2156.956069,"CIV",384 +"Cote d'Ivoire","Africa",1992,52.044,12772596,1648.073791,"CIV",384 +"Cote d'Ivoire","Africa",1997,47.991,14625967,1786.265407,"CIV",384 +"Cote d'Ivoire","Africa",2002,46.832,16252726,1648.800823,"CIV",384 +"Cote d'Ivoire","Africa",2007,48.328,18013409,1544.750112,"CIV",384 +"Croatia","Europe",1952,61.21,3882229,3119.23652,"HRV",191 +"Croatia","Europe",1957,64.77,3991242,4338.231617,"HRV",191 +"Croatia","Europe",1962,67.13,4076557,5477.890018,"HRV",191 +"Croatia","Europe",1967,68.5,4174366,6960.297861,"HRV",191 +"Croatia","Europe",1972,69.61,4225310,9164.090127,"HRV",191 +"Croatia","Europe",1977,70.64,4318673,11305.38517,"HRV",191 +"Croatia","Europe",1982,70.46,4413368,13221.82184,"HRV",191 +"Croatia","Europe",1987,71.52,4484310,13822.58394,"HRV",191 +"Croatia","Europe",1992,72.527,4494013,8447.794873,"HRV",191 +"Croatia","Europe",1997,73.68,4444595,9875.604515,"HRV",191 +"Croatia","Europe",2002,74.876,4481020,11628.38895,"HRV",191 +"Croatia","Europe",2007,75.748,4493312,14619.22272,"HRV",191 +"Cuba","Americas",1952,59.421,6007797,5586.53878,"CUB",192 +"Cuba","Americas",1957,62.325,6640752,6092.174359,"CUB",192 +"Cuba","Americas",1962,65.246,7254373,5180.75591,"CUB",192 +"Cuba","Americas",1967,68.29,8139332,5690.268015,"CUB",192 +"Cuba","Americas",1972,70.723,8831348,5305.445256,"CUB",192 +"Cuba","Americas",1977,72.649,9537988,6380.494966,"CUB",192 +"Cuba","Americas",1982,73.717,9789224,7316.918107,"CUB",192 +"Cuba","Americas",1987,74.174,10239839,7532.924763,"CUB",192 +"Cuba","Americas",1992,74.414,10723260,5592.843963,"CUB",192 +"Cuba","Americas",1997,76.151,10983007,5431.990415,"CUB",192 +"Cuba","Americas",2002,77.158,11226999,6340.646683,"CUB",192 +"Cuba","Americas",2007,78.273,11416987,8948.102923,"CUB",192 +"Czech Republic","Europe",1952,66.87,9125183,6876.14025,"CZE",203 +"Czech Republic","Europe",1957,69.03,9513758,8256.343918,"CZE",203 +"Czech Republic","Europe",1962,69.9,9620282,10136.86713,"CZE",203 +"Czech Republic","Europe",1967,70.38,9835109,11399.44489,"CZE",203 +"Czech Republic","Europe",1972,70.29,9862158,13108.4536,"CZE",203 +"Czech Republic","Europe",1977,70.71,10161915,14800.16062,"CZE",203 +"Czech Republic","Europe",1982,70.96,10303704,15377.22855,"CZE",203 +"Czech Republic","Europe",1987,71.58,10311597,16310.4434,"CZE",203 +"Czech Republic","Europe",1992,72.4,10315702,14297.02122,"CZE",203 +"Czech Republic","Europe",1997,74.01,10300707,16048.51424,"CZE",203 +"Czech Republic","Europe",2002,75.51,10256295,17596.21022,"CZE",203 +"Czech Republic","Europe",2007,76.486,10228744,22833.30851,"CZE",203 +"Denmark","Europe",1952,70.78,4334000,9692.385245,"DNK",208 +"Denmark","Europe",1957,71.81,4487831,11099.65935,"DNK",208 +"Denmark","Europe",1962,72.35,4646899,13583.31351,"DNK",208 +"Denmark","Europe",1967,72.96,4838800,15937.21123,"DNK",208 +"Denmark","Europe",1972,73.47,4991596,18866.20721,"DNK",208 +"Denmark","Europe",1977,74.69,5088419,20422.9015,"DNK",208 +"Denmark","Europe",1982,74.63,5117810,21688.04048,"DNK",208 +"Denmark","Europe",1987,74.8,5127024,25116.17581,"DNK",208 +"Denmark","Europe",1992,75.33,5171393,26406.73985,"DNK",208 +"Denmark","Europe",1997,76.11,5283663,29804.34567,"DNK",208 +"Denmark","Europe",2002,77.18,5374693,32166.50006,"DNK",208 +"Denmark","Europe",2007,78.332,5468120,35278.41874,"DNK",208 +"Djibouti","Africa",1952,34.812,63149,2669.529475,"DJI",262 +"Djibouti","Africa",1957,37.328,71851,2864.969076,"DJI",262 +"Djibouti","Africa",1962,39.693,89898,3020.989263,"DJI",262 +"Djibouti","Africa",1967,42.074,127617,3020.050513,"DJI",262 +"Djibouti","Africa",1972,44.366,178848,3694.212352,"DJI",262 +"Djibouti","Africa",1977,46.519,228694,3081.761022,"DJI",262 +"Djibouti","Africa",1982,48.812,305991,2879.468067,"DJI",262 +"Djibouti","Africa",1987,50.04,311025,2880.102568,"DJI",262 +"Djibouti","Africa",1992,51.604,384156,2377.156192,"DJI",262 +"Djibouti","Africa",1997,53.157,417908,1895.016984,"DJI",262 +"Djibouti","Africa",2002,53.373,447416,1908.260867,"DJI",262 +"Djibouti","Africa",2007,54.791,496374,2082.481567,"DJI",262 +"Dominican Republic","Americas",1952,45.928,2491346,1397.717137,"DOM",214 +"Dominican Republic","Americas",1957,49.828,2923186,1544.402995,"DOM",214 +"Dominican Republic","Americas",1962,53.459,3453434,1662.137359,"DOM",214 +"Dominican Republic","Americas",1967,56.751,4049146,1653.723003,"DOM",214 +"Dominican Republic","Americas",1972,59.631,4671329,2189.874499,"DOM",214 +"Dominican Republic","Americas",1977,61.788,5302800,2681.9889,"DOM",214 +"Dominican Republic","Americas",1982,63.727,5968349,2861.092386,"DOM",214 +"Dominican Republic","Americas",1987,66.046,6655297,2899.842175,"DOM",214 +"Dominican Republic","Americas",1992,68.457,7351181,3044.214214,"DOM",214 +"Dominican Republic","Americas",1997,69.957,7992357,3614.101285,"DOM",214 +"Dominican Republic","Americas",2002,70.847,8650322,4563.808154,"DOM",214 +"Dominican Republic","Americas",2007,72.235,9319622,6025.374752,"DOM",214 +"Ecuador","Americas",1952,48.357,3548753,3522.110717,"ECU",218 +"Ecuador","Americas",1957,51.356,4058385,3780.546651,"ECU",218 +"Ecuador","Americas",1962,54.64,4681707,4086.114078,"ECU",218 +"Ecuador","Americas",1967,56.678,5432424,4579.074215,"ECU",218 +"Ecuador","Americas",1972,58.796,6298651,5280.99471,"ECU",218 +"Ecuador","Americas",1977,61.31,7278866,6679.62326,"ECU",218 +"Ecuador","Americas",1982,64.342,8365850,7213.791267,"ECU",218 +"Ecuador","Americas",1987,67.231,9545158,6481.776993,"ECU",218 +"Ecuador","Americas",1992,69.613,10748394,7103.702595,"ECU",218 +"Ecuador","Americas",1997,72.312,11911819,7429.455877,"ECU",218 +"Ecuador","Americas",2002,74.173,12921234,5773.044512,"ECU",218 +"Ecuador","Americas",2007,74.994,13755680,6873.262326,"ECU",218 +"Egypt","Africa",1952,41.893,22223309,1418.822445,"EGY",818 +"Egypt","Africa",1957,44.444,25009741,1458.915272,"EGY",818 +"Egypt","Africa",1962,46.992,28173309,1693.335853,"EGY",818 +"Egypt","Africa",1967,49.293,31681188,1814.880728,"EGY",818 +"Egypt","Africa",1972,51.137,34807417,2024.008147,"EGY",818 +"Egypt","Africa",1977,53.319,38783863,2785.493582,"EGY",818 +"Egypt","Africa",1982,56.006,45681811,3503.729636,"EGY",818 +"Egypt","Africa",1987,59.797,52799062,3885.46071,"EGY",818 +"Egypt","Africa",1992,63.674,59402198,3794.755195,"EGY",818 +"Egypt","Africa",1997,67.217,66134291,4173.181797,"EGY",818 +"Egypt","Africa",2002,69.806,73312559,4754.604414,"EGY",818 +"Egypt","Africa",2007,71.338,80264543,5581.180998,"EGY",818 +"El Salvador","Americas",1952,45.262,2042865,3048.3029,"SLV",222 +"El Salvador","Americas",1957,48.57,2355805,3421.523218,"SLV",222 +"El Salvador","Americas",1962,52.307,2747687,3776.803627,"SLV",222 +"El Salvador","Americas",1967,55.855,3232927,4358.595393,"SLV",222 +"El Salvador","Americas",1972,58.207,3790903,4520.246008,"SLV",222 +"El Salvador","Americas",1977,56.696,4282586,5138.922374,"SLV",222 +"El Salvador","Americas",1982,56.604,4474873,4098.344175,"SLV",222 +"El Salvador","Americas",1987,63.154,4842194,4140.442097,"SLV",222 +"El Salvador","Americas",1992,66.798,5274649,4444.2317,"SLV",222 +"El Salvador","Americas",1997,69.535,5783439,5154.825496,"SLV",222 +"El Salvador","Americas",2002,70.734,6353681,5351.568666,"SLV",222 +"El Salvador","Americas",2007,71.878,6939688,5728.353514,"SLV",222 +"Equatorial Guinea","Africa",1952,34.482,216964,375.6431231,"GNQ",226 +"Equatorial Guinea","Africa",1957,35.983,232922,426.0964081,"GNQ",226 +"Equatorial Guinea","Africa",1962,37.485,249220,582.8419714,"GNQ",226 +"Equatorial Guinea","Africa",1967,38.987,259864,915.5960025,"GNQ",226 +"Equatorial Guinea","Africa",1972,40.516,277603,672.4122571,"GNQ",226 +"Equatorial Guinea","Africa",1977,42.024,192675,958.5668124,"GNQ",226 +"Equatorial Guinea","Africa",1982,43.662,285483,927.8253427,"GNQ",226 +"Equatorial Guinea","Africa",1987,45.664,341244,966.8968149,"GNQ",226 +"Equatorial Guinea","Africa",1992,47.545,387838,1132.055034,"GNQ",226 +"Equatorial Guinea","Africa",1997,48.245,439971,2814.480755,"GNQ",226 +"Equatorial Guinea","Africa",2002,49.348,495627,7703.4959,"GNQ",226 +"Equatorial Guinea","Africa",2007,51.579,551201,12154.08975,"GNQ",226 +"Eritrea","Africa",1952,35.928,1438760,328.9405571,"ERI",232 +"Eritrea","Africa",1957,38.047,1542611,344.1618859,"ERI",232 +"Eritrea","Africa",1962,40.158,1666618,380.9958433,"ERI",232 +"Eritrea","Africa",1967,42.189,1820319,468.7949699,"ERI",232 +"Eritrea","Africa",1972,44.142,2260187,514.3242082,"ERI",232 +"Eritrea","Africa",1977,44.535,2512642,505.7538077,"ERI",232 +"Eritrea","Africa",1982,43.89,2637297,524.8758493,"ERI",232 +"Eritrea","Africa",1987,46.453,2915959,521.1341333,"ERI",232 +"Eritrea","Africa",1992,49.991,3668440,582.8585102,"ERI",232 +"Eritrea","Africa",1997,53.378,4058319,913.47079,"ERI",232 +"Eritrea","Africa",2002,55.24,4414865,765.3500015,"ERI",232 +"Eritrea","Africa",2007,58.04,4906585,641.3695236,"ERI",232 +"Ethiopia","Africa",1952,34.078,20860941,362.1462796,"ETH",231 +"Ethiopia","Africa",1957,36.667,22815614,378.9041632,"ETH",231 +"Ethiopia","Africa",1962,40.059,25145372,419.4564161,"ETH",231 +"Ethiopia","Africa",1967,42.115,27860297,516.1186438,"ETH",231 +"Ethiopia","Africa",1972,43.515,30770372,566.2439442,"ETH",231 +"Ethiopia","Africa",1977,44.51,34617799,556.8083834,"ETH",231 +"Ethiopia","Africa",1982,44.916,38111756,577.8607471,"ETH",231 +"Ethiopia","Africa",1987,46.684,42999530,573.7413142,"ETH",231 +"Ethiopia","Africa",1992,48.091,52088559,421.3534653,"ETH",231 +"Ethiopia","Africa",1997,49.402,59861301,515.8894013,"ETH",231 +"Ethiopia","Africa",2002,50.725,67946797,530.0535319,"ETH",231 +"Ethiopia","Africa",2007,52.947,76511887,690.8055759,"ETH",231 +"Finland","Europe",1952,66.55,4090500,6424.519071,"FIN",246 +"Finland","Europe",1957,67.49,4324000,7545.415386,"FIN",246 +"Finland","Europe",1962,68.75,4491443,9371.842561,"FIN",246 +"Finland","Europe",1967,69.83,4605744,10921.63626,"FIN",246 +"Finland","Europe",1972,70.87,4639657,14358.8759,"FIN",246 +"Finland","Europe",1977,72.52,4738902,15605.42283,"FIN",246 +"Finland","Europe",1982,74.55,4826933,18533.15761,"FIN",246 +"Finland","Europe",1987,74.83,4931729,21141.01223,"FIN",246 +"Finland","Europe",1992,75.7,5041039,20647.16499,"FIN",246 +"Finland","Europe",1997,77.13,5134406,23723.9502,"FIN",246 +"Finland","Europe",2002,78.37,5193039,28204.59057,"FIN",246 +"Finland","Europe",2007,79.313,5238460,33207.0844,"FIN",246 +"France","Europe",1952,67.41,42459667,7029.809327,"FRA",250 +"France","Europe",1957,68.93,44310863,8662.834898,"FRA",250 +"France","Europe",1962,70.51,47124000,10560.48553,"FRA",250 +"France","Europe",1967,71.55,49569000,12999.91766,"FRA",250 +"France","Europe",1972,72.38,51732000,16107.19171,"FRA",250 +"France","Europe",1977,73.83,53165019,18292.63514,"FRA",250 +"France","Europe",1982,74.89,54433565,20293.89746,"FRA",250 +"France","Europe",1987,76.34,55630100,22066.44214,"FRA",250 +"France","Europe",1992,77.46,57374179,24703.79615,"FRA",250 +"France","Europe",1997,78.64,58623428,25889.78487,"FRA",250 +"France","Europe",2002,79.59,59925035,28926.03234,"FRA",250 +"France","Europe",2007,80.657,61083916,30470.0167,"FRA",250 +"Gabon","Africa",1952,37.003,420702,4293.476475,"GAB",266 +"Gabon","Africa",1957,38.999,434904,4976.198099,"GAB",266 +"Gabon","Africa",1962,40.489,455661,6631.459222,"GAB",266 +"Gabon","Africa",1967,44.598,489004,8358.761987,"GAB",266 +"Gabon","Africa",1972,48.69,537977,11401.94841,"GAB",266 +"Gabon","Africa",1977,52.79,706367,21745.57328,"GAB",266 +"Gabon","Africa",1982,56.564,753874,15113.36194,"GAB",266 +"Gabon","Africa",1987,60.19,880397,11864.40844,"GAB",266 +"Gabon","Africa",1992,61.366,985739,13522.15752,"GAB",266 +"Gabon","Africa",1997,60.461,1126189,14722.84188,"GAB",266 +"Gabon","Africa",2002,56.761,1299304,12521.71392,"GAB",266 +"Gabon","Africa",2007,56.735,1454867,13206.48452,"GAB",266 +"Gambia","Africa",1952,30,284320,485.2306591,"GMB",270 +"Gambia","Africa",1957,32.065,323150,520.9267111,"GMB",270 +"Gambia","Africa",1962,33.896,374020,599.650276,"GMB",270 +"Gambia","Africa",1967,35.857,439593,734.7829124,"GMB",270 +"Gambia","Africa",1972,38.308,517101,756.0868363,"GMB",270 +"Gambia","Africa",1977,41.842,608274,884.7552507,"GMB",270 +"Gambia","Africa",1982,45.58,715523,835.8096108,"GMB",270 +"Gambia","Africa",1987,49.265,848406,611.6588611,"GMB",270 +"Gambia","Africa",1992,52.644,1025384,665.6244126,"GMB",270 +"Gambia","Africa",1997,55.861,1235767,653.7301704,"GMB",270 +"Gambia","Africa",2002,58.041,1457766,660.5855997,"GMB",270 +"Gambia","Africa",2007,59.448,1688359,752.7497265,"GMB",270 +"Germany","Europe",1952,67.5,69145952,7144.114393,"DEU",276 +"Germany","Europe",1957,69.1,71019069,10187.82665,"DEU",276 +"Germany","Europe",1962,70.3,73739117,12902.46291,"DEU",276 +"Germany","Europe",1967,70.8,76368453,14745.62561,"DEU",276 +"Germany","Europe",1972,71,78717088,18016.18027,"DEU",276 +"Germany","Europe",1977,72.5,78160773,20512.92123,"DEU",276 +"Germany","Europe",1982,73.8,78335266,22031.53274,"DEU",276 +"Germany","Europe",1987,74.847,77718298,24639.18566,"DEU",276 +"Germany","Europe",1992,76.07,80597764,26505.30317,"DEU",276 +"Germany","Europe",1997,77.34,82011073,27788.88416,"DEU",276 +"Germany","Europe",2002,78.67,82350671,30035.80198,"DEU",276 +"Germany","Europe",2007,79.406,82400996,32170.37442,"DEU",276 +"Ghana","Africa",1952,43.149,5581001,911.2989371,"GHA",288 +"Ghana","Africa",1957,44.779,6391288,1043.561537,"GHA",288 +"Ghana","Africa",1962,46.452,7355248,1190.041118,"GHA",288 +"Ghana","Africa",1967,48.072,8490213,1125.69716,"GHA",288 +"Ghana","Africa",1972,49.875,9354120,1178.223708,"GHA",288 +"Ghana","Africa",1977,51.756,10538093,993.2239571,"GHA",288 +"Ghana","Africa",1982,53.744,11400338,876.032569,"GHA",288 +"Ghana","Africa",1987,55.729,14168101,847.0061135,"GHA",288 +"Ghana","Africa",1992,57.501,16278738,925.060154,"GHA",288 +"Ghana","Africa",1997,58.556,18418288,1005.245812,"GHA",288 +"Ghana","Africa",2002,58.453,20550751,1111.984578,"GHA",288 +"Ghana","Africa",2007,60.022,22873338,1327.60891,"GHA",288 +"Greece","Europe",1952,65.86,7733250,3530.690067,"GRC",300 +"Greece","Europe",1957,67.86,8096218,4916.299889,"GRC",300 +"Greece","Europe",1962,69.51,8448233,6017.190733,"GRC",300 +"Greece","Europe",1967,71,8716441,8513.097016,"GRC",300 +"Greece","Europe",1972,72.34,8888628,12724.82957,"GRC",300 +"Greece","Europe",1977,73.68,9308479,14195.52428,"GRC",300 +"Greece","Europe",1982,75.24,9786480,15268.42089,"GRC",300 +"Greece","Europe",1987,76.67,9974490,16120.52839,"GRC",300 +"Greece","Europe",1992,77.03,10325429,17541.49634,"GRC",300 +"Greece","Europe",1997,77.869,10502372,18747.69814,"GRC",300 +"Greece","Europe",2002,78.256,10603863,22514.2548,"GRC",300 +"Greece","Europe",2007,79.483,10706290,27538.41188,"GRC",300 +"Guatemala","Americas",1952,42.023,3146381,2428.237769,"GTM",320 +"Guatemala","Americas",1957,44.142,3640876,2617.155967,"GTM",320 +"Guatemala","Americas",1962,46.954,4208858,2750.364446,"GTM",320 +"Guatemala","Americas",1967,50.016,4690773,3242.531147,"GTM",320 +"Guatemala","Americas",1972,53.738,5149581,4031.408271,"GTM",320 +"Guatemala","Americas",1977,56.029,5703430,4879.992748,"GTM",320 +"Guatemala","Americas",1982,58.137,6395630,4820.49479,"GTM",320 +"Guatemala","Americas",1987,60.782,7326406,4246.485974,"GTM",320 +"Guatemala","Americas",1992,63.373,8486949,4439.45084,"GTM",320 +"Guatemala","Americas",1997,66.322,9803875,4684.313807,"GTM",320 +"Guatemala","Americas",2002,68.978,11178650,4858.347495,"GTM",320 +"Guatemala","Americas",2007,70.259,12572928,5186.050003,"GTM",320 +"Guinea","Africa",1952,33.609,2664249,510.1964923,"GIN",324 +"Guinea","Africa",1957,34.558,2876726,576.2670245,"GIN",324 +"Guinea","Africa",1962,35.753,3140003,686.3736739,"GIN",324 +"Guinea","Africa",1967,37.197,3451418,708.7595409,"GIN",324 +"Guinea","Africa",1972,38.842,3811387,741.6662307,"GIN",324 +"Guinea","Africa",1977,40.762,4227026,874.6858643,"GIN",324 +"Guinea","Africa",1982,42.891,4710497,857.2503577,"GIN",324 +"Guinea","Africa",1987,45.552,5650262,805.5724718,"GIN",324 +"Guinea","Africa",1992,48.576,6990574,794.3484384,"GIN",324 +"Guinea","Africa",1997,51.455,8048834,869.4497668,"GIN",324 +"Guinea","Africa",2002,53.676,8807818,945.5835837,"GIN",324 +"Guinea","Africa",2007,56.007,9947814,942.6542111,"GIN",324 +"Guinea-Bissau","Africa",1952,32.5,580653,299.850319,"GNB",624 +"Guinea-Bissau","Africa",1957,33.489,601095,431.7904566,"GNB",624 +"Guinea-Bissau","Africa",1962,34.488,627820,522.0343725,"GNB",624 +"Guinea-Bissau","Africa",1967,35.492,601287,715.5806402,"GNB",624 +"Guinea-Bissau","Africa",1972,36.486,625361,820.2245876,"GNB",624 +"Guinea-Bissau","Africa",1977,37.465,745228,764.7259628,"GNB",624 +"Guinea-Bissau","Africa",1982,39.327,825987,838.1239671,"GNB",624 +"Guinea-Bissau","Africa",1987,41.245,927524,736.4153921,"GNB",624 +"Guinea-Bissau","Africa",1992,43.266,1050938,745.5398706,"GNB",624 +"Guinea-Bissau","Africa",1997,44.873,1193708,796.6644681,"GNB",624 +"Guinea-Bissau","Africa",2002,45.504,1332459,575.7047176,"GNB",624 +"Guinea-Bissau","Africa",2007,46.388,1472041,579.231743,"GNB",624 +"Haiti","Americas",1952,37.579,3201488,1840.366939,"HTI",332 +"Haiti","Americas",1957,40.696,3507701,1726.887882,"HTI",332 +"Haiti","Americas",1962,43.59,3880130,1796.589032,"HTI",332 +"Haiti","Americas",1967,46.243,4318137,1452.057666,"HTI",332 +"Haiti","Americas",1972,48.042,4698301,1654.456946,"HTI",332 +"Haiti","Americas",1977,49.923,4908554,1874.298931,"HTI",332 +"Haiti","Americas",1982,51.461,5198399,2011.159549,"HTI",332 +"Haiti","Americas",1987,53.636,5756203,1823.015995,"HTI",332 +"Haiti","Americas",1992,55.089,6326682,1456.309517,"HTI",332 +"Haiti","Americas",1997,56.671,6913545,1341.726931,"HTI",332 +"Haiti","Americas",2002,58.137,7607651,1270.364932,"HTI",332 +"Haiti","Americas",2007,60.916,8502814,1201.637154,"HTI",332 +"Honduras","Americas",1952,41.912,1517453,2194.926204,"HND",340 +"Honduras","Americas",1957,44.665,1770390,2220.487682,"HND",340 +"Honduras","Americas",1962,48.041,2090162,2291.156835,"HND",340 +"Honduras","Americas",1967,50.924,2500689,2538.269358,"HND",340 +"Honduras","Americas",1972,53.884,2965146,2529.842345,"HND",340 +"Honduras","Americas",1977,57.402,3055235,3203.208066,"HND",340 +"Honduras","Americas",1982,60.909,3669448,3121.760794,"HND",340 +"Honduras","Americas",1987,64.492,4372203,3023.096699,"HND",340 +"Honduras","Americas",1992,66.399,5077347,3081.694603,"HND",340 +"Honduras","Americas",1997,67.659,5867957,3160.454906,"HND",340 +"Honduras","Americas",2002,68.565,6677328,3099.72866,"HND",340 +"Honduras","Americas",2007,70.198,7483763,3548.330846,"HND",340 +"Hong Kong, China","Asia",1952,60.96,2125900,3054.421209,"HKG",344 +"Hong Kong, China","Asia",1957,64.75,2736300,3629.076457,"HKG",344 +"Hong Kong, China","Asia",1962,67.65,3305200,4692.648272,"HKG",344 +"Hong Kong, China","Asia",1967,70,3722800,6197.962814,"HKG",344 +"Hong Kong, China","Asia",1972,72,4115700,8315.928145,"HKG",344 +"Hong Kong, China","Asia",1977,73.6,4583700,11186.14125,"HKG",344 +"Hong Kong, China","Asia",1982,75.45,5264500,14560.53051,"HKG",344 +"Hong Kong, China","Asia",1987,76.2,5584510,20038.47269,"HKG",344 +"Hong Kong, China","Asia",1992,77.601,5829696,24757.60301,"HKG",344 +"Hong Kong, China","Asia",1997,80,6495918,28377.63219,"HKG",344 +"Hong Kong, China","Asia",2002,81.495,6762476,30209.01516,"HKG",344 +"Hong Kong, China","Asia",2007,82.208,6980412,39724.97867,"HKG",344 +"Hungary","Europe",1952,64.03,9504000,5263.673816,"HUN",348 +"Hungary","Europe",1957,66.41,9839000,6040.180011,"HUN",348 +"Hungary","Europe",1962,67.96,10063000,7550.359877,"HUN",348 +"Hungary","Europe",1967,69.5,10223422,9326.64467,"HUN",348 +"Hungary","Europe",1972,69.76,10394091,10168.65611,"HUN",348 +"Hungary","Europe",1977,69.95,10637171,11674.83737,"HUN",348 +"Hungary","Europe",1982,69.39,10705535,12545.99066,"HUN",348 +"Hungary","Europe",1987,69.58,10612740,12986.47998,"HUN",348 +"Hungary","Europe",1992,69.17,10348684,10535.62855,"HUN",348 +"Hungary","Europe",1997,71.04,10244684,11712.7768,"HUN",348 +"Hungary","Europe",2002,72.59,10083313,14843.93556,"HUN",348 +"Hungary","Europe",2007,73.338,9956108,18008.94444,"HUN",348 +"Iceland","Europe",1952,72.49,147962,7267.688428,"ISL",352 +"Iceland","Europe",1957,73.47,165110,9244.001412,"ISL",352 +"Iceland","Europe",1962,73.68,182053,10350.15906,"ISL",352 +"Iceland","Europe",1967,73.73,198676,13319.89568,"ISL",352 +"Iceland","Europe",1972,74.46,209275,15798.06362,"ISL",352 +"Iceland","Europe",1977,76.11,221823,19654.96247,"ISL",352 +"Iceland","Europe",1982,76.99,233997,23269.6075,"ISL",352 +"Iceland","Europe",1987,77.23,244676,26923.20628,"ISL",352 +"Iceland","Europe",1992,78.77,259012,25144.39201,"ISL",352 +"Iceland","Europe",1997,78.95,271192,28061.09966,"ISL",352 +"Iceland","Europe",2002,80.5,288030,31163.20196,"ISL",352 +"Iceland","Europe",2007,81.757,301931,36180.78919,"ISL",352 +"India","Asia",1952,37.373,372000000,546.5657493,"IND",356 +"India","Asia",1957,40.249,409000000,590.061996,"IND",356 +"India","Asia",1962,43.605,454000000,658.3471509,"IND",356 +"India","Asia",1967,47.193,506000000,700.7706107,"IND",356 +"India","Asia",1972,50.651,567000000,724.032527,"IND",356 +"India","Asia",1977,54.208,634000000,813.337323,"IND",356 +"India","Asia",1982,56.596,708000000,855.7235377,"IND",356 +"India","Asia",1987,58.553,788000000,976.5126756,"IND",356 +"India","Asia",1992,60.223,872000000,1164.406809,"IND",356 +"India","Asia",1997,61.765,959000000,1458.817442,"IND",356 +"India","Asia",2002,62.879,1034172547,1746.769454,"IND",356 +"India","Asia",2007,64.698,1110396331,2452.210407,"IND",356 +"Indonesia","Asia",1952,37.468,82052000,749.6816546,"IDN",360 +"Indonesia","Asia",1957,39.918,90124000,858.9002707,"IDN",360 +"Indonesia","Asia",1962,42.518,99028000,849.2897701,"IDN",360 +"Indonesia","Asia",1967,45.964,109343000,762.4317721,"IDN",360 +"Indonesia","Asia",1972,49.203,121282000,1111.107907,"IDN",360 +"Indonesia","Asia",1977,52.702,136725000,1382.702056,"IDN",360 +"Indonesia","Asia",1982,56.159,153343000,1516.872988,"IDN",360 +"Indonesia","Asia",1987,60.137,169276000,1748.356961,"IDN",360 +"Indonesia","Asia",1992,62.681,184816000,2383.140898,"IDN",360 +"Indonesia","Asia",1997,66.041,199278000,3119.335603,"IDN",360 +"Indonesia","Asia",2002,68.588,211060000,2873.91287,"IDN",360 +"Indonesia","Asia",2007,70.65,223547000,3540.651564,"IDN",360 +"Iran","Asia",1952,44.869,17272000,3035.326002,"IRN",364 +"Iran","Asia",1957,47.181,19792000,3290.257643,"IRN",364 +"Iran","Asia",1962,49.325,22874000,4187.329802,"IRN",364 +"Iran","Asia",1967,52.469,26538000,5906.731805,"IRN",364 +"Iran","Asia",1972,55.234,30614000,9613.818607,"IRN",364 +"Iran","Asia",1977,57.702,35480679,11888.59508,"IRN",364 +"Iran","Asia",1982,59.62,43072751,7608.334602,"IRN",364 +"Iran","Asia",1987,63.04,51889696,6642.881371,"IRN",364 +"Iran","Asia",1992,65.742,60397973,7235.653188,"IRN",364 +"Iran","Asia",1997,68.042,63327987,8263.590301,"IRN",364 +"Iran","Asia",2002,69.451,66907826,9240.761975,"IRN",364 +"Iran","Asia",2007,70.964,69453570,11605.71449,"IRN",364 +"Iraq","Asia",1952,45.32,5441766,4129.766056,"IRQ",368 +"Iraq","Asia",1957,48.437,6248643,6229.333562,"IRQ",368 +"Iraq","Asia",1962,51.457,7240260,8341.737815,"IRQ",368 +"Iraq","Asia",1967,54.459,8519282,8931.459811,"IRQ",368 +"Iraq","Asia",1972,56.95,10061506,9576.037596,"IRQ",368 +"Iraq","Asia",1977,60.413,11882916,14688.23507,"IRQ",368 +"Iraq","Asia",1982,62.038,14173318,14517.90711,"IRQ",368 +"Iraq","Asia",1987,65.044,16543189,11643.57268,"IRQ",368 +"Iraq","Asia",1992,59.461,17861905,3745.640687,"IRQ",368 +"Iraq","Asia",1997,58.811,20775703,3076.239795,"IRQ",368 +"Iraq","Asia",2002,57.046,24001816,4390.717312,"IRQ",368 +"Iraq","Asia",2007,59.545,27499638,4471.061906,"IRQ",368 +"Ireland","Europe",1952,66.91,2952156,5210.280328,"IRL",372 +"Ireland","Europe",1957,68.9,2878220,5599.077872,"IRL",372 +"Ireland","Europe",1962,70.29,2830000,6631.597314,"IRL",372 +"Ireland","Europe",1967,71.08,2900100,7655.568963,"IRL",372 +"Ireland","Europe",1972,71.28,3024400,9530.772896,"IRL",372 +"Ireland","Europe",1977,72.03,3271900,11150.98113,"IRL",372 +"Ireland","Europe",1982,73.1,3480000,12618.32141,"IRL",372 +"Ireland","Europe",1987,74.36,3539900,13872.86652,"IRL",372 +"Ireland","Europe",1992,75.467,3557761,17558.81555,"IRL",372 +"Ireland","Europe",1997,76.122,3667233,24521.94713,"IRL",372 +"Ireland","Europe",2002,77.783,3879155,34077.04939,"IRL",372 +"Ireland","Europe",2007,78.885,4109086,40675.99635,"IRL",372 +"Israel","Asia",1952,65.39,1620914,4086.522128,"ISR",376 +"Israel","Asia",1957,67.84,1944401,5385.278451,"ISR",376 +"Israel","Asia",1962,69.39,2310904,7105.630706,"ISR",376 +"Israel","Asia",1967,70.75,2693585,8393.741404,"ISR",376 +"Israel","Asia",1972,71.63,3095893,12786.93223,"ISR",376 +"Israel","Asia",1977,73.06,3495918,13306.61921,"ISR",376 +"Israel","Asia",1982,74.45,3858421,15367.0292,"ISR",376 +"Israel","Asia",1987,75.6,4203148,17122.47986,"ISR",376 +"Israel","Asia",1992,76.93,4936550,18051.52254,"ISR",376 +"Israel","Asia",1997,78.269,5531387,20896.60924,"ISR",376 +"Israel","Asia",2002,79.696,6029529,21905.59514,"ISR",376 +"Israel","Asia",2007,80.745,6426679,25523.2771,"ISR",376 +"Italy","Europe",1952,65.94,47666000,4931.404155,"ITA",380 +"Italy","Europe",1957,67.81,49182000,6248.656232,"ITA",380 +"Italy","Europe",1962,69.24,50843200,8243.58234,"ITA",380 +"Italy","Europe",1967,71.06,52667100,10022.40131,"ITA",380 +"Italy","Europe",1972,72.19,54365564,12269.27378,"ITA",380 +"Italy","Europe",1977,73.48,56059245,14255.98475,"ITA",380 +"Italy","Europe",1982,74.98,56535636,16537.4835,"ITA",380 +"Italy","Europe",1987,76.42,56729703,19207.23482,"ITA",380 +"Italy","Europe",1992,77.44,56840847,22013.64486,"ITA",380 +"Italy","Europe",1997,78.82,57479469,24675.02446,"ITA",380 +"Italy","Europe",2002,80.24,57926999,27968.09817,"ITA",380 +"Italy","Europe",2007,80.546,58147733,28569.7197,"ITA",380 +"Jamaica","Americas",1952,58.53,1426095,2898.530881,"JAM",388 +"Jamaica","Americas",1957,62.61,1535090,4756.525781,"JAM",388 +"Jamaica","Americas",1962,65.61,1665128,5246.107524,"JAM",388 +"Jamaica","Americas",1967,67.51,1861096,6124.703451,"JAM",388 +"Jamaica","Americas",1972,69,1997616,7433.889293,"JAM",388 +"Jamaica","Americas",1977,70.11,2156814,6650.195573,"JAM",388 +"Jamaica","Americas",1982,71.21,2298309,6068.05135,"JAM",388 +"Jamaica","Americas",1987,71.77,2326606,6351.237495,"JAM",388 +"Jamaica","Americas",1992,71.766,2378618,7404.923685,"JAM",388 +"Jamaica","Americas",1997,72.262,2531311,7121.924704,"JAM",388 +"Jamaica","Americas",2002,72.047,2664659,6994.774861,"JAM",388 +"Jamaica","Americas",2007,72.567,2780132,7320.880262,"JAM",388 +"Japan","Asia",1952,63.03,86459025,3216.956347,"JPN",392 +"Japan","Asia",1957,65.5,91563009,4317.694365,"JPN",392 +"Japan","Asia",1962,68.73,95831757,6576.649461,"JPN",392 +"Japan","Asia",1967,71.43,100825279,9847.788607,"JPN",392 +"Japan","Asia",1972,73.42,107188273,14778.78636,"JPN",392 +"Japan","Asia",1977,75.38,113872473,16610.37701,"JPN",392 +"Japan","Asia",1982,77.11,118454974,19384.10571,"JPN",392 +"Japan","Asia",1987,78.67,122091325,22375.94189,"JPN",392 +"Japan","Asia",1992,79.36,124329269,26824.89511,"JPN",392 +"Japan","Asia",1997,80.69,125956499,28816.58499,"JPN",392 +"Japan","Asia",2002,82,127065841,28604.5919,"JPN",392 +"Japan","Asia",2007,82.603,127467972,31656.06806,"JPN",392 +"Jordan","Asia",1952,43.158,607914,1546.907807,"JOR",400 +"Jordan","Asia",1957,45.669,746559,1886.080591,"JOR",400 +"Jordan","Asia",1962,48.126,933559,2348.009158,"JOR",400 +"Jordan","Asia",1967,51.629,1255058,2741.796252,"JOR",400 +"Jordan","Asia",1972,56.528,1613551,2110.856309,"JOR",400 +"Jordan","Asia",1977,61.134,1937652,2852.351568,"JOR",400 +"Jordan","Asia",1982,63.739,2347031,4161.415959,"JOR",400 +"Jordan","Asia",1987,65.869,2820042,4448.679912,"JOR",400 +"Jordan","Asia",1992,68.015,3867409,3431.593647,"JOR",400 +"Jordan","Asia",1997,69.772,4526235,3645.379572,"JOR",400 +"Jordan","Asia",2002,71.263,5307470,3844.917194,"JOR",400 +"Jordan","Asia",2007,72.535,6053193,4519.461171,"JOR",400 +"Kenya","Africa",1952,42.27,6464046,853.540919,"KEN",404 +"Kenya","Africa",1957,44.686,7454779,944.4383152,"KEN",404 +"Kenya","Africa",1962,47.949,8678557,896.9663732,"KEN",404 +"Kenya","Africa",1967,50.654,10191512,1056.736457,"KEN",404 +"Kenya","Africa",1972,53.559,12044785,1222.359968,"KEN",404 +"Kenya","Africa",1977,56.155,14500404,1267.613204,"KEN",404 +"Kenya","Africa",1982,58.766,17661452,1348.225791,"KEN",404 +"Kenya","Africa",1987,59.339,21198082,1361.936856,"KEN",404 +"Kenya","Africa",1992,59.285,25020539,1341.921721,"KEN",404 +"Kenya","Africa",1997,54.407,28263827,1360.485021,"KEN",404 +"Kenya","Africa",2002,50.992,31386842,1287.514732,"KEN",404 +"Kenya","Africa",2007,54.11,35610177,1463.249282,"KEN",404 +"Korea, Dem. Rep.","Asia",1952,50.056,8865488,1088.277758,"KOR",410 +"Korea, Dem. Rep.","Asia",1957,54.081,9411381,1571.134655,"KOR",410 +"Korea, Dem. Rep.","Asia",1962,56.656,10917494,1621.693598,"KOR",410 +"Korea, Dem. Rep.","Asia",1967,59.942,12617009,2143.540609,"KOR",410 +"Korea, Dem. Rep.","Asia",1972,63.983,14781241,3701.621503,"KOR",410 +"Korea, Dem. Rep.","Asia",1977,67.159,16325320,4106.301249,"KOR",410 +"Korea, Dem. Rep.","Asia",1982,69.1,17647518,4106.525293,"KOR",410 +"Korea, Dem. Rep.","Asia",1987,70.647,19067554,4106.492315,"KOR",410 +"Korea, Dem. Rep.","Asia",1992,69.978,20711375,3726.063507,"KOR",410 +"Korea, Dem. Rep.","Asia",1997,67.727,21585105,1690.756814,"KOR",410 +"Korea, Dem. Rep.","Asia",2002,66.662,22215365,1646.758151,"KOR",410 +"Korea, Dem. Rep.","Asia",2007,67.297,23301725,1593.06548,"KOR",410 +"Korea, Rep.","Asia",1952,47.453,20947571,1030.592226,"KOR",410 +"Korea, Rep.","Asia",1957,52.681,22611552,1487.593537,"KOR",410 +"Korea, Rep.","Asia",1962,55.292,26420307,1536.344387,"KOR",410 +"Korea, Rep.","Asia",1967,57.716,30131000,2029.228142,"KOR",410 +"Korea, Rep.","Asia",1972,62.612,33505000,3030.87665,"KOR",410 +"Korea, Rep.","Asia",1977,64.766,36436000,4657.22102,"KOR",410 +"Korea, Rep.","Asia",1982,67.123,39326000,5622.942464,"KOR",410 +"Korea, Rep.","Asia",1987,69.81,41622000,8533.088805,"KOR",410 +"Korea, Rep.","Asia",1992,72.244,43805450,12104.27872,"KOR",410 +"Korea, Rep.","Asia",1997,74.647,46173816,15993.52796,"KOR",410 +"Korea, Rep.","Asia",2002,77.045,47969150,19233.98818,"KOR",410 +"Korea, Rep.","Asia",2007,78.623,49044790,23348.13973,"KOR",410 +"Kuwait","Asia",1952,55.565,160000,108382.3529,"KWT",414 +"Kuwait","Asia",1957,58.033,212846,113523.1329,"KWT",414 +"Kuwait","Asia",1962,60.47,358266,95458.11176,"KWT",414 +"Kuwait","Asia",1967,64.624,575003,80894.88326,"KWT",414 +"Kuwait","Asia",1972,67.712,841934,109347.867,"KWT",414 +"Kuwait","Asia",1977,69.343,1140357,59265.47714,"KWT",414 +"Kuwait","Asia",1982,71.309,1497494,31354.03573,"KWT",414 +"Kuwait","Asia",1987,74.174,1891487,28118.42998,"KWT",414 +"Kuwait","Asia",1992,75.19,1418095,34932.91959,"KWT",414 +"Kuwait","Asia",1997,76.156,1765345,40300.61996,"KWT",414 +"Kuwait","Asia",2002,76.904,2111561,35110.10566,"KWT",414 +"Kuwait","Asia",2007,77.588,2505559,47306.98978,"KWT",414 +"Lebanon","Asia",1952,55.928,1439529,4834.804067,"LBN",422 +"Lebanon","Asia",1957,59.489,1647412,6089.786934,"LBN",422 +"Lebanon","Asia",1962,62.094,1886848,5714.560611,"LBN",422 +"Lebanon","Asia",1967,63.87,2186894,6006.983042,"LBN",422 +"Lebanon","Asia",1972,65.421,2680018,7486.384341,"LBN",422 +"Lebanon","Asia",1977,66.099,3115787,8659.696836,"LBN",422 +"Lebanon","Asia",1982,66.983,3086876,7640.519521,"LBN",422 +"Lebanon","Asia",1987,67.926,3089353,5377.091329,"LBN",422 +"Lebanon","Asia",1992,69.292,3219994,6890.806854,"LBN",422 +"Lebanon","Asia",1997,70.265,3430388,8754.96385,"LBN",422 +"Lebanon","Asia",2002,71.028,3677780,9313.93883,"LBN",422 +"Lebanon","Asia",2007,71.993,3921278,10461.05868,"LBN",422 +"Lesotho","Africa",1952,42.138,748747,298.8462121,"LSO",426 +"Lesotho","Africa",1957,45.047,813338,335.9971151,"LSO",426 +"Lesotho","Africa",1962,47.747,893143,411.8006266,"LSO",426 +"Lesotho","Africa",1967,48.492,996380,498.6390265,"LSO",426 +"Lesotho","Africa",1972,49.767,1116779,496.5815922,"LSO",426 +"Lesotho","Africa",1977,52.208,1251524,745.3695408,"LSO",426 +"Lesotho","Africa",1982,55.078,1411807,797.2631074,"LSO",426 +"Lesotho","Africa",1987,57.18,1599200,773.9932141,"LSO",426 +"Lesotho","Africa",1992,59.685,1803195,977.4862725,"LSO",426 +"Lesotho","Africa",1997,55.558,1982823,1186.147994,"LSO",426 +"Lesotho","Africa",2002,44.593,2046772,1275.184575,"LSO",426 +"Lesotho","Africa",2007,42.592,2012649,1569.331442,"LSO",426 +"Liberia","Africa",1952,38.48,863308,575.5729961,"LBR",430 +"Liberia","Africa",1957,39.486,975950,620.9699901,"LBR",430 +"Liberia","Africa",1962,40.502,1112796,634.1951625,"LBR",430 +"Liberia","Africa",1967,41.536,1279406,713.6036483,"LBR",430 +"Liberia","Africa",1972,42.614,1482628,803.0054535,"LBR",430 +"Liberia","Africa",1977,43.764,1703617,640.3224383,"LBR",430 +"Liberia","Africa",1982,44.852,1956875,572.1995694,"LBR",430 +"Liberia","Africa",1987,46.027,2269414,506.1138573,"LBR",430 +"Liberia","Africa",1992,40.802,1912974,636.6229191,"LBR",430 +"Liberia","Africa",1997,42.221,2200725,609.1739508,"LBR",430 +"Liberia","Africa",2002,43.753,2814651,531.4823679,"LBR",430 +"Liberia","Africa",2007,45.678,3193942,414.5073415,"LBR",430 +"Libya","Africa",1952,42.723,1019729,2387.54806,"LBY",434 +"Libya","Africa",1957,45.289,1201578,3448.284395,"LBY",434 +"Libya","Africa",1962,47.808,1441863,6757.030816,"LBY",434 +"Libya","Africa",1967,50.227,1759224,18772.75169,"LBY",434 +"Libya","Africa",1972,52.773,2183877,21011.49721,"LBY",434 +"Libya","Africa",1977,57.442,2721783,21951.21176,"LBY",434 +"Libya","Africa",1982,62.155,3344074,17364.27538,"LBY",434 +"Libya","Africa",1987,66.234,3799845,11770.5898,"LBY",434 +"Libya","Africa",1992,68.755,4364501,9640.138501,"LBY",434 +"Libya","Africa",1997,71.555,4759670,9467.446056,"LBY",434 +"Libya","Africa",2002,72.737,5368585,9534.677467,"LBY",434 +"Libya","Africa",2007,73.952,6036914,12057.49928,"LBY",434 +"Madagascar","Africa",1952,36.681,4762912,1443.011715,"MDG",450 +"Madagascar","Africa",1957,38.865,5181679,1589.20275,"MDG",450 +"Madagascar","Africa",1962,40.848,5703324,1643.38711,"MDG",450 +"Madagascar","Africa",1967,42.881,6334556,1634.047282,"MDG",450 +"Madagascar","Africa",1972,44.851,7082430,1748.562982,"MDG",450 +"Madagascar","Africa",1977,46.881,8007166,1544.228586,"MDG",450 +"Madagascar","Africa",1982,48.969,9171477,1302.878658,"MDG",450 +"Madagascar","Africa",1987,49.35,10568642,1155.441948,"MDG",450 +"Madagascar","Africa",1992,52.214,12210395,1040.67619,"MDG",450 +"Madagascar","Africa",1997,54.978,14165114,986.2958956,"MDG",450 +"Madagascar","Africa",2002,57.286,16473477,894.6370822,"MDG",450 +"Madagascar","Africa",2007,59.443,19167654,1044.770126,"MDG",450 +"Malawi","Africa",1952,36.256,2917802,369.1650802,"MWI",454 +"Malawi","Africa",1957,37.207,3221238,416.3698064,"MWI",454 +"Malawi","Africa",1962,38.41,3628608,427.9010856,"MWI",454 +"Malawi","Africa",1967,39.487,4147252,495.5147806,"MWI",454 +"Malawi","Africa",1972,41.766,4730997,584.6219709,"MWI",454 +"Malawi","Africa",1977,43.767,5637246,663.2236766,"MWI",454 +"Malawi","Africa",1982,45.642,6502825,632.8039209,"MWI",454 +"Malawi","Africa",1987,47.457,7824747,635.5173634,"MWI",454 +"Malawi","Africa",1992,49.42,10014249,563.2000145,"MWI",454 +"Malawi","Africa",1997,47.495,10419991,692.2758103,"MWI",454 +"Malawi","Africa",2002,45.009,11824495,665.4231186,"MWI",454 +"Malawi","Africa",2007,48.303,13327079,759.3499101,"MWI",454 +"Malaysia","Asia",1952,48.463,6748378,1831.132894,"MYS",458 +"Malaysia","Asia",1957,52.102,7739235,1810.066992,"MYS",458 +"Malaysia","Asia",1962,55.737,8906385,2036.884944,"MYS",458 +"Malaysia","Asia",1967,59.371,10154878,2277.742396,"MYS",458 +"Malaysia","Asia",1972,63.01,11441462,2849.09478,"MYS",458 +"Malaysia","Asia",1977,65.256,12845381,3827.921571,"MYS",458 +"Malaysia","Asia",1982,68,14441916,4920.355951,"MYS",458 +"Malaysia","Asia",1987,69.5,16331785,5249.802653,"MYS",458 +"Malaysia","Asia",1992,70.693,18319502,7277.912802,"MYS",458 +"Malaysia","Asia",1997,71.938,20476091,10132.90964,"MYS",458 +"Malaysia","Asia",2002,73.044,22662365,10206.97794,"MYS",458 +"Malaysia","Asia",2007,74.241,24821286,12451.6558,"MYS",458 +"Mali","Africa",1952,33.685,3838168,452.3369807,"MLI",466 +"Mali","Africa",1957,35.307,4241884,490.3821867,"MLI",466 +"Mali","Africa",1962,36.936,4690372,496.1743428,"MLI",466 +"Mali","Africa",1967,38.487,5212416,545.0098873,"MLI",466 +"Mali","Africa",1972,39.977,5828158,581.3688761,"MLI",466 +"Mali","Africa",1977,41.714,6491649,686.3952693,"MLI",466 +"Mali","Africa",1982,43.916,6998256,618.0140641,"MLI",466 +"Mali","Africa",1987,46.364,7634008,684.1715576,"MLI",466 +"Mali","Africa",1992,48.388,8416215,739.014375,"MLI",466 +"Mali","Africa",1997,49.903,9384984,790.2579846,"MLI",466 +"Mali","Africa",2002,51.818,10580176,951.4097518,"MLI",466 +"Mali","Africa",2007,54.467,12031795,1042.581557,"MLI",466 +"Mauritania","Africa",1952,40.543,1022556,743.1159097,"MRT",478 +"Mauritania","Africa",1957,42.338,1076852,846.1202613,"MRT",478 +"Mauritania","Africa",1962,44.248,1146757,1055.896036,"MRT",478 +"Mauritania","Africa",1967,46.289,1230542,1421.145193,"MRT",478 +"Mauritania","Africa",1972,48.437,1332786,1586.851781,"MRT",478 +"Mauritania","Africa",1977,50.852,1456688,1497.492223,"MRT",478 +"Mauritania","Africa",1982,53.599,1622136,1481.150189,"MRT",478 +"Mauritania","Africa",1987,56.145,1841240,1421.603576,"MRT",478 +"Mauritania","Africa",1992,58.333,2119465,1361.369784,"MRT",478 +"Mauritania","Africa",1997,60.43,2444741,1483.136136,"MRT",478 +"Mauritania","Africa",2002,62.247,2828858,1579.019543,"MRT",478 +"Mauritania","Africa",2007,64.164,3270065,1803.151496,"MRT",478 +"Mauritius","Africa",1952,50.986,516556,1967.955707,"MUS",480 +"Mauritius","Africa",1957,58.089,609816,2034.037981,"MUS",480 +"Mauritius","Africa",1962,60.246,701016,2529.067487,"MUS",480 +"Mauritius","Africa",1967,61.557,789309,2475.387562,"MUS",480 +"Mauritius","Africa",1972,62.944,851334,2575.484158,"MUS",480 +"Mauritius","Africa",1977,64.93,913025,3710.982963,"MUS",480 +"Mauritius","Africa",1982,66.711,992040,3688.037739,"MUS",480 +"Mauritius","Africa",1987,68.74,1042663,4783.586903,"MUS",480 +"Mauritius","Africa",1992,69.745,1096202,6058.253846,"MUS",480 +"Mauritius","Africa",1997,70.736,1149818,7425.705295,"MUS",480 +"Mauritius","Africa",2002,71.954,1200206,9021.815894,"MUS",480 +"Mauritius","Africa",2007,72.801,1250882,10956.99112,"MUS",480 +"Mexico","Americas",1952,50.789,30144317,3478.125529,"MEX",484 +"Mexico","Americas",1957,55.19,35015548,4131.546641,"MEX",484 +"Mexico","Americas",1962,58.299,41121485,4581.609385,"MEX",484 +"Mexico","Americas",1967,60.11,47995559,5754.733883,"MEX",484 +"Mexico","Americas",1972,62.361,55984294,6809.40669,"MEX",484 +"Mexico","Americas",1977,65.032,63759976,7674.929108,"MEX",484 +"Mexico","Americas",1982,67.405,71640904,9611.147541,"MEX",484 +"Mexico","Americas",1987,69.498,80122492,8688.156003,"MEX",484 +"Mexico","Americas",1992,71.455,88111030,9472.384295,"MEX",484 +"Mexico","Americas",1997,73.67,95895146,9767.29753,"MEX",484 +"Mexico","Americas",2002,74.902,102479927,10742.44053,"MEX",484 +"Mexico","Americas",2007,76.195,108700891,11977.57496,"MEX",484 +"Mongolia","Asia",1952,42.244,800663,786.5668575,"MNG",496 +"Mongolia","Asia",1957,45.248,882134,912.6626085,"MNG",496 +"Mongolia","Asia",1962,48.251,1010280,1056.353958,"MNG",496 +"Mongolia","Asia",1967,51.253,1149500,1226.04113,"MNG",496 +"Mongolia","Asia",1972,53.754,1320500,1421.741975,"MNG",496 +"Mongolia","Asia",1977,55.491,1528000,1647.511665,"MNG",496 +"Mongolia","Asia",1982,57.489,1756032,2000.603139,"MNG",496 +"Mongolia","Asia",1987,60.222,2015133,2338.008304,"MNG",496 +"Mongolia","Asia",1992,61.271,2312802,1785.402016,"MNG",496 +"Mongolia","Asia",1997,63.625,2494803,1902.2521,"MNG",496 +"Mongolia","Asia",2002,65.033,2674234,2140.739323,"MNG",496 +"Mongolia","Asia",2007,66.803,2874127,3095.772271,"MNG",496 +"Montenegro","Europe",1952,59.164,413834,2647.585601,"MNE",499 +"Montenegro","Europe",1957,61.448,442829,3682.259903,"MNE",499 +"Montenegro","Europe",1962,63.728,474528,4649.593785,"MNE",499 +"Montenegro","Europe",1967,67.178,501035,5907.850937,"MNE",499 +"Montenegro","Europe",1972,70.636,527678,7778.414017,"MNE",499 +"Montenegro","Europe",1977,73.066,560073,9595.929905,"MNE",499 +"Montenegro","Europe",1982,74.101,562548,11222.58762,"MNE",499 +"Montenegro","Europe",1987,74.865,569473,11732.51017,"MNE",499 +"Montenegro","Europe",1992,75.435,621621,7003.339037,"MNE",499 +"Montenegro","Europe",1997,75.445,692651,6465.613349,"MNE",499 +"Montenegro","Europe",2002,73.981,720230,6557.194282,"MNE",499 +"Montenegro","Europe",2007,74.543,684736,9253.896111,"MNE",499 +"Morocco","Africa",1952,42.873,9939217,1688.20357,"MAR",504 +"Morocco","Africa",1957,45.423,11406350,1642.002314,"MAR",504 +"Morocco","Africa",1962,47.924,13056604,1566.353493,"MAR",504 +"Morocco","Africa",1967,50.335,14770296,1711.04477,"MAR",504 +"Morocco","Africa",1972,52.862,16660670,1930.194975,"MAR",504 +"Morocco","Africa",1977,55.73,18396941,2370.619976,"MAR",504 +"Morocco","Africa",1982,59.65,20198730,2702.620356,"MAR",504 +"Morocco","Africa",1987,62.677,22987397,2755.046991,"MAR",504 +"Morocco","Africa",1992,65.393,25798239,2948.047252,"MAR",504 +"Morocco","Africa",1997,67.66,28529501,2982.101858,"MAR",504 +"Morocco","Africa",2002,69.615,31167783,3258.495584,"MAR",504 +"Morocco","Africa",2007,71.164,33757175,3820.17523,"MAR",504 +"Mozambique","Africa",1952,31.286,6446316,468.5260381,"MOZ",508 +"Mozambique","Africa",1957,33.779,7038035,495.5868333,"MOZ",508 +"Mozambique","Africa",1962,36.161,7788944,556.6863539,"MOZ",508 +"Mozambique","Africa",1967,38.113,8680909,566.6691539,"MOZ",508 +"Mozambique","Africa",1972,40.328,9809596,724.9178037,"MOZ",508 +"Mozambique","Africa",1977,42.495,11127868,502.3197334,"MOZ",508 +"Mozambique","Africa",1982,42.795,12587223,462.2114149,"MOZ",508 +"Mozambique","Africa",1987,42.861,12891952,389.8761846,"MOZ",508 +"Mozambique","Africa",1992,44.284,13160731,410.8968239,"MOZ",508 +"Mozambique","Africa",1997,46.344,16603334,472.3460771,"MOZ",508 +"Mozambique","Africa",2002,44.026,18473780,633.6179466,"MOZ",508 +"Mozambique","Africa",2007,42.082,19951656,823.6856205,"MOZ",508 +"Myanmar","Asia",1952,36.319,20092996,331,"MMR",104 +"Myanmar","Asia",1957,41.905,21731844,350,"MMR",104 +"Myanmar","Asia",1962,45.108,23634436,388,"MMR",104 +"Myanmar","Asia",1967,49.379,25870271,349,"MMR",104 +"Myanmar","Asia",1972,53.07,28466390,357,"MMR",104 +"Myanmar","Asia",1977,56.059,31528087,371,"MMR",104 +"Myanmar","Asia",1982,58.056,34680442,424,"MMR",104 +"Myanmar","Asia",1987,58.339,38028578,385,"MMR",104 +"Myanmar","Asia",1992,59.32,40546538,347,"MMR",104 +"Myanmar","Asia",1997,60.328,43247867,415,"MMR",104 +"Myanmar","Asia",2002,59.908,45598081,611,"MMR",104 +"Myanmar","Asia",2007,62.069,47761980,944,"MMR",104 +"Namibia","Africa",1952,41.725,485831,2423.780443,"NAM",516 +"Namibia","Africa",1957,45.226,548080,2621.448058,"NAM",516 +"Namibia","Africa",1962,48.386,621392,3173.215595,"NAM",516 +"Namibia","Africa",1967,51.159,706640,3793.694753,"NAM",516 +"Namibia","Africa",1972,53.867,821782,3746.080948,"NAM",516 +"Namibia","Africa",1977,56.437,977026,3876.485958,"NAM",516 +"Namibia","Africa",1982,58.968,1099010,4191.100511,"NAM",516 +"Namibia","Africa",1987,60.835,1278184,3693.731337,"NAM",516 +"Namibia","Africa",1992,61.999,1554253,3804.537999,"NAM",516 +"Namibia","Africa",1997,58.909,1774766,3899.52426,"NAM",516 +"Namibia","Africa",2002,51.479,1972153,4072.324751,"NAM",516 +"Namibia","Africa",2007,52.906,2055080,4811.060429,"NAM",516 +"Nepal","Asia",1952,36.157,9182536,545.8657229,"NPL",524 +"Nepal","Asia",1957,37.686,9682338,597.9363558,"NPL",524 +"Nepal","Asia",1962,39.393,10332057,652.3968593,"NPL",524 +"Nepal","Asia",1967,41.472,11261690,676.4422254,"NPL",524 +"Nepal","Asia",1972,43.971,12412593,674.7881296,"NPL",524 +"Nepal","Asia",1977,46.748,13933198,694.1124398,"NPL",524 +"Nepal","Asia",1982,49.594,15796314,718.3730947,"NPL",524 +"Nepal","Asia",1987,52.537,17917180,775.6324501,"NPL",524 +"Nepal","Asia",1992,55.727,20326209,897.7403604,"NPL",524 +"Nepal","Asia",1997,59.426,23001113,1010.892138,"NPL",524 +"Nepal","Asia",2002,61.34,25873917,1057.206311,"NPL",524 +"Nepal","Asia",2007,63.785,28901790,1091.359778,"NPL",524 +"Netherlands","Europe",1952,72.13,10381988,8941.571858,"NLD",528 +"Netherlands","Europe",1957,72.99,11026383,11276.19344,"NLD",528 +"Netherlands","Europe",1962,73.23,11805689,12790.84956,"NLD",528 +"Netherlands","Europe",1967,73.82,12596822,15363.25136,"NLD",528 +"Netherlands","Europe",1972,73.75,13329874,18794.74567,"NLD",528 +"Netherlands","Europe",1977,75.24,13852989,21209.0592,"NLD",528 +"Netherlands","Europe",1982,76.05,14310401,21399.46046,"NLD",528 +"Netherlands","Europe",1987,76.83,14665278,23651.32361,"NLD",528 +"Netherlands","Europe",1992,77.42,15174244,26790.94961,"NLD",528 +"Netherlands","Europe",1997,78.03,15604464,30246.13063,"NLD",528 +"Netherlands","Europe",2002,78.53,16122830,33724.75778,"NLD",528 +"Netherlands","Europe",2007,79.762,16570613,36797.93332,"NLD",528 +"New Zealand","Oceania",1952,69.39,1994794,10556.57566,"NZL",554 +"New Zealand","Oceania",1957,70.26,2229407,12247.39532,"NZL",554 +"New Zealand","Oceania",1962,71.24,2488550,13175.678,"NZL",554 +"New Zealand","Oceania",1967,71.52,2728150,14463.91893,"NZL",554 +"New Zealand","Oceania",1972,71.89,2929100,16046.03728,"NZL",554 +"New Zealand","Oceania",1977,72.22,3164900,16233.7177,"NZL",554 +"New Zealand","Oceania",1982,73.84,3210650,17632.4104,"NZL",554 +"New Zealand","Oceania",1987,74.32,3317166,19007.19129,"NZL",554 +"New Zealand","Oceania",1992,76.33,3437674,18363.32494,"NZL",554 +"New Zealand","Oceania",1997,77.55,3676187,21050.41377,"NZL",554 +"New Zealand","Oceania",2002,79.11,3908037,23189.80135,"NZL",554 +"New Zealand","Oceania",2007,80.204,4115771,25185.00911,"NZL",554 +"Nicaragua","Americas",1952,42.314,1165790,3112.363948,"NIC",558 +"Nicaragua","Americas",1957,45.432,1358828,3457.415947,"NIC",558 +"Nicaragua","Americas",1962,48.632,1590597,3634.364406,"NIC",558 +"Nicaragua","Americas",1967,51.884,1865490,4643.393534,"NIC",558 +"Nicaragua","Americas",1972,55.151,2182908,4688.593267,"NIC",558 +"Nicaragua","Americas",1977,57.47,2554598,5486.371089,"NIC",558 +"Nicaragua","Americas",1982,59.298,2979423,3470.338156,"NIC",558 +"Nicaragua","Americas",1987,62.008,3344353,2955.984375,"NIC",558 +"Nicaragua","Americas",1992,65.843,4017939,2170.151724,"NIC",558 +"Nicaragua","Americas",1997,68.426,4609572,2253.023004,"NIC",558 +"Nicaragua","Americas",2002,70.836,5146848,2474.548819,"NIC",558 +"Nicaragua","Americas",2007,72.899,5675356,2749.320965,"NIC",558 +"Niger","Africa",1952,37.444,3379468,761.879376,"NER",562 +"Niger","Africa",1957,38.598,3692184,835.5234025,"NER",562 +"Niger","Africa",1962,39.487,4076008,997.7661127,"NER",562 +"Niger","Africa",1967,40.118,4534062,1054.384891,"NER",562 +"Niger","Africa",1972,40.546,5060262,954.2092363,"NER",562 +"Niger","Africa",1977,41.291,5682086,808.8970728,"NER",562 +"Niger","Africa",1982,42.598,6437188,909.7221354,"NER",562 +"Niger","Africa",1987,44.555,7332638,668.3000228,"NER",562 +"Niger","Africa",1992,47.391,8392818,581.182725,"NER",562 +"Niger","Africa",1997,51.313,9666252,580.3052092,"NER",562 +"Niger","Africa",2002,54.496,11140655,601.0745012,"NER",562 +"Niger","Africa",2007,56.867,12894865,619.6768924,"NER",562 +"Nigeria","Africa",1952,36.324,33119096,1077.281856,"NGA",566 +"Nigeria","Africa",1957,37.802,37173340,1100.592563,"NGA",566 +"Nigeria","Africa",1962,39.36,41871351,1150.927478,"NGA",566 +"Nigeria","Africa",1967,41.04,47287752,1014.514104,"NGA",566 +"Nigeria","Africa",1972,42.821,53740085,1698.388838,"NGA",566 +"Nigeria","Africa",1977,44.514,62209173,1981.951806,"NGA",566 +"Nigeria","Africa",1982,45.826,73039376,1576.97375,"NGA",566 +"Nigeria","Africa",1987,46.886,81551520,1385.029563,"NGA",566 +"Nigeria","Africa",1992,47.472,93364244,1619.848217,"NGA",566 +"Nigeria","Africa",1997,47.464,106207839,1624.941275,"NGA",566 +"Nigeria","Africa",2002,46.608,119901274,1615.286395,"NGA",566 +"Nigeria","Africa",2007,46.859,135031164,2013.977305,"NGA",566 +"Norway","Europe",1952,72.67,3327728,10095.42172,"NOR",578 +"Norway","Europe",1957,73.44,3491938,11653.97304,"NOR",578 +"Norway","Europe",1962,73.47,3638919,13450.40151,"NOR",578 +"Norway","Europe",1967,74.08,3786019,16361.87647,"NOR",578 +"Norway","Europe",1972,74.34,3933004,18965.05551,"NOR",578 +"Norway","Europe",1977,75.37,4043205,23311.34939,"NOR",578 +"Norway","Europe",1982,75.97,4114787,26298.63531,"NOR",578 +"Norway","Europe",1987,75.89,4186147,31540.9748,"NOR",578 +"Norway","Europe",1992,77.32,4286357,33965.66115,"NOR",578 +"Norway","Europe",1997,78.32,4405672,41283.16433,"NOR",578 +"Norway","Europe",2002,79.05,4535591,44683.97525,"NOR",578 +"Norway","Europe",2007,80.196,4627926,49357.19017,"NOR",578 +"Oman","Asia",1952,37.578,507833,1828.230307,"OMN",512 +"Oman","Asia",1957,40.08,561977,2242.746551,"OMN",512 +"Oman","Asia",1962,43.165,628164,2924.638113,"OMN",512 +"Oman","Asia",1967,46.988,714775,4720.942687,"OMN",512 +"Oman","Asia",1972,52.143,829050,10618.03855,"OMN",512 +"Oman","Asia",1977,57.367,1004533,11848.34392,"OMN",512 +"Oman","Asia",1982,62.728,1301048,12954.79101,"OMN",512 +"Oman","Asia",1987,67.734,1593882,18115.22313,"OMN",512 +"Oman","Asia",1992,71.197,1915208,18616.70691,"OMN",512 +"Oman","Asia",1997,72.499,2283635,19702.05581,"OMN",512 +"Oman","Asia",2002,74.193,2713462,19774.83687,"OMN",512 +"Oman","Asia",2007,75.64,3204897,22316.19287,"OMN",512 +"Pakistan","Asia",1952,43.436,41346560,684.5971438,"PAK",586 +"Pakistan","Asia",1957,45.557,46679944,747.0835292,"PAK",586 +"Pakistan","Asia",1962,47.67,53100671,803.3427418,"PAK",586 +"Pakistan","Asia",1967,49.8,60641899,942.4082588,"PAK",586 +"Pakistan","Asia",1972,51.929,69325921,1049.938981,"PAK",586 +"Pakistan","Asia",1977,54.043,78152686,1175.921193,"PAK",586 +"Pakistan","Asia",1982,56.158,91462088,1443.429832,"PAK",586 +"Pakistan","Asia",1987,58.245,105186881,1704.686583,"PAK",586 +"Pakistan","Asia",1992,60.838,120065004,1971.829464,"PAK",586 +"Pakistan","Asia",1997,61.818,135564834,2049.350521,"PAK",586 +"Pakistan","Asia",2002,63.61,153403524,2092.712441,"PAK",586 +"Pakistan","Asia",2007,65.483,169270617,2605.94758,"PAK",586 +"Panama","Americas",1952,55.191,940080,2480.380334,"PAN",591 +"Panama","Americas",1957,59.201,1063506,2961.800905,"PAN",591 +"Panama","Americas",1962,61.817,1215725,3536.540301,"PAN",591 +"Panama","Americas",1967,64.071,1405486,4421.009084,"PAN",591 +"Panama","Americas",1972,66.216,1616384,5364.249663,"PAN",591 +"Panama","Americas",1977,68.681,1839782,5351.912144,"PAN",591 +"Panama","Americas",1982,70.472,2036305,7009.601598,"PAN",591 +"Panama","Americas",1987,71.523,2253639,7034.779161,"PAN",591 +"Panama","Americas",1992,72.462,2484997,6618.74305,"PAN",591 +"Panama","Americas",1997,73.738,2734531,7113.692252,"PAN",591 +"Panama","Americas",2002,74.712,2990875,7356.031934,"PAN",591 +"Panama","Americas",2007,75.537,3242173,9809.185636,"PAN",591 +"Paraguay","Americas",1952,62.649,1555876,1952.308701,"PRY",600 +"Paraguay","Americas",1957,63.196,1770902,2046.154706,"PRY",600 +"Paraguay","Americas",1962,64.361,2009813,2148.027146,"PRY",600 +"Paraguay","Americas",1967,64.951,2287985,2299.376311,"PRY",600 +"Paraguay","Americas",1972,65.815,2614104,2523.337977,"PRY",600 +"Paraguay","Americas",1977,66.353,2984494,3248.373311,"PRY",600 +"Paraguay","Americas",1982,66.874,3366439,4258.503604,"PRY",600 +"Paraguay","Americas",1987,67.378,3886512,3998.875695,"PRY",600 +"Paraguay","Americas",1992,68.225,4483945,4196.411078,"PRY",600 +"Paraguay","Americas",1997,69.4,5154123,4247.400261,"PRY",600 +"Paraguay","Americas",2002,70.755,5884491,3783.674243,"PRY",600 +"Paraguay","Americas",2007,71.752,6667147,4172.838464,"PRY",600 +"Peru","Americas",1952,43.902,8025700,3758.523437,"PER",604 +"Peru","Americas",1957,46.263,9146100,4245.256698,"PER",604 +"Peru","Americas",1962,49.096,10516500,4957.037982,"PER",604 +"Peru","Americas",1967,51.445,12132200,5788.09333,"PER",604 +"Peru","Americas",1972,55.448,13954700,5937.827283,"PER",604 +"Peru","Americas",1977,58.447,15990099,6281.290855,"PER",604 +"Peru","Americas",1982,61.406,18125129,6434.501797,"PER",604 +"Peru","Americas",1987,64.134,20195924,6360.943444,"PER",604 +"Peru","Americas",1992,66.458,22430449,4446.380924,"PER",604 +"Peru","Americas",1997,68.386,24748122,5838.347657,"PER",604 +"Peru","Americas",2002,69.906,26769436,5909.020073,"PER",604 +"Peru","Americas",2007,71.421,28674757,7408.905561,"PER",604 +"Philippines","Asia",1952,47.752,22438691,1272.880995,"PHL",608 +"Philippines","Asia",1957,51.334,26072194,1547.944844,"PHL",608 +"Philippines","Asia",1962,54.757,30325264,1649.552153,"PHL",608 +"Philippines","Asia",1967,56.393,35356600,1814.12743,"PHL",608 +"Philippines","Asia",1972,58.065,40850141,1989.37407,"PHL",608 +"Philippines","Asia",1977,60.06,46850962,2373.204287,"PHL",608 +"Philippines","Asia",1982,62.082,53456774,2603.273765,"PHL",608 +"Philippines","Asia",1987,64.151,60017788,2189.634995,"PHL",608 +"Philippines","Asia",1992,66.458,67185766,2279.324017,"PHL",608 +"Philippines","Asia",1997,68.564,75012988,2536.534925,"PHL",608 +"Philippines","Asia",2002,70.303,82995088,2650.921068,"PHL",608 +"Philippines","Asia",2007,71.688,91077287,3190.481016,"PHL",608 +"Poland","Europe",1952,61.31,25730551,4029.329699,"POL",616 +"Poland","Europe",1957,65.77,28235346,4734.253019,"POL",616 +"Poland","Europe",1962,67.64,30329617,5338.752143,"POL",616 +"Poland","Europe",1967,69.61,31785378,6557.152776,"POL",616 +"Poland","Europe",1972,70.85,33039545,8006.506993,"POL",616 +"Poland","Europe",1977,70.67,34621254,9508.141454,"POL",616 +"Poland","Europe",1982,71.32,36227381,8451.531004,"POL",616 +"Poland","Europe",1987,70.98,37740710,9082.351172,"POL",616 +"Poland","Europe",1992,70.99,38370697,7738.881247,"POL",616 +"Poland","Europe",1997,72.75,38654957,10159.58368,"POL",616 +"Poland","Europe",2002,74.67,38625976,12002.23908,"POL",616 +"Poland","Europe",2007,75.563,38518241,15389.92468,"POL",616 +"Portugal","Europe",1952,59.82,8526050,3068.319867,"PRT",620 +"Portugal","Europe",1957,61.51,8817650,3774.571743,"PRT",620 +"Portugal","Europe",1962,64.39,9019800,4727.954889,"PRT",620 +"Portugal","Europe",1967,66.6,9103000,6361.517993,"PRT",620 +"Portugal","Europe",1972,69.26,8970450,9022.247417,"PRT",620 +"Portugal","Europe",1977,70.41,9662600,10172.48572,"PRT",620 +"Portugal","Europe",1982,72.77,9859650,11753.84291,"PRT",620 +"Portugal","Europe",1987,74.06,9915289,13039.30876,"PRT",620 +"Portugal","Europe",1992,74.86,9927680,16207.26663,"PRT",620 +"Portugal","Europe",1997,75.97,10156415,17641.03156,"PRT",620 +"Portugal","Europe",2002,77.29,10433867,19970.90787,"PRT",620 +"Portugal","Europe",2007,78.098,10642836,20509.64777,"PRT",620 +"Puerto Rico","Americas",1952,64.28,2227000,3081.959785,"PRI",630 +"Puerto Rico","Americas",1957,68.54,2260000,3907.156189,"PRI",630 +"Puerto Rico","Americas",1962,69.62,2448046,5108.34463,"PRI",630 +"Puerto Rico","Americas",1967,71.1,2648961,6929.277714,"PRI",630 +"Puerto Rico","Americas",1972,72.16,2847132,9123.041742,"PRI",630 +"Puerto Rico","Americas",1977,73.44,3080828,9770.524921,"PRI",630 +"Puerto Rico","Americas",1982,73.75,3279001,10330.98915,"PRI",630 +"Puerto Rico","Americas",1987,74.63,3444468,12281.34191,"PRI",630 +"Puerto Rico","Americas",1992,73.911,3585176,14641.58711,"PRI",630 +"Puerto Rico","Americas",1997,74.917,3759430,16999.4333,"PRI",630 +"Puerto Rico","Americas",2002,77.778,3859606,18855.60618,"PRI",630 +"Puerto Rico","Americas",2007,78.746,3942491,19328.70901,"PRI",630 +"Reunion","Africa",1952,52.724,257700,2718.885295,"REU",638 +"Reunion","Africa",1957,55.09,308700,2769.451844,"REU",638 +"Reunion","Africa",1962,57.666,358900,3173.72334,"REU",638 +"Reunion","Africa",1967,60.542,414024,4021.175739,"REU",638 +"Reunion","Africa",1972,64.274,461633,5047.658563,"REU",638 +"Reunion","Africa",1977,67.064,492095,4319.804067,"REU",638 +"Reunion","Africa",1982,69.885,517810,5267.219353,"REU",638 +"Reunion","Africa",1987,71.913,562035,5303.377488,"REU",638 +"Reunion","Africa",1992,73.615,622191,6101.255823,"REU",638 +"Reunion","Africa",1997,74.772,684810,6071.941411,"REU",638 +"Reunion","Africa",2002,75.744,743981,6316.1652,"REU",638 +"Reunion","Africa",2007,76.442,798094,7670.122558,"REU",638 +"Romania","Europe",1952,61.05,16630000,3144.613186,"ROU",642 +"Romania","Europe",1957,64.1,17829327,3943.370225,"ROU",642 +"Romania","Europe",1962,66.8,18680721,4734.997586,"ROU",642 +"Romania","Europe",1967,66.8,19284814,6470.866545,"ROU",642 +"Romania","Europe",1972,69.21,20662648,8011.414402,"ROU",642 +"Romania","Europe",1977,69.46,21658597,9356.39724,"ROU",642 +"Romania","Europe",1982,69.66,22356726,9605.314053,"ROU",642 +"Romania","Europe",1987,69.53,22686371,9696.273295,"ROU",642 +"Romania","Europe",1992,69.36,22797027,6598.409903,"ROU",642 +"Romania","Europe",1997,69.72,22562458,7346.547557,"ROU",642 +"Romania","Europe",2002,71.322,22404337,7885.360081,"ROU",642 +"Romania","Europe",2007,72.476,22276056,10808.47561,"ROU",642 +"Rwanda","Africa",1952,40,2534927,493.3238752,"RWA",646 +"Rwanda","Africa",1957,41.5,2822082,540.2893983,"RWA",646 +"Rwanda","Africa",1962,43,3051242,597.4730727,"RWA",646 +"Rwanda","Africa",1967,44.1,3451079,510.9637142,"RWA",646 +"Rwanda","Africa",1972,44.6,3992121,590.5806638,"RWA",646 +"Rwanda","Africa",1977,45,4657072,670.0806011,"RWA",646 +"Rwanda","Africa",1982,46.218,5507565,881.5706467,"RWA",646 +"Rwanda","Africa",1987,44.02,6349365,847.991217,"RWA",646 +"Rwanda","Africa",1992,23.599,7290203,737.0685949,"RWA",646 +"Rwanda","Africa",1997,36.087,7212583,589.9445051,"RWA",646 +"Rwanda","Africa",2002,43.413,7852401,785.6537648,"RWA",646 +"Rwanda","Africa",2007,46.242,8860588,863.0884639,"RWA",646 +"Sao Tome and Principe","Africa",1952,46.471,60011,879.5835855,"STP",678 +"Sao Tome and Principe","Africa",1957,48.945,61325,860.7369026,"STP",678 +"Sao Tome and Principe","Africa",1962,51.893,65345,1071.551119,"STP",678 +"Sao Tome and Principe","Africa",1967,54.425,70787,1384.840593,"STP",678 +"Sao Tome and Principe","Africa",1972,56.48,76595,1532.985254,"STP",678 +"Sao Tome and Principe","Africa",1977,58.55,86796,1737.561657,"STP",678 +"Sao Tome and Principe","Africa",1982,60.351,98593,1890.218117,"STP",678 +"Sao Tome and Principe","Africa",1987,61.728,110812,1516.525457,"STP",678 +"Sao Tome and Principe","Africa",1992,62.742,125911,1428.777814,"STP",678 +"Sao Tome and Principe","Africa",1997,63.306,145608,1339.076036,"STP",678 +"Sao Tome and Principe","Africa",2002,64.337,170372,1353.09239,"STP",678 +"Sao Tome and Principe","Africa",2007,65.528,199579,1598.435089,"STP",678 +"Saudi Arabia","Asia",1952,39.875,4005677,6459.554823,"SAU",682 +"Saudi Arabia","Asia",1957,42.868,4419650,8157.591248,"SAU",682 +"Saudi Arabia","Asia",1962,45.914,4943029,11626.41975,"SAU",682 +"Saudi Arabia","Asia",1967,49.901,5618198,16903.04886,"SAU",682 +"Saudi Arabia","Asia",1972,53.886,6472756,24837.42865,"SAU",682 +"Saudi Arabia","Asia",1977,58.69,8128505,34167.7626,"SAU",682 +"Saudi Arabia","Asia",1982,63.012,11254672,33693.17525,"SAU",682 +"Saudi Arabia","Asia",1987,66.295,14619745,21198.26136,"SAU",682 +"Saudi Arabia","Asia",1992,68.768,16945857,24841.61777,"SAU",682 +"Saudi Arabia","Asia",1997,70.533,21229759,20586.69019,"SAU",682 +"Saudi Arabia","Asia",2002,71.626,24501530,19014.54118,"SAU",682 +"Saudi Arabia","Asia",2007,72.777,27601038,21654.83194,"SAU",682 +"Senegal","Africa",1952,37.278,2755589,1450.356983,"SEN",686 +"Senegal","Africa",1957,39.329,3054547,1567.653006,"SEN",686 +"Senegal","Africa",1962,41.454,3430243,1654.988723,"SEN",686 +"Senegal","Africa",1967,43.563,3965841,1612.404632,"SEN",686 +"Senegal","Africa",1972,45.815,4588696,1597.712056,"SEN",686 +"Senegal","Africa",1977,48.879,5260855,1561.769116,"SEN",686 +"Senegal","Africa",1982,52.379,6147783,1518.479984,"SEN",686 +"Senegal","Africa",1987,55.769,7171347,1441.72072,"SEN",686 +"Senegal","Africa",1992,58.196,8307920,1367.899369,"SEN",686 +"Senegal","Africa",1997,60.187,9535314,1392.368347,"SEN",686 +"Senegal","Africa",2002,61.6,10870037,1519.635262,"SEN",686 +"Senegal","Africa",2007,63.062,12267493,1712.472136,"SEN",686 +"Serbia","Europe",1952,57.996,6860147,3581.459448,"SRB",688 +"Serbia","Europe",1957,61.685,7271135,4981.090891,"SRB",688 +"Serbia","Europe",1962,64.531,7616060,6289.629157,"SRB",688 +"Serbia","Europe",1967,66.914,7971222,7991.707066,"SRB",688 +"Serbia","Europe",1972,68.7,8313288,10522.06749,"SRB",688 +"Serbia","Europe",1977,70.3,8686367,12980.66956,"SRB",688 +"Serbia","Europe",1982,70.162,9032824,15181.0927,"SRB",688 +"Serbia","Europe",1987,71.218,9230783,15870.87851,"SRB",688 +"Serbia","Europe",1992,71.659,9826397,9325.068238,"SRB",688 +"Serbia","Europe",1997,72.232,10336594,7914.320304,"SRB",688 +"Serbia","Europe",2002,73.213,10111559,7236.075251,"SRB",688 +"Serbia","Europe",2007,74.002,10150265,9786.534714,"SRB",688 +"Sierra Leone","Africa",1952,30.331,2143249,879.7877358,"SLE",694 +"Sierra Leone","Africa",1957,31.57,2295678,1004.484437,"SLE",694 +"Sierra Leone","Africa",1962,32.767,2467895,1116.639877,"SLE",694 +"Sierra Leone","Africa",1967,34.113,2662190,1206.043465,"SLE",694 +"Sierra Leone","Africa",1972,35.4,2879013,1353.759762,"SLE",694 +"Sierra Leone","Africa",1977,36.788,3140897,1348.285159,"SLE",694 +"Sierra Leone","Africa",1982,38.445,3464522,1465.010784,"SLE",694 +"Sierra Leone","Africa",1987,40.006,3868905,1294.447788,"SLE",694 +"Sierra Leone","Africa",1992,38.333,4260884,1068.696278,"SLE",694 +"Sierra Leone","Africa",1997,39.897,4578212,574.6481576,"SLE",694 +"Sierra Leone","Africa",2002,41.012,5359092,699.489713,"SLE",694 +"Sierra Leone","Africa",2007,42.568,6144562,862.5407561,"SLE",694 +"Singapore","Asia",1952,60.396,1127000,2315.138227,"SGP",702 +"Singapore","Asia",1957,63.179,1445929,2843.104409,"SGP",702 +"Singapore","Asia",1962,65.798,1750200,3674.735572,"SGP",702 +"Singapore","Asia",1967,67.946,1977600,4977.41854,"SGP",702 +"Singapore","Asia",1972,69.521,2152400,8597.756202,"SGP",702 +"Singapore","Asia",1977,70.795,2325300,11210.08948,"SGP",702 +"Singapore","Asia",1982,71.76,2651869,15169.16112,"SGP",702 +"Singapore","Asia",1987,73.56,2794552,18861.53081,"SGP",702 +"Singapore","Asia",1992,75.788,3235865,24769.8912,"SGP",702 +"Singapore","Asia",1997,77.158,3802309,33519.4766,"SGP",702 +"Singapore","Asia",2002,78.77,4197776,36023.1054,"SGP",702 +"Singapore","Asia",2007,79.972,4553009,47143.17964,"SGP",702 +"Slovak Republic","Europe",1952,64.36,3558137,5074.659104,"SVK",703 +"Slovak Republic","Europe",1957,67.45,3844277,6093.26298,"SVK",703 +"Slovak Republic","Europe",1962,70.33,4237384,7481.107598,"SVK",703 +"Slovak Republic","Europe",1967,70.98,4442238,8412.902397,"SVK",703 +"Slovak Republic","Europe",1972,70.35,4593433,9674.167626,"SVK",703 +"Slovak Republic","Europe",1977,70.45,4827803,10922.66404,"SVK",703 +"Slovak Republic","Europe",1982,70.8,5048043,11348.54585,"SVK",703 +"Slovak Republic","Europe",1987,71.08,5199318,12037.26758,"SVK",703 +"Slovak Republic","Europe",1992,71.38,5302888,9498.467723,"SVK",703 +"Slovak Republic","Europe",1997,72.71,5383010,12126.23065,"SVK",703 +"Slovak Republic","Europe",2002,73.8,5410052,13638.77837,"SVK",703 +"Slovak Republic","Europe",2007,74.663,5447502,18678.31435,"SVK",703 +"Slovenia","Europe",1952,65.57,1489518,4215.041741,"SVN",705 +"Slovenia","Europe",1957,67.85,1533070,5862.276629,"SVN",705 +"Slovenia","Europe",1962,69.15,1582962,7402.303395,"SVN",705 +"Slovenia","Europe",1967,69.18,1646912,9405.489397,"SVN",705 +"Slovenia","Europe",1972,69.82,1694510,12383.4862,"SVN",705 +"Slovenia","Europe",1977,70.97,1746919,15277.03017,"SVN",705 +"Slovenia","Europe",1982,71.063,1861252,17866.72175,"SVN",705 +"Slovenia","Europe",1987,72.25,1945870,18678.53492,"SVN",705 +"Slovenia","Europe",1992,73.64,1999210,14214.71681,"SVN",705 +"Slovenia","Europe",1997,75.13,2011612,17161.10735,"SVN",705 +"Slovenia","Europe",2002,76.66,2011497,20660.01936,"SVN",705 +"Slovenia","Europe",2007,77.926,2009245,25768.25759,"SVN",705 +"Somalia","Africa",1952,32.978,2526994,1135.749842,"SOM",706 +"Somalia","Africa",1957,34.977,2780415,1258.147413,"SOM",706 +"Somalia","Africa",1962,36.981,3080153,1369.488336,"SOM",706 +"Somalia","Africa",1967,38.977,3428839,1284.73318,"SOM",706 +"Somalia","Africa",1972,40.973,3840161,1254.576127,"SOM",706 +"Somalia","Africa",1977,41.974,4353666,1450.992513,"SOM",706 +"Somalia","Africa",1982,42.955,5828892,1176.807031,"SOM",706 +"Somalia","Africa",1987,44.501,6921858,1093.244963,"SOM",706 +"Somalia","Africa",1992,39.658,6099799,926.9602964,"SOM",706 +"Somalia","Africa",1997,43.795,6633514,930.5964284,"SOM",706 +"Somalia","Africa",2002,45.936,7753310,882.0818218,"SOM",706 +"Somalia","Africa",2007,48.159,9118773,926.1410683,"SOM",706 +"South Africa","Africa",1952,45.009,14264935,4725.295531,"ZAF",710 +"South Africa","Africa",1957,47.985,16151549,5487.104219,"ZAF",710 +"South Africa","Africa",1962,49.951,18356657,5768.729717,"ZAF",710 +"South Africa","Africa",1967,51.927,20997321,7114.477971,"ZAF",710 +"South Africa","Africa",1972,53.696,23935810,7765.962636,"ZAF",710 +"South Africa","Africa",1977,55.527,27129932,8028.651439,"ZAF",710 +"South Africa","Africa",1982,58.161,31140029,8568.266228,"ZAF",710 +"South Africa","Africa",1987,60.834,35933379,7825.823398,"ZAF",710 +"South Africa","Africa",1992,61.888,39964159,7225.069258,"ZAF",710 +"South Africa","Africa",1997,60.236,42835005,7479.188244,"ZAF",710 +"South Africa","Africa",2002,53.365,44433622,7710.946444,"ZAF",710 +"South Africa","Africa",2007,49.339,43997828,9269.657808,"ZAF",710 +"Spain","Europe",1952,64.94,28549870,3834.034742,"ESP",724 +"Spain","Europe",1957,66.66,29841614,4564.80241,"ESP",724 +"Spain","Europe",1962,69.69,31158061,5693.843879,"ESP",724 +"Spain","Europe",1967,71.44,32850275,7993.512294,"ESP",724 +"Spain","Europe",1972,73.06,34513161,10638.75131,"ESP",724 +"Spain","Europe",1977,74.39,36439000,13236.92117,"ESP",724 +"Spain","Europe",1982,76.3,37983310,13926.16997,"ESP",724 +"Spain","Europe",1987,76.9,38880702,15764.98313,"ESP",724 +"Spain","Europe",1992,77.57,39549438,18603.06452,"ESP",724 +"Spain","Europe",1997,78.77,39855442,20445.29896,"ESP",724 +"Spain","Europe",2002,79.78,40152517,24835.47166,"ESP",724 +"Spain","Europe",2007,80.941,40448191,28821.0637,"ESP",724 +"Sri Lanka","Asia",1952,57.593,7982342,1083.53203,"LKA",144 +"Sri Lanka","Asia",1957,61.456,9128546,1072.546602,"LKA",144 +"Sri Lanka","Asia",1962,62.192,10421936,1074.47196,"LKA",144 +"Sri Lanka","Asia",1967,64.266,11737396,1135.514326,"LKA",144 +"Sri Lanka","Asia",1972,65.042,13016733,1213.39553,"LKA",144 +"Sri Lanka","Asia",1977,65.949,14116836,1348.775651,"LKA",144 +"Sri Lanka","Asia",1982,68.757,15410151,1648.079789,"LKA",144 +"Sri Lanka","Asia",1987,69.011,16495304,1876.766827,"LKA",144 +"Sri Lanka","Asia",1992,70.379,17587060,2153.739222,"LKA",144 +"Sri Lanka","Asia",1997,70.457,18698655,2664.477257,"LKA",144 +"Sri Lanka","Asia",2002,70.815,19576783,3015.378833,"LKA",144 +"Sri Lanka","Asia",2007,72.396,20378239,3970.095407,"LKA",144 +"Sudan","Africa",1952,38.635,8504667,1615.991129,"SDN",736 +"Sudan","Africa",1957,39.624,9753392,1770.337074,"SDN",736 +"Sudan","Africa",1962,40.87,11183227,1959.593767,"SDN",736 +"Sudan","Africa",1967,42.858,12716129,1687.997641,"SDN",736 +"Sudan","Africa",1972,45.083,14597019,1659.652775,"SDN",736 +"Sudan","Africa",1977,47.8,17104986,2202.988423,"SDN",736 +"Sudan","Africa",1982,50.338,20367053,1895.544073,"SDN",736 +"Sudan","Africa",1987,51.744,24725960,1507.819159,"SDN",736 +"Sudan","Africa",1992,53.556,28227588,1492.197043,"SDN",736 +"Sudan","Africa",1997,55.373,32160729,1632.210764,"SDN",736 +"Sudan","Africa",2002,56.369,37090298,1993.398314,"SDN",736 +"Sudan","Africa",2007,58.556,42292929,2602.394995,"SDN",736 +"Swaziland","Africa",1952,41.407,290243,1148.376626,"SWZ",748 +"Swaziland","Africa",1957,43.424,326741,1244.708364,"SWZ",748 +"Swaziland","Africa",1962,44.992,370006,1856.182125,"SWZ",748 +"Swaziland","Africa",1967,46.633,420690,2613.101665,"SWZ",748 +"Swaziland","Africa",1972,49.552,480105,3364.836625,"SWZ",748 +"Swaziland","Africa",1977,52.537,551425,3781.410618,"SWZ",748 +"Swaziland","Africa",1982,55.561,649901,3895.384018,"SWZ",748 +"Swaziland","Africa",1987,57.678,779348,3984.839812,"SWZ",748 +"Swaziland","Africa",1992,58.474,962344,3553.0224,"SWZ",748 +"Swaziland","Africa",1997,54.289,1054486,3876.76846,"SWZ",748 +"Swaziland","Africa",2002,43.869,1130269,4128.116943,"SWZ",748 +"Swaziland","Africa",2007,39.613,1133066,4513.480643,"SWZ",748 +"Sweden","Europe",1952,71.86,7124673,8527.844662,"SWE",752 +"Sweden","Europe",1957,72.49,7363802,9911.878226,"SWE",752 +"Sweden","Europe",1962,73.37,7561588,12329.44192,"SWE",752 +"Sweden","Europe",1967,74.16,7867931,15258.29697,"SWE",752 +"Sweden","Europe",1972,74.72,8122293,17832.02464,"SWE",752 +"Sweden","Europe",1977,75.44,8251648,18855.72521,"SWE",752 +"Sweden","Europe",1982,76.42,8325260,20667.38125,"SWE",752 +"Sweden","Europe",1987,77.19,8421403,23586.92927,"SWE",752 +"Sweden","Europe",1992,78.16,8718867,23880.01683,"SWE",752 +"Sweden","Europe",1997,79.39,8897619,25266.59499,"SWE",752 +"Sweden","Europe",2002,80.04,8954175,29341.63093,"SWE",752 +"Sweden","Europe",2007,80.884,9031088,33859.74835,"SWE",752 +"Switzerland","Europe",1952,69.62,4815000,14734.23275,"CHE",756 +"Switzerland","Europe",1957,70.56,5126000,17909.48973,"CHE",756 +"Switzerland","Europe",1962,71.32,5666000,20431.0927,"CHE",756 +"Switzerland","Europe",1967,72.77,6063000,22966.14432,"CHE",756 +"Switzerland","Europe",1972,73.78,6401400,27195.11304,"CHE",756 +"Switzerland","Europe",1977,75.39,6316424,26982.29052,"CHE",756 +"Switzerland","Europe",1982,76.21,6468126,28397.71512,"CHE",756 +"Switzerland","Europe",1987,77.41,6649942,30281.70459,"CHE",756 +"Switzerland","Europe",1992,78.03,6995447,31871.5303,"CHE",756 +"Switzerland","Europe",1997,79.37,7193761,32135.32301,"CHE",756 +"Switzerland","Europe",2002,80.62,7361757,34480.95771,"CHE",756 +"Switzerland","Europe",2007,81.701,7554661,37506.41907,"CHE",756 +"Syria","Asia",1952,45.883,3661549,1643.485354,"SYR",760 +"Syria","Asia",1957,48.284,4149908,2117.234893,"SYR",760 +"Syria","Asia",1962,50.305,4834621,2193.037133,"SYR",760 +"Syria","Asia",1967,53.655,5680812,1881.923632,"SYR",760 +"Syria","Asia",1972,57.296,6701172,2571.423014,"SYR",760 +"Syria","Asia",1977,61.195,7932503,3195.484582,"SYR",760 +"Syria","Asia",1982,64.59,9410494,3761.837715,"SYR",760 +"Syria","Asia",1987,66.974,11242847,3116.774285,"SYR",760 +"Syria","Asia",1992,69.249,13219062,3340.542768,"SYR",760 +"Syria","Asia",1997,71.527,15081016,4014.238972,"SYR",760 +"Syria","Asia",2002,73.053,17155814,4090.925331,"SYR",760 +"Syria","Asia",2007,74.143,19314747,4184.548089,"SYR",760 +"Taiwan","Asia",1952,58.5,8550362,1206.947913,"TWN",158 +"Taiwan","Asia",1957,62.4,10164215,1507.86129,"TWN",158 +"Taiwan","Asia",1962,65.2,11918938,1822.879028,"TWN",158 +"Taiwan","Asia",1967,67.5,13648692,2643.858681,"TWN",158 +"Taiwan","Asia",1972,69.39,15226039,4062.523897,"TWN",158 +"Taiwan","Asia",1977,70.59,16785196,5596.519826,"TWN",158 +"Taiwan","Asia",1982,72.16,18501390,7426.354774,"TWN",158 +"Taiwan","Asia",1987,73.4,19757799,11054.56175,"TWN",158 +"Taiwan","Asia",1992,74.26,20686918,15215.6579,"TWN",158 +"Taiwan","Asia",1997,75.25,21628605,20206.82098,"TWN",158 +"Taiwan","Asia",2002,76.99,22454239,23235.42329,"TWN",158 +"Taiwan","Asia",2007,78.4,23174294,28718.27684,"TWN",158 +"Tanzania","Africa",1952,41.215,8322925,716.6500721,"TZA",834 +"Tanzania","Africa",1957,42.974,9452826,698.5356073,"TZA",834 +"Tanzania","Africa",1962,44.246,10863958,722.0038073,"TZA",834 +"Tanzania","Africa",1967,45.757,12607312,848.2186575,"TZA",834 +"Tanzania","Africa",1972,47.62,14706593,915.9850592,"TZA",834 +"Tanzania","Africa",1977,49.919,17129565,962.4922932,"TZA",834 +"Tanzania","Africa",1982,50.608,19844382,874.2426069,"TZA",834 +"Tanzania","Africa",1987,51.535,23040630,831.8220794,"TZA",834 +"Tanzania","Africa",1992,50.44,26605473,825.682454,"TZA",834 +"Tanzania","Africa",1997,48.466,30686889,789.1862231,"TZA",834 +"Tanzania","Africa",2002,49.651,34593779,899.0742111,"TZA",834 +"Tanzania","Africa",2007,52.517,38139640,1107.482182,"TZA",834 +"Thailand","Asia",1952,50.848,21289402,757.7974177,"THA",764 +"Thailand","Asia",1957,53.63,25041917,793.5774148,"THA",764 +"Thailand","Asia",1962,56.061,29263397,1002.199172,"THA",764 +"Thailand","Asia",1967,58.285,34024249,1295.46066,"THA",764 +"Thailand","Asia",1972,60.405,39276153,1524.358936,"THA",764 +"Thailand","Asia",1977,62.494,44148285,1961.224635,"THA",764 +"Thailand","Asia",1982,64.597,48827160,2393.219781,"THA",764 +"Thailand","Asia",1987,66.084,52910342,2982.653773,"THA",764 +"Thailand","Asia",1992,67.298,56667095,4616.896545,"THA",764 +"Thailand","Asia",1997,67.521,60216677,5852.625497,"THA",764 +"Thailand","Asia",2002,68.564,62806748,5913.187529,"THA",764 +"Thailand","Asia",2007,70.616,65068149,7458.396327,"THA",764 +"Togo","Africa",1952,38.596,1219113,859.8086567,"TGO",768 +"Togo","Africa",1957,41.208,1357445,925.9083202,"TGO",768 +"Togo","Africa",1962,43.922,1528098,1067.53481,"TGO",768 +"Togo","Africa",1967,46.769,1735550,1477.59676,"TGO",768 +"Togo","Africa",1972,49.759,2056351,1649.660188,"TGO",768 +"Togo","Africa",1977,52.887,2308582,1532.776998,"TGO",768 +"Togo","Africa",1982,55.471,2644765,1344.577953,"TGO",768 +"Togo","Africa",1987,56.941,3154264,1202.201361,"TGO",768 +"Togo","Africa",1992,58.061,3747553,1034.298904,"TGO",768 +"Togo","Africa",1997,58.39,4320890,982.2869243,"TGO",768 +"Togo","Africa",2002,57.561,4977378,886.2205765,"TGO",768 +"Togo","Africa",2007,58.42,5701579,882.9699438,"TGO",768 +"Trinidad and Tobago","Americas",1952,59.1,662850,3023.271928,"TTO",780 +"Trinidad and Tobago","Americas",1957,61.8,764900,4100.3934,"TTO",780 +"Trinidad and Tobago","Americas",1962,64.9,887498,4997.523971,"TTO",780 +"Trinidad and Tobago","Americas",1967,65.4,960155,5621.368472,"TTO",780 +"Trinidad and Tobago","Americas",1972,65.9,975199,6619.551419,"TTO",780 +"Trinidad and Tobago","Americas",1977,68.3,1039009,7899.554209,"TTO",780 +"Trinidad and Tobago","Americas",1982,68.832,1116479,9119.528607,"TTO",780 +"Trinidad and Tobago","Americas",1987,69.582,1191336,7388.597823,"TTO",780 +"Trinidad and Tobago","Americas",1992,69.862,1183669,7370.990932,"TTO",780 +"Trinidad and Tobago","Americas",1997,69.465,1138101,8792.573126,"TTO",780 +"Trinidad and Tobago","Americas",2002,68.976,1101832,11460.60023,"TTO",780 +"Trinidad and Tobago","Americas",2007,69.819,1056608,18008.50924,"TTO",780 +"Tunisia","Africa",1952,44.6,3647735,1468.475631,"TUN",788 +"Tunisia","Africa",1957,47.1,3950849,1395.232468,"TUN",788 +"Tunisia","Africa",1962,49.579,4286552,1660.30321,"TUN",788 +"Tunisia","Africa",1967,52.053,4786986,1932.360167,"TUN",788 +"Tunisia","Africa",1972,55.602,5303507,2753.285994,"TUN",788 +"Tunisia","Africa",1977,59.837,6005061,3120.876811,"TUN",788 +"Tunisia","Africa",1982,64.048,6734098,3560.233174,"TUN",788 +"Tunisia","Africa",1987,66.894,7724976,3810.419296,"TUN",788 +"Tunisia","Africa",1992,70.001,8523077,4332.720164,"TUN",788 +"Tunisia","Africa",1997,71.973,9231669,4876.798614,"TUN",788 +"Tunisia","Africa",2002,73.042,9770575,5722.895655,"TUN",788 +"Tunisia","Africa",2007,73.923,10276158,7092.923025,"TUN",788 +"Turkey","Europe",1952,43.585,22235677,1969.10098,"TUR",792 +"Turkey","Europe",1957,48.079,25670939,2218.754257,"TUR",792 +"Turkey","Europe",1962,52.098,29788695,2322.869908,"TUR",792 +"Turkey","Europe",1967,54.336,33411317,2826.356387,"TUR",792 +"Turkey","Europe",1972,57.005,37492953,3450.69638,"TUR",792 +"Turkey","Europe",1977,59.507,42404033,4269.122326,"TUR",792 +"Turkey","Europe",1982,61.036,47328791,4241.356344,"TUR",792 +"Turkey","Europe",1987,63.108,52881328,5089.043686,"TUR",792 +"Turkey","Europe",1992,66.146,58179144,5678.348271,"TUR",792 +"Turkey","Europe",1997,68.835,63047647,6601.429915,"TUR",792 +"Turkey","Europe",2002,70.845,67308928,6508.085718,"TUR",792 +"Turkey","Europe",2007,71.777,71158647,8458.276384,"TUR",792 +"Uganda","Africa",1952,39.978,5824797,734.753484,"UGA",800 +"Uganda","Africa",1957,42.571,6675501,774.3710692,"UGA",800 +"Uganda","Africa",1962,45.344,7688797,767.2717398,"UGA",800 +"Uganda","Africa",1967,48.051,8900294,908.9185217,"UGA",800 +"Uganda","Africa",1972,51.016,10190285,950.735869,"UGA",800 +"Uganda","Africa",1977,50.35,11457758,843.7331372,"UGA",800 +"Uganda","Africa",1982,49.849,12939400,682.2662268,"UGA",800 +"Uganda","Africa",1987,51.509,15283050,617.7244065,"UGA",800 +"Uganda","Africa",1992,48.825,18252190,644.1707969,"UGA",800 +"Uganda","Africa",1997,44.578,21210254,816.559081,"UGA",800 +"Uganda","Africa",2002,47.813,24739869,927.7210018,"UGA",800 +"Uganda","Africa",2007,51.542,29170398,1056.380121,"UGA",800 +"United Kingdom","Europe",1952,69.18,50430000,9979.508487,"GBR",826 +"United Kingdom","Europe",1957,70.42,51430000,11283.17795,"GBR",826 +"United Kingdom","Europe",1962,70.76,53292000,12477.17707,"GBR",826 +"United Kingdom","Europe",1967,71.36,54959000,14142.85089,"GBR",826 +"United Kingdom","Europe",1972,72.01,56079000,15895.11641,"GBR",826 +"United Kingdom","Europe",1977,72.76,56179000,17428.74846,"GBR",826 +"United Kingdom","Europe",1982,74.04,56339704,18232.42452,"GBR",826 +"United Kingdom","Europe",1987,75.007,56981620,21664.78767,"GBR",826 +"United Kingdom","Europe",1992,76.42,57866349,22705.09254,"GBR",826 +"United Kingdom","Europe",1997,77.218,58808266,26074.53136,"GBR",826 +"United Kingdom","Europe",2002,78.471,59912431,29478.99919,"GBR",826 +"United Kingdom","Europe",2007,79.425,60776238,33203.26128,"GBR",826 +"United States","Americas",1952,68.44,157553000,13990.48208,"USA",840 +"United States","Americas",1957,69.49,171984000,14847.12712,"USA",840 +"United States","Americas",1962,70.21,186538000,16173.14586,"USA",840 +"United States","Americas",1967,70.76,198712000,19530.36557,"USA",840 +"United States","Americas",1972,71.34,209896000,21806.03594,"USA",840 +"United States","Americas",1977,73.38,220239000,24072.63213,"USA",840 +"United States","Americas",1982,74.65,232187835,25009.55914,"USA",840 +"United States","Americas",1987,75.02,242803533,29884.35041,"USA",840 +"United States","Americas",1992,76.09,256894189,32003.93224,"USA",840 +"United States","Americas",1997,76.81,272911760,35767.43303,"USA",840 +"United States","Americas",2002,77.31,287675526,39097.09955,"USA",840 +"United States","Americas",2007,78.242,301139947,42951.65309,"USA",840 +"Uruguay","Americas",1952,66.071,2252965,5716.766744,"URY",858 +"Uruguay","Americas",1957,67.044,2424959,6150.772969,"URY",858 +"Uruguay","Americas",1962,68.253,2598466,5603.357717,"URY",858 +"Uruguay","Americas",1967,68.468,2748579,5444.61962,"URY",858 +"Uruguay","Americas",1972,68.673,2829526,5703.408898,"URY",858 +"Uruguay","Americas",1977,69.481,2873520,6504.339663,"URY",858 +"Uruguay","Americas",1982,70.805,2953997,6920.223051,"URY",858 +"Uruguay","Americas",1987,71.918,3045153,7452.398969,"URY",858 +"Uruguay","Americas",1992,72.752,3149262,8137.004775,"URY",858 +"Uruguay","Americas",1997,74.223,3262838,9230.240708,"URY",858 +"Uruguay","Americas",2002,75.307,3363085,7727.002004,"URY",858 +"Uruguay","Americas",2007,76.384,3447496,10611.46299,"URY",858 +"Venezuela","Americas",1952,55.088,5439568,7689.799761,"VEN",862 +"Venezuela","Americas",1957,57.907,6702668,9802.466526,"VEN",862 +"Venezuela","Americas",1962,60.77,8143375,8422.974165,"VEN",862 +"Venezuela","Americas",1967,63.479,9709552,9541.474188,"VEN",862 +"Venezuela","Americas",1972,65.712,11515649,10505.25966,"VEN",862 +"Venezuela","Americas",1977,67.456,13503563,13143.95095,"VEN",862 +"Venezuela","Americas",1982,68.557,15620766,11152.41011,"VEN",862 +"Venezuela","Americas",1987,70.19,17910182,9883.584648,"VEN",862 +"Venezuela","Americas",1992,71.15,20265563,10733.92631,"VEN",862 +"Venezuela","Americas",1997,72.146,22374398,10165.49518,"VEN",862 +"Venezuela","Americas",2002,72.766,24287670,8605.047831,"VEN",862 +"Venezuela","Americas",2007,73.747,26084662,11415.80569,"VEN",862 +"Vietnam","Asia",1952,40.412,26246839,605.0664917,"VNM",704 +"Vietnam","Asia",1957,42.887,28998543,676.2854478,"VNM",704 +"Vietnam","Asia",1962,45.363,33796140,772.0491602,"VNM",704 +"Vietnam","Asia",1967,47.838,39463910,637.1232887,"VNM",704 +"Vietnam","Asia",1972,50.254,44655014,699.5016441,"VNM",704 +"Vietnam","Asia",1977,55.764,50533506,713.5371196,"VNM",704 +"Vietnam","Asia",1982,58.816,56142181,707.2357863,"VNM",704 +"Vietnam","Asia",1987,62.82,62826491,820.7994449,"VNM",704 +"Vietnam","Asia",1992,67.662,69940728,989.0231487,"VNM",704 +"Vietnam","Asia",1997,70.672,76048996,1385.896769,"VNM",704 +"Vietnam","Asia",2002,73.017,80908147,1764.456677,"VNM",704 +"Vietnam","Asia",2007,74.249,85262356,2441.576404,"VNM",704 +"West Bank and Gaza","Asia",1952,43.16,1030585,1515.592329,"PSE",275 +"West Bank and Gaza","Asia",1957,45.671,1070439,1827.067742,"PSE",275 +"West Bank and Gaza","Asia",1962,48.127,1133134,2198.956312,"PSE",275 +"West Bank and Gaza","Asia",1967,51.631,1142636,2649.715007,"PSE",275 +"West Bank and Gaza","Asia",1972,56.532,1089572,3133.409277,"PSE",275 +"West Bank and Gaza","Asia",1977,60.765,1261091,3682.831494,"PSE",275 +"West Bank and Gaza","Asia",1982,64.406,1425876,4336.032082,"PSE",275 +"West Bank and Gaza","Asia",1987,67.046,1691210,5107.197384,"PSE",275 +"West Bank and Gaza","Asia",1992,69.718,2104779,6017.654756,"PSE",275 +"West Bank and Gaza","Asia",1997,71.096,2826046,7110.667619,"PSE",275 +"West Bank and Gaza","Asia",2002,72.37,3389578,4515.487575,"PSE",275 +"West Bank and Gaza","Asia",2007,73.422,4018332,3025.349798,"PSE",275 +"Yemen, Rep.","Asia",1952,32.548,4963829,781.7175761,"YEM",887 +"Yemen, Rep.","Asia",1957,33.97,5498090,804.8304547,"YEM",887 +"Yemen, Rep.","Asia",1962,35.18,6120081,825.6232006,"YEM",887 +"Yemen, Rep.","Asia",1967,36.984,6740785,862.4421463,"YEM",887 +"Yemen, Rep.","Asia",1972,39.848,7407075,1265.047031,"YEM",887 +"Yemen, Rep.","Asia",1977,44.175,8403990,1829.765177,"YEM",887 +"Yemen, Rep.","Asia",1982,49.113,9657618,1977.55701,"YEM",887 +"Yemen, Rep.","Asia",1987,52.922,11219340,1971.741538,"YEM",887 +"Yemen, Rep.","Asia",1992,55.599,13367997,1879.496673,"YEM",887 +"Yemen, Rep.","Asia",1997,58.02,15826497,2117.484526,"YEM",887 +"Yemen, Rep.","Asia",2002,60.308,18701257,2234.820827,"YEM",887 +"Yemen, Rep.","Asia",2007,62.698,22211743,2280.769906,"YEM",887 +"Zambia","Africa",1952,42.038,2672000,1147.388831,"ZMB",894 +"Zambia","Africa",1957,44.077,3016000,1311.956766,"ZMB",894 +"Zambia","Africa",1962,46.023,3421000,1452.725766,"ZMB",894 +"Zambia","Africa",1967,47.768,3900000,1777.077318,"ZMB",894 +"Zambia","Africa",1972,50.107,4506497,1773.498265,"ZMB",894 +"Zambia","Africa",1977,51.386,5216550,1588.688299,"ZMB",894 +"Zambia","Africa",1982,51.821,6100407,1408.678565,"ZMB",894 +"Zambia","Africa",1987,50.821,7272406,1213.315116,"ZMB",894 +"Zambia","Africa",1992,46.1,8381163,1210.884633,"ZMB",894 +"Zambia","Africa",1997,40.238,9417789,1071.353818,"ZMB",894 +"Zambia","Africa",2002,39.193,10595811,1071.613938,"ZMB",894 +"Zambia","Africa",2007,42.384,11746035,1271.211593,"ZMB",894 +"Zimbabwe","Africa",1952,48.451,3080907,406.8841148,"ZWE",716 +"Zimbabwe","Africa",1957,50.469,3646340,518.7642681,"ZWE",716 +"Zimbabwe","Africa",1962,52.358,4277736,527.2721818,"ZWE",716 +"Zimbabwe","Africa",1967,53.995,4995432,569.7950712,"ZWE",716 +"Zimbabwe","Africa",1972,55.635,5861135,799.3621758,"ZWE",716 +"Zimbabwe","Africa",1977,57.674,6642107,685.5876821,"ZWE",716 +"Zimbabwe","Africa",1982,60.363,7636524,788.8550411,"ZWE",716 +"Zimbabwe","Africa",1987,62.351,9216418,706.1573059,"ZWE",716 +"Zimbabwe","Africa",1992,60.377,10704340,693.4207856,"ZWE",716 +"Zimbabwe","Africa",1997,46.809,11404948,792.4499603,"ZWE",716 +"Zimbabwe","Africa",2002,39.989,11926563,672.0386227,"ZWE",716 +"Zimbabwe","Africa",2007,43.487,12311143,469.7092981,"ZWE",716 diff --git a/datasets/iris.csv b/datasets/iris.csv new file mode 100644 index 00000000..98d55577 --- /dev/null +++ b/datasets/iris.csv @@ -0,0 +1,151 @@ +sepal_length,sepal_width,petal_length,petal_width,species,species_id +5.1,3.5,1.4,0.2,setosa,1 +4.9,3,1.4,0.2,setosa,1 +4.7,3.2,1.3,0.2,setosa,1 +4.6,3.1,1.5,0.2,setosa,1 +5,3.6,1.4,0.2,setosa,1 +5.4,3.9,1.7,0.4,setosa,1 +4.6,3.4,1.4,0.3,setosa,1 +5,3.4,1.5,0.2,setosa,1 +4.4,2.9,1.4,0.2,setosa,1 +4.9,3.1,1.5,0.1,setosa,1 +5.4,3.7,1.5,0.2,setosa,1 +4.8,3.4,1.6,0.2,setosa,1 +4.8,3,1.4,0.1,setosa,1 +4.3,3,1.1,0.1,setosa,1 +5.8,4,1.2,0.2,setosa,1 +5.7,4.4,1.5,0.4,setosa,1 +5.4,3.9,1.3,0.4,setosa,1 +5.1,3.5,1.4,0.3,setosa,1 +5.7,3.8,1.7,0.3,setosa,1 +5.1,3.8,1.5,0.3,setosa,1 +5.4,3.4,1.7,0.2,setosa,1 +5.1,3.7,1.5,0.4,setosa,1 +4.6,3.6,1,0.2,setosa,1 +5.1,3.3,1.7,0.5,setosa,1 +4.8,3.4,1.9,0.2,setosa,1 +5,3,1.6,0.2,setosa,1 +5,3.4,1.6,0.4,setosa,1 +5.2,3.5,1.5,0.2,setosa,1 +5.2,3.4,1.4,0.2,setosa,1 +4.7,3.2,1.6,0.2,setosa,1 +4.8,3.1,1.6,0.2,setosa,1 +5.4,3.4,1.5,0.4,setosa,1 +5.2,4.1,1.5,0.1,setosa,1 +5.5,4.2,1.4,0.2,setosa,1 +4.9,3.1,1.5,0.1,setosa,1 +5,3.2,1.2,0.2,setosa,1 +5.5,3.5,1.3,0.2,setosa,1 +4.9,3.1,1.5,0.1,setosa,1 +4.4,3,1.3,0.2,setosa,1 +5.1,3.4,1.5,0.2,setosa,1 +5,3.5,1.3,0.3,setosa,1 +4.5,2.3,1.3,0.3,setosa,1 +4.4,3.2,1.3,0.2,setosa,1 +5,3.5,1.6,0.6,setosa,1 +5.1,3.8,1.9,0.4,setosa,1 +4.8,3,1.4,0.3,setosa,1 +5.1,3.8,1.6,0.2,setosa,1 +4.6,3.2,1.4,0.2,setosa,1 +5.3,3.7,1.5,0.2,setosa,1 +5,3.3,1.4,0.2,setosa,1 +7,3.2,4.7,1.4,versicolor,2 +6.4,3.2,4.5,1.5,versicolor,2 +6.9,3.1,4.9,1.5,versicolor,2 +5.5,2.3,4,1.3,versicolor,2 +6.5,2.8,4.6,1.5,versicolor,2 +5.7,2.8,4.5,1.3,versicolor,2 +6.3,3.3,4.7,1.6,versicolor,2 +4.9,2.4,3.3,1,versicolor,2 +6.6,2.9,4.6,1.3,versicolor,2 +5.2,2.7,3.9,1.4,versicolor,2 +5,2,3.5,1,versicolor,2 +5.9,3,4.2,1.5,versicolor,2 +6,2.2,4,1,versicolor,2 +6.1,2.9,4.7,1.4,versicolor,2 +5.6,2.9,3.6,1.3,versicolor,2 +6.7,3.1,4.4,1.4,versicolor,2 +5.6,3,4.5,1.5,versicolor,2 +5.8,2.7,4.1,1,versicolor,2 +6.2,2.2,4.5,1.5,versicolor,2 +5.6,2.5,3.9,1.1,versicolor,2 +5.9,3.2,4.8,1.8,versicolor,2 +6.1,2.8,4,1.3,versicolor,2 +6.3,2.5,4.9,1.5,versicolor,2 +6.1,2.8,4.7,1.2,versicolor,2 +6.4,2.9,4.3,1.3,versicolor,2 +6.6,3,4.4,1.4,versicolor,2 +6.8,2.8,4.8,1.4,versicolor,2 +6.7,3,5,1.7,versicolor,2 +6,2.9,4.5,1.5,versicolor,2 +5.7,2.6,3.5,1,versicolor,2 +5.5,2.4,3.8,1.1,versicolor,2 +5.5,2.4,3.7,1,versicolor,2 +5.8,2.7,3.9,1.2,versicolor,2 +6,2.7,5.1,1.6,versicolor,2 +5.4,3,4.5,1.5,versicolor,2 +6,3.4,4.5,1.6,versicolor,2 +6.7,3.1,4.7,1.5,versicolor,2 +6.3,2.3,4.4,1.3,versicolor,2 +5.6,3,4.1,1.3,versicolor,2 +5.5,2.5,4,1.3,versicolor,2 +5.5,2.6,4.4,1.2,versicolor,2 +6.1,3,4.6,1.4,versicolor,2 +5.8,2.6,4,1.2,versicolor,2 +5,2.3,3.3,1,versicolor,2 +5.6,2.7,4.2,1.3,versicolor,2 +5.7,3,4.2,1.2,versicolor,2 +5.7,2.9,4.2,1.3,versicolor,2 +6.2,2.9,4.3,1.3,versicolor,2 +5.1,2.5,3,1.1,versicolor,2 +5.7,2.8,4.1,1.3,versicolor,2 +6.3,3.3,6,2.5,virginica,3 +5.8,2.7,5.1,1.9,virginica,3 +7.1,3,5.9,2.1,virginica,3 +6.3,2.9,5.6,1.8,virginica,3 +6.5,3,5.8,2.2,virginica,3 +7.6,3,6.6,2.1,virginica,3 +4.9,2.5,4.5,1.7,virginica,3 +7.3,2.9,6.3,1.8,virginica,3 +6.7,2.5,5.8,1.8,virginica,3 +7.2,3.6,6.1,2.5,virginica,3 +6.5,3.2,5.1,2,virginica,3 +6.4,2.7,5.3,1.9,virginica,3 +6.8,3,5.5,2.1,virginica,3 +5.7,2.5,5,2,virginica,3 +5.8,2.8,5.1,2.4,virginica,3 +6.4,3.2,5.3,2.3,virginica,3 +6.5,3,5.5,1.8,virginica,3 +7.7,3.8,6.7,2.2,virginica,3 +7.7,2.6,6.9,2.3,virginica,3 +6,2.2,5,1.5,virginica,3 +6.9,3.2,5.7,2.3,virginica,3 +5.6,2.8,4.9,2,virginica,3 +7.7,2.8,6.7,2,virginica,3 +6.3,2.7,4.9,1.8,virginica,3 +6.7,3.3,5.7,2.1,virginica,3 +7.2,3.2,6,1.8,virginica,3 +6.2,2.8,4.8,1.8,virginica,3 +6.1,3,4.9,1.8,virginica,3 +6.4,2.8,5.6,2.1,virginica,3 +7.2,3,5.8,1.6,virginica,3 +7.4,2.8,6.1,1.9,virginica,3 +7.9,3.8,6.4,2,virginica,3 +6.4,2.8,5.6,2.2,virginica,3 +6.3,2.8,5.1,1.5,virginica,3 +6.1,2.6,5.6,1.4,virginica,3 +7.7,3,6.1,2.3,virginica,3 +6.3,3.4,5.6,2.4,virginica,3 +6.4,3.1,5.5,1.8,virginica,3 +6,3,4.8,1.8,virginica,3 +6.9,3.1,5.4,2.1,virginica,3 +6.7,3.1,5.6,2.4,virginica,3 +6.9,3.1,5.1,2.3,virginica,3 +5.8,2.7,5.1,1.9,virginica,3 +6.8,3.2,5.9,2.3,virginica,3 +6.7,3.3,5.7,2.5,virginica,3 +6.7,3,5.2,2.3,virginica,3 +6.3,2.5,5,1.9,virginica,3 +6.5,3,5.2,2,virginica,3 +6.2,3.4,5.4,2.3,virginica,3 +5.9,3,5.1,1.8,virginica,3 diff --git a/datasets/medals.csv b/datasets/medals.csv new file mode 100644 index 00000000..cead3c97 --- /dev/null +++ b/datasets/medals.csv @@ -0,0 +1,4 @@ +nation,gold,silver,bronze +South Korea,24,13,11 +China,10,15,8 +Canada,9,12,12 diff --git a/datasets/stocks.csv b/datasets/stocks.csv new file mode 100644 index 00000000..a5de5647 --- /dev/null +++ b/datasets/stocks.csv @@ -0,0 +1,106 @@ +date,GOOG,AAPL,AMZN,FB,NFLX,MSFT +2018-01-01,1.0,1.0,1.0,1.0,1.0,1.0 +2018-01-08,1.0181722783479359,1.0119428342857142,1.0618806117055755,0.9599678310954937,1.0535263142643385,1.015988161560536 +2018-01-15,1.032007866452698,1.0197714685714288,1.0532404284307675,0.9702434422185674,1.0498595254569378,1.0205238457756243 +2018-01-22,1.066782783389724,0.9800571142857143,1.1406756202628388,1.0168584099483517,1.3076813155940448,1.0665607876956391 +2018-01-29,1.0087731636550115,0.9171428571428571,1.1633743377885228,1.0183569327795472,1.2735367714287167,1.040707528275144 +2018-02-05,0.9415276737437317,0.8937714514285715,1.0898676795580526,0.9425207136466456,1.188008929282134,0.9998865857832728 +2018-02-12,0.9932591826253899,0.9853142457142857,1.1786207619316666,0.9492105716068321,1.3263487897912096,1.043202153459527 +2018-02-19,1.0222821547641083,1.002857142857143,1.2203654438831366,0.9809472149548658,1.3616362026373592,1.0665607876956391 +2018-02-26,0.9788520214265991,1.0069143257142859,1.2205688381237838,0.9452501435830833,1.4336396058469547,1.0551082990110374 +2018-03-05,1.0524482730908842,1.02845712,1.284548542665418,0.9913298905647345,1.5783608462698024,1.0946819232411402 +2018-03-12,1.0303929312465263,1.0172571657142857,1.2786826844946546,0.9905806264731936,1.5165008067883996,1.072683930770293 +2018-03-19,0.9268211040675921,0.9425142971428571,1.2167532101702832,0.8530371628674177,1.4331158380609592,0.9885474319413214 +2018-03-26,0.9360932452590338,0.9587428514285714,1.1775224533715958,0.8551778853033591,1.406495542490225,1.034924537137441 +2018-04-02,0.9136387108614119,0.9621714571428572,1.1432627388670606,0.8413165210173983,1.375541688281783,1.0231318851767346 +2018-04-09,0.9338069537901699,0.99845712,1.16405781403187,0.8804923666954552,1.484118227436587,1.0554484622871423 +2018-04-16,0.9734447261178651,0.9469714342857143,1.242730666448932,0.8899116599439659,1.5608837620628662,1.0772196149853812 +2018-04-23,0.9345146364100891,0.9275428971428572,1.2794473988384474,0.9290339332394776,1.484642138086525,1.0865177211357813 +2018-04-30,0.9509902470625957,1.0504571542857144,1.2862244591394254,0.9451966568307202,1.5243106261176576,1.0790339249567087 +2018-05-07,0.9963982380519172,1.07765712,1.3040906767647622,1.0007492587396545,1.5546453794312736,1.1078352963411884 +2018-05-14,0.9674568868105002,1.06462856,1.2808711585229775,0.9776825642702949,1.5437877293254985,1.0926408755495889 +2018-05-21,0.9758943718805397,1.0776000114285715,1.3099809658381354,0.9896708164943809,1.6728891882258874,1.1153191832334917 +2018-05-28,1.015668254641377,1.0870857428571428,1.3355191588974509,1.038212463316699,1.7140339274719294,1.1428733270694336 +2018-06-04,1.0169111849053498,1.0954285542857143,1.3700554610940723,1.0120417443283358,1.7170817582484463,1.1523981709400573 +2018-06-11,1.0453898287179595,1.0790856914285714,1.3960736368996987,1.048166977313343,1.8666603250949971,1.1353894401771303 +2018-06-18,1.0483111519067918,1.0566857028571428,1.3958296232020404,1.0796895826698554,1.9576645850358452,1.1385644826269534 +2018-06-25,1.0121753574512644,1.0577714342857143,1.3829181608736414,1.039978596521961,1.8640410670974559,1.1181539716939795 +2018-07-02,1.0344211867653972,1.0741142914285715,1.3917291635810913,1.0876638451914205,1.9441401508609901,1.147068848008417 +2018-07-09,1.0785588920381208,1.093314297142857,1.4750394640760272,1.109553119307901,1.884851557577705,1.1954869895569342 +2018-07-16,1.0750116178113753,1.0939428685714285,1.4755844971819587,1.12357503483302,1.7193674908479575,1.2050118447667117 +2018-07-23,1.1236312044424703,1.0913142628571428,1.4784890230752108,0.9359914015737306,1.691556657660921,1.2210000857013248 +2018-07-30,1.1102129167272332,1.1885143142857142,1.4833867718479574,0.951458353177682,1.6338396487013753,1.225082192423581 +2018-08-06,1.1228237368393845,1.1858857085714285,1.5346502643964448,0.9647310099631465,1.6470783692776239,1.2359677687727004 +2018-08-13,1.0895729410299655,1.2433142971428572,1.5313308069300795,0.9301578668399936,1.50854798541483,1.2198661929954373 +2018-08-20,1.1074367837463466,1.235200022857143,1.5501814209506475,0.934706922085943,1.7087480282692504,1.2291642991458374 +2018-08-27,1.1052048693141154,1.3007428857142855,1.637494456642517,0.940486970067317,1.7509404459512254,1.2737271737447062 +2018-09-03,1.0567939333314087,1.2645714457142856,1.5881591374274802,0.8725715159998442,1.6604599490342413,1.227009825898405 +2018-09-10,1.0637798374890872,1.2790856914285713,1.6029011479217037,0.868718232741186,1.7360826197418304,1.2855199050794894 +2018-09-17,1.0579370795194665,1.2437714514285716,1.5580080272628667,0.8719828084993478,1.720034255916133,1.2956117406596723 +2018-09-24,1.0827776350267664,1.2899428857142856,1.6295946560652816,0.8801712695690254,1.7816562507344103,1.2968590589214408 +2018-10-01,1.0500077089175164,1.2816571028571428,1.5373757268816928,0.8420122930046896,1.6731749018244944,1.2714592862805467 +2018-10-08,1.007121903906116,1.2692000057142856,1.4551718788522234,0.822799036998693,1.617029334324746,1.2424310864626127 +2018-10-15,0.9947651405743836,1.2531999885714287,1.4351741929091781,0.8244581110690464,1.5842183202957685,1.2321125018230523 +2018-10-22,0.9720929301886707,1.236000017142857,1.3365524179114776,0.7780036945784202,1.4278298007564696,1.2128358835959658 +2018-10-29,0.9596817889130541,1.1855999771428571,1.3550368620941855,0.8046561475625534,1.4719748494696214,1.203764617218174 +2018-11-05,0.9672663993407256,1.1684000057142856,1.3931936419790223,0.7758094853901156,1.4451640257830367,1.2424310864626127 +2018-11-12,0.9630385756700248,1.1058857085714286,1.2963616956201691,0.7467486995959743,1.3629695899097676,1.2279169808840689 +2018-11-19,0.9289168536315806,0.9845142457142856,1.2220414604271101,0.7050039698687512,1.2325348866009123,1.1687265864899288 +2018-11-26,0.992923504040418,1.0204571542857144,1.375083410656027,0.7525287475773482,1.3625886860662726,1.2573987581948347 +2018-12-03,0.9404389054995582,0.9628000285714285,1.3254226411301075,0.735456214007293,1.2626315952514027,1.1885701057133435 +2018-12-10,0.9454469529126761,0.9455999771428572,1.295141330176286,0.7709927394918039,1.2707271281792676,1.2022904705229511 +2018-12-17,0.8886892896888904,0.8613142628571429,1.1206615472526131,0.668718185644586,1.1733415549944868,1.1138451159123455 +2018-12-24,0.9408925313390586,0.8927428342857143,1.202483038516975,0.712871248181817,1.2194865512765718,1.1383376428543452 +2018-12-31,0.9714034098401133,0.8471999714285714,1.2817010232963573,0.7382927084305257,1.4170674789973934,1.1557999511101043 +2019-01-07,0.9591373489949893,0.8702285314285714,1.334721869745653,0.769601275795517,1.6076479259096166,1.1656650489700635 +2019-01-14,0.9963982380519172,0.8961143257142857,1.3799892040777797,0.8029969932139043,1.6148387919701228,1.2213402489774292 +2019-01-21,0.9898025002005479,0.9014856857142858,1.359137222458745,0.7974845609584834,1.6098384682642397,1.2152170945636216 +2019-01-28,1.0077298024501202,0.95154288,1.3230632475991762,0.8868611275292119,1.6184103905326355,1.1654382205366092 +2019-02-04,0.9934950771344468,0.9737714514285715,1.2921391799289847,0.8955311566861818,1.6551740498315624,1.1982083638006946 +2019-02-11,1.0103608540932627,0.97382856,1.3081910371293217,0.8696815348242483,1.699461814861141,1.2271232401151322 +2019-02-18,1.0073850422758415,0.9884000057142857,1.3273996770823542,0.8664168787877908,1.7287488945009553,1.2583059131804986 +2019-02-25,1.035165084150587,0.9998285771428571,1.3600809993969647,0.8685041144713691,1.7016048311442253,1.275994970495635 +2019-03-04,1.0363716889645844,0.9880571657142858,1.3186455808291295,0.907679960149426,1.6648411718452985,1.2530899137523548 +2019-03-11,1.0746032883264525,1.0635428285714286,1.3931366354548307,0.8883060779778621,1.721319979015192,1.3143213671771998 +2019-03-18,1.0936918990354445,1.0917143028571428,1.435776232539301,0.8795289843340972,1.7191771103581814,1.3272479912178707 +2019-03-25,1.064487521016258,1.0854285542857143,1.4487771761299302,0.8921059494105662,1.6979855684083633,1.3373398267980536 +2019-04-01,1.095188886079836,1.1257142857142857,1.4947687054188046,0.9404334779630673,1.7405113638622944,1.3594511427723972 +2019-04-08,1.1049145977684258,1.1363999714285713,1.4994712046698764,0.9585228806468435,1.6721748970861734,1.3714706231665579 +2019-04-15,1.1216987538299403,1.1649142914285715,1.5146280474808236,0.9541342963617566,1.7160340845746447,1.3989114434990033 +2019-04-22,1.1541874899828073,1.1674285885714286,1.5869876346023932,1.024832747396326,1.7850849901165537,1.4728426811919109 +2019-04-29,1.075456162061569,1.21,1.596612214272432,1.0461332337340143,1.8335634546034707,1.4616168621926098 +2019-05-06,1.0562859304552756,1.126742817142857,1.537644171481961,1.0079742571696786,1.7193199695385504,1.4415465939098175 +2019-05-13,1.0544986709579427,1.08,1.5205753430783882,0.9917045600737096,1.6879375377890014,1.4522055119127901 +2019-05-20,1.0283425342867192,1.02268572,1.483378627942562,0.9690125351133251,1.6876518241903944,1.4314547583296346 +2019-05-27,1.001270175031893,1.00040004,1.44415601504927,0.9497992791073284,1.6347444679569396,1.4024265471725468 +2019-06-03,0.9671666152648106,1.0865713942857143,1.4677172714127285,0.9277495340299855,1.7185103405278745,1.4899647467974881 +2019-06-10,0.9846855880294599,1.1013714571428572,1.521120475440709,0.9704575658402709,1.6178389585732904,1.5018708923489987 +2019-06-17,1.0178275181736574,1.1358857085714287,1.5549896884611636,1.0229595550561554,1.7582264974944881,1.5531239130712344 +2019-06-24,0.9806574431952939,1.130971417142857,1.540613747734834,1.0329140690527994,1.7492261453110591,1.518993128041884 +2019-07-01,1.0266368965939394,1.1670285485714287,1.5807068440449399,1.0511104505931885,1.8122290534732834,1.5541444028995486 +2019-07-08,1.0387124690620373,1.1617143028571428,1.6361032717659916,1.0964409334832987,1.7774655512770718,1.5750084006121237 +2019-07-15,1.025285100664745,1.1576571199999999,1.5982882308164055,1.0616001853379657,1.5005476379697218,1.5491551411916282 +2019-07-22,1.1344366027859267,1.1870857428571429,1.5808207570233568,1.0690393020378066,1.5990284823318142,1.6026759586647925 +2019-07-29,1.0832494231376286,1.1658285942857143,1.4833460531345568,1.011613582715111,1.518310297673454,1.5523300929282209 +2019-08-05,1.0778240762422375,1.1485143142857142,1.4706054102388,1.0053518863681492,1.471165225221077,1.5615149549492018 +2019-08-12,1.0683795554172821,1.18,1.4583936118945735,0.9831415097733526,1.4419733358261506,1.5435990692006107 +2019-08-19,1.0445098208996275,1.1579428514285715,1.4234505212166575,0.9512978019385239,1.3878755896024673,1.5125297196387406 +2019-08-26,1.0779056980467905,1.1928000285714286,1.445148654606286,0.993684731270493,1.398876103650743,1.5632157599905712 +2019-09-02,1.0931748145700046,1.218628542857143,1.491701504811883,1.003425201923729,1.381827735086725,1.5772763674503603 +2019-09-09,1.12459294475006,1.25,1.4964446227063888,1.0018196199576253,1.400780927644628,1.5570926849508404 +2019-09-16,1.115856106545024,1.2441714057142856,1.4596872708598623,1.0164837404393767,1.2893470810670253,1.5811316344000081 +2019-09-23,1.1114649285805127,1.25040004,1.4037863302335007,0.9478191079105451,1.2528214711933554,1.5617416132953483 +2019-09-30,1.0968672799119472,1.2971999714285716,1.4153391824933792,0.9657478790768677,1.2990618720162421,1.5661638719545554 +2019-10-07,1.10271900878617,1.3497714685714286,1.4090502488441077,0.9857639608531775,1.347349808387309,1.583852929269692 +2019-10-14,1.129972884606169,1.3509143085714286,1.4298696556551374,0.9946481136318508,1.3110147218673576,1.5581131747791548 +2019-10-21,1.1477913211905195,1.409028582857143,1.43297747571907,1.0055659243596704,1.3182532521012131,1.5957590748212025 +2019-10-28,1.155602744537941,1.4618286114285712,1.4574742658589632,1.03623221184162,1.3658269020946976,1.6296632015044061 +2019-11-04,1.189742629754999,1.4865143714285716,1.4529508300158953,1.0213539730900516,1.388494690497293,1.6550629741453007 +2019-11-11,1.2110630442115173,1.5186286285714288,1.4152089825177483,1.044153062537231,1.4049716271019665,1.7005329130166023 +2019-11-18,1.1751993590303178,1.4958857085714288,1.420277551536714,1.0640620851786324,1.4785466146353015,1.6962239778608914 +2019-11-25,1.183927115646047,1.5271428571428571,1.465089434095106,1.0791543619217223,1.4984522906221183,1.7165211652903694 +2019-12-02,1.216279741365772,1.5469142342857143,1.425061388144621,1.0759967703720599,1.4636411194904255,1.7207165955161219 +2019-12-09,1.222820990588552,1.57228568,1.4326601685000062,1.0388546682733315,1.421496227879989,1.7522394318575931 +2019-12-16,1.2244177626161101,1.5968000114285714,1.4534552436648156,1.104094173804843,1.6043620457078422,1.7848962516181823 +2019-12-23,1.2265044859331442,1.6559999314285714,1.5212262445137301,1.113727585323171,1.5671698088678079,1.8024719740906685 +2019-12-30,1.213013658002661,1.6779999657142857,1.5033600268883933,1.0984746770626275,1.5408828958311611,1.7881845268582712 diff --git a/datasets/tips.csv b/datasets/tips.csv new file mode 100644 index 00000000..856a65a6 --- /dev/null +++ b/datasets/tips.csv @@ -0,0 +1,245 @@ +total_bill,tip,sex,smoker,day,time,size +16.99,1.01,Female,No,Sun,Dinner,2 +10.34,1.66,Male,No,Sun,Dinner,3 +21.01,3.5,Male,No,Sun,Dinner,3 +23.68,3.31,Male,No,Sun,Dinner,2 +24.59,3.61,Female,No,Sun,Dinner,4 +25.29,4.71,Male,No,Sun,Dinner,4 +8.77,2.0,Male,No,Sun,Dinner,2 +26.88,3.12,Male,No,Sun,Dinner,4 +15.04,1.96,Male,No,Sun,Dinner,2 +14.78,3.23,Male,No,Sun,Dinner,2 +10.27,1.71,Male,No,Sun,Dinner,2 +35.26,5.0,Female,No,Sun,Dinner,4 +15.42,1.57,Male,No,Sun,Dinner,2 +18.43,3.0,Male,No,Sun,Dinner,4 +14.83,3.02,Female,No,Sun,Dinner,2 +21.58,3.92,Male,No,Sun,Dinner,2 +10.33,1.67,Female,No,Sun,Dinner,3 +16.29,3.71,Male,No,Sun,Dinner,3 +16.97,3.5,Female,No,Sun,Dinner,3 +20.65,3.35,Male,No,Sat,Dinner,3 +17.92,4.08,Male,No,Sat,Dinner,2 +20.29,2.75,Female,No,Sat,Dinner,2 +15.77,2.23,Female,No,Sat,Dinner,2 +39.42,7.58,Male,No,Sat,Dinner,4 +19.82,3.18,Male,No,Sat,Dinner,2 +17.81,2.34,Male,No,Sat,Dinner,4 +13.37,2.0,Male,No,Sat,Dinner,2 +12.69,2.0,Male,No,Sat,Dinner,2 +21.7,4.3,Male,No,Sat,Dinner,2 +19.65,3.0,Female,No,Sat,Dinner,2 +9.55,1.45,Male,No,Sat,Dinner,2 +18.35,2.5,Male,No,Sat,Dinner,4 +15.06,3.0,Female,No,Sat,Dinner,2 +20.69,2.45,Female,No,Sat,Dinner,4 +17.78,3.27,Male,No,Sat,Dinner,2 +24.06,3.6,Male,No,Sat,Dinner,3 +16.31,2.0,Male,No,Sat,Dinner,3 +16.93,3.07,Female,No,Sat,Dinner,3 +18.69,2.31,Male,No,Sat,Dinner,3 +31.27,5.0,Male,No,Sat,Dinner,3 +16.04,2.24,Male,No,Sat,Dinner,3 +17.46,2.54,Male,No,Sun,Dinner,2 +13.94,3.06,Male,No,Sun,Dinner,2 +9.68,1.32,Male,No,Sun,Dinner,2 +30.4,5.6,Male,No,Sun,Dinner,4 +18.29,3.0,Male,No,Sun,Dinner,2 +22.23,5.0,Male,No,Sun,Dinner,2 +32.4,6.0,Male,No,Sun,Dinner,4 +28.55,2.05,Male,No,Sun,Dinner,3 +18.04,3.0,Male,No,Sun,Dinner,2 +12.54,2.5,Male,No,Sun,Dinner,2 +10.29,2.6,Female,No,Sun,Dinner,2 +34.81,5.2,Female,No,Sun,Dinner,4 +9.94,1.56,Male,No,Sun,Dinner,2 +25.56,4.34,Male,No,Sun,Dinner,4 +19.49,3.51,Male,No,Sun,Dinner,2 +38.01,3.0,Male,Yes,Sat,Dinner,4 +26.41,1.5,Female,No,Sat,Dinner,2 +11.24,1.76,Male,Yes,Sat,Dinner,2 +48.27,6.73,Male,No,Sat,Dinner,4 +20.29,3.21,Male,Yes,Sat,Dinner,2 +13.81,2.0,Male,Yes,Sat,Dinner,2 +11.02,1.98,Male,Yes,Sat,Dinner,2 +18.29,3.76,Male,Yes,Sat,Dinner,4 +17.59,2.64,Male,No,Sat,Dinner,3 +20.08,3.15,Male,No,Sat,Dinner,3 +16.45,2.47,Female,No,Sat,Dinner,2 +3.07,1.0,Female,Yes,Sat,Dinner,1 +20.23,2.01,Male,No,Sat,Dinner,2 +15.01,2.09,Male,Yes,Sat,Dinner,2 +12.02,1.97,Male,No,Sat,Dinner,2 +17.07,3.0,Female,No,Sat,Dinner,3 +26.86,3.14,Female,Yes,Sat,Dinner,2 +25.28,5.0,Female,Yes,Sat,Dinner,2 +14.73,2.2,Female,No,Sat,Dinner,2 +10.51,1.25,Male,No,Sat,Dinner,2 +17.92,3.08,Male,Yes,Sat,Dinner,2 +27.2,4.0,Male,No,Thur,Lunch,4 +22.76,3.0,Male,No,Thur,Lunch,2 +17.29,2.71,Male,No,Thur,Lunch,2 +19.44,3.0,Male,Yes,Thur,Lunch,2 +16.66,3.4,Male,No,Thur,Lunch,2 +10.07,1.83,Female,No,Thur,Lunch,1 +32.68,5.0,Male,Yes,Thur,Lunch,2 +15.98,2.03,Male,No,Thur,Lunch,2 +34.83,5.17,Female,No,Thur,Lunch,4 +13.03,2.0,Male,No,Thur,Lunch,2 +18.28,4.0,Male,No,Thur,Lunch,2 +24.71,5.85,Male,No,Thur,Lunch,2 +21.16,3.0,Male,No,Thur,Lunch,2 +28.97,3.0,Male,Yes,Fri,Dinner,2 +22.49,3.5,Male,No,Fri,Dinner,2 +5.75,1.0,Female,Yes,Fri,Dinner,2 +16.32,4.3,Female,Yes,Fri,Dinner,2 +22.75,3.25,Female,No,Fri,Dinner,2 +40.17,4.73,Male,Yes,Fri,Dinner,4 +27.28,4.0,Male,Yes,Fri,Dinner,2 +12.03,1.5,Male,Yes,Fri,Dinner,2 +21.01,3.0,Male,Yes,Fri,Dinner,2 +12.46,1.5,Male,No,Fri,Dinner,2 +11.35,2.5,Female,Yes,Fri,Dinner,2 +15.38,3.0,Female,Yes,Fri,Dinner,2 +44.3,2.5,Female,Yes,Sat,Dinner,3 +22.42,3.48,Female,Yes,Sat,Dinner,2 +20.92,4.08,Female,No,Sat,Dinner,2 +15.36,1.64,Male,Yes,Sat,Dinner,2 +20.49,4.06,Male,Yes,Sat,Dinner,2 +25.21,4.29,Male,Yes,Sat,Dinner,2 +18.24,3.76,Male,No,Sat,Dinner,2 +14.31,4.0,Female,Yes,Sat,Dinner,2 +14.0,3.0,Male,No,Sat,Dinner,2 +7.25,1.0,Female,No,Sat,Dinner,1 +38.07,4.0,Male,No,Sun,Dinner,3 +23.95,2.55,Male,No,Sun,Dinner,2 +25.71,4.0,Female,No,Sun,Dinner,3 +17.31,3.5,Female,No,Sun,Dinner,2 +29.93,5.07,Male,No,Sun,Dinner,4 +10.65,1.5,Female,No,Thur,Lunch,2 +12.43,1.8,Female,No,Thur,Lunch,2 +24.08,2.92,Female,No,Thur,Lunch,4 +11.69,2.31,Male,No,Thur,Lunch,2 +13.42,1.68,Female,No,Thur,Lunch,2 +14.26,2.5,Male,No,Thur,Lunch,2 +15.95,2.0,Male,No,Thur,Lunch,2 +12.48,2.52,Female,No,Thur,Lunch,2 +29.8,4.2,Female,No,Thur,Lunch,6 +8.52,1.48,Male,No,Thur,Lunch,2 +14.52,2.0,Female,No,Thur,Lunch,2 +11.38,2.0,Female,No,Thur,Lunch,2 +22.82,2.18,Male,No,Thur,Lunch,3 +19.08,1.5,Male,No,Thur,Lunch,2 +20.27,2.83,Female,No,Thur,Lunch,2 +11.17,1.5,Female,No,Thur,Lunch,2 +12.26,2.0,Female,No,Thur,Lunch,2 +18.26,3.25,Female,No,Thur,Lunch,2 +8.51,1.25,Female,No,Thur,Lunch,2 +10.33,2.0,Female,No,Thur,Lunch,2 +14.15,2.0,Female,No,Thur,Lunch,2 +16.0,2.0,Male,Yes,Thur,Lunch,2 +13.16,2.75,Female,No,Thur,Lunch,2 +17.47,3.5,Female,No,Thur,Lunch,2 +34.3,6.7,Male,No,Thur,Lunch,6 +41.19,5.0,Male,No,Thur,Lunch,5 +27.05,5.0,Female,No,Thur,Lunch,6 +16.43,2.3,Female,No,Thur,Lunch,2 +8.35,1.5,Female,No,Thur,Lunch,2 +18.64,1.36,Female,No,Thur,Lunch,3 +11.87,1.63,Female,No,Thur,Lunch,2 +9.78,1.73,Male,No,Thur,Lunch,2 +7.51,2.0,Male,No,Thur,Lunch,2 +14.07,2.5,Male,No,Sun,Dinner,2 +13.13,2.0,Male,No,Sun,Dinner,2 +17.26,2.74,Male,No,Sun,Dinner,3 +24.55,2.0,Male,No,Sun,Dinner,4 +19.77,2.0,Male,No,Sun,Dinner,4 +29.85,5.14,Female,No,Sun,Dinner,5 +48.17,5.0,Male,No,Sun,Dinner,6 +25.0,3.75,Female,No,Sun,Dinner,4 +13.39,2.61,Female,No,Sun,Dinner,2 +16.49,2.0,Male,No,Sun,Dinner,4 +21.5,3.5,Male,No,Sun,Dinner,4 +12.66,2.5,Male,No,Sun,Dinner,2 +16.21,2.0,Female,No,Sun,Dinner,3 +13.81,2.0,Male,No,Sun,Dinner,2 +17.51,3.0,Female,Yes,Sun,Dinner,2 +24.52,3.48,Male,No,Sun,Dinner,3 +20.76,2.24,Male,No,Sun,Dinner,2 +31.71,4.5,Male,No,Sun,Dinner,4 +10.59,1.61,Female,Yes,Sat,Dinner,2 +10.63,2.0,Female,Yes,Sat,Dinner,2 +50.81,10.0,Male,Yes,Sat,Dinner,3 +15.81,3.16,Male,Yes,Sat,Dinner,2 +7.25,5.15,Male,Yes,Sun,Dinner,2 +31.85,3.18,Male,Yes,Sun,Dinner,2 +16.82,4.0,Male,Yes,Sun,Dinner,2 +32.9,3.11,Male,Yes,Sun,Dinner,2 +17.89,2.0,Male,Yes,Sun,Dinner,2 +14.48,2.0,Male,Yes,Sun,Dinner,2 +9.6,4.0,Female,Yes,Sun,Dinner,2 +34.63,3.55,Male,Yes,Sun,Dinner,2 +34.65,3.68,Male,Yes,Sun,Dinner,4 +23.33,5.65,Male,Yes,Sun,Dinner,2 +45.35,3.5,Male,Yes,Sun,Dinner,3 +23.17,6.5,Male,Yes,Sun,Dinner,4 +40.55,3.0,Male,Yes,Sun,Dinner,2 +20.69,5.0,Male,No,Sun,Dinner,5 +20.9,3.5,Female,Yes,Sun,Dinner,3 +30.46,2.0,Male,Yes,Sun,Dinner,5 +18.15,3.5,Female,Yes,Sun,Dinner,3 +23.1,4.0,Male,Yes,Sun,Dinner,3 +15.69,1.5,Male,Yes,Sun,Dinner,2 +19.81,4.19,Female,Yes,Thur,Lunch,2 +28.44,2.56,Male,Yes,Thur,Lunch,2 +15.48,2.02,Male,Yes,Thur,Lunch,2 +16.58,4.0,Male,Yes,Thur,Lunch,2 +7.56,1.44,Male,No,Thur,Lunch,2 +10.34,2.0,Male,Yes,Thur,Lunch,2 +43.11,5.0,Female,Yes,Thur,Lunch,4 +13.0,2.0,Female,Yes,Thur,Lunch,2 +13.51,2.0,Male,Yes,Thur,Lunch,2 +18.71,4.0,Male,Yes,Thur,Lunch,3 +12.74,2.01,Female,Yes,Thur,Lunch,2 +13.0,2.0,Female,Yes,Thur,Lunch,2 +16.4,2.5,Female,Yes,Thur,Lunch,2 +20.53,4.0,Male,Yes,Thur,Lunch,4 +16.47,3.23,Female,Yes,Thur,Lunch,3 +26.59,3.41,Male,Yes,Sat,Dinner,3 +38.73,3.0,Male,Yes,Sat,Dinner,4 +24.27,2.03,Male,Yes,Sat,Dinner,2 +12.76,2.23,Female,Yes,Sat,Dinner,2 +30.06,2.0,Male,Yes,Sat,Dinner,3 +25.89,5.16,Male,Yes,Sat,Dinner,4 +48.33,9.0,Male,No,Sat,Dinner,4 +13.27,2.5,Female,Yes,Sat,Dinner,2 +28.17,6.5,Female,Yes,Sat,Dinner,3 +12.9,1.1,Female,Yes,Sat,Dinner,2 +28.15,3.0,Male,Yes,Sat,Dinner,5 +11.59,1.5,Male,Yes,Sat,Dinner,2 +7.74,1.44,Male,Yes,Sat,Dinner,2 +30.14,3.09,Female,Yes,Sat,Dinner,4 +12.16,2.2,Male,Yes,Fri,Lunch,2 +13.42,3.48,Female,Yes,Fri,Lunch,2 +8.58,1.92,Male,Yes,Fri,Lunch,1 +15.98,3.0,Female,No,Fri,Lunch,3 +13.42,1.58,Male,Yes,Fri,Lunch,2 +16.27,2.5,Female,Yes,Fri,Lunch,2 +10.09,2.0,Female,Yes,Fri,Lunch,2 +20.45,3.0,Male,No,Sat,Dinner,4 +13.28,2.72,Male,No,Sat,Dinner,2 +22.12,2.88,Female,Yes,Sat,Dinner,2 +24.01,2.0,Male,Yes,Sat,Dinner,4 +15.69,3.0,Male,Yes,Sat,Dinner,3 +11.61,3.39,Male,No,Sat,Dinner,2 +10.77,1.47,Male,No,Sat,Dinner,2 +15.53,3.0,Male,Yes,Sat,Dinner,2 +10.07,1.25,Male,No,Sat,Dinner,2 +12.6,1.0,Male,Yes,Sat,Dinner,2 +32.83,1.17,Male,Yes,Sat,Dinner,2 +35.83,4.67,Female,No,Sat,Dinner,3 +29.03,5.92,Male,No,Sat,Dinner,3 +27.18,2.0,Female,Yes,Sat,Dinner,2 +22.67,2.0,Male,Yes,Sat,Dinner,2 +17.82,1.75,Male,No,Sat,Dinner,2 +18.78,3.0,Female,No,Thur,Dinner,2 diff --git a/datasets/wind.csv b/datasets/wind.csv new file mode 100644 index 00000000..6d22047a --- /dev/null +++ b/datasets/wind.csv @@ -0,0 +1,129 @@ +direction,strength,frequency +N,0-1,0.5 +NNE,0-1,0.6 +NE,0-1,0.5 +ENE,0-1,0.4 +E,0-1,0.4 +ESE,0-1,0.3 +SE,0-1,0.4 +SSE,0-1,0.4 +S,0-1,0.6 +SSW,0-1,0.4 +SW,0-1,0.5 +WSW,0-1,0.6 +W,0-1,0.6 +WNW,0-1,0.5 +NW,0-1,0.4 +NNW,0-1,0.1 +N,1-2,1.6 +NNE,1-2,1.8 +NE,1-2,1.5 +ENE,1-2,1.6 +E,1-2,1.6 +ESE,1-2,1.2 +SE,1-2,1.5 +SSE,1-2,1.7 +S,1-2,2.2 +SSW,1-2,2.0 +SW,1-2,2.3 +WSW,1-2,2.4 +W,1-2,2.3 +WNW,1-2,2.6 +NW,1-2,2.3 +NNW,1-2,0.8 +N,2-3,0.9 +NNE,2-3,1.3 +NE,2-3,1.6 +ENE,2-3,0.9 +E,2-3,1.0 +ESE,2-3,0.6 +SE,2-3,0.6 +SSE,2-3,0.9 +S,2-3,1.4 +SSW,2-3,1.7 +SW,2-3,1.9 +WSW,2-3,2.2 +W,2-3,1.8 +WNW,2-3,1.7 +NW,2-3,1.8 +NNW,2-3,0.8 +N,3-4,0.9 +NNE,3-4,0.8 +NE,3-4,1.2 +ENE,3-4,1.0 +E,3-4,0.8 +ESE,3-4,0.4 +SE,3-4,0.5 +SSE,3-4,0.5 +S,3-4,0.8 +SSW,3-4,0.9 +SW,3-4,1.3 +WSW,3-4,1.1 +W,3-4,1.2 +WNW,3-4,1.2 +NW,3-4,1.3 +NNW,3-4,1.0 +N,4-4,0.4 +NNE,4-4,0.5 +NE,4-4,1.2 +ENE,4-4,0.5 +E,4-4,0.4 +ESE,4-4,0.2 +SE,4-4,0.4 +SSE,4-4,0.4 +S,4-4,0.7 +SSW,4-4,0.6 +SW,4-4,0.7 +WSW,4-4,0.8 +W,4-4,0.9 +WNW,4-4,1.0 +NW,4-4,1.0 +NNW,4-4,0.7 +N,4-5,0.3 +NNE,4-5,0.3 +NE,4-5,0.6 +ENE,4-5,0.2 +E,4-5,0.1 +ESE,4-5,0.1 +SE,4-5,0.05 +SSE,4-5,0.1 +S,4-5,0.1 +SSW,4-5,0.2 +SW,4-5,0.3 +WSW,4-5,0.4 +W,4-5,0.9 +WNW,4-5,0.9 +NW,4-5,0.9 +NNW,4-5,0.3 +N,5-6,0.2 +NNE,5-6,0.1 +NE,5-6,0.1 +ENE,5-6,0.1 +E,5-6,0.1 +ESE,5-6,0.1 +SE,5-6,0.05 +SSE,5-6,0.05 +S,5-6,0.1 +SSW,5-6,0.05 +SW,5-6,0.2 +WSW,5-6,0.2 +W,5-6,0.4 +WNW,5-6,0.7 +NW,5-6,0.7 +NNW,5-6,0.4 +N,6+,0.1 +NNE,6+,0.1 +NE,6+,0.1 +ENE,6+,0.1 +E,6+,0.1 +ESE,6+,0.05 +SE,6+,0.05 +SSE,6+,0.05 +S,6+,0.05 +SSW,6+,0.1 +SW,6+,0.1 +WSW,6+,0.1 +W,6+,0.9 +WNW,6+,2.2 +NW,6+,1.5 +NNW,6+,0.2 diff --git a/deps/generate_artifacts.jl b/deps/generate_artifacts.jl index 49730cab..3f6bdb93 100644 --- a/deps/generate_artifacts.jl +++ b/deps/generate_artifacts.jl @@ -2,7 +2,7 @@ using Pkg.Artifacts using Downloads -function generate_artifacts(ver="latest",repo="https://github.com/JuliaPlots/PlotlyJS.jl") +function generate_artifacts(ver="latest", repo="https://github.com/JuliaPlots/PlotlyJS.jl") artifacts_toml = joinpath(dirname(@__DIR__), "Artifacts.toml") # if Artifacts.toml does not exist we also do not have to remove it @@ -12,13 +12,15 @@ function generate_artifacts(ver="latest",repo="https://github.com/JuliaPlots/Plo plotly_url = "https://cdn.plot.ly/plotly-$ver.min.js" plotlyartifacts_hash = create_artifact() do artifact_dir + @show artifact_dir Downloads.download(plotschema_url, joinpath(artifact_dir, "plot-schema.json")) Downloads.download(plotly_url, joinpath(artifact_dir, "plotly.min.js")) + cp(joinpath(dirname(@__DIR__), "datasets"), joinpath(artifact_dir, "datasets")) end tarball_hash = archive_artifact(plotlyartifacts_hash, "plotly-artifacts-$ver.tar.gz") - bind_artifact!(artifacts_toml, "plotly-artifacts", plotlyartifacts_hash; download_info = [ + bind_artifact!(artifacts_toml, "plotly-artifacts", plotlyartifacts_hash; download_info=[ ("$repo/releases/download/plotly-artifacts-$ver/plotly-artifacts-$ver.tar.gz", tarball_hash) ]) end diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index dfcd6f5d..a46004dd 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -3,7 +3,7 @@ module PlotlyJS using Reexport @reexport using PlotlyBase using JSON -using REPL, Pkg +using REPL, Pkg, Pkg.Artifacts, DelimitedFiles # stdlib # need to import some functions because methods are meta-generated import PlotlyBase: @@ -20,7 +20,7 @@ using Blink using Pkg.Artifacts using Requires -export plot +export plot, dataset, list_datasets # globals for this package const _pkg_root = dirname(dirname(@__FILE__)) @@ -71,6 +71,30 @@ end @inline get_renderer() = DEFAULT_RENDERER[] +list_datasets() = readdir(joinpath(artifact"plotly-artifacts", "datasets")) +function check_dataset_exists(name::String) + ds = list_datasets() + name_ext = Dict(name => strip(ext, '.') for (name, ext) in splitext.(ds)) + if !haskey(name_ext, name) + error("Unknown dataset $name, known datasets are $(collect(keys(name_ext)))") + end + ds_path = joinpath(artifact"plotly-artifacts", "datasets", "$(name).$(name_ext[name])") + return ds_path +end + +function dataset(name::String)::Dict{String,Any} + ds_path = check_dataset_exists(name) + if endswith(ds_path, "csv") + # if csv, use DelimitedFiles and convert to dict + data = DelimitedFiles.readdlm(ds_path, ',') + return Dict(zip(data[1, :], data[2:end, i] for i in 1:size(data, 2))) + elseif endswith(ds_path, "json") + # use json + return JSON.parsefile(ds_path) + end + error("should not ever get here!!! Please file an issue") +end + function __init__() _build_log = joinpath(_pkg_root, "deps", "build.log") @@ -125,6 +149,19 @@ function __init__() ) end end + + @require CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" begin + function dataset(::Type{CSV.File}, name::String) + ds_path = check_dataset_exists(name) + if !endswith(ds_path, "csv") + error("Can only construct CSV.File from a csv data source") + end + CSV.File(ds_path) + end + @require DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" begin + dataset(::Type{DataFrames.DataFrame}, name::String) = DataFrames.DataFrame(dataset(CSV.File, name)) + end + end end end # module diff --git a/src/display.jl b/src/display.jl index 187640db..50fa4ec3 100644 --- a/src/display.jl +++ b/src/display.jl @@ -1,5 +1,3 @@ -using Pkg.Artifacts - # ----------------------------------------- # # SyncPlot -- sync Plot object with display # # ----------------------------------------- # From 6a2154261f2809877a4d61ccd478b70b4f9b01dd Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 25 Jun 2021 12:21:46 -0400 Subject: [PATCH 38/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index bc5648b6..ba707915 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.16.0" +version = "0.16.1" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" From dcf6799739bd1a84154810dc8da0af8d7842cdff Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 8 Jul 2021 16:23:28 -0400 Subject: [PATCH 39/83] make_subplots --- src/PlotlyJS.jl | 8 ++++++-- src/display.jl | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index a46004dd..619a9fd6 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -11,7 +11,7 @@ import PlotlyBase: redraw!, extendtraces!, prependtraces!, purge!, to_image, download_image, restyle, relayout, update, addtraces, deletetraces, movetraces, redraw, extendtraces, prependtraces, prep_kwargs, sizes, savefig, _tovec, - react, react! + react, react!, add_trace! using WebIO using JSExpr @@ -20,7 +20,7 @@ using Blink using Pkg.Artifacts using Requires -export plot, dataset, list_datasets +export plot, dataset, list_datasets, make_subplots # globals for this package const _pkg_root = dirname(dirname(@__FILE__)) @@ -35,6 +35,10 @@ struct PlotlyJSDisplay <: AbstractDisplay end include("display.jl") include("util.jl") +make_subplots(;kwargs...) = plot(Layout(Subplots(;kwargs...))) + +@doc (@doc Subplots) make_subplots + function docs() schema_path = joinpath(dirname(dirname(@__FILE__)), "deps", "schema.html") if !isfile(schema_path) diff --git a/src/display.jl b/src/display.jl index 50fa4ec3..269b4d92 100644 --- a/src/display.jl +++ b/src/display.jl @@ -182,6 +182,12 @@ function send_command(scope, cmd, args...) nothing end +function add_trace!(p::SyncPlot, trace::GenericTrace; kw...) + add_trace!(p.plot, trace; kw...) + addtraces!(p, trace) +end + + # ----------------------- # # Plotly.js api functions # # ----------------------- # From 7167ce3203014d5ab63602c27de4fca57ade727a Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 8 Jul 2021 16:25:39 -0400 Subject: [PATCH 40/83] add make_subplots --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index ba707915..9133ad26 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.16.1" +version = "0.16.2" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" @@ -20,7 +20,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5" JSON = "0.20, 0.21" -PlotlyBase = "0.6" +PlotlyBase = "0.6.4" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" From df3fb4a518c305b860440a3f32a12664b7ce68a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 9 Jul 2021 13:14:15 +0000 Subject: [PATCH 41/83] Update Artifacts.toml for artifact version 1.58.4 --- Artifacts.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index abb621c6..6dee9a0d 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,6 +1,6 @@ [plotly-artifacts] -git-tree-sha1 = "4fa45e1c116c49318fa3d60adb843b5db5c13069" +git-tree-sha1 = "94b18606d21e46687da7e86f1f63afbfa09ce3fb" [[plotly-artifacts.download]] - sha256 = "a1bb98f5a1b277ff6c62340d075ed4c0f1ea7589ec0d77d5046c36e021820909" + sha256 = "1ca88ece3011889d182885a6a0d6de9439cae5716fd0ea70d3fc711f8e61fd7a" url = "https://github.com/JuliaPlots/PlotlyJS.jl/releases/download/plotly-artifacts-1.58.4/plotly-artifacts-1.58.4.tar.gz" From b4d3f0022c77a5287878d247090107d842fbfab7 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Mon, 12 Jul 2021 15:09:05 -0400 Subject: [PATCH 42/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 9133ad26..26777cac 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.16.2" +version = "0.16.3" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" From 182e5d9f00d3b8da7528bd477237bd100407442a Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 14 Jul 2021 11:49:14 -0400 Subject: [PATCH 43/83] loosen constraint on PlotlyBase to 0.6 --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 26777cac..c946df98 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.16.3" +version = "0.16.4" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" @@ -20,7 +20,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5" JSON = "0.20, 0.21" -PlotlyBase = "0.6.4" +PlotlyBase = "0.6" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" From dab9ecb486d9fab43e180f50c4d6c4a2c1007e95 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 14 Jul 2021 14:41:39 -0400 Subject: [PATCH 44/83] ENH: update docs --- docs/Project.toml | 2 +- docs/src/basics.md | 43 +++++++++++++++++---------- docs/src/building_traces_layouts.md | 31 ++++++++++++++++--- docs/src/examples/3d.md | 18 +++++------ docs/src/examples/finance.md | 6 ++-- docs/src/examples/line_scatter.md | 41 ++++++++++++------------- docs/src/examples/maps.md | 15 ++++------ docs/src/examples/tables.md | 11 ++----- docs/src/examples/violin.md | 4 +-- docs/src/manipulating_plots.md | 46 +++++++++++++++++++++++++++++ docs/src/styles.md | 37 +++++++---------------- docs/src/syncplots.md | 46 ++++++++++++++--------------- examples/3d.jl | 18 +++++------ examples/finance.jl | 6 ++-- examples/line_scatter.jl | 41 ++++++++++++------------- examples/maps.jl | 15 ++++------ examples/tables.jl | 11 ++----- examples/violin.jl | 4 +-- src/PlotlyJS.jl | 2 +- 19 files changed, 218 insertions(+), 179 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index 6764ea93..f4a4091d 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -15,4 +15,4 @@ RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] -PlotlyBase = "0.5" +PlotlyBase = "0.6" diff --git a/docs/src/basics.md b/docs/src/basics.md index 74a1b770..994b5a5f 100644 --- a/docs/src/basics.md +++ b/docs/src/basics.md @@ -3,18 +3,20 @@ [plotly.js][_plotlyjs] figures are constructed by calling the function: ```js -Plotly.newPlot(graphdiv, data, layout) +Plotly.newPlot(divid, data, layout, config, frames) ``` where -- `graphdiv` is an html `div` element where the plot should appear +- `divid` is an html `div` element where the plot should appear - `data` is an array of JSON objects describing the various `trace`s in the visualization - `layout` is a JSON object describing the layout properties of the visualization. +- `config` is a JSON object describing the configuration properties of the visualization. See more detail [here](https://plotly.com/javascript/configuration-options/) +- `frames` can contain data and layout objects, which define any changes to be animated, and a traces object that defines which traces to animate. -The `graphdiv` argument is handled automatically by one of the supported +The `divid` argument is handled automatically by one of the supported frontends, so users of this package will mostly be concerned about constructing -the `data` and `layout` arguments. +the `data`, `layout`, and (optionally) `config` and `frames` arguments. For a complete list of traces and their attributes see the [plotly.js chart attribute reference][_plotlyref]. @@ -25,32 +27,41 @@ containing a version of that reference page. --> ## Julia types -There are three core types for representing a visualization (not counting the -two abstract types): +There are a handful of core Julia types for representing a visualization + +These are ```julia abstract type AbstractTrace end abstract type AbstractLayout end -mutable struct GenericTrace{T<:AbstractDict{Symbol,Any}} <: AbstractTrace - kind::ASCIIString +mutable struct GenericTrace{T <: AbstractDict{Symbol,Any}} <: AbstractTrace fields::T end -mutable struct Layout{T<:AbstractDict{Symbol,Any}} <: AbstractLayout +mutable struct Layout{T <: AbstractDict{Symbol,Any}} <: AbstractLayout fields::T + subplots::_Maybe{Subplots} end -mutable struct Plot{TT<:AbstractTrace} - data::Vector{TT} - layout::AbstractLayout - divid::Base.Random.UUID +mutable struct PlotlyFrame{T <: AbstractDict{Symbol,Any}} <: AbstractPlotlyAttribute + fields::T +end + +mutable struct Plot{TT<:AbstractVector{<:AbstractTrace},TL<:AbstractLayout,TF<:AbstractVector{<:PlotlyFrame}} + data::TT + layout::TL + divid::UUID + config::PlotConfig + frames::TF + style::Style end ``` -The fields of the `Plot` type map 1-1 to the arguments to the `Plotly.newplot` -function +The `data`, `layout`, `divid`, `config`, and `frames` fields of the `Plot` type map 1-1 to the arguments to the `Plotly.newplot` function. + +The `style` argument is unique to Julia and hooks into the Julia based themeing and styling system as described in [the style docs](@ref styles) [_plotlyjs]: https://plotly.com/javascript/ -[_plotlyref]: https://plotly.com/javascript/reference/ +[_plotlyref]: https://plotly.com/julia/reference/ diff --git a/docs/src/building_traces_layouts.md b/docs/src/building_traces_layouts.md index 8a6a2579..3e1a5f07 100644 --- a/docs/src/building_traces_layouts.md +++ b/docs/src/building_traces_layouts.md @@ -15,13 +15,14 @@ A `Plot` instance will have a vector of `trace`s. These should each be a subtype PlotlyJS.jl defines one such subtype: ```julia -mutable struct GenericTrace{T<:AbstractDict{Symbol,Any}} <: AbstractTrace - kind::ASCIIString +mutable struct GenericTrace{T <: AbstractDict{Symbol,Any}} <: AbstractTrace fields::T end ``` -The `kind` field specifies the type of trace and the `fields` is an AbstractDict object that maps trace attributes to their values. +The `fields` is an AbstractDict object that maps trace attributes to their values. + +We create this wrapper around a Dict to provide some convnient syntax as described below. Let's consider an example. Suppose we would like to build the following JSON object: @@ -135,8 +136,9 @@ println(JSON.json(t1, 2)) The `Layout` type is defined as ```julia -mutable struct Layout{T<:AbstractDict{Symbol,Any}} <: AbstractLayout +mutable struct Layout{T <: AbstractDict{Symbol,Any}} <: AbstractLayout fields::T + subplots::_Maybe{Subplots} end ``` @@ -254,3 +256,24 @@ this allows you to _compute_ group specific trace attributes on the fly. See the docstring for `GenericTrace` and the `violin_side_by_side` example on the [Violin](@ref) example page more details. + +### Facets + +!!! note + New in PlotlyBase version 0.6.5 (PlotlyJS version 0.16.4) + +When plotting a `DataFrame` (let's call it `df`), the keyword arguments `facet_row` and `facet_col` allow you to create a matrix of subplots. The rows of this matrix correspond `unique(df[:facet_row])`, where `:facet_row` is a placeholder for the actual value passed as the `facet_row` argument. Similarly, the columns of the matrix of subplots come from `unique(df[:facet_col])`. + +Each subplot will have the same structure, as defined by the keyword arguments passed to `plot`, but will only show data for a single value of `facet_row` and `facet_col` at a time. + +Below is an example of how this works + +```@repl facets +using PlotlyJS, CSV, DataFrames +df = dataset(DataFrame, "tips") + +plot( + df, x=:total_bill, y=:tip, xbingroyp="x", ybingroup="y", kind="histogram2d", + facet_row=:sex, facet_col=:smoker +) +``` diff --git a/docs/src/examples/3d.md b/docs/src/examples/3d.md index 9e424e54..a0b804dd 100644 --- a/docs/src/examples/3d.md +++ b/docs/src/examples/3d.md @@ -141,8 +141,8 @@ function multiple_surface() [9, 9.01, 9, 9.2, 9.23, 9.2], [8.99, 8.99, 8.98, 9.18, 9.2, 9.19], [8.93, 8.97, 8.97, 9.18, 9.2, 9.18]] - z2 = map(x->x.+1, z1) - z3 = map(x->x.-1, z1) + z2 = map(x -> x .+ 1, z1) + z3 = map(x -> x .- 1, z1) trace1 = surface(z=z1, colorscale="Viridis") trace2 = surface(z=z2, showscale=false, opacity=0.9, colorscale="Viridis") trace3 = surface(z=z3, showscale=false, opacity=0.9, colorscale="Viridis") @@ -154,17 +154,17 @@ multiple_surface() ```@example 3d function clustering_alpha_shapes() # load data - iris = dataset("datasets", "iris") - nms = unique(iris[:Species]) + iris = RDatasets.dataset("datasets", "iris") + nms = unique(iris.Species) colors = [RGB(0.89, 0.1, 0.1), RGB(0.21, 0.50, 0.72), RGB(0.28, 0.68, 0.3)] data = GenericTrace[] for (i, nm) in enumerate(nms) - df = iris[iris[:Species] .== nm, :] - x=df[:SepalLength] - y=df[:SepalWidth] - z=df[:PetalLength] + df = iris[iris[!, :Species] .== nm, :] + x = df[!, :SepalLength] + y = df[!, :SepalWidth] + z = df[!, :PetalLength] trace = scatter3d(;name=nm, mode="markers", marker_size=3, marker_color=colors[i], marker_line_width=0, x=x, y=y, z=z) @@ -189,7 +189,7 @@ function clustering_alpha_shapes() showbackground=true, backgroundcolor="rgb(230, 230,230)"), aspectratio=attr(x=1, y=1, z=0.7), - aspectmode = "manual")) + aspectmode="manual")) plot(data, layout) end clustering_alpha_shapes() diff --git a/docs/src/examples/finance.md b/docs/src/examples/finance.md index 8a44248d..7a79ecfb 100644 --- a/docs/src/examples/finance.md +++ b/docs/src/examples/finance.md @@ -1,7 +1,7 @@ # Finance ```@example finance -using PlotlyJS, HTTP, CSV +using PlotlyJS, HTTP, CSV, DataFrames ``` ```@example finance @@ -19,7 +19,7 @@ ohlc1() function ohlc2() function get_ohlc(ticker; kwargs...) res = HTTP.get("https://www.quandl.com/api/v3/datasets/WIKI/$(ticker)/data.csv?start_date=2017-01-01") - df = CSV.read(res.body) + df = DataFrame(CSV.File(res.body)) ohlc(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end @@ -46,7 +46,7 @@ candlestick1() function candlestick2() function get_candlestick(ticker; kwargs...) res = HTTP.get("https://www.quandl.com/api/v3/datasets/WIKI/$(ticker)/data.csv?start_date=2017-01-01") - df = CSV.read(res.body) + df = DataFrame(CSV.File(res.body)) candlestick(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end diff --git a/docs/src/examples/line_scatter.md b/docs/src/examples/line_scatter.md index 0527550b..40362c6c 100644 --- a/docs/src/examples/line_scatter.md +++ b/docs/src/examples/line_scatter.md @@ -1,7 +1,7 @@ # Line Scatter ```@example line_scatter -using PlotlyJS, DataFrames, CSV, Dates +using PlotlyJS, DataFrames, CSV, Dates, HTTP ``` ```@example line_scatter @@ -21,8 +21,8 @@ function linescatter2() text=["A-1", "A-2", "A-3", "A-4", "A-5"], marker_size=12) - trace2 = scatter(;x=1:5+0.5, y=[4, 1, 7, 1, 4], - mode="markers", name= "Team B", + trace2 = scatter(;x=1:5 + 0.5, y=[4, 1, 7, 1, 4], + mode="markers", name="Team B", text=["B-a", "B-b", "B-c", "B-d", "B-e"]) # setting marker.size this way is _equivalent_ to what we did for trace1 trace2["marker"] = Dict(:size => 12) @@ -43,10 +43,10 @@ function linescatter3() text=["A-1", "A-2", "A-3", "A-4", "A-5"], marker_size=12, textfont_family="Raleway, sans-serif") - trace2 = scatter(;x=1:5+0.5, y=[4, 1, 7, 1, 4], - mode="markers+text", name= "Team B", + trace2 = scatter(;x=1:5 + 0.5, y=[4, 1, 7, 1, 4], + mode="markers+text", name="Team B", textposition="bottom center", - text= ["B-a", "B-b", "B-c", "B-d", "B-e"], + text=["B-a", "B-b", "B-c", "B-d", "B-e"], marker_size=12, textfont_family="Times New Roman") data = [trace1, trace2] @@ -92,8 +92,8 @@ function linescatter5() name="Percent of estimated registered voters") # also could have set the marker props above by using a dict trace2["marker"] = Dict(:color => "rgba(204, 204, 204, 0.95)", - :line => Dict(:color=> "rgba(217, 217, 217, 1.0)", - :width=> 1), + :line => Dict(:color => "rgba(217, 217, 217, 1.0)", + :width => 1), :symbol => "circle", :size => 16) @@ -163,17 +163,17 @@ linescatter6() ```@example line_scatter function batman() # reference: https://github.com/alanedelman/18.337_2015/blob/master/Lecture01_0909/The%20Bat%20Curve.ipynb - σ(x) = @. √(1-x.^2) - el(x) = @. 3*σ(x/7) - s(x) = @. 4.2 - 0.5*x - 2.0*σ(0.5*x-0.5) - b(x) = @. σ(abs(2-x)-1) - x.^2/11 + 0.5x - 3 + σ(x) = @. √(1 - x.^2) + el(x) = @. 3 * σ(x / 7) + s(x) = @. 4.2 - 0.5 * x - 2.0 * σ(0.5 * x - 0.5) + b(x) = @. σ(abs(2 - x) - 1) - x.^2 / 11 + 0.5x - 3 c(x) = [1.7, 1.7, 2.6, 0.9] p(i, f; kwargs...) = scatter(;x=[-i; 0.0; i], y=[f(i); NaN; f(i)], marker_color="black", showlegend=false, kwargs...) traces = vcat(p(3:0.1:7, el; name="wings 1"), - p(4:0.1:7, t->-el(t); name="wings 2"), + p(4:0.1:7, t -> -el(t); name="wings 2"), p(1:0.1:3, s; name="Shoulders"), p(0:0.1:4, b; name="Bottom"), p([0, 0.5, 0.8, 1], c; name="head")) @@ -187,23 +187,20 @@ batman() function dumbell() # reference: https://plot.ly/r/dumbbell-plots/ # read Data into dataframe - nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv" - download(url, nm) - df = CSV.read(nm) - rm(nm) + df = DataFrame(CSV.File(HTTP.get(url).body)) # sort dataframe by male earnings df = sort(df, :Men, rev=false) - men = scatter(;y=df[:School], x=df[:Men], mode="markers", name="Men", + men = scatter(;y=df.School, x=df.Men, mode="markers", name="Men", marker=attr(color="blue", size=12)) - women = scatter(;y=df[:School], x=df[:Women], mode="markers", name="Women", + women = scatter(;y=df.School, x=df.Women, mode="markers", name="Women", marker=attr(color="pink", size=12)) lines = map(eachrow(df)) do r - scatter(y=fill(r[:School], 2), x=[r[:Women], r[:Men]], mode="lines", - name=r[:School], showlegend=false, line_color="gray") + scatter(y=fill(r.School, 2), x=[r.Women, r.Men], mode="lines", + name=r.School, showlegend=false, line_color="gray") end data = Base.typed_vcat(GenericTrace, men, women, lines) @@ -295,7 +292,7 @@ function errorbars2() value = [] j = 0 rand = 0 - while j <= num+1 + while j <= num + 1 rand = rand() * mul append!(value, [rand]) j += 1 diff --git a/docs/src/examples/maps.md b/docs/src/examples/maps.md index 7839ceb8..e6ffb3e1 100644 --- a/docs/src/examples/maps.md +++ b/docs/src/examples/maps.md @@ -1,7 +1,7 @@ # Maps ```@example maps -using PlotlyJS, DataFrames, CSV +using PlotlyJS, DataFrames, CSV, HTTP ``` ```@example maps @@ -27,18 +27,15 @@ maps1() ```@example maps function maps2() # read Data into dataframe - nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/2014_us_cities.csv" - download(url, nm) - df = CSV.read(nm) - rm(nm) + df = DataFrame(CSV.File(HTTP.get(url).body)) trace = scattergeo(;locationmode="USA-states", - lat=df[:lat], - lon=df[:lon], + lat=df.lat, + lon=df.lon, hoverinfo="text", - text=[string(x[:name], " pop: ", x[:pop]) for x in eachrow(df)], - marker_size=df[:pop]/50_000, + text=[string(x.name, " pop: ", x.pop) for x in eachrow(df)], + marker_size=df.pop ./ 50_000, marker_line_color="black", marker_line_width=2) geo = attr(scope="usa", projection_type="albers usa", diff --git a/docs/src/examples/tables.md b/docs/src/examples/tables.md index c24084d7..0e2d1abb 100644 --- a/docs/src/examples/tables.md +++ b/docs/src/examples/tables.md @@ -1,7 +1,7 @@ # Tables ```@example tables -using PlotlyJS, DataFrames, CSV +using PlotlyJS, DataFrames, CSV, HTTP ``` ```@example tables @@ -80,19 +80,14 @@ table2a() ```@example tables function table3() - nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" - download(url, nm) - df = CSV.read(nm) - rm(nm) - - data = Array(df) + df = DataFrame(CSV.File(HTTP.get(url).body)) trace = table( columnwidth=[200, 500, 600, 600, 400, 400, 600, 600, 600], # columnorder=0:9, header=attr( - values=map(x-> replace(string(x), '_' => '-'), names(df)), + values=map(x -> replace(string(x), '_' => '-'), names(df)), align="center", line=attr(width=1, color="rgb(50, 50, 50)"), fill_color=["rgb(235, 100, 230)"], diff --git a/docs/src/examples/violin.md b/docs/src/examples/violin.md index 6af36717..c793f2a9 100644 --- a/docs/src/examples/violin.md +++ b/docs/src/examples/violin.md @@ -90,7 +90,7 @@ violin_old_faithful() ```@example violin function violin_side_by_side() # requires RDatasets and DataFrames - tips = dataset("reshape2", "tips") + tips = RDatasets.dataset("reshape2", "tips") parts = zip( ("Female", "Male"), ("positive", "negative"), @@ -99,7 +99,7 @@ function violin_side_by_side() ) traces = GenericTrace[] for (sex, side, color, pointpos) in parts - sub_tips = tips[tips[:Sex] .== sex, :] + sub_tips = tips[tips[!, :Sex] .== sex, :] sub_traces = violin(sub_tips, group=:Day, x=:TotalBill, y0=(df) -> df[1, :Day], diff --git a/docs/src/manipulating_plots.md b/docs/src/manipulating_plots.md index 9757a1dc..4f267464 100644 --- a/docs/src/manipulating_plots.md +++ b/docs/src/manipulating_plots.md @@ -90,6 +90,52 @@ Finally, we can make a 2x2 grid of subplots: p3 p4] ``` +!!! note + New in PlotlyBase version 0.6.5 (PlotlyJS version 0.16.4) + + +As of version 0.16.4, we can also create a non-rectangular grid of subplots using this syntax. + +For example: + +```@example subplots +[p1 p2 p3 p4; p2 p4; p1] +``` + +### `make_subplots` + +!!! note + New in PlotlyBase version 0.6.4 (PlotlyJS version 0.16.3) + +As of version 0.16.3, there is another option for creaing subplots: the `make_subplots` function + +This function takes a number of keyword arguments and allows fine grained control over the layout and labels for subplots. + +Consider the example below: + +```@example subplots +p = make_subplots( + rows=5, cols=2, + specs=[Spec() Spec(rowspan=2) + Spec() missing + Spec(rowspan=2, colspan=2) missing + missing missing + Spec() Spec()] +) + +add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(1,1)"), row=1, col=1) +add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(1,2)"), row=1, col=2) +add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(2,1)"), row=2, col=1) +add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(3,1)"), row=3, col=1) +add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(5,1)"), row=5, col=1) +add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(5,2)"), row=5, col=2) + +relayout!(p, height=600, width=600, title_text="specs examples") +p.plot +``` + +More examples are being worked on at this time (2021-07-14), but for now you can view the docs for [`make_subplots`](@ref) to get an idea of what else is possible. + ## Saving figures diff --git a/docs/src/styles.md b/docs/src/styles.md index da44a6de..27dcf873 100644 --- a/docs/src/styles.md +++ b/docs/src/styles.md @@ -25,13 +25,14 @@ used to set style properties that should be cycled through for each trace. For example, to have all traces alternate between being colored green and red, I could define: -```julia +```@example styles +using PlotlyJS # hide mystyle = Style(global_trace=attr(marker_color=["green", "red"])) ``` If I were then to define a plot -```julia +```@example styles p = plot(rand(10, 3), style=mystyle) ``` @@ -40,7 +41,7 @@ The first and third plots would be green, while the second would be red. As usual, if the `marker_color` attribute on a trace was already set, then it will not be altered. For example: -```julia +```@example styles p = plot( [ scatter(y=rand(4)), @@ -55,7 +56,7 @@ p = plot( Then the first and fourth traces would be red, the second black, and the third green. -## Defining `Style`s +## [Defining `Style`s](@id styles) There are 3 ways to define a `Style`: @@ -65,7 +66,7 @@ To define a brand new style, you simply construct one or more of the fields and assign it using the keyword argument `Style` constructor. For example, this is how the `ggplot` style is defined (as of time of writing): -```julia +```@example styles ggplot = let axis = attr(showgrid=true, gridcolor="white", linewidth=1.0, linecolor="white", titlefont_color="#555555", @@ -90,14 +91,6 @@ ggplot = let end ``` -When displayed in the REPL we see the following: - -``` -Style with: - - layout with fields font, margin, paper_bgcolor, plot_bgcolor, titlefont, xaxis, and yaxis - - global_trace: PlotlyAttribute with field marker -``` - Notice that we didn't have to define the `trace` field. When building new `Style`s you only need to define the fields of the `Style` type that you actually use in your style. @@ -109,21 +102,11 @@ style. Suppose that I liked the `ggplot` style, but wanted to make sure that the marker symbol on scatter traces was always a square. I could define the following style: -```julia +```@example styles square_ggplot = Style(ggplot, trace=Dict(:scatter => attr(marker_symbol="square"))) ``` -When displayed in the REPL we see the following: - -``` -Style with: - - layout with fields font, margin, paper_bgcolor, plot_bgcolor, titlefont, xaxis, and yaxis - - global_trace: PlotlyAttribute with field marker - - trace: - - scatter: PlotlyAttribute with field marker -``` - Notice that all the information for `color_cycle`, `layout` and `global_trace` is the same as in the `ggplot` case above, but we now have the addition of another section for the `trace` field as it is no longer empty. @@ -137,14 +120,14 @@ title to be large, say at a level of 20. We might want to apply this transformation to multiple existing styles. One way we could achieve this is by defining -```julia +```@example styles big_title = Style(layout=Layout(titlefont_size=20)) ``` and then composing `big_title` with an existing `Style` (e.g. `ggplot` from above) by calling -```julia +```@example styles big_ggplot = Style(ggplot, big_title) ``` @@ -159,7 +142,7 @@ great, but doesn't actually show off the power of composing `Style`s. Composition becomes more powerful when you use more than two styles. Consider the following example: -```julia +```@example styles square = Style(trace=Dict(:scatter => attr(marker_symbol="square"))) big_square_ggplot = Style(ggplot, square, big_title) ``` diff --git a/docs/src/syncplots.md b/docs/src/syncplots.md index ee5d63f1..0e4a122c 100644 --- a/docs/src/syncplots.md +++ b/docs/src/syncplots.md @@ -13,10 +13,13 @@ We'll also discuss how to integrate with various frontends. Recall that the definition of the `Plot` object is ```julia -mutable struct Plot{TT<:AbstractTrace} - data::Vector{TT} - layout::AbstractLayout - divid::Base.Random.UUID +mutable struct Plot{TT<:AbstractVector{<:AbstractTrace},TL<:AbstractLayout,TF<:AbstractVector{<:PlotlyFrame}} + data::TT + layout::TL + frames::TF + divid::UUID + config::PlotConfig + style::Style end ``` @@ -56,19 +59,13 @@ PlotlyBase.Plot Especially convenient is the `group` keyword argument when calling `Plot(::AbstractDataFrame, ... ; ...)`. Here is an example below: -```@repl iris_group +```@example iris_group using PlotlyJS # hide using RDatasets -iris = dataset("datasets", "iris"); +iris = RDatasets.dataset("datasets", "iris"); p = Plot(iris, x=:SepalLength, y=:SepalWidth, mode="markers", marker_size=8, group=:Species) ``` -which would result in the following plot - -```@example iris_group -p -``` - ## `SyncPlot`s A `Plot` is a pure Julia object and doesn't interact with plotly.js by itself. @@ -85,8 +82,7 @@ follows: mutable struct SyncPlot plot::PlotlyBase.Plot scope::Scope - events::Dict - options::Dict + window::Union{Nothing,Blink.Window} end ``` @@ -96,9 +92,7 @@ plot (the `Plot` instance) in sync with a plot with a frontend. !!! note The `Plot` function will create a new `Plot` object and the `plot` function will create a new `SyncPlot`. The `plot` function passes all arguments - (except the `options` keyword argument -- see below) to construct a `Plot` - and then sets up the display. All `Plot` methods are also defined for - `plot` + to construct a `Plot` and then sets up the display. All `Plot` methods are also defined for `plot` By leveraging WebIO.jl we can render our figures anywhere WebIO can render. At time of writing this includes [Jupyter notebooks](https://jupyter.org/), @@ -164,16 +158,20 @@ with business logic implemented entirely in Julia!. ### Display configuration -When calling `plot` the `options` keyword argument is given special treatment. -It should be an instance of `AbstractDict` and its contents are passed as -display options to the plotly.js library. For details on which options are -supported, see the [plotly.js documentation on the -subject](https://plotly.com/javascriptconfiguration-options/). +!!! note + New in PlotlyBase version 0.6.4 (PlotlyJS version 0.16.3) + + +When calling `plot` or `Plot`, we can specify some configuration options using the `config` keyword argument. + +The `config` argument must be set to an instance of `PlotConfig`, which should be constructed using keyword arguments. As an example, if we were to execute the following code, we would see a static chart (no hover information or ability to zoom/pan) with 4 lines instead of an interactive one: -```julia -plot(rand(10, 4), options=Dict(:staticPlot => true)) +```example plot_config +Plot(rand(10, 4), config=PlotConfig(staticPlot=true)) ``` + +See the API docs for [`PlotConfig`](@ref) for a full list of options. diff --git a/examples/3d.jl b/examples/3d.jl index 2257bf3a..051cf73d 100644 --- a/examples/3d.jl +++ b/examples/3d.jl @@ -130,8 +130,8 @@ function multiple_surface() [9, 9.01, 9, 9.2, 9.23, 9.2], [8.99, 8.99, 8.98, 9.18, 9.2, 9.19], [8.93, 8.97, 8.97, 9.18, 9.2, 9.18]] - z2 = map(x->x.+1, z1) - z3 = map(x->x.-1, z1) + z2 = map(x -> x .+ 1, z1) + z3 = map(x -> x .- 1, z1) trace1 = surface(z=z1, colorscale="Viridis") trace2 = surface(z=z2, showscale=false, opacity=0.9, colorscale="Viridis") trace3 = surface(z=z3, showscale=false, opacity=0.9, colorscale="Viridis") @@ -140,17 +140,17 @@ end function clustering_alpha_shapes() # load data - iris = dataset("datasets", "iris") - nms = unique(iris[:Species]) + iris = RDatasets.dataset("datasets", "iris") + nms = unique(iris.Species) colors = [RGB(0.89, 0.1, 0.1), RGB(0.21, 0.50, 0.72), RGB(0.28, 0.68, 0.3)] data = GenericTrace[] for (i, nm) in enumerate(nms) - df = iris[iris[:Species] .== nm, :] - x=df[:SepalLength] - y=df[:SepalWidth] - z=df[:PetalLength] + df = iris[iris[!, :Species] .== nm, :] + x = df[!, :SepalLength] + y = df[!, :SepalWidth] + z = df[!, :PetalLength] trace = scatter3d(;name=nm, mode="markers", marker_size=3, marker_color=colors[i], marker_line_width=0, x=x, y=y, z=z) @@ -175,7 +175,7 @@ function clustering_alpha_shapes() showbackground=true, backgroundcolor="rgb(230, 230,230)"), aspectratio=attr(x=1, y=1, z=0.7), - aspectmode = "manual")) + aspectmode="manual")) plot(data, layout) end diff --git a/examples/finance.jl b/examples/finance.jl index 61ed3fd0..ede3a16b 100644 --- a/examples/finance.jl +++ b/examples/finance.jl @@ -1,4 +1,4 @@ -using PlotlyJS, HTTP, CSV +using PlotlyJS, HTTP, CSV, DataFrames function ohlc1() t = ohlc(open=[33.0, 33.3, 33.5, 33.0, 34.1], @@ -11,7 +11,7 @@ end function ohlc2() function get_ohlc(ticker; kwargs...) res = HTTP.get("https://www.quandl.com/api/v3/datasets/WIKI/$(ticker)/data.csv?start_date=2017-01-01") - df = CSV.read(res.body) + df = DataFrame(CSV.File(res.body)) ohlc(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end @@ -32,7 +32,7 @@ end function candlestick2() function get_candlestick(ticker; kwargs...) res = HTTP.get("https://www.quandl.com/api/v3/datasets/WIKI/$(ticker)/data.csv?start_date=2017-01-01") - df = CSV.read(res.body) + df = DataFrame(CSV.File(res.body)) candlestick(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end diff --git a/examples/line_scatter.jl b/examples/line_scatter.jl index d0c7fc0b..e9b1bb04 100644 --- a/examples/line_scatter.jl +++ b/examples/line_scatter.jl @@ -1,4 +1,4 @@ -using PlotlyJS, DataFrames, CSV, Dates +using PlotlyJS, DataFrames, CSV, Dates, HTTP function linescatter1() trace1 = scatter(;x=1:4, y=[10, 15, 13, 17], mode="markers") @@ -13,8 +13,8 @@ function linescatter2() text=["A-1", "A-2", "A-3", "A-4", "A-5"], marker_size=12) - trace2 = scatter(;x=1:5+0.5, y=[4, 1, 7, 1, 4], - mode="markers", name= "Team B", + trace2 = scatter(;x=1:5 + 0.5, y=[4, 1, 7, 1, 4], + mode="markers", name="Team B", text=["B-a", "B-b", "B-c", "B-d", "B-e"]) # setting marker.size this way is _equivalent_ to what we did for trace1 trace2["marker"] = Dict(:size => 12) @@ -32,10 +32,10 @@ function linescatter3() text=["A-1", "A-2", "A-3", "A-4", "A-5"], marker_size=12, textfont_family="Raleway, sans-serif") - trace2 = scatter(;x=1:5+0.5, y=[4, 1, 7, 1, 4], - mode="markers+text", name= "Team B", + trace2 = scatter(;x=1:5 + 0.5, y=[4, 1, 7, 1, 4], + mode="markers+text", name="Team B", textposition="bottom center", - text= ["B-a", "B-b", "B-c", "B-d", "B-e"], + text=["B-a", "B-b", "B-c", "B-d", "B-e"], marker_size=12, textfont_family="Times New Roman") data = [trace1, trace2] @@ -75,8 +75,8 @@ function linescatter5() name="Percent of estimated registered voters") # also could have set the marker props above by using a dict trace2["marker"] = Dict(:color => "rgba(204, 204, 204, 0.95)", - :line => Dict(:color=> "rgba(217, 217, 217, 1.0)", - :width=> 1), + :line => Dict(:color => "rgba(217, 217, 217, 1.0)", + :width => 1), :symbol => "circle", :size => 16) @@ -140,17 +140,17 @@ end function batman() # reference: https://github.com/alanedelman/18.337_2015/blob/master/Lecture01_0909/The%20Bat%20Curve.ipynb - σ(x) = @. √(1-x.^2) - el(x) = @. 3*σ(x/7) - s(x) = @. 4.2 - 0.5*x - 2.0*σ(0.5*x-0.5) - b(x) = @. σ(abs(2-x)-1) - x.^2/11 + 0.5x - 3 + σ(x) = @. √(1 - x.^2) + el(x) = @. 3 * σ(x / 7) + s(x) = @. 4.2 - 0.5 * x - 2.0 * σ(0.5 * x - 0.5) + b(x) = @. σ(abs(2 - x) - 1) - x.^2 / 11 + 0.5x - 3 c(x) = [1.7, 1.7, 2.6, 0.9] p(i, f; kwargs...) = scatter(;x=[-i; 0.0; i], y=[f(i); NaN; f(i)], marker_color="black", showlegend=false, kwargs...) traces = vcat(p(3:0.1:7, el; name="wings 1"), - p(4:0.1:7, t->-el(t); name="wings 2"), + p(4:0.1:7, t -> -el(t); name="wings 2"), p(1:0.1:3, s; name="Shoulders"), p(0:0.1:4, b; name="Bottom"), p([0, 0.5, 0.8, 1], c; name="head")) @@ -161,23 +161,20 @@ end function dumbell() # reference: https://plot.ly/r/dumbbell-plots/ # read Data into dataframe - nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv" - download(url, nm) - df = CSV.read(nm) - rm(nm) + df = DataFrame(CSV.File(HTTP.get(url).body)) # sort dataframe by male earnings df = sort(df, :Men, rev=false) - men = scatter(;y=df[:School], x=df[:Men], mode="markers", name="Men", + men = scatter(;y=df.School, x=df.Men, mode="markers", name="Men", marker=attr(color="blue", size=12)) - women = scatter(;y=df[:School], x=df[:Women], mode="markers", name="Women", + women = scatter(;y=df.School, x=df.Women, mode="markers", name="Women", marker=attr(color="pink", size=12)) lines = map(eachrow(df)) do r - scatter(y=fill(r[:School], 2), x=[r[:Women], r[:Men]], mode="lines", - name=r[:School], showlegend=false, line_color="gray") + scatter(y=fill(r.School, 2), x=[r.Women, r.Men], mode="lines", + name=r.School, showlegend=false, line_color="gray") end data = Base.typed_vcat(GenericTrace, men, women, lines) @@ -263,7 +260,7 @@ function errorbars2() value = [] j = 0 rand = 0 - while j <= num+1 + while j <= num + 1 rand = rand() * mul append!(value, [rand]) j += 1 diff --git a/examples/maps.jl b/examples/maps.jl index c5f72185..c4913432 100644 --- a/examples/maps.jl +++ b/examples/maps.jl @@ -1,4 +1,4 @@ -using PlotlyJS, DataFrames, CSV +using PlotlyJS, DataFrames, CSV, HTTP function maps1() marker = attr(size=[20, 30, 15, 10], @@ -19,18 +19,15 @@ end function maps2() # read Data into dataframe - nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/2014_us_cities.csv" - download(url, nm) - df = CSV.read(nm) - rm(nm) + df = DataFrame(CSV.File(HTTP.get(url).body)) trace = scattergeo(;locationmode="USA-states", - lat=df[:lat], - lon=df[:lon], + lat=df.lat, + lon=df.lon, hoverinfo="text", - text=[string(x[:name], " pop: ", x[:pop]) for x in eachrow(df)], - marker_size=df[:pop]/50_000, + text=[string(x.name, " pop: ", x.pop) for x in eachrow(df)], + marker_size=df.pop ./ 50_000, marker_line_color="black", marker_line_width=2) geo = attr(scope="usa", projection_type="albers usa", diff --git a/examples/tables.jl b/examples/tables.jl index 09170784..4dda39f9 100644 --- a/examples/tables.jl +++ b/examples/tables.jl @@ -1,4 +1,4 @@ -using PlotlyJS, DataFrames, CSV +using PlotlyJS, DataFrames, CSV, HTTP function table1() values = [ @@ -68,19 +68,14 @@ end function table3() - nm = tempname() url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" - download(url, nm) - df = CSV.read(nm) - rm(nm) - - data = Array(df) + df = DataFrame(CSV.File(HTTP.get(url).body)) trace = table( columnwidth=[200, 500, 600, 600, 400, 400, 600, 600, 600], # columnorder=0:9, header=attr( - values=map(x-> replace(string(x), '_' => '-'), names(df)), + values=map(x -> replace(string(x), '_' => '-'), names(df)), align="center", line=attr(width=1, color="rgb(50, 50, 50)"), fill_color=["rgb(235, 100, 230)"], diff --git a/examples/violin.jl b/examples/violin.jl index 16540306..6569a35f 100644 --- a/examples/violin.jl +++ b/examples/violin.jl @@ -78,7 +78,7 @@ end function violin_side_by_side() # requires RDatasets and DataFrames - tips = dataset("reshape2", "tips") + tips = RDatasets.dataset("reshape2", "tips") parts = zip( ("Female", "Male"), ("positive", "negative"), @@ -87,7 +87,7 @@ function violin_side_by_side() ) traces = GenericTrace[] for (sex, side, color, pointpos) in parts - sub_tips = tips[tips[:Sex] .== sex, :] + sub_tips = tips[tips[!, :Sex] .== sex, :] sub_traces = violin(sub_tips, group=:Day, x=:TotalBill, y0=(df) -> df[1, :Day], diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 619a9fd6..ca02931a 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -36,7 +36,7 @@ include("display.jl") include("util.jl") make_subplots(;kwargs...) = plot(Layout(Subplots(;kwargs...))) - + @doc (@doc Subplots) make_subplots function docs() From e32481501311bbdfc180e9f8c20c69f8bb89356a Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 15 Jul 2021 13:52:23 -0400 Subject: [PATCH 45/83] update layout --- src/display.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display.jl b/src/display.jl index 269b4d92..e458cf7c 100644 --- a/src/display.jl +++ b/src/display.jl @@ -210,7 +210,7 @@ end function relayout!(plt::SyncPlot, update::AbstractDict=Dict(); kwargs...) relayout!(plt.plot, update; kwargs...) - send_command(plt.scope, :relayout, merge(update, prep_kwargs(kwargs))) + update!(plt, layout=plt.plot.layout) end function react!(plt::SyncPlot, data::AbstractVector{<:AbstractTrace}, layout::Layout) From 3d586922b21617e80f66ca51237ce5ba28134252 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 16 Jul 2021 14:01:15 +0000 Subject: [PATCH 46/83] remove Base.vect overload --- .devcontainer/devcontainer.json | 10 ++++++++++ Project.toml | 6 +++--- src/util.jl | 7 +++---- 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..bb8eaaf8 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,10 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/julia +// See https://github.com/julia-vscode/julia-devcontainer/blob/master/Dockerfile for image contents +{ + "name": "Julia (Community)", + "image": "ghcr.io/julia-vscode/julia-devcontainer", + "extensions": ["julialang.language-julia"], + "postCreateCommand": "/julia-devcontainer-scripts/postcreate.jl", + "remoteUser": "vscode" +} diff --git a/Project.toml b/Project.toml index c946df98..b61515e4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.16.4" +version = "0.17.0" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" @@ -20,11 +20,11 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5" JSON = "0.20, 0.21" -PlotlyBase = "0.6" +PlotlyBase = "0.6, 0.7" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" -julia = "1.3, 1.4, 1.5" +julia = "1.3, 1.4, 1.5, 1.6" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/util.jl b/src/util.jl index d1371940..0f7a16f8 100644 --- a/src/util.jl +++ b/src/util.jl @@ -4,11 +4,10 @@ JSON.lower(sp::SyncPlot) = sp.plot PlotlyBase._is3d(p::SyncPlot) = _is3d(p.plot) # subplot methods on syncplot -Base.hcat(sps::SyncPlot...) = SyncPlot(hcat([sp.plot for sp in sps]...)) -Base.vcat(sps::SyncPlot...) = SyncPlot(vcat([sp.plot for sp in sps]...)) -Base.vect(sps::SyncPlot...) = vcat(sps...) +Base.hcat(sps::SyncPlot...) = SyncPlot(hcat(Plot[sp.plot for sp in sps]...)) +Base.vcat(sps::SyncPlot...) = SyncPlot(vcat(Plot[sp.plot for sp in sps]...)) Base.hvcat(rows::Tuple{Vararg{Int}}, sps::SyncPlot...) = - SyncPlot(hvcat(rows, [sp.plot for sp in sps]...)) + SyncPlot(hvcat(rows, Plot[sp.plot for sp in sps]...)) function PlotlyBase.add_recession_bands!(p::SyncPlot; kwargs...) new_shapes = add_recession_bands!(p.plot; kwargs...) From e47fe852d8c830eec74d6bc2e86300d6660d129c Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 16 Jul 2021 09:32:50 -0600 Subject: [PATCH 47/83] update to plotly 2.x! --- .github/workflows/artifacts.yml | 18 ++++++------ .gitignore | 1 + deps/build.jl | 6 ++-- deps/find_attr_groups.jl | 51 --------------------------------- 4 files changed, 12 insertions(+), 64 deletions(-) delete mode 100644 deps/find_attr_groups.jl diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 8a64bed6..b6359b17 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -2,7 +2,7 @@ name: Artifacts -# Controls when the action will run. +# Controls when the action will run. on: # Allows you to run this workflow manually from the Actions tab, do not run automatically workflow_dispatch: @@ -14,9 +14,9 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest # The plotly version. Bumping this environment variable should do the trick - env: - PLOTLY_VER: 1.58.4 - + env: + PLOTLY_VER: 2.2.1 + # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -24,29 +24,29 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 # otherwise, you will failed to push refs to dest repo - + - name: "Set up Julia" uses: julia-actions/setup-julia@v1 with: version: 1.6.0 - + - name: "Get artifact" run: | cd $GITHUB_WORKSPACE julia -e 'include(joinpath(pwd(),"deps","generate_artifacts.jl")); generate_artifacts("'"$PLOTLY_VER"'","'"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"'")' - + - name: "Commit updated Artifacts.toml" run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git commit -m "Update Artifacts.toml for artifact version $PLOTLY_VER" "Artifacts.toml" - + - name: "Push changes" uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref }} - + - name: "Release" uses: ncipollo/release-action@v1 with: diff --git a/.gitignore b/.gitignore index ea5fb485..0cdd2010 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ assets/node_modules/ assets/package-lock.json deps/build.log Manifest.toml +.DS_Store diff --git a/deps/build.jl b/deps/build.jl index 28eb1df9..629cf390 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,9 +1,7 @@ const _pkg_root = dirname(dirname(@__FILE__)) -const _pkg_deps = joinpath(_pkg_root,"deps") -const _pkg_assets = joinpath(_pkg_root,"assets") +const _pkg_deps = joinpath(_pkg_root, "deps") +const _pkg_assets = joinpath(_pkg_root, "assets") !isdir(_pkg_assets) && mkdir(_pkg_assets) include("make_schema_docs.jl") -include("find_attr_groups.jl") -AttrGroups.main() diff --git a/deps/find_attr_groups.jl b/deps/find_attr_groups.jl deleted file mode 100644 index 27aaabe2..00000000 --- a/deps/find_attr_groups.jl +++ /dev/null @@ -1,51 +0,0 @@ -module AttrGroups - -using JSON -using DelimitedFiles -using Pkg.Artifacts - -_symbol_dict(x) = x -_symbol_dict(d::AbstractDict) = - Dict{Symbol,Any}([(Symbol(k), _symbol_dict(v)) for (k, v) in d]) - -function main() - - data = _symbol_dict(JSON.parsefile(joinpath(artifact"plotly-artifacts", "plot-schema.json")))[:schema] - - nms = Set{Symbol}() - function add_to_names!(d::AbstractDict) - foreach(add_to_names!, keys(d)) - foreach(add_to_names!, values(d)) - nothing - end - add_to_names!(s::Symbol) = push!(nms, s) - add_to_names!(x) = nothing - - add_to_names!(data[:layout][:layoutAttributes]) - for (_, v) in data[:traces] - add_to_names!(v) - end - - _UNDERSCORE_ATTRS = collect( - filter( - x-> occursin(string(x), "_") && !startswith(string(x), "_"), - nms - ) - ) - - _SRC_ATTRS = collect(filter(x -> endswith(string(x), "src"), nms)) - - open(joinpath(@__DIR__, "src_attrs.csv"), "w") do f - writedlm(f, map(string, _SRC_ATTRS)) - end - - open(joinpath(@__DIR__, "underscore_attrs.csv"), "w") do f - writedlm(f, map(string, _UNDERSCORE_ATTRS)) - end - - _UNDERSCORE_ATTRS, _SRC_ATTRS -end - - - -end # module From 39479f6acc376bd9e35a167d54833c7957866faa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 16 Jul 2021 15:44:04 +0000 Subject: [PATCH 48/83] Update Artifacts.toml for artifact version 2.2.1 --- Artifacts.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 6dee9a0d..4c8aaf52 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,6 +1,6 @@ [plotly-artifacts] -git-tree-sha1 = "94b18606d21e46687da7e86f1f63afbfa09ce3fb" +git-tree-sha1 = "bc8e1450d988edc838c4f4bbe03439b715c6215f" [[plotly-artifacts.download]] - sha256 = "1ca88ece3011889d182885a6a0d6de9439cae5716fd0ea70d3fc711f8e61fd7a" - url = "https://github.com/JuliaPlots/PlotlyJS.jl/releases/download/plotly-artifacts-1.58.4/plotly-artifacts-1.58.4.tar.gz" + sha256 = "8d0799af112772a95b6490f763cf505128dd83be8f59e13aa27378a92f7d5a38" + url = "https://github.com/JuliaPlots/PlotlyJS.jl/releases/download/plotly-artifacts-2.2.1/plotly-artifacts-2.2.1.tar.gz" From 256f8f3a615c84f8c89894c3eea7be9eb2e907e3 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 16 Jul 2021 09:46:19 -0600 Subject: [PATCH 49/83] bump version number to use plotly 2.x! --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index b61515e4..7061f34b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.17.0" +version = "0.18.0" [deps] Blink = "ad839575-38b3-5650-b840-f874b8c74a25" From cbd87cfc3123c0a46dd0425f7bc14de12483a8b9 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 23 Jul 2021 20:57:52 -0400 Subject: [PATCH 50/83] udpate plotly.js version in artifacts --- .github/workflows/artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index b6359b17..40ac8504 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest # The plotly version. Bumping this environment variable should do the trick env: - PLOTLY_VER: 2.2.1 + PLOTLY_VER: 2.3.0 # Steps represent a sequence of tasks that will be executed as part of the job steps: From 64f90834a6ea1a2d7a9ca74e7afc215df84aeedd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 24 Jul 2021 02:55:30 +0000 Subject: [PATCH 51/83] Update Artifacts.toml for artifact version 2.3.0 --- Artifacts.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 4c8aaf52..8043d489 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,6 +1,6 @@ [plotly-artifacts] -git-tree-sha1 = "bc8e1450d988edc838c4f4bbe03439b715c6215f" +git-tree-sha1 = "9f06f8e2fd71afece4d3fc49d36438b9a6b5c1ad" [[plotly-artifacts.download]] - sha256 = "8d0799af112772a95b6490f763cf505128dd83be8f59e13aa27378a92f7d5a38" - url = "https://github.com/JuliaPlots/PlotlyJS.jl/releases/download/plotly-artifacts-2.2.1/plotly-artifacts-2.2.1.tar.gz" + sha256 = "6942d56622e1585cc5aee576d6d465ac35e05a4aecb521815d991ecb0829a76d" + url = "https://github.com/JuliaPlots/PlotlyJS.jl/releases/download/plotly-artifacts-2.3.0/plotly-artifacts-2.3.0.tar.gz" From 1872f24f3c54992cc34b5bb892df71af1dd765f7 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Sat, 24 Jul 2021 14:28:12 -0400 Subject: [PATCH 52/83] migrate kaleido support from PlotlyBase over to PlotlyJS --- Project.toml | 4 +- src/PlotlyJS.jl | 17 +--- src/kaleido.jl | 219 +++++++++++++++++++++++++++++++++++++++++++++++ test/kaleido.jl | 17 ++++ test/runtests.jl | 1 + 5 files changed, 244 insertions(+), 14 deletions(-) create mode 100644 src/kaleido.jl create mode 100644 test/kaleido.jl diff --git a/Project.toml b/Project.toml index 7061f34b..093d82be 100644 --- a/Project.toml +++ b/Project.toml @@ -4,10 +4,12 @@ authors = ["Spencer Lyon "] version = "0.18.0" [deps] +Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" Blink = "ad839575-38b3-5650-b840-f874b8c74a25" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" JSExpr = "97c1335a-c9c5-57fe-bc5d-ec35cebe8660" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +Kaleido_jll = "f7e6163d-2fa5-5f23-b69c-1db539e41963" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5" @@ -20,7 +22,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5" JSON = "0.20, 0.21" -PlotlyBase = "0.6, 0.7" +PlotlyBase = "0.6, ^0.7" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index ca02931a..7be6b29f 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -1,5 +1,6 @@ module PlotlyJS +using Base64 using Reexport @reexport using PlotlyBase using JSON @@ -34,6 +35,7 @@ struct PlotlyJSDisplay <: AbstractDisplay end # include the rest of the core parts of the package include("display.jl") include("util.jl") +include("kaleido.jl") make_subplots(;kwargs...) = plot(Layout(Subplots(;kwargs...))) @@ -50,19 +52,6 @@ function docs() Blink.content!(w, "html", open(f -> read(f, String), schema_path), fade=false, async=false) end -PlotlyBase.savefig(p::SyncPlot, a...; k...) = savefig(p.plot, a...; k...) -PlotlyBase.savefig(io::IO, p::SyncPlot, a...; k...) = savefig(io, p.plot, a...; k...) - -for (mime, fmt) in PlotlyBase._KALEIDO_MIMES - @eval function Base.show( - io::IO, ::MIME{Symbol($mime)}, plt::SyncPlot, - width::Union{Nothing,Int}=nothing, - height::Union{Nothing,Int}=nothing, - scale::Union{Nothing,Real}=nothing, - ) - savefig(io, plt.plot, format=$fmt) - end -end @enum RENDERERS BLINK IJULIA BROWSER DOCS @@ -106,6 +95,8 @@ function __init__() @warn("Warnings were generated during the last build of PlotlyJS: please check the build log at $_build_log") end + @async _start_kaleido_process() + if !isfile(_js_path) @info("plotly.js javascript libary not found -- downloading now") include(joinpath(_pkg_root, "deps", "build.jl")) diff --git a/src/kaleido.jl b/src/kaleido.jl new file mode 100644 index 00000000..746b6b8f --- /dev/null +++ b/src/kaleido.jl @@ -0,0 +1,219 @@ +using Kaleido_jll + +mutable struct Pipes + stdin::Pipe + stdout::Pipe + stderr::Pipe + proc::Base.Process + Pipes() = new() +end + +const P = Pipes() + +const ALL_FORMATS = ["png", "jpeg", "webp", "svg", "pdf", "eps", "json"] +const TEXT_FORMATS = ["svg", "json", "eps"] + +function _restart_kaleido_process() + if isdefined(P, :proc) && process_running(P.proc) + kill(P.proc) + end + _start_kaleido_process() +end + + +function _start_kaleido_process() + global P + try + BIN = let + art = Kaleido_jll.artifact_dir + cmd = if Sys.islinux() || Sys.isapple() + joinpath(art, "kaleido") + else + # Windows + joinpath(art, "kaleido.cmd") + end + no_sandbox = "--no-sandbox" + Sys.isapple() ? `$(cmd) plotly --disable-gpu --single-process` : `$(cmd) plotly --disable-gpu $(no_sandbox)` + end + kstdin = Pipe() + kstdout = Pipe() + kstderr = Pipe() + kproc = run(pipeline(BIN, + stdin=kstdin, stdout=kstdout, stderr=kstderr), + wait=false) + process_running(kproc) || error("There was a problem startink up kaleido.") + close(kstdout.in) + close(kstderr.in) + close(kstdin.out) + Base.start_reading(kstderr.out) + P.stdin = kstdin + P.stdout = kstdout + P.stderr = kstderr + P.proc = kproc + + # read startup message and check for errors + res = readline(P.stdout) + if length(res) == 0 + error("Could not start Kaleido process") + end + + js = JSON.parse(res) + if get(js, "code", 0) != 0 + error("Could not start Kaleido process") + end + catch e + @warn "Kaleido is not available on this system. Julia will be unable to save images of any plots." + @warn "$e" + end + nothing +end + +function savefig( + p::Plot; + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + format::String="png" + )::Vector{UInt8} + if !(format in ALL_FORMATS) + error("Unknown format $format. Expected one of $ALL_FORMATS") + end + + # construct payload + _get(x, def) = x === nothing ? def : x + payload = Dict( + :width => _get(width, 700), + :height => _get(height, 500), + :scale => _get(scale, 1), + :format => format, + :data => p + ) + + _ensure_kaleido_running() + + # convert payload to vector of bytes + bytes = transcode(UInt8, JSON.json(payload)) + write(P.stdin, bytes) + write(P.stdin, transcode(UInt8, "\n")) + flush(P.stdin) + + # read stdout and parse to json + res = readline(P.stdout) + js = JSON.parse(res) + + # check error code + code = get(js, "code", 0) + if code != 0 + msg = get(js, "message", nothing) + error("Transform failed with error code $code: $msg") + end + + # get raw image + img = String(js["result"]) + + # base64 decode if needed, otherwise transcode to vector of byte + if format in TEXT_FORMATS + return transcode(UInt8, img) + else + return base64decode(img) + end +end + +""" + savefig( + io::IO, + p::Plot; + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + format::String="png" + ) + +Save a plot `p` to the io stream `io`. They keyword argument `format` +determines the type of data written to the figure and must be one of +$(join(ALL_FORMATS, ", ")), or html. `scale` sets the +image scale. `width` and `height` set the dimensions, in pixels. Defaults +are taken from `p.layout`, or supplied by plotly +""" +function savefig(io::IO, + p::Plot; + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + format::String="png") + + + if format == "html" + return show(io, MIME("text/html"), p, include_mathjax="cdn", include_plotlyjs="cdn", full_html=true) + end + + bytes = savefig(p, width=width, height=height, scale=scale, format=format) + write(io, bytes) +end + +""" + savefig( + p::Plot, fn::AbstractString; + format::Union{Nothing,String}=nothing, + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + ) + +Save a plot `p` to a file named `fn`. If `format` is given and is one of +$(join(ALL_FORMATS, ", ")), or html; it will be the format of the file. By +default the format is guessed from the extension of `fn`. `scale` sets the +image scale. `width` and `height` set the dimensions, in pixels. Defaults +are taken from `p.layout`, or supplied by plotly +""" +function savefig( + p::Plot, fn::AbstractString; + format::Union{Nothing,String}=nothing, + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + ) + ext = split(fn, ".")[end] + if format === nothing + format = String(ext) + end + + open(fn, "w") do f + savefig(f, p; format=format, scale=scale, width=width, height=height) + end + return fn +end + +_kaleido_running() = isdefined(P, :stdin) && isopen(P.stdin) && process_running(P.proc) +_ensure_kaleido_running() = !_kaleido_running() && _restart_kaleido_process() + +const _KALEIDO_MIMES = Dict( + "application/pdf" => "pdf", + "image/png" => "png", + "image/svg+xml" => "svg", + "image/eps" => "eps", + "image/jpeg" => "jpeg", + "image/jpeg" => "jpeg", + "application/json" => "json", + "application/json; charset=UTF-8" => "json", +) + +for (mime, fmt) in _KALEIDO_MIMES + @eval function Base.show( + io::IO, ::MIME{Symbol($mime)}, plt::Plot, + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + ) + savefig(io, plt, format=$fmt) + end + + @eval function Base.show( + io::IO, ::MIME{Symbol($mime)}, plt::SyncPlot, + width::Union{Nothing,Int}=nothing, + height::Union{Nothing,Int}=nothing, + scale::Union{Nothing,Real}=nothing, + ) + savefig(io, plt.plot, format=$fmt) + end +end diff --git a/test/kaleido.jl b/test/kaleido.jl new file mode 100644 index 00000000..084845d3 --- /dev/null +++ b/test/kaleido.jl @@ -0,0 +1,17 @@ +function myplot(fn) + x = 0:0.1:2π + plt = Plot(scatter(x=x, y=sin.(x))) + savefig(plt, fn) +end + +@testset "kaleido" begin + for ext in [PlotlyBase.ALL_FORMATS..., "html"] + if ext === "eps" + continue + end + @show fn = tempname() * "." * ext + myplot(fn) == fn + @test isfile(fn) + rm(fn) + end +end diff --git a/test/runtests.jl b/test/runtests.jl index e72abaf4..ad0f91b7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -8,5 +8,6 @@ using Blink !Blink.AtomShell.isinstalled() && Blink.AtomShell.install() include("blink.jl") +include("kaleido.jl") end From 7fd3d3f5ea554bb467d58d29975416cc629138aa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 26 Jul 2021 00:16:34 +0000 Subject: [PATCH 53/83] CompatHelper: bump compat for "PlotlyBase" to "0.8" --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 093d82be..a1a4267f 100644 --- a/Project.toml +++ b/Project.toml @@ -22,7 +22,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5" JSON = "0.20, 0.21" -PlotlyBase = "0.6, ^0.7" +PlotlyBase = "0.6, ^0.7, 0.8" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" From 58909c5d852615dcddf5bcc4177acc2ce263a5b9 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Mon, 26 Jul 2021 10:08:54 -0400 Subject: [PATCH 54/83] bump version number --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d992ea80..66456608 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.0" +version = "0.18.1" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From d0792bbd6266843becff45ee276335cc3cf5f969 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 29 Jul 2021 15:08:48 -0400 Subject: [PATCH 55/83] add savefig export --- src/PlotlyJS.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 7be6b29f..a4456924 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -11,7 +11,7 @@ import PlotlyBase: restyle!, relayout!, update!, addtraces!, deletetraces!, movetraces!, redraw!, extendtraces!, prependtraces!, purge!, to_image, download_image, restyle, relayout, update, addtraces, deletetraces, movetraces, redraw, - extendtraces, prependtraces, prep_kwargs, sizes, savefig, _tovec, + extendtraces, prependtraces, prep_kwargs, sizes, _tovec, react, react!, add_trace! using WebIO @@ -21,7 +21,7 @@ using Blink using Pkg.Artifacts using Requires -export plot, dataset, list_datasets, make_subplots +export plot, dataset, list_datasets, make_subplots, savefig # globals for this package const _pkg_root = dirname(dirname(@__FILE__)) From 2efc10915744921d4776eb28784dd56781decbbf Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 29 Jul 2021 15:11:08 -0400 Subject: [PATCH 56/83] only run kaleido tests --- test/runtests.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index ad0f91b7..5bc6a437 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,10 +4,10 @@ using Test using PlotlyJS const M = PlotlyJS -using Blink -!Blink.AtomShell.isinstalled() && Blink.AtomShell.install() +# using Blink +# !Blink.AtomShell.isinstalled() && Blink.AtomShell.install() -include("blink.jl") +# include("blink.jl") include("kaleido.jl") end From d22625a3b9c85bfbf96c6a188e987d32c9e59ba1 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 29 Jul 2021 15:13:17 -0400 Subject: [PATCH 57/83] add unittest ci --- .github/workflows/ci-master-workflow.yml | 40 ++++++++++++++++++++++++ .github/workflows/ci-pr-workflow.yml | 39 +++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/ci-master-workflow.yml create mode 100644 .github/workflows/ci-pr-workflow.yml diff --git a/.github/workflows/ci-master-workflow.yml b/.github/workflows/ci-master-workflow.yml new file mode 100644 index 00000000..90a010e3 --- /dev/null +++ b/.github/workflows/ci-master-workflow.yml @@ -0,0 +1,40 @@ +name: Run CI on master + +on: + push: + branches: + - master + +jobs: + test: + name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} + timeout-minutes: 30 + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: + - '1.6' + - '1' + julia-arch: [x64] + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-version }} + arch: ${{ matrix.julia-arch }} + - uses: julia-actions/julia-buildpkg@latest + env: + PYTHON: "" + - uses: julia-actions/julia-runtest@latest + env: + PYTHON: "" + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: ./lcov.info + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/ci-pr-workflow.yml b/.github/workflows/ci-pr-workflow.yml new file mode 100644 index 00000000..777ff8e6 --- /dev/null +++ b/.github/workflows/ci-pr-workflow.yml @@ -0,0 +1,39 @@ +name: Run CI on PR + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + test: + name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} + timeout-minutes: 30 + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: + - '1.6' + - '1' + julia-arch: [x64] + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: ${{ matrix.julia-version }} + arch: ${{ matrix.julia-arch }} + - uses: julia-actions/julia-buildpkg@latest + env: + PYTHON: "" + - uses: julia-actions/julia-runtest@latest + env: + PYTHON: "" + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: ./lcov.info + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} From 179c724261f11159c29115af782e0f006eafcbf4 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 29 Jul 2021 15:26:54 -0400 Subject: [PATCH 58/83] fix savefig issues --- src/kaleido.jl | 15 ++++++++++----- test/kaleido.jl | 21 ++++++++++++--------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/kaleido.jl b/src/kaleido.jl index 746b6b8f..c01900bd 100644 --- a/src/kaleido.jl +++ b/src/kaleido.jl @@ -68,6 +68,8 @@ function _start_kaleido_process() nothing end +savefig(p::SyncPlot; kwargs...) = savefig(p.plot; kwargs...) + function savefig( p::Plot; width::Union{Nothing,Int}=nothing, @@ -119,6 +121,10 @@ function savefig( end end + +@inline _get_Plot(p::Plot) = p +@inline _get_Plot(p::SyncPlot) = p.plot + """ savefig( io::IO, @@ -136,21 +142,20 @@ image scale. `width` and `height` set the dimensions, in pixels. Defaults are taken from `p.layout`, or supplied by plotly """ function savefig(io::IO, - p::Plot; + p::Union{SyncPlot,Plot}; width::Union{Nothing,Int}=nothing, height::Union{Nothing,Int}=nothing, scale::Union{Nothing,Real}=nothing, format::String="png") - - if format == "html" - return show(io, MIME("text/html"), p, include_mathjax="cdn", include_plotlyjs="cdn", full_html=true) + return show(io, MIME("text/html"), _get_Plot(p), include_mathjax="cdn", include_plotlyjs="cdn", full_html=true) end bytes = savefig(p, width=width, height=height, scale=scale, format=format) write(io, bytes) end + """ savefig( p::Plot, fn::AbstractString; @@ -167,7 +172,7 @@ image scale. `width` and `height` set the dimensions, in pixels. Defaults are taken from `p.layout`, or supplied by plotly """ function savefig( - p::Plot, fn::AbstractString; + p::Union{SyncPlot,Plot}, fn::AbstractString; format::Union{Nothing,String}=nothing, width::Union{Nothing,Int}=nothing, height::Union{Nothing,Int}=nothing, diff --git a/test/kaleido.jl b/test/kaleido.jl index 084845d3..cf09c9cc 100644 --- a/test/kaleido.jl +++ b/test/kaleido.jl @@ -1,17 +1,20 @@ -function myplot(fn) +function myplot(fn, func) x = 0:0.1:2π - plt = Plot(scatter(x=x, y=sin.(x))) + plt = func(scatter(x=x, y=sin.(x))) savefig(plt, fn) end @testset "kaleido" begin - for ext in [PlotlyBase.ALL_FORMATS..., "html"] - if ext === "eps" - continue + for func in [Plot, plot] + for ext in [PlotlyJS.ALL_FORMATS..., "html"] + if ext === "eps" + continue + end + fn = tempname() * "." * ext + @show func, fn + myplot(fn, func) == fn + @test isfile(fn) + rm(fn) end - @show fn = tempname() * "." * ext - myplot(fn) == fn - @test isfile(fn) - rm(fn) end end From eac4ec3e4bd8233dcd597000f0f9689f96ec137e Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 29 Jul 2021 15:30:07 -0400 Subject: [PATCH 59/83] bump version number --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 66456608..6412d957 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.1" +version = "0.18.2" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From a3ba71da54419d520ef40c58cc89051d1f7f440c Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 30 Jul 2021 10:44:41 -0400 Subject: [PATCH 60/83] enh add support for json2 and json3 --- src/PlotlyJS.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index a4456924..5e26e73d 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -130,6 +130,12 @@ function __init__() insert!(Base.Multimedia.displays, findlast(x -> x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotlyJSDisplay()) end) + @require JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3" JSON2.write(io::IO, p::SyncPlot) = JSON.print(io, p) + @require JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" begin + JSON3.write(io::IO, p::SyncPlot) = JSON.print(io, p.plot) + JSON3.write(p::SyncPlot) = JSON.json(p.plot) + end + @require IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" begin function IJulia.display_dict(p::SyncPlot) From f837a34350e3253e690afe515457c52553fdf8c1 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 30 Jul 2021 10:52:37 -0400 Subject: [PATCH 61/83] remove styles from docs as they are not supported anymore --- docs/make.jl | 27 ++-- docs/src/basics.md | 3 - docs/src/examples/violin.md | 4 +- docs/src/styles.md | 272 ------------------------------------ docs/src/syncplots.md | 1 - 5 files changed, 15 insertions(+), 292 deletions(-) delete mode 100644 docs/src/styles.md diff --git a/docs/make.jl b/docs/make.jl index 2cda6cc1..db9dac92 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -10,7 +10,7 @@ using Random, Dates, LinearAlgebra, DelimitedFiles # to override display_dict below import Documenter.Utilities: display_dict, limitstringmime -using Base64: stringmime +using Base64:stringmime function display_dict(p::PlotlyBase.Plot) out = Dict{MIME,Any}() @@ -39,7 +39,7 @@ function single_example_file(filename::String) # Read lines from a files fulltext = open( - f->read(f, String), + f -> read(f, String), joinpath(THIS_DIR, "..", "examples", filename), "r" ) @@ -55,19 +55,19 @@ function single_example_file(filename::String) else first_line = findfirst(x -> match(regex, x) !== nothing, all_lines) if first_line !== nothing - preamble = strip(join(all_lines[1:first_line-1], "\n")) + preamble = strip(join(all_lines[1:first_line - 1], "\n")) write_example(preamble) end end while true # Find next function name (break if none) - l = findnext(x -> match(regex, x) !== nothing, all_lines, l+1) + l = findnext(x -> match(regex, x) !== nothing, all_lines, l + 1) if l == 0 || l === nothing break end # find corresponding end for this function - end_l = findnext(x -> match(regex_end, x) !== nothing, all_lines, l+1) + end_l = findnext(x -> match(regex_end, x) !== nothing, all_lines, l + 1) # Pull out function text func_block = join(all_lines[l:end_l], "\n") @@ -98,22 +98,21 @@ end handle_examples() makedocs( - sitename = "PlotlyJS", - format = Documenter.HTML( - assets = [ + sitename="PlotlyJS", + format=Documenter.HTML( + assets=[ asset("https://cdn.plot.ly/plotly-1.54.7.js") ] ), - modules = [PlotlyJS, PlotlyBase], + modules=[PlotlyJS, PlotlyBase], linkcheck=true, - pages = [ + pages=[ "Home" => "index.md", "User Guide" => [ "Preliminaries" => "basics.md", "Building Blocks" => "building_traces_layouts.md", "Putting it together" => "syncplots.md", "Working with plots" => "manipulating_plots.md", - "Styles" => "styles.md", "Contributing" => "contributing.md", ], "Examples" => [ @@ -141,10 +140,10 @@ makedocs( # Documenter can also automatically deploy documentation to gh-pages. # See "Hosting Documentation" and deploydocs() in the Documenter manual # for more information. -#=deploydocs( +#= deploydocs( repo = "" -)=# +) =# deploydocs( - repo = "github.com/JuliaPlots/PlotlyJS.jl.git", + repo="github.com/JuliaPlots/PlotlyJS.jl.git", ) diff --git a/docs/src/basics.md b/docs/src/basics.md index 994b5a5f..94f77f9b 100644 --- a/docs/src/basics.md +++ b/docs/src/basics.md @@ -54,14 +54,11 @@ mutable struct Plot{TT<:AbstractVector{<:AbstractTrace},TL<:AbstractLayout,TF<:A divid::UUID config::PlotConfig frames::TF - style::Style end ``` The `data`, `layout`, `divid`, `config`, and `frames` fields of the `Plot` type map 1-1 to the arguments to the `Plotly.newplot` function. -The `style` argument is unique to Julia and hooks into the Julia based themeing and styling system as described in [the style docs](@ref styles) - [_plotlyjs]: https://plotly.com/javascript/ [_plotlyref]: https://plotly.com/julia/reference/ diff --git a/docs/src/examples/violin.md b/docs/src/examples/violin.md index c793f2a9..7191e078 100644 --- a/docs/src/examples/violin.md +++ b/docs/src/examples/violin.md @@ -129,7 +129,7 @@ violin_side_by_side() ``` ```@example violin -function violin_style() +function violin_styled() y1 = vcat(abs.(20 .* rand(100)), rand(UInt16, 300) .* 500 ./ typemax(UInt16)) y2 = [25.261999999999997, 66.5419, 98.2114, 0.09070629 ] box = attr(fillcolor="black", line_color="black", width=0.01) @@ -157,6 +157,6 @@ function violin_style() ) plot([trace1, trace2], layout) end -violin_style() +violin_styled() ``` diff --git a/docs/src/styles.md b/docs/src/styles.md deleted file mode 100644 index 27dcf873..00000000 --- a/docs/src/styles.md +++ /dev/null @@ -1,272 +0,0 @@ -Starting with v0.4.0, PlotlyJS.jl now has support for styles. A style is -defined as an instance of the following type: - -```julia -struct Style - layout::Layout - global_trace::PlotlyAttribute - trace::Dict{Symbol,PlotlyAttribute} -end -``` - -Let's go over the fields one by one: - -- `layout`: A `Layout` object defining style attributes for the layout -- `global_trace`: A `PlotlyAttribute` (created with the `attr` function) that -contains trace attributes to be applied to traces of all types -- `trace`: A dictionary mapping trace types into attributes to be applied to -that type of trace - -## `Cycler`s - -Starting with v0.7.1, PlotlyJS.jl has a new type called `Cycler` that can be -used to set style properties that should be cycled through for each trace. - -For example, to have all traces alternate between being colored green and red, -I could define: - -```@example styles -using PlotlyJS # hide -mystyle = Style(global_trace=attr(marker_color=["green", "red"])) -``` - -If I were then to define a plot - -```@example styles -p = plot(rand(10, 3), style=mystyle) -``` - -The first and third plots would be green, while the second would be red. - -As usual, if the `marker_color` attribute on a trace was already set, then -it will not be altered. For example: - -```@example styles -p = plot( - [ - scatter(y=rand(4)), - scatter(y=rand(4), marker_color="black"), - scatter(y=rand(4)), - scatter(y=rand(4)), - ], - style=mystyle -) -``` - -Then the first and fourth traces would be red, the second black, and the third -green. - -## [Defining `Style`s](@id styles) - -There are 3 ways to define a `Style`: - -### 1. `Style`s from scratch - -To define a brand new style, you simply construct one or more of the fields and -assign it using the keyword argument `Style` constructor. For example, this is -how the `ggplot` style is defined (as of time of writing): - -```@example styles -ggplot = let - axis = attr(showgrid=true, gridcolor="white", linewidth=1.0, - linecolor="white", titlefont_color="#555555", - titlefont_size=14, ticks="outside", - tickcolor="#555555" - ) - layout = Layout(plot_bgcolor="#E5E5E5", - paper_bgcolor="white", - font_size=10, - xaxis=axis, - yaxis=axis, - titlefont_size=14) - - colors = Cycler([ - "#E24A33", "#348ABD", "#988ED5", "#777777", "#FBC15E", - "#8EBA42", "#FFB5B8" - ]) - gta = attr( - marker_line_width=0.5, marker_line_color="#348ABD", marker_color=colors - ) - Style(layout=layout, global_trace=gta) -end -``` - -Notice that we didn't have to define the `trace` field. When building new -`Style`s you only need to define the fields of the `Style` type that you -actually use in your style. - -### 2. From other `Style`s - -The second approach is to define a new `Style`, starting from an existing -style. Suppose that I liked the `ggplot` style, but wanted to make sure that -the marker symbol on scatter traces was always a square. I could define the -following style: - -```@example styles -square_ggplot = Style(ggplot, - trace=Dict(:scatter => attr(marker_symbol="square"))) -``` - -Notice that all the information for `color_cycle`, `layout` and `global_trace` -is the same as in the `ggplot` case above, but we now have the addition of -another section for the `trace` field as it is no longer empty. - -### 3. Composition - -The final method for constructing new `Style`s is to compose existing styles. - -Suppose that we want the ability to easily change the font size on the plot -title to be large, say at a level of 20. We might want to apply this -transformation to multiple existing styles. One way we could achieve this is by -defining - -```@example styles -big_title = Style(layout=Layout(titlefont_size=20)) -``` - -and then composing `big_title` with an existing `Style` (e.g. `ggplot` from -above) by calling - -```@example styles -big_ggplot = Style(ggplot, big_title) -``` - -It is important that we put `big_title` _after_ `ggplot` as the composing -`Style` constructor has the same behavior as the function `Base.merge` where -fields that appear in both the left and right arguments are set to the value of -the rightmost appearance. - -The only thing we've gained over method number 2 for defining styles is that we -can now reuse the `big_title` `Style` as many times as we'd like. This is -great, but doesn't actually show off the power of composing `Style`s. -Composition becomes more powerful when you use more than two styles. Consider -the following example: - -```@example styles -square = Style(trace=Dict(:scatter => attr(marker_symbol="square"))) -big_square_ggplot = Style(ggplot, square, big_title) -``` - -Here the order of `square` and `big_title` was not important as they don't -define any of the same attributes. - -## Using `Style`s - -Now that we know how to build a `Style`, how do we use it?. There are two main -ways to use a `Style`: - -- Global mode: call the `use_style!(::Style)` function to set a global style -for all _subsequent_ plots (styles are not applied retroactively to plots that -were created before this function is called). -- Plot by plot mode: All methods of the `plot` and `Plot` functions accept a -keyword argument `style::Style` that sets the style for that plot only. - -!!! note - Styles do not transfer to parent plots when creating subplots. If you want - to apply a `Style` to a plot containing subplots you must either use the - global mode or construct the plot and set the `style` field on the parent - after subplots are created (e.g. `p = [p1 p2]; p.style=ggplot`, where - `ggplot` is defined as above) - -## Built in `Style`s - -There are a few built in styles that come with PlotlyJS.jl. More will be added -over time. To see which styles are currently built in look at the unexported -`PlotlyJS.STYLES` variable. - -To obtain a built in style use the method `style(s::Symbol)`, where `s` is one -of the symbols in `PlotlyJS.STYLES`. - -To use a built in style globally use the method `use_style!(s::Symbol)`, where -again `s` is a symbol from `PlotlyJS.STYLES`. - -## Appendix: How `Style`s work - -The best way to think about styles is that they will apply default values for -attributes, only if the attribute is not already defined. For example, suppose -we had the following style: - -```julia -goofy = Style(global_trace=attr(marker_color="red"), - trace=Dict(:scatter => attr(mode="markers"))) -``` - -two plots: - -```julia -p1 = plot(scatter(y=1:3, mode="lines", marker_symbol="square"), style=goofy) -p2 = plot(scatter(y=1:3, marker_color="green"), style=goofy) -``` - -If we inspect the json from these two plots we see: - -``` -julia> print(json(p1, 2)) -{ - "layout": { - "margin": { - "r": 50, - "l": 50, - "b": 50, - "t": 60 - } - }, - "data": [ - { - "y": [ - 1, - 2, - 3 - ], - "type": "scatter", - "mode": "lines", - "marker": { - "symbol": "square", - "color": "red" - } - } - ] -} - -julia> print(json(p2, 2)) -{ - "layout": { - "margin": { - "r": 50, - "l": 50, - "b": 50, - "t": 60 - } - }, - "data": [ - { - "y": [ - 1, - 2, - 3 - ], - "type": "scatter", - "marker": { - "color": "green" - }, - "mode": "markers" - } - ] -} -``` - -Notice that on p1: - -- the `marker.color` attribute was set to red -- `marker.symbol` remained square -- `mode` was not changed from `lines` to `markers`. - -On the other hand, in `p2` we see that the - -- `mode` was set to `markers` -- `marker.color` was not changed from green to red - -This happened because the scatter in p1 defined the `mode` attribute, but not -`marker_color` whereas the scatter in p2 defined `marker_color` but not `mode`. -In both cases the attributes inside the `Style` became a default value for -fields that were not already set inside the trace. diff --git a/docs/src/syncplots.md b/docs/src/syncplots.md index 0e4a122c..7a0a694c 100644 --- a/docs/src/syncplots.md +++ b/docs/src/syncplots.md @@ -19,7 +19,6 @@ mutable struct Plot{TT<:AbstractVector{<:AbstractTrace},TL<:AbstractLayout,TF<:A frames::TF divid::UUID config::PlotConfig - style::Style end ``` From 0a07433e5ddac42bae4b7a854cbfaea19a7dc8bb Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 30 Jul 2021 11:02:04 -0400 Subject: [PATCH 62/83] bump version number --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6412d957..6524a839 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.2" +version = "0.18.3 " [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From 67fc4796b19212f2b2a8cd93fab4757d80a10795 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 30 Jul 2021 11:02:34 -0400 Subject: [PATCH 63/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6524a839..fb2dc1bc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.3 " +version = "0.18.3" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From 604b37bdc78f1744d53c4499ebdf04d20aebb49b Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Mon, 2 Aug 2021 11:19:47 -0400 Subject: [PATCH 64/83] fix subplot docs --- docs/make.jl | 28 +++---- docs/src/assets/include_plotlyjs.js | 12 +++ docs/src/examples/subplots.md | 112 ++++++++++++++++++++++++++-- docs/src/examples/violin.md | 4 +- examples/subplots.jl | 100 +++++++++++++++++++++++-- src/display.jl | 2 +- 6 files changed, 228 insertions(+), 30 deletions(-) create mode 100644 docs/src/assets/include_plotlyjs.js diff --git a/docs/make.jl b/docs/make.jl index db9dac92..330e0521 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -2,6 +2,8 @@ using Documenter using PlotlyJS using PlotlyBase +PlotlyJS.set_default_renderer(PlotlyJS.DOCS) + const THIS_DIR = dirname(@__FILE__) # used in examples @@ -9,19 +11,19 @@ using Distributions, HTTP, DataFrames, RDatasets, Colors, CSV, JSON using Random, Dates, LinearAlgebra, DelimitedFiles # to override display_dict below -import Documenter.Utilities: display_dict, limitstringmime -using Base64:stringmime - -function display_dict(p::PlotlyBase.Plot) - out = Dict{MIME,Any}() - # Always generate text/plain - out[MIME"text/plain"()] = limitstringmime(MIME"text/plain"(), p) - svg_m = MIME"image/svg+xml"() - out[svg_m] = stringmime(svg_m, p) - out -end +# import Documenter.Utilities: display_dict, limitstringmime +# using Base64:stringmime + +# function display_dict(p::PlotlyBase.Plot) +# out = Dict{MIME,Any}() +# # Always generate text/plain +# out[MIME"text/plain"()] = limitstringmime(MIME"text/plain"(), p) +# svg_m = MIME"image/svg+xml"() +# out[svg_m] = stringmime(svg_m, p) +# out +# end -display_dict(p::PlotlyJS.SyncPlot) = display_dict(p.plot) +# display_dict(p::PlotlyJS.SyncPlot) = display_dict(p.plot) ## handle examples # Walk through each example in a file and get the markdown from `single_example` @@ -101,7 +103,7 @@ makedocs( sitename="PlotlyJS", format=Documenter.HTML( assets=[ - asset("https://cdn.plot.ly/plotly-1.54.7.js") + "include_plotlyjs.js" ] ), modules=[PlotlyJS, PlotlyBase], diff --git a/docs/src/assets/include_plotlyjs.js b/docs/src/assets/include_plotlyjs.js new file mode 100644 index 00000000..dd69c2aa --- /dev/null +++ b/docs/src/assets/include_plotlyjs.js @@ -0,0 +1,12 @@ +if (typeof require !== "undefined") { + console.log("Trying to load plotly.js via requirejs"); + require.undef("plotly"); + requirejs.config({ + paths: { + plotly: ["https://cdn.plot.ly/plotly-2.3.0.min"], + }, + }); + require(["plotly"], function (Plotly) { + window._Plotly = Plotly; + }); +} diff --git a/docs/src/examples/subplots.md b/docs/src/examples/subplots.md index 998aa902..094a7e4d 100644 --- a/docs/src/examples/subplots.md +++ b/docs/src/examples/subplots.md @@ -19,7 +19,7 @@ subplots1() function subplots2() p1 = linescatter1() p2 = linescatter2() - p = [p1, p2] + p = [p1; p2] p end subplots2() @@ -42,7 +42,7 @@ subplots3() ```@example subplots function subplots_withcomprehension() - hcat([plot(scatter(x = 1:5, y = rand(5))) for i in 1:3]...) + hcat([plot(scatter(x=1:5, y=rand(5))) for i in 1:3]...) end subplots_withcomprehension() ``` @@ -50,10 +50,10 @@ subplots_withcomprehension() ```@example subplots function subplots_withsharedaxes() data = [ - scatter(x=1:3, y=2:4), - scatter(x=20:10:40, y=fill(5, 3), xaxis="x2", yaxis="y"), - scatter(x=2:4, y=600:100:800, xaxis="x", yaxis="y3"), - scatter(x=4000:1000:6000, y=7000:1000:9000, xaxis="x4", yaxis="y4") + scatter(x=1:3, y=2:4), + scatter(x=20:10:40, y=fill(5, 3), xaxis="x2", yaxis="y"), + scatter(x=2:4, y=600:100:800, xaxis="x", yaxis="y3"), + scatter(x=4000:1000:6000, y=7000:1000:9000, xaxis="x4", yaxis="y4") ] layout = Layout( xaxis_domain=[0, 0.45], @@ -61,10 +61,108 @@ function subplots_withsharedaxes() xaxis4=attr(domain=[0.55, 1.0], anchor="y4"), xaxis2_domain=[0.55, 1], yaxis3_domain=[0.55, 1], - yaxis4=attr(domain=[0.55, 1], anchor="x4") + yaxis4=attr(domain=[0.55, 1], anchor="x4") ) plot(data, layout) end subplots_withsharedaxes() ``` +```@example subplots +function with_make_subplots1() + + # The `shared_xaxes` argument to `make_subplots` can be used to link the x + # axes of subplots in the resulting figure. The `vertical_spacing` argument + # is used to control the vertical spacing between rows in the subplot grid. + + # Here is an example that creates a figure with 3 vertically stacked + # subplots with linked x axes. A small vertical spacing value is used to + # reduce the spacing between subplot rows. + + p = make_subplots(rows=3, cols=1, shared_xaxes=true, vertical_spacing=0.02) + add_trace!(p, scatter(x=0:2, y=10:12), row=3, col=1) + add_trace!(p, scatter(x=2:4, y=100:10:120), row=2, col=1) + add_trace!(p, scatter(x=3:5, y=1000:100:1200), row=1, col=1) + relayout!(p, title_text="Stacked Subplots with Shared X-Axes") + p +end +with_make_subplots1() +``` + +```@example subplots +function with_make_subplots2() + # The `shared_yaxes` argument to `make_subplots` can be used to link the y + # axes of subplots in the resulting figure. + + # Here is an example that creates a figure with a 2 x 2 subplot grid, where + # the y axes of each row are linked. + + p = make_subplots(rows=3, cols=2, shared_yaxes=true) + add_trace!(p, scatter(x=0:2, y=10:12), row=1, col=1) + add_trace!(p, scatter(x=20:10:40, y=1:3), row=1, col=2) + add_trace!(p, scatter(x=3:5, y=600:100:800), row=2, col=1) + add_trace!(p, scatter(x=3:5, y=1000:100:1200), row=2, col=2) + relayout!(p, title_text="Multiple Subplots with Shared Y-Axes") + p +end +with_make_subplots2() +``` + +```@example subplots +function with_make_subplots3() + # The `specs` argument to `make_subplots` is used to configure per-subplot + # options. `specs` must be a `Matrix` with dimensions that match those + # provided as the `rows` and `cols` arguments. The elements of `specs` may + # either be `missing`, indicating no subplot should be initialized starting + # with this grid cell, or an instance of `Spec` containing subplot options. + # The `colspan` subplot option specifies the number of grid columns that the + # subplot starting in the given cell should occupy. If unspecified, + # `colspan` defaults to 1. + + # Here is an example that creates a 2 by 2 subplot grid containing 3 + # subplots. The subplot `specs` element for position (2, 1) has a `colspan` + # value of 2, causing it to span the full figure width. The subplot `specs` + # element f or position (2, 2) is `None` because no subplot begins at this + # location in the grid. + p = make_subplots( + rows=2, cols=2, + specs=[Spec() Spec(); Spec(colspan=2) missing], + subplot_titles=["First Subplot" "Second Subplot"; "Third Subplot" missing] + ) + + add_trace!(p, scatter(x=[1, 2], y=[1, 2]), row=1, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2]), row=1, col=2) + add_trace!(p, scatter(x=[1, 2, 3], y=[2, 1, 2]), row=2, col=1) + + relayout!(p, showlegend=false, title_text="Specs with Subplot Title") + p +end +with_make_subplots3() +``` + +```@example subplots +function with_make_subplots4() + # Here is an example that uses the `rowspan` and `colspan` subplot options + # to create a custom subplot layout with subplots of mixed sizes. + p = make_subplots( + rows=5, cols=2, + specs=[Spec() Spec(rowspan=2) + Spec() missing + Spec(rowspan=2, colspan=2) missing + missing missing + Spec() Spec()] + ) + + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(1,1)"), row=1, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(1,2)"), row=1, col=2) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(2,1)"), row=2, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(3,1)"), row=3, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(5,1)"), row=5, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(5,2)"), row=5, col=2) + + relayout!(p, height=600, width=600, title_text="specs examples") + p +end +with_make_subplots4() +``` + diff --git a/docs/src/examples/violin.md b/docs/src/examples/violin.md index 7191e078..c793f2a9 100644 --- a/docs/src/examples/violin.md +++ b/docs/src/examples/violin.md @@ -129,7 +129,7 @@ violin_side_by_side() ``` ```@example violin -function violin_styled() +function violin_style() y1 = vcat(abs.(20 .* rand(100)), rand(UInt16, 300) .* 500 ./ typemax(UInt16)) y2 = [25.261999999999997, 66.5419, 98.2114, 0.09070629 ] box = attr(fillcolor="black", line_color="black", width=0.01) @@ -157,6 +157,6 @@ function violin_styled() ) plot([trace1, trace2], layout) end -violin_styled() +violin_style() ``` diff --git a/examples/subplots.jl b/examples/subplots.jl index 0883695e..3d11594e 100644 --- a/examples/subplots.jl +++ b/examples/subplots.jl @@ -10,7 +10,7 @@ end function subplots2() p1 = linescatter1() p2 = linescatter2() - p = [p1, p2] + p = [p1; p2] p end @@ -29,16 +29,16 @@ end function subplots_withcomprehension() - hcat([plot(scatter(x = 1:5, y = rand(5))) for i in 1:3]...) + hcat([plot(scatter(x=1:5, y=rand(5))) for i in 1:3]...) end function subplots_withsharedaxes() data = [ - scatter(x=1:3, y=2:4), - scatter(x=20:10:40, y=fill(5, 3), xaxis="x2", yaxis="y"), - scatter(x=2:4, y=600:100:800, xaxis="x", yaxis="y3"), - scatter(x=4000:1000:6000, y=7000:1000:9000, xaxis="x4", yaxis="y4") + scatter(x=1:3, y=2:4), + scatter(x=20:10:40, y=fill(5, 3), xaxis="x2", yaxis="y"), + scatter(x=2:4, y=600:100:800, xaxis="x", yaxis="y3"), + scatter(x=4000:1000:6000, y=7000:1000:9000, xaxis="x4", yaxis="y4") ] layout = Layout( xaxis_domain=[0, 0.45], @@ -46,7 +46,93 @@ function subplots_withsharedaxes() xaxis4=attr(domain=[0.55, 1.0], anchor="y4"), xaxis2_domain=[0.55, 1], yaxis3_domain=[0.55, 1], - yaxis4=attr(domain=[0.55, 1], anchor="x4") + yaxis4=attr(domain=[0.55, 1], anchor="x4") ) plot(data, layout) end + +function with_make_subplots1() + + # The `shared_xaxes` argument to `make_subplots` can be used to link the x + # axes of subplots in the resulting figure. The `vertical_spacing` argument + # is used to control the vertical spacing between rows in the subplot grid. + + # Here is an example that creates a figure with 3 vertically stacked + # subplots with linked x axes. A small vertical spacing value is used to + # reduce the spacing between subplot rows. + + p = make_subplots(rows=3, cols=1, shared_xaxes=true, vertical_spacing=0.02) + add_trace!(p, scatter(x=0:2, y=10:12), row=3, col=1) + add_trace!(p, scatter(x=2:4, y=100:10:120), row=2, col=1) + add_trace!(p, scatter(x=3:5, y=1000:100:1200), row=1, col=1) + relayout!(p, title_text="Stacked Subplots with Shared X-Axes") + p +end + +function with_make_subplots2() + # The `shared_yaxes` argument to `make_subplots` can be used to link the y + # axes of subplots in the resulting figure. + + # Here is an example that creates a figure with a 2 x 2 subplot grid, where + # the y axes of each row are linked. + + p = make_subplots(rows=3, cols=2, shared_yaxes=true) + add_trace!(p, scatter(x=0:2, y=10:12), row=1, col=1) + add_trace!(p, scatter(x=20:10:40, y=1:3), row=1, col=2) + add_trace!(p, scatter(x=3:5, y=600:100:800), row=2, col=1) + add_trace!(p, scatter(x=3:5, y=1000:100:1200), row=2, col=2) + relayout!(p, title_text="Multiple Subplots with Shared Y-Axes") + p +end + +function with_make_subplots3() + # The `specs` argument to `make_subplots` is used to configure per-subplot + # options. `specs` must be a `Matrix` with dimensions that match those + # provided as the `rows` and `cols` arguments. The elements of `specs` may + # either be `missing`, indicating no subplot should be initialized starting + # with this grid cell, or an instance of `Spec` containing subplot options. + # The `colspan` subplot option specifies the number of grid columns that the + # subplot starting in the given cell should occupy. If unspecified, + # `colspan` defaults to 1. + + # Here is an example that creates a 2 by 2 subplot grid containing 3 + # subplots. The subplot `specs` element for position (2, 1) has a `colspan` + # value of 2, causing it to span the full figure width. The subplot `specs` + # element f or position (2, 2) is `None` because no subplot begins at this + # location in the grid. + p = make_subplots( + rows=2, cols=2, + specs=[Spec() Spec(); Spec(colspan=2) missing], + subplot_titles=["First Subplot" "Second Subplot"; "Third Subplot" missing] + ) + + add_trace!(p, scatter(x=[1, 2], y=[1, 2]), row=1, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2]), row=1, col=2) + add_trace!(p, scatter(x=[1, 2, 3], y=[2, 1, 2]), row=2, col=1) + + relayout!(p, showlegend=false, title_text="Specs with Subplot Title") + p +end + +function with_make_subplots4() + # Here is an example that uses the `rowspan` and `colspan` subplot options + # to create a custom subplot layout with subplots of mixed sizes. + p = make_subplots( + rows=5, cols=2, + specs=[Spec() Spec(rowspan=2) + Spec() missing + Spec(rowspan=2, colspan=2) missing + missing missing + Spec() Spec()] + ) + + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(1,1)"), row=1, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(1,2)"), row=1, col=2) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(2,1)"), row=2, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(3,1)"), row=3, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(5,1)"), row=5, col=1) + add_trace!(p, scatter(x=[1, 2], y=[1, 2], name="(5,2)"), row=5, col=2) + + relayout!(p, height=600, width=600, title_text="specs examples") + p +end diff --git a/src/display.jl b/src/display.jl index e458cf7c..a88fa120 100644 --- a/src/display.jl +++ b/src/display.jl @@ -16,7 +16,7 @@ end function Base.show(io::IO, mm::MIME"text/html", p::SyncPlot) # if we are rendering docs -- short circuit and display html if get_renderer() == DOCS - return show(io, mm, p.plot, full_html=false, include_plotlyjs="require") + return show(io, mm, p.plot, full_html=false, include_plotlyjs="require-loaded") end show(io, mm, p.scope) end From acba7d1a8812d3fecd59020fe6638ee7e19f1319 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 11 Aug 2021 10:45:07 -0400 Subject: [PATCH 65/83] Update PlotlyJS.jl --- src/PlotlyJS.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 5e26e73d..43a553f0 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -130,7 +130,7 @@ function __init__() insert!(Base.Multimedia.displays, findlast(x -> x isa REPL.REPLDisplay, Base.Multimedia.displays) + 1, PlotlyJSDisplay()) end) - @require JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3" JSON2.write(io::IO, p::SyncPlot) = JSON.print(io, p) + @require JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3" JSON2.write(io::IO, p::SyncPlot) = JSON2.write(io, p.plot) @require JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" begin JSON3.write(io::IO, p::SyncPlot) = JSON.print(io, p.plot) JSON3.write(p::SyncPlot) = JSON.json(p.plot) From 365c35f6e028a759425d8d6c2173c9ee0c09cfde Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 11 Aug 2021 13:20:29 -0400 Subject: [PATCH 66/83] fix add_trace! method, closes #407 --- src/display.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display.jl b/src/display.jl index a88fa120..edbb67b1 100644 --- a/src/display.jl +++ b/src/display.jl @@ -16,7 +16,7 @@ end function Base.show(io::IO, mm::MIME"text/html", p::SyncPlot) # if we are rendering docs -- short circuit and display html if get_renderer() == DOCS - return show(io, mm, p.plot, full_html=false, include_plotlyjs="require-loaded") + return show(io, mm, p.plot, full_html=false, include_plotlyjs="require") end show(io, mm, p.scope) end @@ -184,7 +184,7 @@ end function add_trace!(p::SyncPlot, trace::GenericTrace; kw...) add_trace!(p.plot, trace; kw...) - addtraces!(p, trace) + send_command(p.scope, :addTraces, trace) end From d1f5ad9246f0dd5e73e83239118a8cbcd4eb92fc Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 11 Aug 2021 13:22:04 -0400 Subject: [PATCH 67/83] keep require-loaded in docs render --- src/display.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display.jl b/src/display.jl index edbb67b1..a67c0ac8 100644 --- a/src/display.jl +++ b/src/display.jl @@ -16,7 +16,7 @@ end function Base.show(io::IO, mm::MIME"text/html", p::SyncPlot) # if we are rendering docs -- short circuit and display html if get_renderer() == DOCS - return show(io, mm, p.plot, full_html=false, include_plotlyjs="require") + return show(io, mm, p.plot, full_html=false, include_plotlyjs="require-loaded") end show(io, mm, p.scope) end From 0224ca7c7492972e14ffa3cb50b08b2e22f38a68 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 11 Aug 2021 13:28:10 -0400 Subject: [PATCH 68/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index fb2dc1bc..c12e6577 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.3" +version = "0.18.4" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From 015884ed5292829f8d86b057c2a21224519b5db8 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 17 Aug 2021 20:23:49 -0400 Subject: [PATCH 69/83] enh: added new PlotlyBase methods for SyncPlot --- Project.toml | 2 +- src/PlotlyJS.jl | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c12e6577..d7b196df 100644 --- a/Project.toml +++ b/Project.toml @@ -22,7 +22,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5, 1" JSON = "0.20, 0.21" -PlotlyBase = "0.6, ^0.7, 0.8" +PlotlyBase = "0.8.9" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 43a553f0..541f1c6b 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -165,4 +165,20 @@ function __init__() end end +# for methods that update the layout, first apply to the plot, then let plotly.js +# deal with the rest via the react function +for (k, v) in vcat(PlotlyBase._layout_obj_updaters, PlotlyBase._layout_vector_updaters) + @eval function PlotlyBase.$(k)(p::SyncPlot, args...;kwargs...) + $(k)(p.plot, args...; kwargs...) + send_command(p.scope, :react, p.plot.data, p.plot.layout) + end +end + +for k in [:add_hrect!, :add_hline!, :add_vrect!, :add_vline!] + @eval function PlotlyBase.$(k)(p::SyncPlot, args...;kwargs...) + $(k)(p.plot, args...; kwargs...) + send_command(p.scope, :react, p.plot.data, p.plot.layout) + end +end + end # module From aa2c120c4756ca7b247e7672769623ac43621e97 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 17 Aug 2021 20:27:15 -0400 Subject: [PATCH 70/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d7b196df..ad65d4df 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.4" +version = "0.18.5" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From b8426a559df76aa2f12128a21e5edbc449f9e506 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 17 Aug 2021 20:37:37 -0400 Subject: [PATCH 71/83] update docs/Project.toml -- get compat entries from PlotlyJS itself --- docs/Project.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index f4a4091d..5826022b 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -13,6 +13,3 @@ PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5" PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[compat] -PlotlyBase = "0.6" From acf820a9a1280395c395dde6b4559bbd763eee29 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Wed, 25 Aug 2021 10:44:10 -0400 Subject: [PATCH 72/83] implement add_shape! method --- src/PlotlyJS.jl | 2 +- src/display.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 541f1c6b..335c6fda 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -174,7 +174,7 @@ for (k, v) in vcat(PlotlyBase._layout_obj_updaters, PlotlyBase._layout_vector_up end end -for k in [:add_hrect!, :add_hline!, :add_vrect!, :add_vline!] +for k in [:add_hrect!, :add_hline!, :add_vrect!, :add_vline!, :add_shape!] @eval function PlotlyBase.$(k)(p::SyncPlot, args...;kwargs...) $(k)(p.plot, args...; kwargs...) send_command(p.scope, :react, p.plot.data, p.plot.layout) diff --git a/src/display.jl b/src/display.jl index a67c0ac8..17d143d2 100644 --- a/src/display.jl +++ b/src/display.jl @@ -16,7 +16,7 @@ end function Base.show(io::IO, mm::MIME"text/html", p::SyncPlot) # if we are rendering docs -- short circuit and display html if get_renderer() == DOCS - return show(io, mm, p.plot, full_html=false, include_plotlyjs="require-loaded") + return show(io, mm, p.plot, full_html=false, include_plotlyjs="require-loaded", include_mathjax=false) end show(io, mm, p.scope) end From ce6896ff5bbc75b7702ed8921f38ebf7a1fd9cee Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 26 Aug 2021 10:02:55 -0400 Subject: [PATCH 73/83] overload add_layout_image! --- src/PlotlyJS.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 335c6fda..e84c6fab 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -174,7 +174,7 @@ for (k, v) in vcat(PlotlyBase._layout_obj_updaters, PlotlyBase._layout_vector_up end end -for k in [:add_hrect!, :add_hline!, :add_vrect!, :add_vline!, :add_shape!] +for k in [:add_hrect!, :add_hline!, :add_vrect!, :add_vline!, :add_shape!, :add_layout_image!] @eval function PlotlyBase.$(k)(p::SyncPlot, args...;kwargs...) $(k)(p.plot, args...; kwargs...) send_command(p.scope, :react, p.plot.data, p.plot.layout) From ffbfd843974543371f0cee1dedcf6d6f3cd3e8ae Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 26 Aug 2021 10:03:08 -0400 Subject: [PATCH 74/83] add `mgrid` helper function (used throughout docs) --- src/PlotlyJS.jl | 2 +- src/util.jl | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index e84c6fab..9d3e514e 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -21,7 +21,7 @@ using Blink using Pkg.Artifacts using Requires -export plot, dataset, list_datasets, make_subplots, savefig +export plot, dataset, list_datasets, make_subplots, savefig, mgrid # globals for this package const _pkg_root = dirname(dirname(@__FILE__)) diff --git a/src/util.jl b/src/util.jl index 0f7a16f8..d17a5281 100644 --- a/src/util.jl +++ b/src/util.jl @@ -14,3 +14,18 @@ function PlotlyBase.add_recession_bands!(p::SyncPlot; kwargs...) relayout!(p, shapes=new_shapes) new_shapes end + +function mgrid(arrays...) + lengths = collect(length.(arrays)) + uno = ones(Int, length(arrays)) + out = [] + for i in 1:length(arrays) + repeats = copy(lengths) + repeats[i] = 1 + + shape = copy(uno) + shape[i] = lengths[i] + push!(out, reshape(arrays[i], shape...) .* ones(repeats...)) + end + out +end From 1f63ee054a84c914f04d05114ccfc4e39467dcf3 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 26 Aug 2021 10:03:42 -0400 Subject: [PATCH 75/83] Update dependency for PlotlyBase 0.8.15 needed for `add_layout_image! --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ad65d4df..fd0a80aa 100644 --- a/Project.toml +++ b/Project.toml @@ -22,7 +22,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" Blink = "0.12" JSExpr = "0.5, 1" JSON = "0.20, 0.21" -PlotlyBase = "0.8.9" +PlotlyBase = "0.8.15" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" From 58b7be0810797b6060be649dcba52b9dc4cf523e Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 26 Aug 2021 10:04:15 -0400 Subject: [PATCH 76/83] bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index fd0a80aa..812c871e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.5" +version = "0.18.6" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From 2dfbf276471ff139a51cad43f04a3fc07c839a57 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Thu, 26 Aug 2021 10:50:54 -0400 Subject: [PATCH 77/83] bug for add_trace! method --- src/display.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display.jl b/src/display.jl index 17d143d2..c74e629e 100644 --- a/src/display.jl +++ b/src/display.jl @@ -184,7 +184,7 @@ end function add_trace!(p::SyncPlot, trace::GenericTrace; kw...) add_trace!(p.plot, trace; kw...) - send_command(p.scope, :addTraces, trace) + send_command(p.scope, :react, p.plot.data, p.plot.layout) end From c57cd27cb6d961e6cba5c26744b22200ceb11f0c Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 3 Sep 2021 10:10:22 -0400 Subject: [PATCH 78/83] Rename election.geojson to election_geo.geojson --- datasets/{election.geojson => election_geo.geojson} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename datasets/{election.geojson => election_geo.geojson} (100%) diff --git a/datasets/election.geojson b/datasets/election_geo.geojson similarity index 100% rename from datasets/election.geojson rename to datasets/election_geo.geojson From 2e250683b05db24201ee7d588e6ea3d47c378cc2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 3 Sep 2021 14:11:09 +0000 Subject: [PATCH 79/83] Update Artifacts.toml for artifact version 2.3.0 --- Artifacts.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Artifacts.toml b/Artifacts.toml index 8043d489..bbf5a64b 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,6 +1,6 @@ [plotly-artifacts] -git-tree-sha1 = "9f06f8e2fd71afece4d3fc49d36438b9a6b5c1ad" +git-tree-sha1 = "77a3f27e7a726685591b11ef3174d43a9a974c9a" [[plotly-artifacts.download]] - sha256 = "6942d56622e1585cc5aee576d6d465ac35e05a4aecb521815d991ecb0829a76d" + sha256 = "3b753911705e17ec01d565fa69b5cf08e01b772efed8f4f6e506a0ebea2c6354" url = "https://github.com/JuliaPlots/PlotlyJS.jl/releases/download/plotly-artifacts-2.3.0/plotly-artifacts-2.3.0.tar.gz" From 94944c52b026afb95a7ef2c70d74d7c63b5c3326 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 3 Sep 2021 10:14:44 -0400 Subject: [PATCH 80/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 812c871e..cd9d814a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.6" +version = "0.18.7" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" From 8b4bbc4ca29481557595a4990f83ad9e135abf26 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 17 Sep 2021 11:09:12 -0400 Subject: [PATCH 81/83] Update index.md --- docs/src/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/src/index.md b/docs/src/index.md index 43cb5e77..69b50298 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -17,6 +17,14 @@ plotly graphics to files [_plotlyjs]: https://plot.ly/javascript [_plotlyref]: https://plotly.com/javascriptreference +## Getting Help + +There are three primary resources for getting help with using this library: + +1. The [Julia discourse page](https://discourse.julialang.org/). This is your best option if the question you have is specific to Julia. Appropriate topics include how to integrate with other Julia packages or how to use plotly features unique to PlotlyJS.jl +2. The [julia channel](https://community.plotly.com/c/graphing-libraries/julia/23) on the plotly discussion page. This is your best option if you want visibility from other parts of the plotly community including python and R users. +3. [GitHub Issues](https://github.com/JuliaPlots/PlotlyJS.jl/issues). This is appropriate only for bug reports or feature requests. General usage questions should not be posted to GitHub, but rather should utilize one of the discussion forums above + ## Installation To install PlotlyJS.jl, open up a Julia REPL, press `]` to enter package mode and type: From 0fc22c0a20a80f46b5c2ce871114d3b10dfba2f7 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 5 Oct 2021 09:38:18 -0400 Subject: [PATCH 82/83] fix doc build --- src/display.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display.jl b/src/display.jl index c74e629e..ba1c50ad 100644 --- a/src/display.jl +++ b/src/display.jl @@ -16,7 +16,7 @@ end function Base.show(io::IO, mm::MIME"text/html", p::SyncPlot) # if we are rendering docs -- short circuit and display html if get_renderer() == DOCS - return show(io, mm, p.plot, full_html=false, include_plotlyjs="require-loaded", include_mathjax=false) + return show(io, mm, p.plot, full_html=false, include_plotlyjs="require-loaded", include_mathjax=missing) end show(io, mm, p.scope) end From 562082f9a584a22bd9bda42dc0402640b5e8f611 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Tue, 5 Oct 2021 10:00:55 -0400 Subject: [PATCH 83/83] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cd9d814a..ce62a48d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlotlyJS" uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" authors = ["Spencer Lyon "] -version = "0.18.7" +version = "0.18.8" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"