diff --git a/.gitignore b/.gitignore index 54c049475cc..4fefea4a4f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ node_modules +_site + +__pycache__ build/* !build/plotcss.js @@ -17,3 +20,7 @@ tags !.github/ !.gitignore !.npmignore + +tmp + +docs/ diff --git a/BUILDING.md b/BUILDING.md deleted file mode 100644 index c5ee25e7765..00000000000 --- a/BUILDING.md +++ /dev/null @@ -1,67 +0,0 @@ -# Alternative ways to require or build plotly.js -Depending on your needs you may require/import one of [the distributed plotly.js packages](https://github.com/plotly/plotly.js/blob/master/dist/README.md) or [a plotly.js/lib index file](https://github.com/plotly/plotly.js/tree/master/lib) and integrate it into your application. - -The sections below provide additional info in respect to alternative building frameworks. - ---- -## Angular CLI - -Since Angular uses webpack under the hood and doesn't allow easily to change it's webpack configuration, there is some work needed using a `custom-webpack` builder to get things going. - -1. Install [`@angular-builders/custom-webpack`](https://www.npmjs.com/package/@angular-builders/custom-webpack) and [ify-loader@v1.1.0+](https://github.com/hughsk/ify-loader) -2. Create a new `extra-webpack.config.js` beside `angular.json`. - -> extra-webpack.config.json -```javascript -module.exports = { - module: { - rules: [ - { - test: /\.js$/, - include: [ - path.resolve(__dirname, "node_modules/plotly.js") - ], - loader: 'ify-loader' - } - ] - }, -}; -``` - -3. Change the builder in `angular.json` to `"@angular-builders/custom-webpack:browser` and configure it correctly to use our new webpack config. - -> angular.json -```json -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "MY_PROJECT_NAME": { - "root": "", - "sourceRoot": "src", - "projectType": "application", - "prefix": "app", - "schematics": { - "@schematics/angular:component": { - "styleext": "scss" - } - }, - "architect": { - "build": { - "builder": "@angular-builders/custom-webpack:browser", - "options": { - .... - "customWebpackConfig": { - "path": "./extra-webpack.config.js", - "replaceDuplicatePlugins": true, - "mergeStrategies": {"module.rules": "merge"} - } - } - } -... -``` - -It's important to set `projects.x.architect.build.builder` and `projects.x.architect.build.options.customWebpackConfig`. -If you have more projects in your `angular.json` make sure to adjust their settings accordingly. ---- diff --git a/code_of_conduct.md b/CODE_OF_CONDUCT.md similarity index 100% rename from code_of_conduct.md rename to CODE_OF_CONDUCT.md diff --git a/CONTRIBUTING-DOCS.md b/CONTRIBUTING-DOCS.md new file mode 100644 index 00000000000..ebcf4e94298 --- /dev/null +++ b/CONTRIBUTING-DOCS.md @@ -0,0 +1,151 @@ +# Contribute to Plotly's [JavaScript Documentation](https://plotly.com/javascript/) + +Plotly welcomes contributions to its [open-source JavaScript graphing libraries documentation](https://plotly.com/javascript) from its community of users. + +Our JavaScript tutorials are written in HTML files in the `_posts/plotly_js` directory of this repository. + +## Contribute Quickly to Plotly's JavaScript Graphing Library Documentation + +To quickly make a contribution to Plotly's JavaScript graphing libraries documentation, simply submit a pull request with the change you would like to suggest. This can be done using the GitHub graphical user interface at https://github.com/plotly/graphing-library-docs. + +The easiest way to do this is to follow the `Edit this page on GitHub` link at the top right of the page you are interested in contributing to: + +![Screen Shot 2020-01-07 at 12 45 39 PM](https://user-images.githubusercontent.com/1557650/71916356-bfe53800-314b-11ea-92b6-eb763037f6d5.png) + +**You don't have to worry about breaking the site when you submit a pull request!** This is because your change will not be merged to production immediately. A Plotly team member will first perform a code review on your pull request in order to ensure that it definitely increases the health of Plotly's graphing libraries codebase. + +## Develop Locally + +For contributions such as new example posts, we recommend setting up a local development environment so that you can test your changes as you work on them. + +**See the `How To Get The Application Working Locally` section of the [Contributing Guide](https://github.com/plotly/graphing-library-docs/blob/master/Contributing.md) to learn how to clone this repository to your local development environment and install its dependencies.** + +Then follow these instructions to create or modify a new post. If the post is the first of its chart type, you need to create an index page for it first. + +## Create An Index Page For A New Chart Type: + +If you are documenting a new chart type, then you need to create an index page for it before creating the actual example page. + +1. In `documentation/_posts/plotly_js`, create a folder titled with the chart type or topic you're adding to the documentation (i.e. `bar`). + +2. `cd` into the folder you created and create an HTML index file for the chart type named: `yyyy-mm-dd-chart_type_plotly_js_index.html`. Copy the index file template below. Make sure to replace placeholder text! +``` +--- +name: Add-Chart-Type-or-Topic +permalink: javascript/add-chart-type-or-topic/ +description: How to make a D3.js-based add-chart-type-or-topic in javascript. Add an additional sentence summarizing chart-type or topic. +layout: langindex +thumbnail: thumbnail/mixed.jpg +language: plotly_js +page_type: example_index +display_as: **SEE BELOW +order: 5 +--- + {% assign examples = site.posts | where:"language","plotly_js" | where:"suite","add-chart-type-or-topic"| sort: "order" %} + {% include posts/auto_examples.html examples=examples %} +``` + - Make sure to update `_includes/posts/documentation_eg.html`, `_includes/layouts/side-bar.html`, and `_data/display_as_py_r_js.yml` and the CI python scripts with the new chart type! + + - Index pages for chart categories must have `order: 5`. + +## Create A New Example Post: + +1. In the folder containing the examples for the chart type you are writing documentation for, create a file named: `yyyy-mm-dd-example-title.html`. + +2. Copy the example post template below and write JavaScript code to demonstrate the feature you are documenting. + - If `plot_url` front-matter is not present, then the resulting chart will be displayed inline and a `Try It Codepen` button will be automatically generated. + - If `plot_url` front-matter is present, then the URL given will be embedded in an `iframe` below the example. +``` +--- +description: How to make a D3.js-based bar chart in javascript. Seven examples of +grouped, stacked, overlaid, and colored bar charts. +display_as: basic +language: plotly_js +layout: base +name: Bar Charts +order: 3 +page_type: example_index +permalink: javascript/bar-charts/ +redirect_from: javascript-graphing-library/bar-charts/ +thumbnail: thumbnail/bar.jpg **MORE INFO ON ADDING THUMBNAILS BELOW +markdown_content: | + indented content in markdown format which will prefix an example ****SEE BELOW +--- +var data = [ + { + x: ['giraffes', 'orangutans', 'monkeys'], + y: [20, 14, 23], + type: 'bar' + }The +]; + +Plotly.newPlot('myDiv', data); +``` + +- `display_as` sets where your tutorial is displayed. Make sure to update `_includes/posts/documentation_eg.html` with the new chart type!: + - 'file_settings' = https://plotly.com/javascript/plotly-fundamentals + - 'basic' = https://plotly.com/javascript/basic-charts + - 'statistical' = https://plotly.com/javascript/statistical-charts + - 'scientific' = https://plotly.com/javascript/scientific-charts + - 'financial' = https://plotly.com/javascript/financial-charts + - 'maps' = https://plotly.com/javascript/maps + - '3d_charts' = https://plotly.com/javascript/3d-charts + - See additional options [HERE](https://github.com/plotly/graphing-library-docs/blob/master/_includes/posts/documentation_eg.html#L1) + + - `order` defines the order in which the tutorials appear in each section on plot.ly/javascript. + - Note The `order` of posts within a `display_as` must be a set of consecutive integers (i.e. [1, 2, 3, 4, 5, 6, ...]). + - If a post has an `order` less than 5, it **MUST** also have the `page_type: example_index` front-matter so that it gets displayed on the index page. + + - `markdown_content` is rendered directly above the examples. In general, it is best to *avoid* paragraph-formatted explanation and let the simplicity of the example speak for itself, but that's not always possible. Take note that headings in this block *are* reflected in the sidebar. + + - Thumbnail images should named `your-tutorial-chart.jpg` and be *EXACTLY* 160px X 160px. + - posts in the following `display_as` categories **MUST** have a thumbnail + - 'file_settings' = https://plotly.com/javascript/plotly-fundamentals + - 'basic' = https://plotly.com/javascript/basic-charts + - 'statistical' = https://plotly.com/javascript/statistical-charts + - 'scientific' = https://plotly.com/javascript/scientific-charts + - 'financial' = https://plotly.com/javascript/financial-charts + - 'maps' = https://plotly.com/javascript/maps + - '3d_charts' = https://plotly.com/javascript/3d-charts + - Thumbnail images should be clear and interesting. You do not need to capture the ENTIRE chart, but rather focus on the most interesting part of the chart. + - Use images.plot.ly for adding new images. The password is in the Plotly 1Password Engineering Vault. + - Log-in here: https://661924842005.signin.aws.amazon.com/console + - From the Amazon Web Services Console select S3 (Scalable Storage in the Cloud) then select plotly-tutorials -> plotly-documentation -> thumbnail + - Now from All Buckets /plotly-tutorials/plotly-documentation/thumbnail select the Actions dropdown and upload your .jpg file + +## Modify An Existing Post: + +1. Find the post you want to modify in `_posts/plotly_js`. Then, open the HTML file that contains that post and modify either the front-matter or the JavaScript. + +# Best Practices: + - `order` examples from basic to advanced + - avoid the use of global JavaScript variables for `data` and `layout`. + - make the chart display in a DOM element named `myDiv` + - use the `.newPlot()` function + - use "real" data to make the examples realistic and useful for users. + - avoid using random or dummy data as much as humanly possible! Should only be a last resort. + - upload data files to https://github.com/plotly/datasets as importing data rather than pasting a large chunk of data in the tutorial creates a cleaner example. + - use `var config = {mapboxAccessToken: "your access token"};` if your chart requires Mapbox authentication. `"your access token` will replaced by Plotly's private token at build time. In development mode, you will need to create a `_data/mapboxtoken.yml` file and paste Plotly's non-URL restricted Mapbox key into it. This is available in 1Password. + +## Make a Pull Request + - Ready for your changes to be reviewed? Make a pull request! + + - Create a feature branch and use `git status` to list changed files. + ``` + git checkout -b your_feature_branch + git status + ``` + - Add, commit, and push the files that you'd like to add to your PR: + ``` + git add file-a + git add file-b + git commit -m 'message about your changes' + git push origin your_feature_branch + ``` + - Visit the [documentation repo](https://github.com/plotly/graphing-library-docs) and open a pull request!. You can then tag **@jdamiba** for a review. + +## Style Edits + +Please refer to our [Styles README](https://github.com/plotly/graphing-library-docs/blob/master/style_README.md) + +Thanks for contributing to our documentation!! diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14be34d8b8d..96d7b25c2d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,11 +12,11 @@ environment for doing development and running tests. Please check out our [Code of Conduct](code_of_conduct.md). Don't tl:dr; it but the general idea is to be nice. -## Plotly.js vs Plotly.py and Plotly.R +## Plotly.js vs Plotly.py -[Plotly.js](https://plotly.com/javascript) is a standalone Javascript data visualization library, and it also powers the Python and R modules named `plotly` in those respective ecosystems (referred to as [Plotly.py](https://plotly.com/python) and [Plotly.R](http://plotly.com/r), respectively, for clarity). There also exist Plotly.js-powered libraries for other languages such as Julia, Scala, Rust, .NET and even C++! +[Plotly.js](https://plotly.com/javascript) is a standalone Javascript data visualization library, and it also powers the Python module named `plotly` (referred to as [Plotly.py](https://plotly.com/python) for clarity). -The basic architecture of Plotly.js is to accept [JSON](https://json.org/) representation of figures that adhere to the [figure schema](https://plotly.com/javascript/reference/index/) and draw interactive graphical representations of these figures in a browser. Libraries in other languages like Python and R provide idiomatic interfaces for users of those languages to create and manipulate these JSON structures, and arrange for them to be rendered in a browser context by Plotly.js. This means that in many cases, when a Python or R user wishes to add a feature to the library they know as `plotly`, the relevant changes must be implemented in Plotly.js, in this repo. +The basic architecture of Plotly.js is to accept [JSON](https://json.org/) representation of figures that adhere to the [figure schema](https://plotly.com/javascript/reference/index/) and draw interactive graphical representations of these figures in a browser. The Python library provides an idiomatic interface for Python users to create and manipulate these JSON structures, and arrange for them to be rendered in a browser context by Plotly.js. This means that in many cases, when a Python user wishes to add a feature to the library they know as `plotly`, the relevant changes must be implemented in Plotly.js, in this repo. ## How do changes get made to Plotly.js? @@ -37,7 +37,8 @@ The basic process for adding new features or fixing bugs is as follows. Please n The current Plotly.js maintainers are all employees of Plotly (the company) and one of their primary responsibilities is ensuring the process above runs smoothly. It is worth noting that maintainers and non-maintainer Plotly employees all follow the process above: proposing changes, iterating on proposals and eventually developing and reviewing each other's pull requests. As mentioned above, maintainers look after bug fixes, performance, security, documentation and concerns that impact the long-term prospects for this library. In terms of development work, maintainers tend to prioritize issues that do or are likely to impact Plotly customers, as well as on [sponsored features or bug fixes](https://plot.ly/products/consulting-and-oem/). Sponsored work proceeds via the process listed above, albeit with the option of conducting portions of the "discussion" step in a confidential setting if desired. Please note that maintainers are happy and eager to help with community-led pull requests, independent of customer-driven development priorities :) ### The Plotly.js Community -The Plotly.js community, construed fairly broadly, includes the maintainers and all users of Plotly.js and associated projects ([Plotly.py](https://plotly.com/python), [Dash](https://dash.plotly.com/), [Plotly.R](https://plotly.com/r), [Chart Studio](https://plotly.com/chart-studio) and many others). The community includes people from any background, domain, affiliation and level of technical expertise, for example (but not limited to!) employees of small or large companies or startups; employees or students of universities or other educational institutions; government employees and contractors; employees and volunteers of non-profits; individual hobbyists etc. + +The Plotly.js community, construed fairly broadly, includes the maintainers and all users of Plotly.js and associated projects ([Plotly.py](https://plotly.com/python), [Dash](https://dash.plotly.com/), and others supported by the open source community). The community includes people from any background, domain, affiliation and level of technical expertise, for example (but not limited to!) employees of small or large companies or startups; employees or students of universities or other educational institutions; government employees and contractors; employees and volunteers of non-profits; individual hobbyists etc. **Anyone in the community is encouraged to contribute to every step of the process described above!** Creating issues to report bugs or suggest new behaviours is a valuable contribution to this project, as is proposing a concrete set of changes to address issues created by anyone at any time. In the same way, giving feedback on proposals created by anyone in the community is valuable, as is, of course, development and review work. [Proposing changes to the documentation of Plotly.js or associated projects](https://github.com/plotly/graphing-library-docs/blob/master/README.md) is an extremely valuable form of contribution, as is [asking or answering questions on our community forum](https://community.plotly.com/), as it creates a record of a question and discussion, which others can stumble across later and use to further their own work. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..58f1ff6f6e8 --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ +# Manage plotly.js documentation. + +RUN = uv run +SCHEMA_SRC = test/plot-schema.json +HANDWRITTEN = content +TMP = tmp + +EXAMPLES_DIR = ${HANDWRITTEN}/plotly_js +EXAMPLES_IN := $(shell find "${EXAMPLES_DIR}" -name '*.html') +EXAMPLES_TMP = ${TMP}/javascript +EXAMPLES_OUT = ${EXAMPLES_TMP}/axes/index.html # could be any of the generated files + +REFERENCE_DIR = ${HANDWRITTEN}/reference_pages/javascript/ +REFERENCE_IN := $(wildcard ${REFERENCE_DIR}/*.html) +REFERENCE_TMP = ${TMP}/reference +REFERENCE_OUT = ${REFERENCE_TMP}/bar/index.html # could be any of the generated files + +DOCS_DIR=docs +DOCS_OUT=${DOCS_DIR}/sitemap.xml + +## commands: show available commands +commands: + @grep -h -E '^##' ${MAKEFILE_LIST} | sed -e 's/## //g' | column -t -s ':' + +## docs: rebuild full documentation in `./docs` +.PHONY: docs +docs: ${DOCS_OUT} + +${DOCS_OUT}: ${EXAMPLES_OUT} ${REFERENCE_OUT} + @${RUN} mkdocs build + +## examples: build intermediate example documentation in ./tmp +examples: ${EXAMPLES_OUT} + +${EXAMPLES_OUT}: bin/example_pages.py ${EXAMPLES_IN} + @mkdir -p ${TMP} + @${RUN} bin/example_pages.py --indir ${EXAMPLES_DIR} --outdir ${EXAMPLES_TMP} --jsversion 3.2.1 + +## reference: build intermediate reference documentation in ./tmp +reference: ${REFERENCE_OUT} + +${REFERENCE_OUT}: bin/reference_pages.py ${SCHEMA_SRC} ${REFERENCE_IN} + @mkdir -p ${TMP} + @${RUN} bin/reference_pages.py --schema ${SCHEMA_SRC} --outdir ${REFERENCE_TMP} ${REFERENCE_IN} + +## serve: display documentation +serve: + ${RUN} mkdocs serve + +## --: -- + +## clean: clean up repository +clean: + @find . -name '*~' -delete + @find . -name '.DS_Store' -delete + @rm -rf docs ${TMP} + +## format: reformat Python code +format: + @ruff format bin + +## lint: check code and project +lint: + @ruff check bin diff --git a/README.md b/README.md index 218a7d49c7a..e56ac0da82c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![circle ci](https://circleci.com/gh/plotly/plotly.js.svg?style=shield)](https://circleci.com/gh/plotly/plotly.js) [![MIT License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/plotly/plotly.js/blob/master/LICENSE) -[Plotly.js](https://plotly.com/javascript) is a standalone Javascript data visualization library, and it also powers the Python and R modules named `plotly` in those respective ecosystems (referred to as [Plotly.py](https://plotly.com/python) and [Plotly.R](http://plotly.com/r)). +[Plotly.js](https://plotly.com/javascript) is a standalone Javascript data visualization library, and it also powers the Python module named `plotly` (referred to as [Plotly.py](https://plotly.com/python)). Plotly.js can be used to produce dozens of chart types and visualizations, including statistical charts, 3D graphs, scientific charts, SVG and tile maps, financial charts and more. @@ -22,22 +22,20 @@ Plotly.js can be used to produce dozens of chart types and visualizations, inclu +## Table of Contents -## Table of contents - -* [Load as a node module](#load-as-a-node-module) -* [Load via script tag](#load-via-script-tag) +* [Load as a Node Module](#load-as-a-node-module) +* [Load via Script Tag](#load-via-script-tag) * [Bundles](#bundles) -* [Alternative ways to load and build plotly.js](#alternative-ways-to-load-and-build-plotlyjs) * [Documentation](#documentation) -* [Bugs and feature requests](#bugs-and-feature-requests) +* [Bugs and Feature Requests](#bugs-and-feature-requests) * [Contributing](#contributing) -* [Notable contributors](#notable-contributors) +* [Notable Contributors](#notable-contributors) * [Copyright and license](#copyright-and-license) * [Community](#community) ---- -## Load as a node module +## Load as a Node Module + Install [a ready-to-use distributed bundle](https://github.com/plotly/plotly.js/blob/master/dist/README.md) ```sh npm i --save plotly.js-dist-min @@ -54,10 +52,10 @@ var Plotly = require('plotly.js-dist-min') You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plotly.js-dist) if you prefer using an unminified package. ---- -## Load via script tag +## Load via Script Tag + +### The `script` HTML Element -### The script HTML element > In the examples below `Plotly` object is added to the window scope by `script`. The `newPlot` method is then used to draw an interactive figure as described by `data` and `layout` into the desired `div` here named `gd`. As demonstrated in the example above basic knowledge of `html` and [JSON](https://en.wikipedia.org/wiki/JSON) syntax is enough to get started i.e. with/without JavaScript! To learn and build more with plotly.js please visit [plotly.js documentation](https://plotly.com/javascript). ```html @@ -77,6 +75,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo ``` Alternatively you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag. + ```html ``` @@ -95,7 +96,9 @@ While non-minified source files may contain characters outside UTF-8, it is reco > Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.5. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version. ### MathJax + You could load either version two or version three of MathJax files, for example: + ```html ``` @@ -108,21 +111,20 @@ You could load either version two or version three of MathJax files, for example Please refer to `devtools/test_dashboard/index-mathjax3chtml.html` to see an example. ### Need to have several WebGL graphs on a page? + You may simply load [virtual-webgl](https://github.com/greggman/virtual-webgl) script for WebGL 1 (not WebGL 2) before loading other scripts. + ```html ``` ## Bundles + There are two kinds of plotly.js bundles: + 1. Complete and partial official bundles that are distributed to `npm` and the `CDN`, described in [the dist README](https://github.com/plotly/plotly.js/blob/master/dist/README.md). 2. Custom bundles you can create yourself to optimize the size of bundle depending on your needs. Please visit [CUSTOM_BUNDLE](https://github.com/plotly/plotly.js/blob/master/CUSTOM_BUNDLE.md) for more information. ---- -## Alternative ways to load and build plotly.js -If your library needs to bundle or directly load [plotly.js/lib/index.js](https://github.com/plotly/plotly.js/blob/master/lib/index.js) or parts of its modules similar to [index-basic](https://github.com/plotly/plotly.js/blob/master/lib/index-basic.js) in some other way than via an official or a custom bundle, or in case you want to tweak the default build configurations, then please visit [`BUILDING.md`](https://github.com/plotly/plotly.js/blob/master/BUILDING.md). - ---- ## Documentation Official plotly.js documentation is hosted at [https://plotly.com/javascript](https://plotly.com/javascript). @@ -130,18 +132,15 @@ Official plotly.js documentation is hosted at [https://plotly.com/javascript](ht These pages are generated by the Plotly [graphing-library-docs repo](https://github.com/plotly/graphing-library-docs) built with [Jekyll](https://jekyllrb.com/) and publicly hosted on GitHub Pages. For more info about contributing to Plotly documentation, please read through [contributing guidelines](https://github.com/plotly/graphing-library-docs/blob/master/README.md). ---- -## Bugs and feature requests +## Bugs and Feature Requests Have a bug or a feature request? Please [open a Github issue](https://github.com/plotly/plotly.js/issues/new) keeping in mind the [issue guidelines](https://github.com/plotly/plotly.js/blob/master/.github/ISSUE_TEMPLATE.md). You may also want to read about [how changes get made to Plotly.js](https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md) ---- ## Contributing Please read through our [contributing guidelines](https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md). Included are directions for opening issues, using plotly.js in your project and notes on development. ---- -## Notable contributors +## Notable Contributors Plotly.js is at the core of a large and dynamic ecosystem with many contributors who file issues, reproduce bugs, suggest improvements, write code in this repo (and other upstream or downstream ones) and help users in the Plotly community forum. The following people deserve special recognition for their outsized contributions to this ecosystem: @@ -171,7 +170,6 @@ Plotly.js is at the core of a large and dynamic ecosystem with many contributors |**Alex Vados**| [@alexander-daniel](https://github.com/alexander-daniel) | Hall of Fame | |**Mojtaba Samimi** | [@archmoj](https://github.com/archmoj) | Hall of Fame | ---- ## Copyright and license Code and documentation copyright 2025 Plotly, Inc. @@ -184,7 +182,6 @@ This project is maintained under the [Semantic Versioning guidelines](https://se See the [Releases section](https://github.com/plotly/plotly.js/releases) of our GitHub project for changelogs for each release version of plotly.js. ---- ## Community * Follow us on [X](https://x.com/plotlygraphs) and [LinkedIn](https://www.linkedin.com/company/plotly/) for the latest Plotly news. diff --git a/bin/example_pages.py b/bin/example_pages.py new file mode 100644 index 00000000000..c09c9e6862c --- /dev/null +++ b/bin/example_pages.py @@ -0,0 +1,267 @@ +"""Rebuild plotly.js example pages from Jekyll HTML.""" + +import argparse +import frontmatter +from html import escape +import json +from markdown import markdown +from pathlib import Path +import re +from mkdocs.config import load_config +from utils import _log + + +HTML_TAG_RE = re.compile(r"<[^>]*>") +SUITE_RE = re.compile(r'where:"suite","(.+?)"') + + +def main(): + """Main driver.""" + args = _parse_args() + index_files, example_files = _get_source_files(args) + for path, record in index_files.items(): + _process(args, path, record, example_files) + + +def _get_source_files(args): + """Load and classify source files.""" + index_files = {} + example_files = {} + for filepath in args.indir.glob("**/*.html"): + page = frontmatter.load(filepath) + record = {"header": page.metadata, "content": page.content} + if not str(filepath).endswith("index.html"): + example_files[filepath] = record + elif "posts/auto_examples.html" in page.content: + index_files[filepath] = record + return index_files, example_files + + +def _get_suite(path, content): + """Get suite specification from index file.""" + m = SUITE_RE.search(content) + if _log(not m, f"cannot find 'suite' in index file {path}"): + return None + return m.group(1) + + +def _make_html(args, examples): + """Build HTML page full of examples.""" + accum = [] + for counter, (path, record) in enumerate(examples): + header = record["header"] + content = record["content"] + accum.append('
\n') + accum.append('
\n') + + _make_html_name(accum, path, header) + + accum.append('
\n') + _make_html_text(accum, path, header, content) + if _make_plot_url(accum, path, header, content): + pass + elif _make_mydiv(args, accum, path, header, content, counter): + pass + accum.append("
\n") + + accum.append("
\n") + accum.append("
\n\n") + + return "".join(accum) + + +HTML_NAME = """\ +

+ {name} +

+""" + + +def _make_html_name(accum, path, header): + """Make example name block.""" + name = header["name"] if header["name"] else "" + _log(not name, f"{path} does not have name") + name = _strip_html(name.replace(" ", "-").replace(",", "").lower()) + accum.append(HTML_NAME.format(name=name)) + + +HTML_TEXT = """\ + {markdown_content} + {page_content} + {description} +""" + +HTML_TEXT_PAGE_CONTENT = """\ +
+
{text}
+
+""" + +HTML_TEXT_DESCRIPTION = """\ +
+ {text} +
+""" + + +def _make_html_text(accum, path, header, content): + """Make text of example.""" + # columns = "twelve" if "horizontal" in header.get("arrangement", "") else "six" + markdown_content = markdown(header.get("markdown_content", "")) + page_content = ( + HTML_TEXT_PAGE_CONTENT.format(text=escape(content)) if content else "" + ) + description = header.get("description", "") + description = HTML_TEXT_DESCRIPTION.format(text=description) if description else "" + accum.append( + HTML_TEXT.format( + markdown_content=markdown_content, + page_content=page_content, + description=description, + ) + ) + + +MYDIV_D3 = "\n\t<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js'></script>" +MYDIV_MATHJAX = "\n\t<script src='//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML'></script>" + +MYDIV = """\ +
+ + +
+
+ +""" + + +def _make_mydiv(args, accum, path, header, content, counter): + """Handle myDiv case.""" + if ("'myDiv'" not in content) and ('"myDiv"' not in content): + return False + + d3 = MYDIV_D3 if "d3." in content else "" + mathjax = MYDIV_MATHJAX if "remember to load MathJax.js" in content else "" + # columns = "twelve" if "horizontal" in header.get("arrangement", "") else "six" + name = header["name"] + unique_mydiv = f"myDiv_{counter}" + content_mydiv = content.replace("myDiv", unique_mydiv) + content_json = escape(json.dumps(content)) + + # Get JS Version + mkdocs_path = Path(__file__).resolve().parent.parent / "mkdocs.yml" + config = load_config(config_file=str(mkdocs_path)) + extra = config.get("extra", {}) + version = extra.get("js_version") + + accum.append( + MYDIV.format( + d3=d3, + mathjax=mathjax, + name=name, + unique_mydiv=unique_mydiv, + content_mydiv=content_mydiv, + content_json=content_json, + jsversion=version, + ) + ) + + return True + + +PLOT_URL = """\ + {plot_url_img} + {plot_url_embed} +""" + +PLOT_URL_IMG = """\ + +""" + +PLOT_URL_EMBED = """\ + +""" + + +def _make_plot_url(accum, path, header, content): + """Handle specified plot URL.""" + plot_url = header.get("plot_url") + if not plot_url: + return False + columns = "twelve" if "horizontal" in header.get("arrangement", "") else "six" + + plot_url_img = "" + plot_url_embed = "" + if (".gif" in plot_url) or (".png" in plot_url): + plot_url_img = PLOT_URL_IMG.format(plot_url=plot_url) + else: + embed_class = ".embed" if "plot.ly" in plot_url else "" + width = f"{header.get('width', '550')}px" + height = f"{header.get('height', '550')}px" + plot_url_embed = PLOT_URL_EMBED.format( + plot_url=plot_url, + embed_class=embed_class, + width=width, + height=height, + ) + accum.append( + PLOT_URL.format( + columns=columns, + plot_url=plot_url, + plot_url_img=plot_url_img, + plot_url_embed=plot_url_embed, + ) + ) + + return True + + +def _parse_args(): + """Parse command-line arguments.""" + parser = argparse.ArgumentParser(description="Generate HTML example documentation") + parser.add_argument("--indir", type=Path, help="Input directory") + parser.add_argument("--jsversion", help="Plotly JS version") + parser.add_argument("--schema", type=Path, help="Path to plot schema JSON file") + parser.add_argument("--outdir", type=Path, help="Output directory") + parser.add_argument( + "--verbose", type=int, default=0, help="Integer verbosity level" + ) + return parser.parse_args() + + +def _process(args, path, record, example_files): + """Process a section.""" + if (suite := _get_suite(path, record["content"])) is None: + return + + examples = [ + (p, r) + for p, r in example_files.items() + if r["header"].get("suite", None) == suite + ] + examples.sort( + key=lambda pair: (example_files[pair[0]]["header"]["order"], str(pair[0])) + ) + + section = record["header"]["permalink"].strip("/").split("/")[-1] + _log(args.verbose > 0, f"...{section}: {len(examples)}") + + html = _make_html(args, examples) + + output_path = args.outdir / section / "index.html" + output_path.parent.mkdir(parents=True, exist_ok=True) + output_path.write_text(html) + + +def _strip_html(text): + """Remove HTML tags from text.""" + return HTML_TAG_RE.sub("", text) + + +if __name__ == "__main__": + main() diff --git a/bin/generate_reference_pages.py b/bin/generate_reference_pages.py new file mode 100644 index 00000000000..7f6418917cb --- /dev/null +++ b/bin/generate_reference_pages.py @@ -0,0 +1,46 @@ +"""Generate reference pages to satisfy MkDocs.""" + +import os +from pathlib import Path +import mkdocs_gen_files + + +def generate_pages(path, output_dir, parent, nav=None): + """ + Walk through a directory and generate Markdown files that + include the corresponding HTML snippets. + """ + with os.scandir(path) as it: + entries = sorted(it, key=lambda e: e.name) + for folder in entries: + dir_name = folder.name + ".md" + file_path = os.path.join(output_dir, dir_name) + + with open(file_path, "w") as f: + f.write(f"# {folder.name}\n") + f.write(f'--8<-- "{parent}/{folder.name}/index.html"\n') + + # Add markdown file to navigation + if nav is not None: + nav[(folder.name)] = dir_name + + it.close() + + +nav = mkdocs_gen_files.Nav() + +parent = Path(__file__).resolve().parent.parent +ref_path = f"{parent}/tmp/reference" +ref_output_dir = f"{parent}/pages/reference/" + +examples_path = f"{parent}/tmp/javascript" +examples_output_dir = f"{parent}/pages/" + +os.makedirs(ref_output_dir, exist_ok=True) +os.makedirs(examples_output_dir, exist_ok=True) + +generate_pages(ref_path, ref_output_dir, "reference", nav) +generate_pages(examples_path, examples_output_dir, "javascript") + +# with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: +# nav_file.writelines(nav.build_literate_nav()) diff --git a/bin/reference_pages.py b/bin/reference_pages.py new file mode 100644 index 00000000000..46e89ed1acb --- /dev/null +++ b/bin/reference_pages.py @@ -0,0 +1,419 @@ +"""Rebuild a reference page from the Jekyll HTML and plot schema JSON file.""" + +import argparse +from html import escape +import json +from pathlib import Path +import re +import sys + +from utils import _log, _str + + +INCLUDE_BLOCK_RE = re.compile( + r'{%\s*include\s+posts/reference-block.html\s+parentlink="(.+?)"\s+block="(.+?)"\s+parentpath="(.+?)"\s+mustmatch="(.+?)"\s*%}' +) +INCLUDE_TRACE_RE = re.compile( + r'\{%\s*include\s+posts/reference-trace.html\s+trace_name="(.+?)"\s+trace_data=site\.data\.plotschema\.traces\.(.+?)\s*%}' +) +TITLE_RE = re.compile(r"

.+?(.+?).*

") + + +PLOT_SCHEMA_CONTENT = """\ +
+ A {trace_name} trace is an object with the key "type" equal to "{trace_data_attributes_type}" + (i.e. {{"type": "{trace_data_attributes_type}"}}) and any of the keys listed below. +

{trace_data_meta_description}

+
+""" + +PLOT_SCHEMA_REPLACEMENTS = ( + ("*", '"'), + ("{array}", "array"), + ("{arrays}", "arrays"), + ("{object}", "object"), + ("{2D array}", "2D array"), +) + +OBJ_EXCLUDES = { + "_arrayAttrRegexps", + "_deprecated", + "_isLinkedToArray", + "_isSubplotObj", + "description", + "editType", + "extras", + "flags", + "impliedEdits", + "items", + "magic_underscores", + "role", + "stream", + "transformsuid", +} + +SKIP_MUSTMATCH = { + "annotations", + "coloraxis", + "geo", + "images", + "mapbox", + "polar", + "scene", + "shapes", + "sliders", + "smith", + "ternary", + "updatemenus", + "xaxis", + "yaxis", +} + +ANNOTATION = " ".join( + [ + "
An annotation is a text element that can be placed anywhere in the plot.", + "It can be positioned with respect to relative coordinates in the plot", + "or with respect to the actual data coordinates of the graph.", + "Annotations can be shown with or without an arrow.", + ] +) + + +def main(): + """Main driver.""" + args = _parse_args() + schema = json.loads(args.schema.read_text()) + assert "traces" in schema, f"'traces' missing from {args.schema}" + + for src_path in args.inputs: + _log(args.verbose > 0, f"...{src_path}") + src_content = src_path.read_text() + + m = TITLE_RE.search(src_content) + if _log(not m, f"failed to match title in {src_path}"): + continue + title = m.group(1) + + if m := INCLUDE_TRACE_RE.search(src_content): + if _log( + m.group(1) != title, + f"title {title} != include title {m.group(1)} in {src_path}", + ): + continue + trace_name = m.group(2) + trace_data = schema["traces"].get(trace_name, None) + if _log( + trace_data is None, f"trace '{trace_name}' not found in {args.schema}" + ): + continue + html = _reference_trace(args, schema, src_path, trace_name, trace_data) + + elif m := INCLUDE_BLOCK_RE.search(src_content): + parent_link = m.group(1) + block = m.group(2) + parent_path = m.group(3) + mustmatch = m.group(4) + accum = [] + attributes = schema["layout"]["layoutAttributes"] + _reference_block( + args, + src_path, + accum, + attributes, + parent_link, + parent_path, + block, + mustmatch, + ) + html = _replace_special("".join([_str(a) for a in accum])) + + else: + _log(not m, f"failed to match include in {src_path}") + continue + + output_path = args.outdir / title.replace(".", "/") / "index.html" + output_path.parent.mkdir(parents=True, exist_ok=True) + output_path.write_text(html) + + +def _bool_or_star(value): + if isinstance(value, bool): + return str(value).lower() + else: + return f"*{value}*" + + +def _comma(accum, i, text=","): + """Conditionally insert comma in list.""" + if i > 0: + accum.append(f"{text} ") + + +def _get(value, key, default=None): + """Simulate Jekyll's obj.field (which is 'nil' if 'obj' is a string).""" + if isinstance(value, str): + return default + assert isinstance(value, dict), f"{value} not recognized" + return value.get(key, default) + + +def _parse_args(): + """Parse command-line arguments.""" + parser = argparse.ArgumentParser( + description="Generate HTML reference documentation" + ) + parser.add_argument("inputs", nargs="+", type=Path, help="Input Jekyll files") + parser.add_argument("--schema", type=Path, help="Path to plot schema JSON file") + parser.add_argument("--outdir", type=Path, help="Output directory") + parser.add_argument( + "--verbose", type=int, default=0, help="Integer verbosity level" + ) + return parser.parse_args() + + +def _reference_block( + args, src_path, accum, attributes, parent_link, parent_path, block, mustmatch=None +): + """Generate HTML documentation for a trace's attributes.""" + accum.append("\n") + + +def _reference_block_valtype(src_path, accum, key, value): + """Handle a value type.""" + outer = " " * 12 + inner = " " * 20 + accum.append("
\n") + + if (_get(value, "valType") == "enumerated") or _get( + _get(value, "valType"), "values" + ): + accum.append(f"{outer}Type:\n") + accum.append(f"{inner}{_get(value, 'valType')}") + if _get(value, "arrayOk"): + accum.append(f" or array of {_get(value, 'valType')}s\n") + accum.append(f"{inner}, one of (\n") + for i, sub_value in enumerate(_get(value, "values")): + _comma(accum, i, "|") + accum.append(f"{_bool_or_star(sub_value)}") + accum.append(f"{inner})\n") + + elif _get(value, "valType") in {"number", "integer"}: + accum.append(f"{inner}Type: {_get(value, 'valType')}") + if _get(value, "arrayOk"): + accum.append(f" or array of {_get(value, 'valType')}s") + if _get(value, "min") and _get(value, "max"): + accum.append( + f" between or equal to {_get(value, 'min')} and {_get(value, 'max')}\n" + ) + elif _get(value, "min"): + accum.append(f" greater than or equal to {_get(value, 'min')}\n") + elif _get(value, "max"): + accum.append(f" less than or equal to {_get(value, 'max')}\n") + + elif _get(value, "valType") == "boolean": + accum.append(f"{inner}Type: {_get(value, 'valType')}") + if _get(value, "arrayOk"): + accum.append(f" or array of {_get(value, 'valType')}s") + + elif _get(value, "valType") == "flaglist": + accum.append(f"{inner}Type: {_get(value, 'valType')} string.\n\n") + flags = _get(value, "flags") + if not flags: + print(f"no flags for flaglist {key} in {src_path}", file=sys.stderr) + return + + accum.append(f"{inner}Any combination of ") + for i, f in enumerate(flags): + _comma(accum, i) + accum.append(_bool_or_star(f)) + accum.append(" joined with a *+*\n") + accum.append(f"{inner}OR ") + + extras = _get(value, "extras") + if extras: + for i, x in enumerate(extras): + _comma(accum, i) + accum.append(_bool_or_star(x)) + + accum.append(".\n\n") + accum.append(f"{inner}
Examples: ") + accum.append(f"*{flags[0]}*, ") + accum.append(f"*{flags[1]}*, ") + accum.append(f"*{flags[0]}+{flags[1]}*, ") + if len(flags) > 2: + accum.append(f"*{flags[0]}+{flags[1]}+{flags[2]}*, ") + if extras: + accum.append(f"*{extras[0]}*") + accum.append("\n\n") + + elif _get(value, "valType") == "data_array": + accum.append(f"{inner}Type: {_get(value, 'valType')}\n") + + elif _get(value, "valType") == "info_array": + accum.append("{inner}Type: {{array}}\n") + + elif _get(value, "valType") == "color": + accum.append(f"{inner}Type: {_get(value, 'valType')}") + if _get(value, "arrayOk"): + accum.append(f" or array of {_get(value, 'valType')}s") + + elif _get(value, "valType") == "any": + accum.append(f"{inner}Type: number or categorical coordinate string\n") + + elif _get(value, "valType") == "string": + if "src" in key: + return + accum.append(f"{inner}Type: string") + if _get(value, "arrayOk"): + accum.append(" or array of strings") + + else: + accum.append(f"{inner}Type: {_get(value, 'valType')}\n") + + if _get(value, "role") == "object": + if _get(value, "items"): + accum.append(f"{inner}Type: {{array}} of {{object}}s") + else: + accum.append(f"{inner}Type: {{object}}") + + +def _reference_block_dflt(src_path, accum, key, value): + """Handle a default.""" + outer = " " * 16 + if _get(value, "valType") == "flaglist": + accum.append( + f"{outer}
Default: *{_get(value, 'dflt')}*\n" + ) + else: + accum.append(f"{outer}
Default: ") + if _get(value, "dflt") == "": + accum.append("**") + elif _get(value, "valType") == "colorscale": + temp = [f"[{', '.join(_str(d))}]" for d in _get(value, "dflt")] + accum.append(f"[{', '.join(temp)}]") + elif _get(value, "valType") in {"info_array", "colorlist"}: + accum.append(f"[{', '.join([_str(x) for x in _get(value, 'dflt')])}]") + elif (_get(value, "valType") in {"string", "color"}) or ( + _get(value, "dflt") == "auto" + ): + accum.append(f"*{_get(value, 'dflt')}*") + elif (_get(value, "valType") == "enumerated") and ( + _get(value, "dflt") not in {"true", "false"} + ): + accum.append(f"*{_get(value, 'dflt')}*") + else: + accum.append(_get(value, "dflt")) + accum.append("\n") + + +def _reference_block_array(src_path, accum, key, value): + """Handle an array.""" + outer = " " * 12 + inner = " " * 16 + accum.append(f"{outer}
Type: {{array}} of {{object}} where\n") + accum.append(f"{outer}each {{object}} has one or more of the keys listed below.\n") + if key == "annotations": + if not _get(value, "descipription"): + accum.append(f"{inner}{ANNOTATION}\n") + + +def _reference_block_object( + args, src_path, accum, parent_link, parent_path, key, value +): + """Handle an object with a recursive call.""" + parent_path = f"{parent_path}-{key}" + if _get(value, "items"): + # This will break if there is ever more than one type of item in items, + # but for now it's just "shape" and "annotation" + for item_key, item_value in _get(value, "items").items(): + attributes = item_value + else: + attributes = value + _reference_block( + args, src_path, accum, attributes, parent_link, parent_path, "nested" + ) + + +def _reference_trace(args, schema, src_path, trace_name, trace_data): + """Generate HTML documentation for a trace.""" + plot_schema_content = PLOT_SCHEMA_CONTENT.format( + trace_name=trace_name, + trace_data_attributes_type=trace_data["attributes"]["type"], + trace_data_meta_description=trace_data["meta"]["description"], + ) + accum = [plot_schema_content] + + parent_link = trace_name + parent_path = f"data[type={trace_name}]" + attributes = trace_data["attributes"] + _reference_block( + args, src_path, accum, attributes, parent_link, parent_path, "data" + ) + + return _replace_special("".join([_str(a) for a in accum])) + + +def _replace_special(text): + """Handle our funky special-case strings.""" + for original, replacement in PLOT_SCHEMA_REPLACEMENTS: + text = text.replace(original, replacement) + return text + + +def _skip_mustmatch(key, mustmatch): + if mustmatch is None: + return False + if mustmatch == "global": + return key in SKIP_MUSTMATCH + elif key != mustmatch: + return True + else: + return False + + +if __name__ == "__main__": + main() diff --git a/bin/utils.py b/bin/utils.py new file mode 100644 index 00000000000..8c900f56409 --- /dev/null +++ b/bin/utils.py @@ -0,0 +1,21 @@ +"""Documentation generation utilities.""" + +import sys + + +def _log(condition, msg): + """Conditionally report progress.""" + if condition: + print(msg, file=sys.stderr) + return condition + + +def _str(val): + """Hacky string conversion.""" + if isinstance(val, str): + return val + if isinstance(val, bool): + return str(val).lower() + if isinstance(val, int): + return str(val) + return str(val) diff --git a/content/index.html b/content/index.html new file mode 100644 index 00000000000..294b98a660b --- /dev/null +++ b/content/index.html @@ -0,0 +1,92 @@ +--- +name: Plotly Open Source Graphing Libraries +permalink: /api/ +redirect_from: +- / +- /graphing-libraries/ +--- + + + + +{% include layouts/head.html %} + + + {% include layouts/google-tag-body.html %} + + {% include layouts/_header-main.html %} + +
+
+
+
+
+

Plotly Open Source Graphing Libraries

+ +

+ Interactive charts and maps for Python, Javascript, and Dash. +

+
+
+
+
+
+ +
+ +
+
+
+ + {% include layouts/_footer-main.html %} + + + + diff --git a/content/plotly_js/3d/3d-cluster/3d-point-cluster.html b/content/plotly_js/3d/3d-cluster/3d-point-cluster.html new file mode 100644 index 00000000000..6f5509abf4c --- /dev/null +++ b/content/plotly_js/3d/3d-cluster/3d-point-cluster.html @@ -0,0 +1,81 @@ +--- +name: 3D Point Clustering +language: plotly_js +suite: 3d-cluster +order: 0 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/alpha_shape.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var data = [{ + x: unpack(rows, 'x'), + y: unpack(rows, 'y'), + z: unpack(rows, 'z'), + mode: 'markers', + type: 'scatter3d', + marker: { + color: 'rgb(23, 190, 207)', + size: 2 + } + },{ + alphahull: 7, + opacity: 0.1, + type: 'mesh3d', + x: unpack(rows, 'x'), + y: unpack(rows, 'y'), + z: unpack(rows, 'z') + }]; + + var layout = { + autosize: true, + height: 480, + scene: { + aspectratio: { + x: 1, + y: 1, + z: 1 + }, + camera: { + center: { + x: 0, + y: 0, + z: 0 + }, + eye: { + x: 1.25, + y: 1.25, + z: 1.25 + }, + up: { + x: 0, + y: 0, + z: 1 + } + }, + xaxis: { + type: 'linear', + zeroline: false + }, + yaxis: { + type: 'linear', + zeroline: false + }, + zaxis: { + type: 'linear', + zeroline: false + } + }, + title: { + text: '3d point clustering' + }, + width: 477 + }; + + Plotly.newPlot('myDiv', data, layout); + +}); diff --git a/content/plotly_js/3d/3d-cluster/3d_point_cluster_index.html b/content/plotly_js/3d/3d-cluster/3d_point_cluster_index.html new file mode 100644 index 00000000000..9c64706ff38 --- /dev/null +++ b/content/plotly_js/3d/3d-cluster/3d_point_cluster_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a 3D Cluster Graph in JavaScript. +display_as: 3d_charts +language: plotly_js +layout: base +name: 3D Cluster Graph +order: 7 +permalink: javascript/3d-point-clustering/ +redirect_from: javascript-graphing-library/3d-point-clustering/ +thumbnail: thumbnail/3d-clusters.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-cluster" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/3d-cone/3d-cone-plotly_js_index.html b/content/plotly_js/3d/3d-cone/3d-cone-plotly_js_index.html new file mode 100644 index 00000000000..599c4533ea1 --- /dev/null +++ b/content/plotly_js/3d/3d-cone/3d-cone-plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make 3D cone plots in javascript. +display_as: 3d_charts +language: plotly_js +layout: base +name: 3D Cone Plots +order: 8 +permalink: javascript/cone-plot/ +redirect_from: javascript/3d-cone/ +thumbnail: thumbnail/3dcone.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3dcone" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/3d-cone/basic-3d-cone.html b/content/plotly_js/3d/3d-cone/basic-3d-cone.html new file mode 100644 index 00000000000..621c8cfb7b2 --- /dev/null +++ b/content/plotly_js/3d/3d-cone/basic-3d-cone.html @@ -0,0 +1,24 @@ +--- +name: Basic 3D Cone +language: plotly_js +suite: 3dcone +order: 1 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + type: "cone", + x: [1], y: [1], z: [1], + u: [1], v: [1], w: [0] +}] + +var layout = { + "scene": { + "camera": { + "eye": {x: -0.76, y: 1.8, z: 0.92} + } + } +} + +Plotly.newPlot('myDiv',data,layout) diff --git a/content/plotly_js/3d/3d-cone/lighting.html b/content/plotly_js/3d/3d-cone/lighting.html new file mode 100644 index 00000000000..d65813e86fb --- /dev/null +++ b/content/plotly_js/3d/3d-cone/lighting.html @@ -0,0 +1,126 @@ +--- +name: 3D Cone Lighting +language: plotly_js +suite: 3dcone +order: 3 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + type: "cone", + name: "base", + x: [1, 1, 1], + y: [1, 2, 3], + z: [1, 1, 1], + u: [1, 2, 3], + v: [1, 1, 2], + w: [4, 4, 1], + hoverinfo: "u+v+w+name", + showscale: false + }, + { + type: "cone", + name: "opacity:0.3", + x: [2, 2, 2], + y: [1, 2, 3], + z: [1, 1, 1], + u: [1, 2, 3], + v: [1, 1, 2], + w: [4, 4, 1], + hoverinfo: "u+v+w+name", + showscale: false, + opacity: 0.3 + }, + { + type: "cone", + name: "lighting.ambient:0.3", + x: [3, 3, 3], + y: [1, 2, 3], + z: [1, 1, 1], + u: [1, 2, 3], + v: [1, 1, 2], + w: [4, 4, 1], + hoverinfo: "u+v+w+name", + showscale: false, + lighting: {ambient: 0.3} + }, + { + type: "cone", + name: "lighting.diffuse:0.3", + x: [4, 4, 4], + y: [1, 2, 3], + z: [1, 1, 1], + u: [1, 2, 3], + v: [1, 1, 2], + w: [4, 4, 1], + hoverinfo: "u+v+w+name", + showscale: false, + lighting: {diffuse: 0.3} + }, + { + type: "cone", + name: "lighting.specular:2", + x: [5, 5, 5], + y: [1, 2, 3], + z: [1, 1, 1], + u: [1, 2, 3], + v: [1, 1, 2], + w: [4, 4, 1], + hoverinfo: "u+v+w+name", + showscale: false, + lighting: {specular: 2} + }, + { + type: "cone", + name: "lighting.roughness:1", + x: [6, 6, 6], + y: [1, 2, 3], + z: [1, 1, 1], + u: [1, 2, 3], + v: [1, 1, 2], + w: [4, 4, 1], + hoverinfo: "u+v+w+name", + showscale: false, + lighting: {roughness: 1} + }, + { + type: "cone", + name: "lighting.fresnel:2", + x: [7, 7, 7], + y: [1, 2, 3], + z: [1, 1, 1], + u: [1, 2, 3], + v: [1, 1, 2], + w: [4, 4, 1], + hoverinfo: "u+v+w+name", + showscale: false, + lighting: {fresnel: 2} + }, + { + type: "cone", + name: "lighting.position x:0,y:0,z:1e5", + x: [8, 8, 8], + y: [1, 2, 3], + z: [1, 1, 1], + u: [1, 2, 3], + v: [1, 1, 2], + w: [4, 4, 1], + hoverinfo: "u+v+w+name", + showscale: false, + lightposition: {x: 0, y: 0, z: 1e5} +}] + +var layout = { + scene: { + aspectmode: "data", + camera: { + eye: {x: 0.05, y: -2.6, z: 2} + } + }, + width: 500, + height: 500, + margin: {t: 0, b: 0, l: 0, r: 0} +} + +Plotly.newPlot('myDiv',data,layout) diff --git a/content/plotly_js/3d/3d-cone/multiple-3d-cone.html b/content/plotly_js/3d/3d-cone/multiple-3d-cone.html new file mode 100644 index 00000000000..2feb33e8ef5 --- /dev/null +++ b/content/plotly_js/3d/3d-cone/multiple-3d-cone.html @@ -0,0 +1,38 @@ +--- +name: Multiple 3D Cone +language: plotly_js +suite: 3dcone +order: 2 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + type: "cone", + x: [1, 2, 3], + y: [1, 2, 3], + z: [1, 2, 3], + u: [1, 0, 0], + v: [0, 3, 0], + w: [0, 0, 2], + sizemode: "absolute", + sizeref: 2, + anchor: "tip", + colorbar: { + x: 0, + xanchor: "right", + side: "left" + } +}] + +var layout = { + scene: { + domain: {x: [0, 1]}, + camera: { + eye: {x: -1.57, y: 1.36, z: 0.58} + } + }, + width: 800 +} + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/3d/3d-isosurface/basic-isosurface.html b/content/plotly_js/3d/3d-isosurface/basic-isosurface.html new file mode 100644 index 00000000000..7e7e3da8b91 --- /dev/null +++ b/content/plotly_js/3d/3d-isosurface/basic-isosurface.html @@ -0,0 +1,36 @@ +--- +name: Basic Isosurface Plot +language: plotly_js +suite: isosurface +order: 1 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + type: "isosurface", + x: [0,0,0,0,1,1,1,1], + y: [0,1,0,1,0,1,0,1], + z: [1,1,0,0,1,1,0,0], + value: [1,2,3,4,5,6,7,8], + isomin: 2, + isomax: 6, + colorscale: "Reds" + } +]; + +var layout = { + margin: {t:0, l:0, b:0}, + scene: { + camera: { + eye: { + x: 1.88, + y: -2.12, + z: 0.96 + } + } + } +}; + +Plotly.newPlot('myDiv', data, layout, {showSendToCloud: true}); diff --git a/content/plotly_js/3d/3d-isosurface/isosurface-plotly_js_index.html b/content/plotly_js/3d/3d-isosurface/isosurface-plotly_js_index.html new file mode 100644 index 00000000000..f93e61bd781 --- /dev/null +++ b/content/plotly_js/3d/3d-isosurface/isosurface-plotly_js_index.html @@ -0,0 +1,13 @@ +--- +description: How to make 3D isosurface plots in javascript. +display_as: 3d_charts +language: plotly_js +layout: base +name: 3D Isosurface Plots +order: 10 +permalink: javascript/3d-isosurface-plots/ +thumbnail: thumbnail/isosurface.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","isosurface" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/3d-isosurface/isosurface-slices.html b/content/plotly_js/3d/3d-isosurface/isosurface-slices.html new file mode 100644 index 00000000000..35cd650780f --- /dev/null +++ b/content/plotly_js/3d/3d-isosurface/isosurface-slices.html @@ -0,0 +1,50 @@ +--- +name: Isosurface with Additional Slices +language: plotly_js +suite: isosurface +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/clebsch-cubic.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) {return parseFloat(row[key]); }); +} + +var data = [ + { + type: "isosurface", + x: unpack(rows, 'x'), + y: unpack(rows, 'y'), + z: unpack(rows, 'z'), + value: unpack(rows, 'value'), + isomin: -100, + isomax: 100, + surface: {show: true, count: 1, fill: 0.8}, + slices: {z: { + show: true, locations: [-0.3, 0.5] + }}, + caps: { + x: {show: false}, + y: {show: false}, + z: {show: false} + }, + } +]; + +var layout = { + margin: {t:0, l:0, b:0}, + scene: { + camera: { + eye: { + x: 1.86, + y: 0.61, + z: 0.98 + } + } + } +}; + +Plotly.newPlot('myDiv', data, layout, {showSendToCloud: true}); +}); diff --git a/content/plotly_js/3d/3d-isosurface/multiple-isosurfaces-caps.html b/content/plotly_js/3d/3d-isosurface/multiple-isosurfaces-caps.html new file mode 100644 index 00000000000..cbe30342945 --- /dev/null +++ b/content/plotly_js/3d/3d-isosurface/multiple-isosurfaces-caps.html @@ -0,0 +1,48 @@ +--- +name: Multiple Isosurfaces with Caps +language: plotly_js +suite: isosurface +order: 4 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/clebsch-cubic.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) {return parseFloat(row[key]); }); +} + +var data = [ + { + type: "isosurface", + x: unpack(rows, 'x'), + y: unpack(rows, 'y'), + z: unpack(rows, 'z'), + value: unpack(rows, 'value'), + isomin: -10, + isomax: 10, + surface: {show: true, count: 4, fill: 1, pattern: 'odd'}, + caps: { + x: {show: true}, + y: {show: true}, + z: {show: true} + }, + } +]; + +var layout = { + margin: {t:0, l:0, b:0}, + scene: { + camera: { + eye: { + x: 1.86, + y: 0.61, + z: 0.98 + } + } + } +}; + +Plotly.newPlot('myDiv', data, layout, {showSendToCloud: true}); +}); + diff --git a/content/plotly_js/3d/3d-line/3d-line-spiral.html b/content/plotly_js/3d/3d-line/3d-line-spiral.html new file mode 100644 index 00000000000..c00bf962050 --- /dev/null +++ b/content/plotly_js/3d/3d-line/3d-line-spiral.html @@ -0,0 +1,37 @@ +--- +name: 3D Line Spiral Plot +language: plotly_js +suite: 3d-line +order: 2 +sitemap: false +arrangement: horizontal +--- +var pointCount = 3142; +var i, r; + +var x = []; +var y = []; +var z = []; +var c = []; + +for(i = 0; i < pointCount; i++) + { + r = i * (pointCount - i); + x.push(r * Math.cos(i / 30)); + y.push(r * Math.sin(i / 30)); + z.push(i); + c.push(i) + } + +Plotly.newPlot('myDiv', [{ + type: 'scatter3d', + mode: 'lines', + x: x, + y: y, + z: z, + opacity: 0.7, + line: { + width: 10, + color: c, + colorscale: 'Viridis'} + }]); \ No newline at end of file diff --git a/content/plotly_js/3d/3d-line/3d-line_plotly_js_index.html b/content/plotly_js/3d/3d-line/3d-line_plotly_js_index.html new file mode 100644 index 00000000000..0c20f58808f --- /dev/null +++ b/content/plotly_js/3d/3d-line/3d-line_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make 3D line plots in javascript. +display_as: 3d_charts +language: plotly_js +layout: base +name: 3D Line Plots +order: 5 +page_type: example_index +permalink: javascript/3d-line-plots/ +redirect_from: javascript-graphing-library/3d-line-plots/ +thumbnail: thumbnail/3d-line.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-line" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/3d-line/random-walk.html b/content/plotly_js/3d/3d-line/random-walk.html new file mode 100644 index 00000000000..824f0b2ab74 --- /dev/null +++ b/content/plotly_js/3d/3d-line/random-walk.html @@ -0,0 +1,91 @@ +--- +name: 3D Random Walk Plot +language: plotly_js +suite: 3d-line +order: 3 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/_3d-line-plot.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) + { return row[key]; }); + } + +var trace1 = { + x: unpack(rows, 'x1'), + y: unpack(rows, 'y1'), + z: unpack(rows, 'z1'), + mode: 'lines', + marker: { + color: '#1f77b4', + size: 12, + symbol: 'circle', + line: { + color: 'rgb(0,0,0)', + width: 0 + }}, + line: { + color: '#1f77b4', + width: 1 + }, + type: 'scatter3d' +}; + +var trace2 = { + x: unpack(rows, 'x2'), + y: unpack(rows, 'y2'), + z: unpack(rows, 'z2'), + mode: 'lines', + marker: { + color: '#9467bd', + size: 12, + symbol: 'circle', + line: { + color: 'rgb(0,0,0)', + width: 0 + }}, + line: { + color: 'rgb(44, 160, 44)', + width: 1 + }, + type: 'scatter3d' +}; + +var trace3 = { + x: unpack(rows, 'x3'), + y: unpack(rows, 'y3'), + z: unpack(rows, 'z3'), + mode: 'lines', + marker: { + color: '#bcbd22', + size: 12, + symbol: 'circle', + line: { + color: 'rgb(0,0,0)', + width: 0 + }}, + line: { + color: '#bcbd22', + width: 1 + }, + type: 'scatter3d' +}; + +var data = [trace1, trace2, trace3]; +var layout = { + title: { + text: '3D Line Plot' + }, + autosize: false, + width: 500, + height: 500, + margin: { + l: 0, + r: 0, + b: 0, + t: 65 + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/3d/3d-line/simple-3d-line+markers.html b/content/plotly_js/3d/3d-line/simple-3d-line+markers.html new file mode 100644 index 00000000000..01fee224c88 --- /dev/null +++ b/content/plotly_js/3d/3d-line/simple-3d-line+markers.html @@ -0,0 +1,43 @@ +--- +name: 3D Line + Markers Plot +language: plotly_js +suite: 3d-line +order: 1 +sitemap: false +arrangement: horizontal +--- +var pointCount = 31; +var i, r; + +var x = []; +var y = []; +var z = []; +var c = []; + +for(i = 0; i < pointCount; i++) +{ + r = 10 * Math.cos(i / 10); + x.push(r * Math.cos(i)); + y.push(r * Math.sin(i)); + z.push(i); + c.push(i) +} + +Plotly.newPlot('myDiv', [{ + type: 'scatter3d', + mode: 'lines+markers', + x: x, + y: y, + z: z, + line: { + width: 6, + color: c, + colorscale: "Viridis"}, + marker: { + size: 3.5, + color: c, + colorscale: "Greens", + cmin: -20, + cmax: 50 + }}, +]); \ No newline at end of file diff --git a/content/plotly_js/3d/3d-line/simple-3d-line-plot.html b/content/plotly_js/3d/3d-line/simple-3d-line-plot.html new file mode 100644 index 00000000000..5edbb41d93c --- /dev/null +++ b/content/plotly_js/3d/3d-line/simple-3d-line-plot.html @@ -0,0 +1,33 @@ +--- +name: 3D Line Plot +language: plotly_js +suite: 3d-line +order: 0 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/3d-line1.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) + { return row[key]; }); } + +var x = unpack(rows , 'x'); +var y = unpack(rows , 'y'); +var z = unpack(rows , 'z'); +var c = unpack(rows , 'color'); +Plotly.newPlot('myDiv', [{ + type: 'scatter3d', + mode: 'lines', + x: x, + y: y, + z: z, + opacity: 1, + line: { + width: 6, + color: c, + reversescale: false + } +}], { + height: 640 +}); +}); diff --git a/content/plotly_js/3d/3d-mesh/3d-alphahull-mesh.html b/content/plotly_js/3d/3d-mesh/3d-alphahull-mesh.html new file mode 100644 index 00000000000..703cef4e249 --- /dev/null +++ b/content/plotly_js/3d/3d-mesh/3d-alphahull-mesh.html @@ -0,0 +1,34 @@ +--- +name: 3D Mesh Plot with Alphahull +language: plotly_js +suite: 3d-mesh +order: 1 +sitemap: false +arrangement: horizontal +--- +// Generating random data.. +a=[]; b=[]; c=[]; +for(i=0;i<50;i++) + { + var a_ = Math.random(); + a.push(a_); + + var b_ = Math.random(); + b.push(b_); + + var c_ = Math.random(); + c.push(c_); + } +// Plotting the mesh +var data=[ + { + alphahull:5, + opacity:0.8, + color:'rgb(200,100,300)', + type: 'mesh3d', + x: a, + y: b, + z: c, + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/3d/3d-mesh/3d-mesh-index.html b/content/plotly_js/3d/3d-mesh/3d-mesh-index.html new file mode 100644 index 00000000000..44c19e36759 --- /dev/null +++ b/content/plotly_js/3d/3d-mesh/3d-mesh-index.html @@ -0,0 +1,14 @@ +--- +description: How to make 3D mesh plots in javascript. +display_as: 3d_charts +language: plotly_js +layout: base +name: 3D Mesh Plots +order: 4 +page_type: example_index +permalink: javascript/3d-mesh/ +thumbnail: thumbnail/3d-mesh.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-mesh" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/3d-mesh/3d-simple-mesh.html b/content/plotly_js/3d/3d-mesh/3d-simple-mesh.html new file mode 100644 index 00000000000..2f3c2af0104 --- /dev/null +++ b/content/plotly_js/3d/3d-mesh/3d-simple-mesh.html @@ -0,0 +1,34 @@ +--- +name: Simple 3D Mesh Plot +language: plotly_js +suite: 3d-mesh +order: 0 +sitemap: true +arrangement: horizontal +--- + +// Generating random data.. +a=[]; b=[]; c=[]; +for(i=0;i<50;i++) + { + var a_ = Math.random(); + a.push(a_); + + var b_ = Math.random(); + b.push(b_); + + var c_ = Math.random(); + c.push(c_); + } +// Plotting the mesh +var data=[ + { + opacity:0.8, + color:'rgb(300,100,200)', + type: 'mesh3d', + x: a, + y: b, + z: c, + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/3d/3d-mesh/cube-mesh.html b/content/plotly_js/3d/3d-mesh/cube-mesh.html new file mode 100644 index 00000000000..d1106bc9512 --- /dev/null +++ b/content/plotly_js/3d/3d-mesh/cube-mesh.html @@ -0,0 +1,29 @@ +--- +name: 3D Mesh Cube +language: plotly_js +suite: 3d-mesh +order: 3 +sitemap: false +arrangement: horizontal +--- + +var intensity = [0, 0.14285714285714285, 0.2857142857142857, 0.42857142857142855, 0.5714285714285714, 0.7142857142857143, 0.8571428571428571, 1]; + +var data = [{ + type: "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: intensity, + colorscale: [ + [0, 'rgb(255, 0, 255)'], + [0.5, 'rgb(0, 255, 0)'], + [1, 'rgb(0, 0, 255)'] + ] + } +]; + +Plotly.newPlot('myDiv', data, {}); diff --git a/content/plotly_js/3d/3d-mesh/tetrahedron.html b/content/plotly_js/3d/3d-mesh/tetrahedron.html new file mode 100644 index 00000000000..1864ec37129 --- /dev/null +++ b/content/plotly_js/3d/3d-mesh/tetrahedron.html @@ -0,0 +1,26 @@ +--- +name: 3D Mesh Tetrahedron +language: plotly_js +suite: 3d-mesh +order: 2 +sitemap: false +arrangement: horizontal +--- +var data = [{ + type: "mesh3d", + x: [0, 1, 2, 0], + y: [0, 0, 1, 2], + z: [0, 2, 0, 1], + i: [0, 0, 0, 1], + j: [1, 2, 3, 2], + k: [2, 3, 1, 3], + intensity: [0, 0.33, 0.66, 1], + colorscale: [ + [0, 'rgb(255, 0, 0)'], + [0.5, 'rgb(0, 255, 0)'], + [1, 'rgb(0, 0, 255)'] + ] + } +]; + +Plotly.newPlot('myDiv', data, {}); diff --git a/content/plotly_js/3d/3d-scatter/3d-scatter_plotly_js_index.html b/content/plotly_js/3d/3d-scatter/3d-scatter_plotly_js_index.html new file mode 100644 index 00000000000..982d4d4f84a --- /dev/null +++ b/content/plotly_js/3d/3d-scatter/3d-scatter_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make 3D scatter plots in javascript. +display_as: 3d_charts +language: plotly_js +layout: base +name: 3D Scatter Plots +order: 1 +page_type: example_index +permalink: javascript/3d-scatter-plots/ +redirect_from: javascript-graphing-library/3d-scatter-plots/ +thumbnail: thumbnail/3d-scatter.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-scatter" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/3d-scatter/simple-3d-scatter.html b/content/plotly_js/3d/3d-scatter/simple-3d-scatter.html new file mode 100644 index 00000000000..d0655e52326 --- /dev/null +++ b/content/plotly_js/3d/3d-scatter/simple-3d-scatter.html @@ -0,0 +1,47 @@ +--- +name: 3D Scatter Plot +language: plotly_js +suite: 3d-scatter +order: 0 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/3d-scatter.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) + { return row[key]; });} + +var trace1 = { + x:unpack(rows, 'x1'), y: unpack(rows, 'y1'), z: unpack(rows, 'z1'), + mode: 'markers', + marker: { + size: 12, + line: { + color: 'rgba(217, 217, 217, 0.14)', + width: 0.5}, + opacity: 0.8}, + type: 'scatter3d' +}; + +var trace2 = { + x:unpack(rows, 'x2'), y: unpack(rows, 'y2'), z: unpack(rows, 'z2'), + mode: 'markers', + marker: { + color: 'rgb(127, 127, 127)', + size: 12, + symbol: 'circle', + line: { + color: 'rgb(204, 204, 204)', + width: 1}, + opacity: 0.8}, + type: 'scatter3d'}; + +var data = [trace1, trace2]; +var layout = {margin: { + l: 0, + r: 0, + b: 0, + t: 0 + }}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/3d/3d-streamtube/3d-streamtube-plotly_js_index.html b/content/plotly_js/3d/3d-streamtube/3d-streamtube-plotly_js_index.html new file mode 100644 index 00000000000..bc80988b791 --- /dev/null +++ b/content/plotly_js/3d/3d-streamtube/3d-streamtube-plotly_js_index.html @@ -0,0 +1,13 @@ +--- +description: How to make 3D streamtube plots in javascript. +display_as: 3d_charts +language: plotly_js +layout: base +name: 3D Streamtube Plots +order: 9 +permalink: javascript/streamtube-plot/ +thumbnail: thumbnail/streamtube.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","streamtube" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/3d-streamtube/basic-streamtube.html b/content/plotly_js/3d/3d-streamtube/basic-streamtube.html new file mode 100644 index 00000000000..c74cab0c7b8 --- /dev/null +++ b/content/plotly_js/3d/3d-streamtube/basic-streamtube.html @@ -0,0 +1,43 @@ +--- +name: Basic Streamtube Plot +language: plotly_js +suite: streamtube +order: 2 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/streamtube-basic.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var data = [{ + type: "streamtube", + x: unpack(rows, 'x'), + y: unpack(rows, 'y'), + z: unpack(rows, 'z'), + u: unpack(rows, 'u'), + v: unpack(rows, 'v'), + w: unpack(rows, 'w'), + sizeref: 0.5, + cmin: 0, + cmax: 3 + }] + + var layout = { + scene: { + camera: { + eye: { + x: -0.7243612458865182, + y: 1.9269804254717962, + z: 0.6704828299861716 + } + } + } + } + + Plotly.newPlot('myDiv', data, layout) + +}); diff --git a/content/plotly_js/3d/3d-streamtube/intro-streamtube.html b/content/plotly_js/3d/3d-streamtube/intro-streamtube.html new file mode 100644 index 00000000000..74ed19d94ad --- /dev/null +++ b/content/plotly_js/3d/3d-streamtube/intro-streamtube.html @@ -0,0 +1,10 @@ +--- +name: Introduction +language: plotly_js +suite: streamtube +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + In streamtube plots, attributes inlcude `x`, `y`, and `z`, which set the coorindates of the vector field, and `u`, `v`, and `w`, which sets the x, y, and z components of the vector field. Additionally, you can use `starts` to determine the streamtube's starting position. Lastly, `maxdisplayed` determines the maximum segments displayed in a streamtube. +--- diff --git a/content/plotly_js/3d/3d-streamtube/starting-position.html b/content/plotly_js/3d/3d-streamtube/starting-position.html new file mode 100644 index 00000000000..3ae2ac73261 --- /dev/null +++ b/content/plotly_js/3d/3d-streamtube/starting-position.html @@ -0,0 +1,55 @@ +--- +name: Starting Position and Segments +language: plotly_js +suite: streamtube +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/streamtube-wind.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return +row[key]; }); + } + + var data = [{ + type: 'streamtube', + x: unpack(rows, 'x'), + y: unpack(rows, 'y'), + z: unpack(rows, 'z'), + u: unpack(rows, 'u'), + v: unpack(rows, 'v'), + w: unpack(rows, 'w'), + starts: { + x: Array(16).fill(80), + y: [20,30,40,50,20,30,40,50,20,30,40,50,20,30,40,50], + z: [0,0,0,0,5,5,5,5,10,10,10,10,15,15,15,15] + }, + sizeref: 0.3, + colorscale: "Portland", + showscale: false, + maxdisplayed: 3000 + }] + + var layout = { + scene: { + aspectratio: { + x: 2, + y: 1, + z: 0.3 + } + }, + margin: { + t: 20, + b: 20, + l: 20, + r: 20 + }, + width: 600, + height: 400 + } + + Plotly.newPlot('myDiv', data, layout); + +}); diff --git a/content/plotly_js/3d/3d-surface/3d-surface_plotly_js_index.html b/content/plotly_js/3d/3d-surface/3d-surface_plotly_js_index.html new file mode 100644 index 00000000000..9642491d218 --- /dev/null +++ b/content/plotly_js/3d/3d-surface/3d-surface_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make 3D surface plots in javascript. +display_as: 3d_charts +language: plotly_js +layout: base +name: 3D Surface Plots +order: 3 +page_type: example_index +permalink: javascript/3d-surface-plots/ +redirect_from: javascript-graphing-library/3d-surface-plots/ +thumbnail: thumbnail/3d-surface.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-surface" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/3d-surface/elevations-3d-surface.html b/content/plotly_js/3d/3d-surface/elevations-3d-surface.html new file mode 100644 index 00000000000..9aa643ab28c --- /dev/null +++ b/content/plotly_js/3d/3d-surface/elevations-3d-surface.html @@ -0,0 +1,41 @@ +--- +name: Topographical 3D Surface Plot +language: plotly_js +suite: 3d-surface +order: 0 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var z_data=[ ] +for(i=0;i<24;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type: 'surface' + }]; + +var layout = { + title: { + text: 'Mt Bruno Elevation' + }, + autosize: false, + width: 500, + height: 500, + margin: { + l: 65, + r: 50, + b: 65, + t: 90, + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/3d/3d-surface/multiple-graphs-3d-surface.html b/content/plotly_js/3d/3d-surface/multiple-graphs-3d-surface.html new file mode 100644 index 00000000000..10d7a1aef2c --- /dev/null +++ b/content/plotly_js/3d/3d-surface/multiple-graphs-3d-surface.html @@ -0,0 +1,53 @@ +--- +name: Multiple 3D Surface Plots +language: plotly_js +suite: 3d-surface +order: 1 +sitemap: false +arrangement: horizontal +--- + +z1 = [ + [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 = []; +for (var i=0;i +
+ +
+ +
+

Plotly.js 3D Charts

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+ + + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","3d_charts" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/3d/ribbon-plots/ribbon-plot-example.html b/content/plotly_js/3d/ribbon-plots/ribbon-plot-example.html new file mode 100644 index 00000000000..159111076e2 --- /dev/null +++ b/content/plotly_js/3d/ribbon-plots/ribbon-plot-example.html @@ -0,0 +1,74 @@ +--- +name: Basic Ribbon Plot +language: plotly_js +suite: ribbon-plot +order: 0 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/3d-ribbon.json', function(figure){ + + var trace1 = { + x:figure.data[0].x, y:figure.data[0].y, z:figure.data[0].z, + name: '', + colorscale: figure.data[0].colorscale, + type: 'surface', + showscale: false + } + var trace2 = { + x:figure.data[1].x, y:figure.data[1].y, z:figure.data[1].z, + name: '', + colorscale: figure.data[1].colorscale, + type: 'surface', + showscale: false + } + var trace3 = { + x:figure.data[2].x, y:figure.data[2].y, z:figure.data[2].z, + colorscale: figure.data[2].colorscale, + type: 'surface', + showscale: false + } + var trace4 = { + x:figure.data[3].x, y:figure.data[3].y, z:figure.data[3].z, + colorscale: figure.data[3].colorscale, + type: 'surface', + showscale: false + } + var trace5 = { + x:figure.data[4].x, y:figure.data[4].y, z:figure.data[4].z, + colorscale: figure.data[4].colorscale, + type: 'surface', + showscale: false + } + var trace6 = { + x:figure.data[5].x, y:figure.data[5].y, z:figure.data[5].z, + colorscale: figure.data[5].colorscale, + type: 'surface', + showscale: false + } + var trace7 = { + x:figure.data[6].x, y:figure.data[6].y, z:figure.data[6].z, + name: '', + colorscale: figure.data[6].colorscale, + type: 'surface', + showscale: false + } + + var data = [trace1, trace2, trace3, trace4, trace5, trace6, trace7]; + + var layout = { + title: { + text: 'Ribbon Plot' + }, + showlegend: false, + autosize: true, + width: 600, + height: 600, + scene: { + xaxis: {title: {text: 'Sample #'}}, + yaxis: {title: {text: 'Wavelength'}}, + zaxis: {title: {text: 'OD'}} + } + }; + Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/3d/ribbon-plots/ribbon-plot-index.html b/content/plotly_js/3d/ribbon-plots/ribbon-plot-index.html new file mode 100644 index 00000000000..43599837367 --- /dev/null +++ b/content/plotly_js/3d/ribbon-plots/ribbon-plot-index.html @@ -0,0 +1,15 @@ +--- +description: How to make a D3.js-based ribbon plot in JavaScript. +display_as: 3d_charts +language: plotly_js +layout: base +name: Ribbon Plots +order: 2 +page_type: example_index +permalink: javascript/ribbon-plots/ +redirect_from: javascript-graphing-library/ribbon-plots/ +thumbnail: thumbnail/ribbon-plot.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","ribbon-plot" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/3d/trisurf/trisurf-basic.html b/content/plotly_js/3d/trisurf/trisurf-basic.html new file mode 100644 index 00000000000..ec33eefdb96 --- /dev/null +++ b/content/plotly_js/3d/trisurf/trisurf-basic.html @@ -0,0 +1,43 @@ +--- +name: Basic Trisurf Plot +language: plotly_js +suite: trisurf +order: 0 +sitemap: false +arrangement: horizontal +--- + +function trisurf(Tri, X, Y, Z, C) { + var data = { + type: 'mesh3d', + x: X, + y: Y, + z: Z, + i: Tri.map(function(f) { return f[0] }), + j: Tri.map(function(f) { return f[1] }), + k: Tri.map(function(f) { return f[2] }), + facecolor: C, + flatshading: true, + } + + Plotly.newPlot('myDiv', [data]) +} + + +//Example usage +trisurf( + [ + [0, 1, 2], + [0, 2, 3], + [0, 3, 1], + [1, 2, 3] + ], + [0, 1, 0, 0], + [0, 0, 1, 0], + [0, 0, 0, 1], + [ + 'rgb(0, 0, 0)', + 'rgb(255, 0, 0)', + 'rgb(0, 255, 0)', + 'rgb(0, 0, 255)' + ]) \ No newline at end of file diff --git a/content/plotly_js/3d/trisurf/trisurf-box.html b/content/plotly_js/3d/trisurf/trisurf-box.html new file mode 100644 index 00000000000..84371570f9d --- /dev/null +++ b/content/plotly_js/3d/trisurf/trisurf-box.html @@ -0,0 +1,77 @@ +--- +name: Extending the Cube Example for Boxes +language: plotly_js +suite: trisurf +order: 2 +sitemap: false +arrangement: horizontal +--- + +// Note x, y, z define the vertices for a unit cube + +var x = [0, 0, 1, 1, 0, 0, 1, 1]; +var y = [0, 1, 1, 0, 0, 1, 1, 0]; +var z = [0, 0, 0, 0, 1, 1, 1, 1]; +var i = [7, 0, 0, 0, 4, 4, 2, 6, 4, 0, 3, 7]; +var j = [3, 4, 1, 2, 5, 6, 5, 5, 0, 1, 2, 2]; +var k = [0, 7, 2, 3, 6, 7, 1, 2, 5, 5, 7, 6]; + +var range_x = [-2, 2]; +var range_y = [-3, 3]; +var range_z = [-1, 1]; + +function rectangle(x, y, z, range_x, range_y, range_z) { + + if (range_x.length !== 2 || range_y.length !== 2 || range_z.length !== 2) { + throw 'Ranges must contain 2 values'; + } + // we will forego other checks for to limit the length of the example + x = x.map(function(e, i) { + return range_x[e]; + }); + + y = y.map(function(e, i) { + return range_y[e]; + }); + + z = z.map(function(e, i) { + return range_z[e]; + }); + + return {x: x, y: y, z: z}; +} + +result = rectangle(x, y, z, range_x, range_y, range_z); + +// x, y, z now represent the vertices for the rectangular box with +// the ranges specified above +x = result.x; +y = result.y; +z = result.z; + +var facecolor = [ + 'rgb(50, 200, 200)', + 'rgb(100, 200, 255)', + 'rgb(150, 200, 115)', + 'rgb(200, 200, 50)', + 'rgb(230, 200, 10)', + 'rgb(255, 140, 0)' +]; + +facecolor2 = new Array(facecolor.length * 2); +facecolor.forEach(function(x, i) { + facecolor2[i * 2 + 1] = facecolor2[i * 2] = x; +}); + +var data = { + x: x, + y: y, + z: z, + i: i, + j: j, + k: k, + facecolor: facecolor2, + type: 'mesh3d' +}; + +Plotly.newPlot('myDiv', [data]); diff --git a/content/plotly_js/3d/trisurf/trisurf-cube.html b/content/plotly_js/3d/trisurf/trisurf-cube.html new file mode 100644 index 00000000000..08be28ca3e0 --- /dev/null +++ b/content/plotly_js/3d/trisurf/trisurf-cube.html @@ -0,0 +1,43 @@ +--- +name: Trisurf Cube +language: plotly_js +suite: trisurf +order: 1 +sitemap: false +arrangement: horizontal +--- + +var x = [0, 0, 1, 1, 0, 0, 1, 1] +var y = [0, 1, 1, 0, 0, 1, 1, 0] +var z = [0, 0, 0, 0, 1, 1, 1, 1] +var i = [7, 0, 0, 0, 4, 4, 2, 6, 4, 0, 3, 7] +var j = [3, 4, 1, 2, 5, 6, 5, 5, 0, 1, 2, 2] +var k = [0, 7, 2, 3, 6, 7, 1, 2, 5, 5, 7, 6] + +var facecolor = [ + 'rgb(50, 200, 200)', + 'rgb(100, 200, 255)', + 'rgb(150, 200, 115)', + 'rgb(200, 200, 50)', + 'rgb(230, 200, 10)', + 'rgb(255, 140, 0)' +] + +facecolor2 = new Array(facecolor.length * 2); + +facecolor.forEach(function(x, i) { + facecolor2[i * 2 + 1] = facecolor2[i * 2] = x; +}); + +var data = { + x: x, + y: y, + z: z, + i: i, + j: j, + k: k, + facecolor: facecolor2, + type: 'mesh3d' +} + +Plotly.newPlot('myDiv', [data]) diff --git a/content/plotly_js/3d/trisurf/trisurf_plotly_js_index.html b/content/plotly_js/3d/trisurf/trisurf_plotly_js_index.html new file mode 100644 index 00000000000..366598ae9fc --- /dev/null +++ b/content/plotly_js/3d/trisurf/trisurf_plotly_js_index.html @@ -0,0 +1,13 @@ +--- +description: How to make Trisurf in javascript. +display_as: 3d_charts +language: plotly_js +layout: base +name: Tri-Surf Plots +order: 6 +permalink: javascript/trisurf/ +thumbnail: thumbnail/trisurf.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","trisurf" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/animations/animations-slider/adding-sliders.html b/content/plotly_js/animations/animations-slider/adding-sliders.html new file mode 100644 index 00000000000..6e87af70fe2 --- /dev/null +++ b/content/plotly_js/animations/animations-slider/adding-sliders.html @@ -0,0 +1,172 @@ +--- +name: Animating with a Slider +plot_url: https://codepen.io/plotly/embed/KNrJQo/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: adding-sliders +order: 1 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv', function (err, data) { + // Create a lookup table to sort and regroup the columns of data, + // first by year, then by continent: + var lookup = {}; + function getData(year, continent) { + var byYear, trace; + if (!(byYear = lookup[year])) {; + byYear = lookup[year] = {}; + } + // If a container for this year + continent doesn't exist yet, + // then create one: + if (!(trace = byYear[continent])) { + trace = byYear[continent] = { + x: [], + y: [], + id: [], + text: [], + marker: {size: []} + }; + } + return trace; + } + + // Go through each row, get the right trace, and append the data: + for (var i = 0; i < data.length; i++) { + var datum = data[i]; + var trace = getData(datum.year, datum.continent); + trace.text.push(datum.country); + trace.id.push(datum.country); + trace.x.push(datum.lifeExp); + trace.y.push(datum.gdpPercap); + trace.marker.size.push(datum.pop); + } + + // Get the group names: + var years = Object.keys(lookup); + // In this case, every year includes every continent, so we + // can just infer the continents from the *first* year: + var firstYear = lookup[years[0]]; + var continents = Object.keys(firstYear); + + // Create the main traces, one for each continent: + var traces = []; + for (i = 0; i < continents.length; i++) { + var data = firstYear[continents[i]]; + // One small note. We're creating a single trace here, to which + // the frames will pass data for the different years. It's + // subtle, but to avoid data reference problems, we'll slice + // the arrays to ensure we never write any new data into our + // lookup table: + traces.push({ + name: continents[i], + x: data.x.slice(), + y: data.y.slice(), + id: data.id.slice(), + text: data.text.slice(), + mode: 'markers', + marker: { + size: data.marker.size.slice(), + sizemode: 'area', + sizeref: 200000 + } + }); + } + + // Create a frame for each year. Frames are effectively just + // traces, except they don't need to contain the *full* trace + // definition (for example, appearance). The frames just need + // the parts the traces that change (here, the data). + var frames = []; + for (i = 0; i < years.length; i++) { + frames.push({ + name: years[i], + data: continents.map(function (continent) { + return getData(years[i], continent); + }) + }) + } + + // Now create slider steps, one for each frame. The slider + // executes a plotly.js API command (here, Plotly.animate). + // In this example, we'll animate to one of the named frames + // created in the above loop. + var sliderSteps = []; + for (i = 0; i < years.length; i++) { + sliderSteps.push({ + method: 'animate', + label: years[i], + args: [[years[i]], { + mode: 'immediate', + transition: {duration: 300}, + frame: {duration: 300, redraw: false}, + }] + }); + } + + var layout = { + xaxis: { + title: {text: 'Life Expectancy'}, + range: [30, 85] + }, + yaxis: { + title: {text: 'GDP per Capita'}, + type: 'log' + }, + hovermode: 'closest', + // We'll use updatemenus (whose functionality includes menus as + // well as buttons) to create a play button and a pause button. + // The play button works by passing `null`, which indicates that + // Plotly should animate all frames. The pause button works by + // passing `[null]`, which indicates we'd like to interrupt any + // currently running animations with a new list of frames. Here + // The new list of frames is empty, so it halts the animation. + updatemenus: [{ + x: 0, + y: 0, + yanchor: 'top', + xanchor: 'left', + showactive: false, + direction: 'left', + type: 'buttons', + pad: {t: 87, r: 10}, + buttons: [{ + method: 'animate', + args: [null, { + mode: 'immediate', + fromcurrent: true, + transition: {duration: 300}, + frame: {duration: 500, redraw: false} + }], + label: 'Play' + }, { + method: 'animate', + args: [[null], { + mode: 'immediate', + transition: {duration: 0}, + frame: {duration: 0, redraw: false} + }], + label: 'Pause' + }] + }], + // Finally, add the slider and use `pad` to position it + // nicely next to the buttons. + sliders: [{ + pad: {l: 130, t: 55}, + currentvalue: { + visible: true, + prefix: 'Year:', + xanchor: 'right', + font: {size: 20, color: '#666'} + }, + steps: sliderSteps + }] + }; + + // Create the plot: + Plotly.newPlot('myDiv', { + data: traces, + layout: layout, + frames: frames, + }); +}); diff --git a/content/plotly_js/animations/animations-slider/gapminder-with-frames.json b/content/plotly_js/animations/animations-slider/gapminder-with-frames.json new file mode 100644 index 00000000000..843dc88bad5 --- /dev/null +++ b/content/plotly_js/animations/animations-slider/gapminder-with-frames.json @@ -0,0 +1,8705 @@ +{ + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 8425333, + 120447, + 46886859, + 4693836, + 556263527.999989, + 2125900, + 372000000, + 82052000, + 17272000, + 5441766, + 1620914, + 86459025, + 607914, + 8865488, + 20947571, + 160000, + 1439529, + 6748378, + 800663, + 20092996, + 9182536, + 507833, + 41346560, + 22438691, + 4005677, + 1127000, + 7982342, + 3661549, + 8550362, + 21289402, + 26246839, + 1030585, + 4963829 + ] + }, + "mode":"markers", + "x":[ + 28.801, + 50.939, + 37.484, + 39.417, + 44, + 60.96, + 37.373, + 37.468, + 44.869, + 45.32, + 65.39, + 63.03, + 43.158, + 50.056, + 47.453, + 55.565, + 55.928, + 48.463, + 42.244, + 36.319, + 36.157, + 37.578, + 43.436, + 47.752, + 39.875, + 60.396, + 57.593, + 45.883, + 58.5, + 50.848, + 40.412, + 43.16, + 32.548 + ], + "y":[ + 779.4453145, + 9867.084765, + 684.2441716, + 368.4692856, + 400.448610699994, + 3054.421209, + 546.5657493, + 749.6816546, + 3035.326002, + 4129.766056, + 4086.522128, + 3216.956347, + 1546.907807, + 1088.277758, + 1030.592226, + 108382.3529, + 4834.804067, + 1831.132894, + 786.5668575, + 331, + 545.8657229, + 1828.230307, + 684.5971438, + 1272.880995, + 6459.554823, + 2315.138227, + 1083.53203, + 1643.485354, + 1206.947913, + 757.7974177, + 605.0664917, + 1515.592329, + 781.7175761 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1282697, + 6927772, + 8730405, + 2791000, + 7274900, + 3882229, + 9125183, + 4334000, + 4090500, + 42459667, + 69145952, + 7733250, + 9504000, + 147962, + 2952156, + 47666000, + 413834, + 10381988, + 3327728, + 25730551, + 8526050, + 16630000, + 6860147, + 3558137, + 1489518, + 28549870, + 7124673, + 4815000, + 22235677, + 50430000 + ] + }, + "mode":"markers", + "x":[ + 55.23, + 66.8, + 68, + 53.82, + 59.6, + 61.21, + 66.87, + 70.78, + 66.55, + 67.41, + 67.5, + 65.86, + 64.03, + 72.49, + 66.91, + 65.94, + 59.164, + 72.13, + 72.67, + 61.31, + 59.82, + 61.05, + 57.996, + 64.36, + 65.57, + 64.94, + 71.86, + 69.62, + 43.585, + 69.18 + ], + "y":[ + 1601.056136, + 6137.076492, + 8343.105127, + 973.5331948, + 2444.286648, + 3119.23652, + 6876.14025, + 9692.385245, + 6424.519071, + 7029.809327, + 7144.114393, + 3530.690067, + 5263.673816, + 7267.688428, + 5210.280328, + 4931.404155, + 2647.585601, + 8941.571858, + 10095.42172, + 4029.329699, + 3068.319867, + 3144.613186, + 3581.459448, + 5074.659104, + 4215.041741, + 3834.034742, + 8527.844662, + 14734.23275, + 1969.10098, + 9979.508487 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 9279525, + 4232095, + 1738315, + 442308, + 4469979, + 2445618, + 5009067, + 1291695, + 2682462, + 153936, + 14100005, + 854885, + 2977019, + 63149, + 22223309, + 216964, + 1438760, + 20860941, + 420702, + 284320, + 5581001, + 2664249, + 580653, + 6464046, + 748747, + 863308, + 1019729, + 4762912, + 2917802, + 3838168, + 1022556, + 516556, + 9939217, + 6446316, + 485831, + 3379468, + 33119096, + 257700, + 2534927, + 60011, + 2755589, + 2143249, + 2526994, + 14264935, + 8504667, + 290243, + 8322925, + 1219113, + 3647735, + 5824797, + 2672000, + 3080907 + ] + }, + "mode":"markers", + "x":[ + 43.077, + 30.015, + 38.223, + 47.622, + 31.975, + 39.031, + 38.523, + 35.463, + 38.092, + 40.715, + 39.143, + 42.111, + 40.477, + 34.812, + 41.893, + 34.482, + 35.928, + 34.078, + 37.003, + 30, + 43.149, + 33.609, + 32.5, + 42.27, + 42.138, + 38.48, + 42.723, + 36.681, + 36.256, + 33.685, + 40.543, + 50.986, + 42.873, + 31.286, + 41.725, + 37.444, + 36.324, + 52.724, + 40, + 46.471, + 37.278, + 30.331, + 32.978, + 45.009, + 38.635, + 41.407, + 41.215, + 38.596, + 44.6, + 39.978, + 42.038, + 48.451 + ], + "y":[ + 2449.008185, + 3520.610273, + 1062.7522, + 851.2411407, + 543.2552413, + 339.2964587, + 1172.667655, + 1071.310713, + 1178.665927, + 1102.990936, + 780.5423257, + 2125.621418, + 1388.594732, + 2669.529475, + 1418.822445, + 375.6431231, + 328.9405571, + 362.1462796, + 4293.476475, + 485.2306591, + 911.2989371, + 510.1964923, + 299.850319, + 853.540919, + 298.8462121, + 575.5729961, + 2387.54806, + 1443.011715, + 369.1650802, + 452.3369807, + 743.1159097, + 1967.955707, + 1688.20357, + 468.5260381, + 2423.780443, + 761.879376, + 1077.281856, + 2718.885295, + 493.3238752, + 879.5835855, + 1450.356983, + 879.7877358, + 1135.749842, + 4725.295531, + 1615.991129, + 1148.376626, + 716.6500721, + 859.8086567, + 1468.475631, + 734.753484, + 1147.388831, + 406.8841148 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 17876956, + 2883315, + 56602560, + 14785584, + 6377619, + 12350771, + 926317, + 6007797, + 2491346, + 3548753, + 2042865, + 3146381, + 3201488, + 1517453, + 1426095, + 30144317, + 1165790, + 940080, + 1555876, + 8025700, + 2227000, + 662850, + 157553000, + 2252965, + 5439568 + ] + }, + "mode":"markers", + "x":[ + 62.485, + 40.414, + 50.917, + 68.75, + 54.745, + 50.643, + 57.206, + 59.421, + 45.928, + 48.357, + 45.262, + 42.023, + 37.579, + 41.912, + 58.53, + 50.789, + 42.314, + 55.191, + 62.649, + 43.902, + 64.28, + 59.1, + 68.44, + 66.071, + 55.088 + ], + "y":[ + 5911.315053, + 2677.326347, + 2108.944355, + 11367.16112, + 3939.978789, + 2144.115096, + 2627.009471, + 5586.53878, + 1397.717137, + 3522.110717, + 3048.3029, + 2428.237769, + 1840.366939, + 2194.926204, + 2898.530881, + 3478.125529, + 3112.363948, + 2480.380334, + 1952.308701, + 3758.523437, + 3081.959785, + 3023.271928, + 13990.48208, + 5716.766744, + 7689.799761 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 8691212, + 1994794 + ] + }, + "mode":"markers", + "x":[ + 69.12, + 69.39 + ], + "y":[ + 10039.59564, + 10556.57566 + ] + } + ], + "frames":[ + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 8425333, + 120447, + 46886859, + 4693836, + 556263527.999989, + 2125900, + 372000000, + 82052000, + 17272000, + 5441766, + 1620914, + 86459025, + 607914, + 8865488, + 20947571, + 160000, + 1439529, + 6748378, + 800663, + 20092996, + 9182536, + 507833, + 41346560, + 22438691, + 4005677, + 1127000, + 7982342, + 3661549, + 8550362, + 21289402, + 26246839, + 1030585, + 4963829 + ] + }, + "mode":"markers", + "x":[ + 28.801, + 50.939, + 37.484, + 39.417, + 44, + 60.96, + 37.373, + 37.468, + 44.869, + 45.32, + 65.39, + 63.03, + 43.158, + 50.056, + 47.453, + 55.565, + 55.928, + 48.463, + 42.244, + 36.319, + 36.157, + 37.578, + 43.436, + 47.752, + 39.875, + 60.396, + 57.593, + 45.883, + 58.5, + 50.848, + 40.412, + 43.16, + 32.548 + ], + "y":[ + 779.4453145, + 9867.084765, + 684.2441716, + 368.4692856, + 400.448610699994, + 3054.421209, + 546.5657493, + 749.6816546, + 3035.326002, + 4129.766056, + 4086.522128, + 3216.956347, + 1546.907807, + 1088.277758, + 1030.592226, + 108382.3529, + 4834.804067, + 1831.132894, + 786.5668575, + 331, + 545.8657229, + 1828.230307, + 684.5971438, + 1272.880995, + 6459.554823, + 2315.138227, + 1083.53203, + 1643.485354, + 1206.947913, + 757.7974177, + 605.0664917, + 1515.592329, + 781.7175761 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1282697, + 6927772, + 8730405, + 2791000, + 7274900, + 3882229, + 9125183, + 4334000, + 4090500, + 42459667, + 69145952, + 7733250, + 9504000, + 147962, + 2952156, + 47666000, + 413834, + 10381988, + 3327728, + 25730551, + 8526050, + 16630000, + 6860147, + 3558137, + 1489518, + 28549870, + 7124673, + 4815000, + 22235677, + 50430000 + ] + }, + "mode":"markers", + "x":[ + 55.23, + 66.8, + 68, + 53.82, + 59.6, + 61.21, + 66.87, + 70.78, + 66.55, + 67.41, + 67.5, + 65.86, + 64.03, + 72.49, + 66.91, + 65.94, + 59.164, + 72.13, + 72.67, + 61.31, + 59.82, + 61.05, + 57.996, + 64.36, + 65.57, + 64.94, + 71.86, + 69.62, + 43.585, + 69.18 + ], + "y":[ + 1601.056136, + 6137.076492, + 8343.105127, + 973.5331948, + 2444.286648, + 3119.23652, + 6876.14025, + 9692.385245, + 6424.519071, + 7029.809327, + 7144.114393, + 3530.690067, + 5263.673816, + 7267.688428, + 5210.280328, + 4931.404155, + 2647.585601, + 8941.571858, + 10095.42172, + 4029.329699, + 3068.319867, + 3144.613186, + 3581.459448, + 5074.659104, + 4215.041741, + 3834.034742, + 8527.844662, + 14734.23275, + 1969.10098, + 9979.508487 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 9279525, + 4232095, + 1738315, + 442308, + 4469979, + 2445618, + 5009067, + 1291695, + 2682462, + 153936, + 14100005, + 854885, + 2977019, + 63149, + 22223309, + 216964, + 1438760, + 20860941, + 420702, + 284320, + 5581001, + 2664249, + 580653, + 6464046, + 748747, + 863308, + 1019729, + 4762912, + 2917802, + 3838168, + 1022556, + 516556, + 9939217, + 6446316, + 485831, + 3379468, + 33119096, + 257700, + 2534927, + 60011, + 2755589, + 2143249, + 2526994, + 14264935, + 8504667, + 290243, + 8322925, + 1219113, + 3647735, + 5824797, + 2672000, + 3080907 + ] + }, + "mode":"markers", + "x":[ + 43.077, + 30.015, + 38.223, + 47.622, + 31.975, + 39.031, + 38.523, + 35.463, + 38.092, + 40.715, + 39.143, + 42.111, + 40.477, + 34.812, + 41.893, + 34.482, + 35.928, + 34.078, + 37.003, + 30, + 43.149, + 33.609, + 32.5, + 42.27, + 42.138, + 38.48, + 42.723, + 36.681, + 36.256, + 33.685, + 40.543, + 50.986, + 42.873, + 31.286, + 41.725, + 37.444, + 36.324, + 52.724, + 40, + 46.471, + 37.278, + 30.331, + 32.978, + 45.009, + 38.635, + 41.407, + 41.215, + 38.596, + 44.6, + 39.978, + 42.038, + 48.451 + ], + "y":[ + 2449.008185, + 3520.610273, + 1062.7522, + 851.2411407, + 543.2552413, + 339.2964587, + 1172.667655, + 1071.310713, + 1178.665927, + 1102.990936, + 780.5423257, + 2125.621418, + 1388.594732, + 2669.529475, + 1418.822445, + 375.6431231, + 328.9405571, + 362.1462796, + 4293.476475, + 485.2306591, + 911.2989371, + 510.1964923, + 299.850319, + 853.540919, + 298.8462121, + 575.5729961, + 2387.54806, + 1443.011715, + 369.1650802, + 452.3369807, + 743.1159097, + 1967.955707, + 1688.20357, + 468.5260381, + 2423.780443, + 761.879376, + 1077.281856, + 2718.885295, + 493.3238752, + 879.5835855, + 1450.356983, + 879.7877358, + 1135.749842, + 4725.295531, + 1615.991129, + 1148.376626, + 716.6500721, + 859.8086567, + 1468.475631, + 734.753484, + 1147.388831, + 406.8841148 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 17876956, + 2883315, + 56602560, + 14785584, + 6377619, + 12350771, + 926317, + 6007797, + 2491346, + 3548753, + 2042865, + 3146381, + 3201488, + 1517453, + 1426095, + 30144317, + 1165790, + 940080, + 1555876, + 8025700, + 2227000, + 662850, + 157553000, + 2252965, + 5439568 + ] + }, + "mode":"markers", + "x":[ + 62.485, + 40.414, + 50.917, + 68.75, + 54.745, + 50.643, + 57.206, + 59.421, + 45.928, + 48.357, + 45.262, + 42.023, + 37.579, + 41.912, + 58.53, + 50.789, + 42.314, + 55.191, + 62.649, + 43.902, + 64.28, + 59.1, + 68.44, + 66.071, + 55.088 + ], + "y":[ + 5911.315053, + 2677.326347, + 2108.944355, + 11367.16112, + 3939.978789, + 2144.115096, + 2627.009471, + 5586.53878, + 1397.717137, + 3522.110717, + 3048.3029, + 2428.237769, + 1840.366939, + 2194.926204, + 2898.530881, + 3478.125529, + 3112.363948, + 2480.380334, + 1952.308701, + 3758.523437, + 3081.959785, + 3023.271928, + 13990.48208, + 5716.766744, + 7689.799761 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 8691212, + 1994794 + ] + }, + "mode":"markers", + "x":[ + 69.12, + 69.39 + ], + "y":[ + 10039.59564, + 10556.57566 + ] + } + ], + "name":"1952" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 9240934, + 138655, + 51365468, + 5322536, + 637408000, + 2736300, + 409000000, + 90124000, + 19792000, + 6248643, + 1944401, + 91563009, + 746559, + 9411381, + 22611552, + 212846, + 1647412, + 7739235, + 882134, + 21731844, + 9682338, + 561977, + 46679944, + 26072194, + 4419650, + 1445929, + 9128546, + 4149908, + 10164215, + 25041917, + 28998543, + 1070439, + 5498090 + ] + }, + "mode":"markers", + "x":[ + 30.332, + 53.832, + 39.348, + 41.366, + 50.54896, + 64.75, + 40.249, + 39.918, + 47.181, + 48.437, + 67.84, + 65.5, + 45.669, + 54.081, + 52.681, + 58.033, + 59.489, + 52.102, + 45.248, + 41.905, + 37.686, + 40.08, + 45.557, + 51.334, + 42.868, + 63.179, + 61.456, + 48.284, + 62.4, + 53.63, + 42.887, + 45.671, + 33.97 + ], + "y":[ + 820.8530296, + 11635.79945, + 661.6374577, + 434.0383364, + 575.9870009, + 3629.076457, + 590.061996, + 858.9002707, + 3290.257643, + 6229.333562, + 5385.278451, + 4317.694365, + 1886.080591, + 1571.134655, + 1487.593537, + 113523.1329, + 6089.786934, + 1810.066992, + 912.6626085, + 350, + 597.9363558, + 2242.746551, + 747.0835292, + 1547.944844, + 8157.591248, + 2843.104409, + 1072.546602, + 2117.234893, + 1507.86129, + 793.5774148, + 676.2854478, + 1827.067742, + 804.8304547 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1476505, + 6965860, + 8989111, + 3076000, + 7651254, + 3991242, + 9513758, + 4487831, + 4324000, + 44310863, + 71019069, + 8096218, + 9839000, + 165110, + 2878220, + 49182000, + 442829, + 11026383, + 3491938, + 28235346, + 8817650, + 17829327, + 7271135, + 3844277, + 1533070, + 29841614, + 7363802, + 5126000, + 25670939, + 51430000 + ] + }, + "mode":"markers", + "x":[ + 59.28, + 67.48, + 69.24, + 58.45, + 66.61, + 64.77, + 69.03, + 71.81, + 67.49, + 68.93, + 69.1, + 67.86, + 66.41, + 73.47, + 68.9, + 67.81, + 61.448, + 72.99, + 73.44, + 65.77, + 61.51, + 64.1, + 61.685, + 67.45, + 67.85, + 66.66, + 72.49, + 70.56, + 48.079, + 70.42 + ], + "y":[ + 1942.284244, + 8842.59803, + 9714.960623, + 1353.989176, + 3008.670727, + 4338.231617, + 8256.343918, + 11099.65935, + 7545.415386, + 8662.834898, + 10187.82665, + 4916.299889, + 6040.180011, + 9244.001412, + 5599.077872, + 6248.656232, + 3682.259903, + 11276.19344, + 11653.97304, + 4734.253019, + 3774.571743, + 3943.370225, + 4981.090891, + 6093.26298, + 5862.276629, + 4564.80241, + 9911.878226, + 17909.48973, + 2218.754257, + 11283.17795 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 10270856, + 4561361, + 1925173, + 474639, + 4713416, + 2667518, + 5359923, + 1392284, + 2894855, + 170928, + 15577932, + 940458, + 3300000, + 71851, + 25009741, + 232922, + 1542611, + 22815614, + 434904, + 323150, + 6391288, + 2876726, + 601095, + 7454779, + 813338, + 975950, + 1201578, + 5181679, + 3221238, + 4241884, + 1076852, + 609816, + 11406350, + 7038035, + 548080, + 3692184, + 37173340, + 308700, + 2822082, + 61325, + 3054547, + 2295678, + 2780415, + 16151549, + 9753392, + 326741, + 9452826, + 1357445, + 3950849, + 6675501, + 3016000, + 3646340 + ] + }, + "mode":"markers", + "x":[ + 45.685, + 31.999, + 40.358, + 49.618, + 34.906, + 40.533, + 40.428, + 37.464, + 39.881, + 42.46, + 40.652, + 45.053, + 42.469, + 37.328, + 44.444, + 35.983, + 38.047, + 36.667, + 38.999, + 32.065, + 44.779, + 34.558, + 33.489, + 44.686, + 45.047, + 39.486, + 45.289, + 38.865, + 37.207, + 35.307, + 42.338, + 58.089, + 45.423, + 33.779, + 45.226, + 38.598, + 37.802, + 55.09, + 41.5, + 48.945, + 39.329, + 31.57, + 34.977, + 47.985, + 39.624, + 43.424, + 42.974, + 41.208, + 47.1, + 42.571, + 44.077, + 50.469 + ], + "y":[ + 3013.976023, + 3827.940465, + 959.6010805, + 918.2325349, + 617.1834648, + 379.5646281, + 1313.048099, + 1190.844328, + 1308.495577, + 1211.148548, + 905.8602303, + 2315.056572, + 1500.895925, + 2864.969076, + 1458.915272, + 426.0964081, + 344.1618859, + 378.9041632, + 4976.198099, + 520.9267111, + 1043.561537, + 576.2670245, + 431.7904566, + 944.4383152, + 335.9971151, + 620.9699901, + 3448.284395, + 1589.20275, + 416.3698064, + 490.3821867, + 846.1202613, + 2034.037981, + 1642.002314, + 495.5868333, + 2621.448058, + 835.5234025, + 1100.592563, + 2769.451844, + 540.2893983, + 860.7369026, + 1567.653006, + 1004.484437, + 1258.147413, + 5487.104219, + 1770.337074, + 1244.708364, + 698.5356073, + 925.9083202, + 1395.232468, + 774.3710692, + 1311.956766, + 518.7642681 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 19610538, + 3211738, + 65551171, + 17010154, + 7048426, + 14485993, + 1112300, + 6640752, + 2923186, + 4058385, + 2355805, + 3640876, + 3507701, + 1770390, + 1535090, + 35015548, + 1358828, + 1063506, + 1770902, + 9146100, + 2260000, + 764900, + 171984000, + 2424959, + 6702668 + ] + }, + "mode":"markers", + "x":[ + 64.399, + 41.89, + 53.285, + 69.96, + 56.074, + 55.118, + 60.026, + 62.325, + 49.828, + 51.356, + 48.57, + 44.142, + 40.696, + 44.665, + 62.61, + 55.19, + 45.432, + 59.201, + 63.196, + 46.263, + 68.54, + 61.8, + 69.49, + 67.044, + 57.907 + ], + "y":[ + 6856.856212, + 2127.686326, + 2487.365989, + 12489.95006, + 4315.622723, + 2323.805581, + 2990.010802, + 6092.174359, + 1544.402995, + 3780.546651, + 3421.523218, + 2617.155967, + 1726.887882, + 2220.487682, + 4756.525781, + 4131.546641, + 3457.415947, + 2961.800905, + 2046.154706, + 4245.256698, + 3907.156189, + 4100.3934, + 14847.12712, + 6150.772969, + 9802.466526 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 9712569, + 2229407 + ] + }, + "mode":"markers", + "x":[ + 70.33, + 70.26 + ], + "y":[ + 10949.64959, + 12247.39532 + ] + } + ], + "name":"1957" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 10267083, + 171863, + 56839289, + 6083619, + 665770000, + 3305200, + 454000000, + 99028000, + 22874000, + 7240260, + 2310904, + 95831757, + 933559, + 10917494, + 26420307, + 358266, + 1886848, + 8906385, + 1010280, + 23634436, + 10332057, + 628164, + 53100671, + 30325264, + 4943029, + 1750200, + 10421936, + 4834621, + 11918938, + 29263397, + 33796140, + 1133134, + 6120081 + ] + }, + "mode":"markers", + "x":[ + 31.997, + 56.923, + 41.216, + 43.415, + 44.50136, + 67.65, + 43.605, + 42.518, + 49.325, + 51.457, + 69.39, + 68.73, + 48.126, + 56.656, + 55.292, + 60.47, + 62.094, + 55.737, + 48.251, + 45.108, + 39.393, + 43.165, + 47.67, + 54.757, + 45.914, + 65.798, + 62.192, + 50.305, + 65.2, + 56.061, + 45.363, + 48.127, + 35.18 + ], + "y":[ + 853.10071, + 12753.27514, + 686.3415538, + 496.9136476, + 487.6740183, + 4692.648272, + 658.3471509, + 849.2897701, + 4187.329802, + 8341.737815, + 7105.630706, + 6576.649461, + 2348.009158, + 1621.693598, + 1536.344387, + 95458.11176, + 5714.560611, + 2036.884944, + 1056.353958, + 388, + 652.3968593, + 2924.638113, + 803.3427418, + 1649.552153, + 11626.41975, + 3674.735572, + 1074.47196, + 2193.037133, + 1822.879028, + 1002.199172, + 772.0491602, + 2198.956312, + 825.6232006 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1728137, + 7129864, + 9218400, + 3349000, + 8012946, + 4076557, + 9620282, + 4646899, + 4491443, + 47124000, + 73739117, + 8448233, + 10063000, + 182053, + 2830000, + 50843200, + 474528, + 11805689, + 3638919, + 30329617, + 9019800, + 18680721, + 7616060, + 4237384, + 1582962, + 31158061, + 7561588, + 5666000, + 29788695, + 53292000 + ] + }, + "mode":"markers", + "x":[ + 64.82, + 69.54, + 70.25, + 61.93, + 69.51, + 67.13, + 69.9, + 72.35, + 68.75, + 70.51, + 70.3, + 69.51, + 67.96, + 73.68, + 70.29, + 69.24, + 63.728, + 73.23, + 73.47, + 67.64, + 64.39, + 66.8, + 64.531, + 70.33, + 69.15, + 69.69, + 73.37, + 71.32, + 52.098, + 70.76 + ], + "y":[ + 2312.888958, + 10750.72111, + 10991.20676, + 1709.683679, + 4254.337839, + 5477.890018, + 10136.86713, + 13583.31351, + 9371.842561, + 10560.48553, + 12902.46291, + 6017.190733, + 7550.359877, + 10350.15906, + 6631.597314, + 8243.58234, + 4649.593785, + 12790.84956, + 13450.40151, + 5338.752143, + 4727.954889, + 4734.997586, + 6289.629157, + 7481.107598, + 7402.303395, + 5693.843879, + 12329.44192, + 20431.0927, + 2322.869908, + 12477.17707 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 11000948, + 4826015, + 2151895, + 512764, + 4919632, + 2961915, + 5793633, + 1523478, + 3150417, + 191689, + 17486434, + 1047924, + 3832408, + 89898, + 28173309, + 249220, + 1666618, + 25145372, + 455661, + 374020, + 7355248, + 3140003, + 627820, + 8678557, + 893143, + 1112796, + 1441863, + 5703324, + 3628608, + 4690372, + 1146757, + 701016, + 13056604, + 7788944, + 621392, + 4076008, + 41871351, + 358900, + 3051242, + 65345, + 3430243, + 2467895, + 3080153, + 18356657, + 11183227, + 370006, + 10863958, + 1528098, + 4286552, + 7688797, + 3421000, + 4277736 + ] + }, + "mode":"markers", + "x":[ + 48.303, + 34, + 42.618, + 51.52, + 37.814, + 42.045, + 42.643, + 39.475, + 41.716, + 44.467, + 42.122, + 48.435, + 44.93, + 39.693, + 46.992, + 37.485, + 40.158, + 40.059, + 40.489, + 33.896, + 46.452, + 35.753, + 34.488, + 47.949, + 47.747, + 40.502, + 47.808, + 40.848, + 38.41, + 36.936, + 44.248, + 60.246, + 47.924, + 36.161, + 48.386, + 39.487, + 39.36, + 57.666, + 43, + 51.893, + 41.454, + 32.767, + 36.981, + 49.951, + 40.87, + 44.992, + 44.246, + 43.922, + 49.579, + 45.344, + 46.023, + 52.358 + ], + "y":[ + 2550.81688, + 4269.276742, + 949.4990641, + 983.6539764, + 722.5120206, + 355.2032273, + 1399.607441, + 1193.068753, + 1389.817618, + 1406.648278, + 896.3146335, + 2464.783157, + 1728.869428, + 3020.989263, + 1693.335853, + 582.8419714, + 380.9958433, + 419.4564161, + 6631.459222, + 599.650276, + 1190.041118, + 686.3736739, + 522.0343725, + 896.9663732, + 411.8006266, + 634.1951625, + 6757.030816, + 1643.38711, + 427.9010856, + 496.1743428, + 1055.896036, + 2529.067487, + 1566.353493, + 556.6863539, + 3173.215595, + 997.7661127, + 1150.927478, + 3173.72334, + 597.4730727, + 1071.551119, + 1654.988723, + 1116.639877, + 1369.488336, + 5768.729717, + 1959.593767, + 1856.182125, + 722.0038073, + 1067.53481, + 1660.30321, + 767.2717398, + 1452.725766, + 527.2721818 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 21283783, + 3593918, + 76039390, + 18985849, + 7961258, + 17009885, + 1345187, + 7254373, + 3453434, + 4681707, + 2747687, + 4208858, + 3880130, + 2090162, + 1665128, + 41121485, + 1590597, + 1215725, + 2009813, + 10516500, + 2448046, + 887498, + 186538000, + 2598466, + 8143375 + ] + }, + "mode":"markers", + "x":[ + 65.142, + 43.428, + 55.665, + 71.3, + 57.924, + 57.863, + 62.842, + 65.246, + 53.459, + 54.64, + 52.307, + 46.954, + 43.59, + 48.041, + 65.61, + 58.299, + 48.632, + 61.817, + 64.361, + 49.096, + 69.62, + 64.9, + 70.21, + 68.253, + 60.77 + ], + "y":[ + 7133.166023, + 2180.972546, + 3336.585802, + 13462.48555, + 4519.094331, + 2492.351109, + 3460.937025, + 5180.75591, + 1662.137359, + 4086.114078, + 3776.803627, + 2750.364446, + 1796.589032, + 2291.156835, + 5246.107524, + 4581.609385, + 3634.364406, + 3536.540301, + 2148.027146, + 4957.037982, + 5108.34463, + 4997.523971, + 16173.14586, + 5603.357717, + 8422.974165 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 10794968, + 2488550 + ] + }, + "mode":"markers", + "x":[ + 70.93, + 71.24 + ], + "y":[ + 12217.22686, + 13175.678 + ] + } + ], + "name":"1962" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 11537966, + 202182, + 62821884, + 6960067, + 754550000, + 3722800, + 506000000, + 109343000, + 26538000, + 8519282, + 2693585, + 100825279, + 1255058, + 12617009, + 30131000, + 575003, + 2186894, + 10154878, + 1149500, + 25870271, + 11261690, + 714775, + 60641899, + 35356600, + 5618198, + 1977600, + 11737396, + 5680812, + 13648692, + 34024249, + 39463910, + 1142636, + 6740785 + ] + }, + "mode":"markers", + "x":[ + 34.02, + 59.923, + 43.453, + 45.415, + 58.38112, + 70, + 47.193, + 45.964, + 52.469, + 54.459, + 70.75, + 71.43, + 51.629, + 59.942, + 57.716, + 64.624, + 63.87, + 59.371, + 51.253, + 49.379, + 41.472, + 46.988, + 49.8, + 56.393, + 49.901, + 67.946, + 64.266, + 53.655, + 67.5, + 58.285, + 47.838, + 51.631, + 36.984 + ], + "y":[ + 836.1971382, + 14804.6727, + 721.1860862, + 523.4323142, + 612.7056934, + 6197.962814, + 700.7706107, + 762.4317721, + 5906.731805, + 8931.459811, + 8393.741404, + 9847.788607, + 2741.796252, + 2143.540609, + 2029.228142, + 80894.88326, + 6006.983042, + 2277.742396, + 1226.04113, + 349, + 676.4422254, + 4720.942687, + 942.4082588, + 1814.12743, + 16903.04886, + 4977.41854, + 1135.514326, + 1881.923632, + 2643.858681, + 1295.46066, + 637.1232887, + 2649.715007, + 862.4421463 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1984060, + 7376998, + 9556500, + 3585000, + 8310226, + 4174366, + 9835109, + 4838800, + 4605744, + 49569000, + 76368453, + 8716441, + 10223422, + 198676, + 2900100, + 52667100, + 501035, + 12596822, + 3786019, + 31785378, + 9103000, + 19284814, + 7971222, + 4442238, + 1646912, + 32850275, + 7867931, + 6063000, + 33411317, + 54959000 + ] + }, + "mode":"markers", + "x":[ + 66.22, + 70.14, + 70.94, + 64.79, + 70.42, + 68.5, + 70.38, + 72.96, + 69.83, + 71.55, + 70.8, + 71, + 69.5, + 73.73, + 71.08, + 71.06, + 67.178, + 73.82, + 74.08, + 69.61, + 66.6, + 66.8, + 66.914, + 70.98, + 69.18, + 71.44, + 74.16, + 72.77, + 54.336, + 71.36 + ], + "y":[ + 2760.196931, + 12834.6024, + 13149.04119, + 2172.352423, + 5577.0028, + 6960.297861, + 11399.44489, + 15937.21123, + 10921.63626, + 12999.91766, + 14745.62561, + 8513.097016, + 9326.64467, + 13319.89568, + 7655.568963, + 10022.40131, + 5907.850937, + 15363.25136, + 16361.87647, + 6557.152776, + 6361.517993, + 6470.866545, + 7991.707066, + 8412.902397, + 9405.489397, + 7993.512294, + 15258.29697, + 22966.14432, + 2826.356387, + 14142.85089 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 12760499, + 5247469, + 2427334, + 553541, + 5127935, + 3330989, + 6335506, + 1733638, + 3495967, + 217378, + 19941073, + 1179760, + 4744870, + 127617, + 31681188, + 259864, + 1820319, + 27860297, + 489004, + 439593, + 8490213, + 3451418, + 601287, + 10191512, + 996380, + 1279406, + 1759224, + 6334556, + 4147252, + 5212416, + 1230542, + 789309, + 14770296, + 8680909, + 706640, + 4534062, + 47287752, + 414024, + 3451079, + 70787, + 3965841, + 2662190, + 3428839, + 20997321, + 12716129, + 420690, + 12607312, + 1735550, + 4786986, + 8900294, + 3900000, + 4995432 + ] + }, + "mode":"markers", + "x":[ + 51.407, + 35.985, + 44.885, + 53.298, + 40.697, + 43.548, + 44.799, + 41.478, + 43.601, + 46.472, + 44.056, + 52.04, + 47.35, + 42.074, + 49.293, + 38.987, + 42.189, + 42.115, + 44.598, + 35.857, + 48.072, + 37.197, + 35.492, + 50.654, + 48.492, + 41.536, + 50.227, + 42.881, + 39.487, + 38.487, + 46.289, + 61.557, + 50.335, + 38.113, + 51.159, + 40.118, + 41.04, + 60.542, + 44.1, + 54.425, + 43.563, + 34.113, + 38.977, + 51.927, + 42.858, + 46.633, + 45.757, + 46.769, + 52.053, + 48.051, + 47.768, + 53.995 + ], + "y":[ + 3246.991771, + 5522.776375, + 1035.831411, + 1214.709294, + 794.8265597, + 412.9775136, + 1508.453148, + 1136.056615, + 1196.810565, + 1876.029643, + 861.5932424, + 2677.939642, + 2052.050473, + 3020.050513, + 1814.880728, + 915.5960025, + 468.7949699, + 516.1186438, + 8358.761987, + 734.7829124, + 1125.69716, + 708.7595409, + 715.5806402, + 1056.736457, + 498.6390265, + 713.6036483, + 18772.75169, + 1634.047282, + 495.5147806, + 545.0098873, + 1421.145193, + 2475.387562, + 1711.04477, + 566.6691539, + 3793.694753, + 1054.384891, + 1014.514104, + 4021.175739, + 510.9637142, + 1384.840593, + 1612.404632, + 1206.043465, + 1284.73318, + 7114.477971, + 1687.997641, + 2613.101665, + 848.2186575, + 1477.59676, + 1932.360167, + 908.9185217, + 1777.077318, + 569.7950712 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 22934225, + 4040665, + 88049823, + 20819767, + 8858908, + 19764027, + 1588717, + 8139332, + 4049146, + 5432424, + 3232927, + 4690773, + 4318137, + 2500689, + 1861096, + 47995559, + 1865490, + 1405486, + 2287985, + 12132200, + 2648961, + 960155, + 198712000, + 2748579, + 9709552 + ] + }, + "mode":"markers", + "x":[ + 65.634, + 45.032, + 57.632, + 72.13, + 60.523, + 59.963, + 65.424, + 68.29, + 56.751, + 56.678, + 55.855, + 50.016, + 46.243, + 50.924, + 67.51, + 60.11, + 51.884, + 64.071, + 64.951, + 51.445, + 71.1, + 65.4, + 70.76, + 68.468, + 63.479 + ], + "y":[ + 8052.953021, + 2586.886053, + 3429.864357, + 16076.58803, + 5106.654313, + 2678.729839, + 4161.727834, + 5690.268015, + 1653.723003, + 4579.074215, + 4358.595393, + 3242.531147, + 1452.057666, + 2538.269358, + 6124.703451, + 5754.733883, + 4643.393534, + 4421.009084, + 2299.376311, + 5788.09333, + 6929.277714, + 5621.368472, + 19530.36557, + 5444.61962, + 9541.474188 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 11872264, + 2728150 + ] + }, + "mode":"markers", + "x":[ + 71.1, + 71.52 + ], + "y":[ + 14526.12465, + 14463.91893 + ] + } + ], + "name":"1967" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 13079460, + 230800, + 70759295, + 7450606, + 862030000, + 4115700, + 567000000, + 121282000, + 30614000, + 10061506, + 3095893, + 107188273, + 1613551, + 14781241, + 33505000, + 841934, + 2680018, + 11441462, + 1320500, + 28466390, + 12412593, + 829050, + 69325921, + 40850141, + 6472756, + 2152400, + 13016733, + 6701172, + 15226039, + 39276153, + 44655014, + 1089572, + 7407075 + ] + }, + "mode":"markers", + "x":[ + 36.088, + 63.3, + 45.252, + 40.317, + 63.11888, + 72, + 50.651, + 49.203, + 55.234, + 56.95, + 71.63, + 73.42, + 56.528, + 63.983, + 62.612, + 67.712, + 65.421, + 63.01, + 53.754, + 53.07, + 43.971, + 52.143, + 51.929, + 58.065, + 53.886, + 69.521, + 65.042, + 57.296, + 69.39, + 60.405, + 50.254, + 56.532, + 39.848 + ], + "y":[ + 739.9811058, + 18268.65839, + 630.2336265, + 421.6240257, + 676.9000921, + 8315.928145, + 724.032527, + 1111.107907, + 9613.818607, + 9576.037596, + 12786.93223, + 14778.78636, + 2110.856309, + 3701.621503, + 3030.87665, + 109347.867, + 7486.384341, + 2849.09478, + 1421.741975, + 357, + 674.7881296, + 10618.03855, + 1049.938981, + 1989.37407, + 24837.42865, + 8597.756202, + 1213.39553, + 2571.423014, + 4062.523897, + 1524.358936, + 699.5016441, + 3133.409277, + 1265.047031 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 2263554, + 7544201, + 9709100, + 3819000, + 8576200, + 4225310, + 9862158, + 4991596, + 4639657, + 51732000, + 78717088, + 8888628, + 10394091, + 209275, + 3024400, + 54365564, + 527678, + 13329874, + 3933004, + 33039545, + 8970450, + 20662648, + 8313288, + 4593433, + 1694510, + 34513161, + 8122293, + 6401400, + 37492953, + 56079000 + ] + }, + "mode":"markers", + "x":[ + 67.69, + 70.63, + 71.44, + 67.45, + 70.9, + 69.61, + 70.29, + 73.47, + 70.87, + 72.38, + 71, + 72.34, + 69.76, + 74.46, + 71.28, + 72.19, + 70.636, + 73.75, + 74.34, + 70.85, + 69.26, + 69.21, + 68.7, + 70.35, + 69.82, + 73.06, + 74.72, + 73.78, + 57.005, + 72.01 + ], + "y":[ + 3313.422188, + 16661.6256, + 16672.14356, + 2860.16975, + 6597.494398, + 9164.090127, + 13108.4536, + 18866.20721, + 14358.8759, + 16107.19171, + 18016.18027, + 12724.82957, + 10168.65611, + 15798.06362, + 9530.772896, + 12269.27378, + 7778.414017, + 18794.74567, + 18965.05551, + 8006.506993, + 9022.247417, + 8011.414402, + 10522.06749, + 9674.167626, + 12383.4862, + 10638.75131, + 17832.02464, + 27195.11304, + 3450.69638, + 15895.11641 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 14760787, + 5894858, + 2761407, + 619351, + 5433886, + 3529983, + 7021028, + 1927260, + 3899068, + 250027, + 23007669, + 1340458, + 6071696, + 178848, + 34807417, + 277603, + 2260187, + 30770372, + 537977, + 517101, + 9354120, + 3811387, + 625361, + 12044785, + 1116779, + 1482628, + 2183877, + 7082430, + 4730997, + 5828158, + 1332786, + 851334, + 16660670, + 9809596, + 821782, + 5060262, + 53740085, + 461633, + 3992121, + 76595, + 4588696, + 2879013, + 3840161, + 23935810, + 14597019, + 480105, + 14706593, + 2056351, + 5303507, + 10190285, + 4506497, + 5861135 + ] + }, + "mode":"markers", + "x":[ + 54.518, + 37.928, + 47.014, + 56.024, + 43.591, + 44.057, + 47.049, + 43.457, + 45.569, + 48.944, + 45.989, + 54.907, + 49.801, + 44.366, + 51.137, + 40.516, + 44.142, + 43.515, + 48.69, + 38.308, + 49.875, + 38.842, + 36.486, + 53.559, + 49.767, + 42.614, + 52.773, + 44.851, + 41.766, + 39.977, + 48.437, + 62.944, + 52.862, + 40.328, + 53.867, + 40.546, + 42.821, + 64.274, + 44.6, + 56.48, + 45.815, + 35.4, + 40.973, + 53.696, + 45.083, + 49.552, + 47.62, + 49.759, + 55.602, + 51.016, + 50.107, + 55.635 + ], + "y":[ + 4182.663766, + 5473.288005, + 1085.796879, + 2263.611114, + 854.7359763, + 464.0995039, + 1684.146528, + 1070.013275, + 1104.103987, + 1937.577675, + 904.8960685, + 3213.152683, + 2378.201111, + 3694.212352, + 2024.008147, + 672.4122571, + 514.3242082, + 566.2439442, + 11401.94841, + 756.0868363, + 1178.223708, + 741.6662307, + 820.2245876, + 1222.359968, + 496.5815922, + 803.0054535, + 21011.49721, + 1748.562982, + 584.6219709, + 581.3688761, + 1586.851781, + 2575.484158, + 1930.194975, + 724.9178037, + 3746.080948, + 954.2092363, + 1698.388838, + 5047.658563, + 590.5806638, + 1532.985254, + 1597.712056, + 1353.759762, + 1254.576127, + 7765.962636, + 1659.652775, + 3364.836625, + 915.9850592, + 1649.660188, + 2753.285994, + 950.735869, + 1773.498265, + 799.3621758 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 24779799, + 4565872, + 100840058, + 22284500, + 9717524, + 22542890, + 1834796, + 8831348, + 4671329, + 6298651, + 3790903, + 5149581, + 4698301, + 2965146, + 1997616, + 55984294, + 2182908, + 1616384, + 2614104, + 13954700, + 2847132, + 975199, + 209896000, + 2829526, + 11515649 + ] + }, + "mode":"markers", + "x":[ + 67.065, + 46.714, + 59.504, + 72.88, + 63.441, + 61.623, + 67.849, + 70.723, + 59.631, + 58.796, + 58.207, + 53.738, + 48.042, + 53.884, + 69, + 62.361, + 55.151, + 66.216, + 65.815, + 55.448, + 72.16, + 65.9, + 71.34, + 68.673, + 65.712 + ], + "y":[ + 9443.038526, + 2980.331339, + 4985.711467, + 18970.57086, + 5494.024437, + 3264.660041, + 5118.146939, + 5305.445256, + 2189.874499, + 5280.99471, + 4520.246008, + 4031.408271, + 1654.456946, + 2529.842345, + 7433.889293, + 6809.40669, + 4688.593267, + 5364.249663, + 2523.337977, + 5937.827283, + 9123.041742, + 6619.551419, + 21806.03594, + 5703.408898, + 10505.25966 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 13177000, + 2929100 + ] + }, + "mode":"markers", + "x":[ + 71.93, + 71.89 + ], + "y":[ + 16788.62948, + 16046.03728 + ] + } + ], + "name":"1972" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 14880372, + 297410, + 80428306, + 6978607, + 943455000, + 4583700, + 634000000, + 136725000, + 35480679, + 11882916, + 3495918, + 113872473, + 1937652, + 16325320, + 36436000, + 1140357, + 3115787, + 12845381, + 1528000, + 31528087, + 13933198, + 1004533, + 78152686, + 46850962, + 8128505, + 2325300, + 14116836, + 7932503, + 16785196, + 44148285, + 50533506, + 1261091, + 8403990 + ] + }, + "mode":"markers", + "x":[ + 38.438, + 65.593, + 46.923, + 31.22, + 63.96736, + 73.6, + 54.208, + 52.702, + 57.702, + 60.413, + 73.06, + 75.38, + 61.134, + 67.159, + 64.766, + 69.343, + 66.099, + 65.256, + 55.491, + 56.059, + 46.748, + 57.367, + 54.043, + 60.06, + 58.69, + 70.795, + 65.949, + 61.195, + 70.59, + 62.494, + 55.764, + 60.765, + 44.175 + ], + "y":[ + 786.11336, + 19340.10196, + 659.8772322, + 524.9721832, + 741.2374699, + 11186.14125, + 813.337323, + 1382.702056, + 11888.59508, + 14688.23507, + 13306.61921, + 16610.37701, + 2852.351568, + 4106.301249, + 4657.22102, + 59265.47714, + 8659.696836, + 3827.921571, + 1647.511665, + 371, + 694.1124398, + 11848.34392, + 1175.921193, + 2373.204287, + 34167.7626, + 11210.08948, + 1348.775651, + 3195.484582, + 5596.519826, + 1961.224635, + 713.5371196, + 3682.831494, + 1829.765177 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 2509048, + 7568430, + 9821800, + 4086000, + 8797022, + 4318673, + 10161915, + 5088419, + 4738902, + 53165019, + 78160773, + 9308479, + 10637171, + 221823, + 3271900, + 56059245, + 560073, + 13852989, + 4043205, + 34621254, + 9662600, + 21658597, + 8686367, + 4827803, + 1746919, + 36439000, + 8251648, + 6316424, + 42404033, + 56179000 + ] + }, + "mode":"markers", + "x":[ + 68.93, + 72.17, + 72.8, + 69.86, + 70.81, + 70.64, + 70.71, + 74.69, + 72.52, + 73.83, + 72.5, + 73.68, + 69.95, + 76.11, + 72.03, + 73.48, + 73.066, + 75.24, + 75.37, + 70.67, + 70.41, + 69.46, + 70.3, + 70.45, + 70.97, + 74.39, + 75.44, + 75.39, + 59.507, + 72.76 + ], + "y":[ + 3533.00391, + 19749.4223, + 19117.97448, + 3528.481305, + 7612.240438, + 11305.38517, + 14800.16062, + 20422.9015, + 15605.42283, + 18292.63514, + 20512.92123, + 14195.52428, + 11674.83737, + 19654.96247, + 11150.98113, + 14255.98475, + 9595.929905, + 21209.0592, + 23311.34939, + 9508.141454, + 10172.48572, + 9356.39724, + 12980.66956, + 10922.66404, + 15277.03017, + 13236.92117, + 18855.72521, + 26982.29052, + 4269.122326, + 17428.74846 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 17152804, + 6162675, + 3168267, + 781472, + 5889574, + 3834415, + 7959865, + 2167533, + 4388260, + 304739, + 26480870, + 1536769, + 7459574, + 228694, + 38783863, + 192675, + 2512642, + 34617799, + 706367, + 608274, + 10538093, + 4227026, + 745228, + 14500404, + 1251524, + 1703617, + 2721783, + 8007166, + 5637246, + 6491649, + 1456688, + 913025, + 18396941, + 11127868, + 977026, + 5682086, + 62209173, + 492095, + 4657072, + 86796, + 5260855, + 3140897, + 4353666, + 27129932, + 17104986, + 551425, + 17129565, + 2308582, + 6005061, + 11457758, + 5216550, + 6642107 + ] + }, + "mode":"markers", + "x":[ + 58.014, + 39.483, + 49.19, + 59.319, + 46.137, + 45.91, + 49.355, + 46.775, + 47.383, + 50.939, + 47.804, + 55.625, + 52.374, + 46.519, + 53.319, + 42.024, + 44.535, + 44.51, + 52.79, + 41.842, + 51.756, + 40.762, + 37.465, + 56.155, + 52.208, + 43.764, + 57.442, + 46.881, + 43.767, + 41.714, + 50.852, + 64.93, + 55.73, + 42.495, + 56.437, + 41.291, + 44.514, + 67.064, + 45, + 58.55, + 48.879, + 36.788, + 41.974, + 55.527, + 47.8, + 52.537, + 49.919, + 52.887, + 59.837, + 50.35, + 51.386, + 57.674 + ], + "y":[ + 4910.416756, + 3008.647355, + 1029.161251, + 3214.857818, + 743.3870368, + 556.1032651, + 1783.432873, + 1109.374338, + 1133.98495, + 1172.603047, + 795.757282, + 3259.178978, + 2517.736547, + 3081.761022, + 2785.493582, + 958.5668124, + 505.7538077, + 556.8083834, + 21745.57328, + 884.7552507, + 993.2239571, + 874.6858643, + 764.7259628, + 1267.613204, + 745.3695408, + 640.3224383, + 21951.21176, + 1544.228586, + 663.2236766, + 686.3952693, + 1497.492223, + 3710.982963, + 2370.619976, + 502.3197334, + 3876.485958, + 808.8970728, + 1981.951806, + 4319.804067, + 670.0806011, + 1737.561657, + 1561.769116, + 1348.285159, + 1450.992513, + 8028.651439, + 2202.988423, + 3781.410618, + 962.4922932, + 1532.776998, + 3120.876811, + 843.7331372, + 1588.688299, + 685.5876821 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 26983828, + 5079716, + 114313951, + 23796400, + 10599793, + 25094412, + 2108457, + 9537988, + 5302800, + 7278866, + 4282586, + 5703430, + 4908554, + 3055235, + 2156814, + 63759976, + 2554598, + 1839782, + 2984494, + 15990099, + 3080828, + 1039009, + 220239000, + 2873520, + 13503563 + ] + }, + "mode":"markers", + "x":[ + 68.481, + 50.023, + 61.489, + 74.21, + 67.052, + 63.837, + 70.75, + 72.649, + 61.788, + 61.31, + 56.696, + 56.029, + 49.923, + 57.402, + 70.11, + 65.032, + 57.47, + 68.681, + 66.353, + 58.447, + 73.44, + 68.3, + 73.38, + 69.481, + 67.456 + ], + "y":[ + 10079.02674, + 3548.097832, + 6660.118654, + 22090.88306, + 4756.763836, + 3815.80787, + 5926.876967, + 6380.494966, + 2681.9889, + 6679.62326, + 5138.922374, + 4879.992748, + 1874.298931, + 3203.208066, + 6650.195573, + 7674.929108, + 5486.371089, + 5351.912144, + 3248.373311, + 6281.290855, + 9770.524921, + 7899.554209, + 24072.63213, + 6504.339663, + 13143.95095 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 14074100, + 3164900 + ] + }, + "mode":"markers", + "x":[ + 73.49, + 72.22 + ], + "y":[ + 18334.19751, + 16233.7177 + ] + } + ], + "name":"1977" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 12881816, + 377967, + 93074406, + 7272485, + 1000281000, + 5264500, + 708000000, + 153343000, + 43072751, + 14173318, + 3858421, + 118454974, + 2347031, + 17647518, + 39326000, + 1497494, + 3086876, + 14441916, + 1756032, + 34680442, + 15796314, + 1301048, + 91462088, + 53456774, + 11254672, + 2651869, + 15410151, + 9410494, + 18501390, + 48827160, + 56142181, + 1425876, + 9657618 + ] + }, + "mode":"markers", + "x":[ + 39.854, + 69.052, + 50.009, + 50.957, + 65.525, + 75.45, + 56.596, + 56.159, + 59.62, + 62.038, + 74.45, + 77.11, + 63.739, + 69.1, + 67.123, + 71.309, + 66.983, + 68, + 57.489, + 58.056, + 49.594, + 62.728, + 56.158, + 62.082, + 63.012, + 71.76, + 68.757, + 64.59, + 72.16, + 64.597, + 58.816, + 64.406, + 49.113 + ], + "y":[ + 978.0114388, + 19211.14731, + 676.9818656, + 624.4754784, + 962.4213805, + 14560.53051, + 855.7235377, + 1516.872988, + 7608.334602, + 14517.90711, + 15367.0292, + 19384.10571, + 4161.415959, + 4106.525293, + 5622.942464, + 31354.03573, + 7640.519521, + 4920.355951, + 2000.603139, + 424, + 718.3730947, + 12954.79101, + 1443.429832, + 2603.273765, + 33693.17525, + 15169.16112, + 1648.079789, + 3761.837715, + 7426.354774, + 2393.219781, + 707.2357863, + 4336.032082, + 1977.55701 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 2780097, + 7574613, + 9856303, + 4172693, + 8892098, + 4413368, + 10303704, + 5117810, + 4826933, + 54433565, + 78335266, + 9786480, + 10705535, + 233997, + 3480000, + 56535636, + 562548, + 14310401, + 4114787, + 36227381, + 9859650, + 22356726, + 9032824, + 5048043, + 1861252, + 37983310, + 8325260, + 6468126, + 47328791, + 56339704 + ] + }, + "mode":"markers", + "x":[ + 70.42, + 73.18, + 73.93, + 70.69, + 71.08, + 70.46, + 70.96, + 74.63, + 74.55, + 74.89, + 73.8, + 75.24, + 69.39, + 76.99, + 73.1, + 74.98, + 74.101, + 76.05, + 75.97, + 71.32, + 72.77, + 69.66, + 70.162, + 70.8, + 71.063, + 76.3, + 76.42, + 76.21, + 61.036, + 74.04 + ], + "y":[ + 3630.880722, + 21597.08362, + 20979.84589, + 4126.613157, + 8224.191647, + 13221.82184, + 15377.22855, + 21688.04048, + 18533.15761, + 20293.89746, + 22031.53274, + 15268.42089, + 12545.99066, + 23269.6075, + 12618.32141, + 16537.4835, + 11222.58762, + 21399.46046, + 26298.63531, + 8451.531004, + 11753.84291, + 9605.314053, + 15181.0927, + 11348.54585, + 17866.72175, + 13926.16997, + 20667.38125, + 28397.71512, + 4241.356344, + 18232.42452 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 20033753, + 7016384, + 3641603, + 970347, + 6634596, + 4580410, + 9250831, + 2476971, + 4875118, + 348643, + 30646495, + 1774735, + 9025951, + 305991, + 45681811, + 285483, + 2637297, + 38111756, + 753874, + 715523, + 11400338, + 4710497, + 825987, + 17661452, + 1411807, + 1956875, + 3344074, + 9171477, + 6502825, + 6998256, + 1622136, + 992040, + 20198730, + 12587223, + 1099010, + 6437188, + 73039376, + 517810, + 5507565, + 98593, + 6147783, + 3464522, + 5828892, + 31140029, + 20367053, + 649901, + 19844382, + 2644765, + 6734098, + 12939400, + 6100407, + 7636524 + ] + }, + "mode":"markers", + "x":[ + 61.368, + 39.942, + 50.904, + 61.484, + 48.122, + 47.471, + 52.961, + 48.295, + 49.517, + 52.933, + 47.784, + 56.695, + 53.983, + 48.812, + 56.006, + 43.662, + 43.89, + 44.916, + 56.564, + 45.58, + 53.744, + 42.891, + 39.327, + 58.766, + 55.078, + 44.852, + 62.155, + 48.969, + 45.642, + 43.916, + 53.599, + 66.711, + 59.65, + 42.795, + 58.968, + 42.598, + 45.826, + 69.885, + 46.218, + 60.351, + 52.379, + 38.445, + 42.955, + 58.161, + 50.338, + 55.561, + 50.608, + 55.471, + 64.048, + 49.849, + 51.821, + 60.363 + ], + "y":[ + 5745.160213, + 2756.953672, + 1277.897616, + 4551.14215, + 807.1985855, + 559.603231, + 2367.983282, + 956.7529907, + 797.9081006, + 1267.100083, + 673.7478181, + 4879.507522, + 2602.710169, + 2879.468067, + 3503.729636, + 927.8253427, + 524.8758493, + 577.8607471, + 15113.36194, + 835.8096108, + 876.032569, + 857.2503577, + 838.1239671, + 1348.225791, + 797.2631074, + 572.1995694, + 17364.27538, + 1302.878658, + 632.8039209, + 618.0140641, + 1481.150189, + 3688.037739, + 2702.620356, + 462.2114149, + 4191.100511, + 909.7221354, + 1576.97375, + 5267.219353, + 881.5706467, + 1890.218117, + 1518.479984, + 1465.010784, + 1176.807031, + 8568.266228, + 1895.544073, + 3895.384018, + 874.2426069, + 1344.577953, + 3560.233174, + 682.2662268, + 1408.678565, + 788.8550411 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 29341374, + 5642224, + 128962939, + 25201900, + 11487112, + 27764644, + 2424367, + 9789224, + 5968349, + 8365850, + 4474873, + 6395630, + 5198399, + 3669448, + 2298309, + 71640904, + 2979423, + 2036305, + 3366439, + 18125129, + 3279001, + 1116479, + 232187835, + 2953997, + 15620766 + ] + }, + "mode":"markers", + "x":[ + 69.942, + 53.859, + 63.336, + 75.76, + 70.565, + 66.653, + 73.45, + 73.717, + 63.727, + 64.342, + 56.604, + 58.137, + 51.461, + 60.909, + 71.21, + 67.405, + 59.298, + 70.472, + 66.874, + 61.406, + 73.75, + 68.832, + 74.65, + 70.805, + 68.557 + ], + "y":[ + 8997.897412, + 3156.510452, + 7030.835878, + 22898.79214, + 5095.665738, + 4397.575659, + 5262.734751, + 7316.918107, + 2861.092386, + 7213.791267, + 4098.344175, + 4820.49479, + 2011.159549, + 3121.760794, + 6068.05135, + 9611.147541, + 3470.338156, + 7009.601598, + 4258.503604, + 6434.501797, + 10330.98915, + 9119.528607, + 25009.55914, + 6920.223051, + 11152.41011 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 15184200, + 3210650 + ] + }, + "mode":"markers", + "x":[ + 74.74, + 73.84 + ], + "y":[ + 19477.00928, + 17632.4104 + ] + } + ], + "name":"1982" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 13867957, + 454612, + 103764241, + 8371791, + 1084035000, + 5584510, + 788000000, + 169276000, + 51889696, + 16543189, + 4203148, + 122091325, + 2820042, + 19067554, + 41622000, + 1891487, + 3089353, + 16331785, + 2015133, + 38028578, + 17917180, + 1593882, + 105186881, + 60017788, + 14619745, + 2794552, + 16495304, + 11242847, + 19757799, + 52910342, + 62826491, + 1691210, + 11219340 + ] + }, + "mode":"markers", + "x":[ + 40.822, + 70.75, + 52.819, + 53.914, + 67.274, + 76.2, + 58.553, + 60.137, + 63.04, + 65.044, + 75.6, + 78.67, + 65.869, + 70.647, + 69.81, + 74.174, + 67.926, + 69.5, + 60.222, + 58.339, + 52.537, + 67.734, + 58.245, + 64.151, + 66.295, + 73.56, + 69.011, + 66.974, + 73.4, + 66.084, + 62.82, + 67.046, + 52.922 + ], + "y":[ + 852.3959448, + 18524.02406, + 751.9794035, + 683.8955732, + 1378.904018, + 20038.47269, + 976.5126756, + 1748.356961, + 6642.881371, + 11643.57268, + 17122.47986, + 22375.94189, + 4448.679912, + 4106.492315, + 8533.088805, + 28118.42998, + 5377.091329, + 5249.802653, + 2338.008304, + 385, + 775.6324501, + 18115.22313, + 1704.686583, + 2189.634995, + 21198.26136, + 18861.53081, + 1876.766827, + 3116.774285, + 11054.56175, + 2982.653773, + 820.7994449, + 5107.197384, + 1971.741538 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3075321, + 7578903, + 9870200, + 4338977, + 8971958, + 4484310, + 10311597, + 5127024, + 4931729, + 55630100, + 77718298, + 9974490, + 10612740, + 244676, + 3539900, + 56729703, + 569473, + 14665278, + 4186147, + 37740710, + 9915289, + 22686371, + 9230783, + 5199318, + 1945870, + 38880702, + 8421403, + 6649942, + 52881328, + 56981620 + ] + }, + "mode":"markers", + "x":[ + 72, + 74.94, + 75.35, + 71.14, + 71.34, + 71.52, + 71.58, + 74.8, + 74.83, + 76.34, + 74.847, + 76.67, + 69.58, + 77.23, + 74.36, + 76.42, + 74.865, + 76.83, + 75.89, + 70.98, + 74.06, + 69.53, + 71.218, + 71.08, + 72.25, + 76.9, + 77.19, + 77.41, + 63.108, + 75.007 + ], + "y":[ + 3738.932735, + 23687.82607, + 22525.56308, + 4314.114757, + 8239.854824, + 13822.58394, + 16310.4434, + 25116.17581, + 21141.01223, + 22066.44214, + 24639.18566, + 16120.52839, + 12986.47998, + 26923.20628, + 13872.86652, + 19207.23482, + 11732.51017, + 23651.32361, + 31540.9748, + 9082.351172, + 13039.30876, + 9696.273295, + 15870.87851, + 12037.26758, + 18678.53492, + 15764.98313, + 23586.92927, + 30281.70459, + 5089.043686, + 21664.78767 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 23254956, + 7874230, + 4243788, + 1151184, + 7586551, + 5126023, + 10780667, + 2840009, + 5498955, + 395114, + 35481645, + 2064095, + 10761098, + 311025, + 52799062, + 341244, + 2915959, + 42999530, + 880397, + 848406, + 14168101, + 5650262, + 927524, + 21198082, + 1599200, + 2269414, + 3799845, + 10568642, + 7824747, + 7634008, + 1841240, + 1042663, + 22987397, + 12891952, + 1278184, + 7332638, + 81551520, + 562035, + 6349365, + 110812, + 7171347, + 3868905, + 6921858, + 35933379, + 24725960, + 779348, + 23040630, + 3154264, + 7724976, + 15283050, + 7272406, + 9216418 + ] + }, + "mode":"markers", + "x":[ + 65.799, + 39.906, + 52.337, + 63.622, + 49.557, + 48.211, + 54.985, + 50.485, + 51.051, + 54.926, + 47.412, + 57.47, + 54.655, + 50.04, + 59.797, + 45.664, + 46.453, + 46.684, + 60.19, + 49.265, + 55.729, + 45.552, + 41.245, + 59.339, + 57.18, + 46.027, + 66.234, + 49.35, + 47.457, + 46.364, + 56.145, + 68.74, + 62.677, + 42.861, + 60.835, + 44.555, + 46.886, + 71.913, + 44.02, + 61.728, + 55.769, + 40.006, + 44.501, + 60.834, + 51.744, + 57.678, + 51.535, + 56.941, + 66.894, + 51.509, + 50.821, + 62.351 + ], + "y":[ + 5681.358539, + 2430.208311, + 1225.85601, + 6205.88385, + 912.0631417, + 621.8188189, + 2602.664206, + 844.8763504, + 952.386129, + 1315.980812, + 672.774812, + 4201.194937, + 2156.956069, + 2880.102568, + 3885.46071, + 966.8968149, + 521.1341333, + 573.7413142, + 11864.40844, + 611.6588611, + 847.0061135, + 805.5724718, + 736.4153921, + 1361.936856, + 773.9932141, + 506.1138573, + 11770.5898, + 1155.441948, + 635.5173634, + 684.1715576, + 1421.603576, + 4783.586903, + 2755.046991, + 389.8761846, + 3693.731337, + 668.3000228, + 1385.029563, + 5303.377488, + 847.991217, + 1516.525457, + 1441.72072, + 1294.447788, + 1093.244963, + 7825.823398, + 1507.819159, + 3984.839812, + 831.8220794, + 1202.201361, + 3810.419296, + 617.7244065, + 1213.315116, + 706.1573059 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 31620918, + 6156369, + 142938076, + 26549700, + 12463354, + 30964245, + 2799811, + 10239839, + 6655297, + 9545158, + 4842194, + 7326406, + 5756203, + 4372203, + 2326606, + 80122492, + 3344353, + 2253639, + 3886512, + 20195924, + 3444468, + 1191336, + 242803533, + 3045153, + 17910182 + ] + }, + "mode":"markers", + "x":[ + 70.774, + 57.251, + 65.205, + 76.86, + 72.492, + 67.768, + 74.752, + 74.174, + 66.046, + 67.231, + 63.154, + 60.782, + 53.636, + 64.492, + 71.77, + 69.498, + 62.008, + 71.523, + 67.378, + 64.134, + 74.63, + 69.582, + 75.02, + 71.918, + 70.19 + ], + "y":[ + 9139.671389, + 2753.69149, + 7807.095818, + 26626.51503, + 5547.063754, + 4903.2191, + 5629.915318, + 7532.924763, + 2899.842175, + 6481.776993, + 4140.442097, + 4246.485974, + 1823.015995, + 3023.096699, + 6351.237495, + 8688.156003, + 2955.984375, + 7034.779161, + 3998.875695, + 6360.943444, + 12281.34191, + 7388.597823, + 29884.35041, + 7452.398969, + 9883.584648 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 16257249, + 3317166 + ] + }, + "mode":"markers", + "x":[ + 76.32, + 74.32 + ], + "y":[ + 21888.88903, + 19007.19129 + ] + } + ], + "name":"1987" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 16317921, + 529491, + 113704579, + 10150094, + 1164970000, + 5829696, + 872000000, + 184816000, + 60397973, + 17861905, + 4936550, + 124329269, + 3867409, + 20711375, + 43805450, + 1418095, + 3219994, + 18319502, + 2312802, + 40546538, + 20326209, + 1915208, + 120065004, + 67185766, + 16945857, + 3235865, + 17587060, + 13219062, + 20686918, + 56667095, + 69940728, + 2104779, + 13367997 + ] + }, + "mode":"markers", + "x":[ + 41.674, + 72.601, + 56.018, + 55.803, + 68.69, + 77.601, + 60.223, + 62.681, + 65.742, + 59.461, + 76.93, + 79.36, + 68.015, + 69.978, + 72.244, + 75.19, + 69.292, + 70.693, + 61.271, + 59.32, + 55.727, + 71.197, + 60.838, + 66.458, + 68.768, + 75.788, + 70.379, + 69.249, + 74.26, + 67.298, + 67.662, + 69.718, + 55.599 + ], + "y":[ + 649.3413952, + 19035.57917, + 837.8101643, + 682.3031755, + 1655.784158, + 24757.60301, + 1164.406809, + 2383.140898, + 7235.653188, + 3745.640687, + 18051.52254, + 26824.89511, + 3431.593647, + 3726.063507, + 12104.27872, + 34932.91959, + 6890.806854, + 7277.912802, + 1785.402016, + 347, + 897.7403604, + 18616.70691, + 1971.829464, + 2279.324017, + 24841.61777, + 24769.8912, + 2153.739222, + 3340.542768, + 15215.6579, + 4616.896545, + 989.0231487, + 6017.654756, + 1879.496673 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3326498, + 7914969, + 10045622, + 4256013, + 8658506, + 4494013, + 10315702, + 5171393, + 5041039, + 57374179, + 80597764, + 10325429, + 10348684, + 259012, + 3557761, + 56840847, + 621621, + 15174244, + 4286357, + 38370697, + 9927680, + 22797027, + 9826397, + 5302888, + 1999210, + 39549438, + 8718867, + 6995447, + 58179144, + 57866349 + ] + }, + "mode":"markers", + "x":[ + 71.581, + 76.04, + 76.46, + 72.178, + 71.19, + 72.527, + 72.4, + 75.33, + 75.7, + 77.46, + 76.07, + 77.03, + 69.17, + 78.77, + 75.467, + 77.44, + 75.435, + 77.42, + 77.32, + 70.99, + 74.86, + 69.36, + 71.659, + 71.38, + 73.64, + 77.57, + 78.16, + 78.03, + 66.146, + 76.42 + ], + "y":[ + 2497.437901, + 27042.01868, + 25575.57069, + 2546.781445, + 6302.623438, + 8447.794873, + 14297.02122, + 26406.73985, + 20647.16499, + 24703.79615, + 26505.30317, + 17541.49634, + 10535.62855, + 25144.39201, + 17558.81555, + 22013.64486, + 7003.339037, + 26790.94961, + 33965.66115, + 7738.881247, + 16207.26663, + 6598.409903, + 9325.068238, + 9498.467723, + 14214.71681, + 18603.06452, + 23880.01683, + 31871.5303, + 5678.348271, + 22705.09254 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 26298373, + 8735988, + 4981671, + 1342614, + 8878303, + 5809236, + 12467171, + 3265124, + 6429417, + 454429, + 41672143, + 2409073, + 12772596, + 384156, + 59402198, + 387838, + 3668440, + 52088559, + 985739, + 1025384, + 16278738, + 6990574, + 1050938, + 25020539, + 1803195, + 1912974, + 4364501, + 12210395, + 10014249, + 8416215, + 2119465, + 1096202, + 25798239, + 13160731, + 1554253, + 8392818, + 93364244, + 622191, + 7290203, + 125911, + 8307920, + 4260884, + 6099799, + 39964159, + 28227588, + 962344, + 26605473, + 3747553, + 8523077, + 18252190, + 8381163, + 10704340 + ] + }, + "mode":"markers", + "x":[ + 67.744, + 40.647, + 53.919, + 62.745, + 50.26, + 44.736, + 54.314, + 49.396, + 51.724, + 57.939, + 45.548, + 56.433, + 52.044, + 51.604, + 63.674, + 47.545, + 49.991, + 48.091, + 61.366, + 52.644, + 57.501, + 48.576, + 43.266, + 59.285, + 59.685, + 40.802, + 68.755, + 52.214, + 49.42, + 48.388, + 58.333, + 69.745, + 65.393, + 44.284, + 61.999, + 47.391, + 47.472, + 73.615, + 23.599, + 62.742, + 58.196, + 38.333, + 39.658, + 61.888, + 53.556, + 58.474, + 50.44, + 58.061, + 70.001, + 48.825, + 46.1, + 60.377 + ], + "y":[ + 5023.216647, + 2627.845685, + 1191.207681, + 7954.111645, + 931.7527731, + 631.6998778, + 1793.163278, + 747.9055252, + 1058.0643, + 1246.90737, + 457.7191807, + 4016.239529, + 1648.073791, + 2377.156192, + 3794.755195, + 1132.055034, + 582.8585102, + 421.3534653, + 13522.15752, + 665.6244126, + 925.060154, + 794.3484384, + 745.5398706, + 1341.921721, + 977.4862725, + 636.6229191, + 9640.138501, + 1040.67619, + 563.2000145, + 739.014375, + 1361.369784, + 6058.253846, + 2948.047252, + 410.8968239, + 3804.537999, + 581.182725, + 1619.848217, + 6101.255823, + 737.0685949, + 1428.777814, + 1367.899369, + 1068.696278, + 926.9602964, + 7225.069258, + 1492.197043, + 3553.0224, + 825.682454, + 1034.298904, + 4332.720164, + 644.1707969, + 1210.884633, + 693.4207856 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 33958947, + 6893451, + 155975974, + 28523502, + 13572994, + 34202721, + 3173216, + 10723260, + 7351181, + 10748394, + 5274649, + 8486949, + 6326682, + 5077347, + 2378618, + 88111030, + 4017939, + 2484997, + 4483945, + 22430449, + 3585176, + 1183669, + 256894189, + 3149262, + 20265563 + ] + }, + "mode":"markers", + "x":[ + 71.868, + 59.957, + 67.057, + 77.95, + 74.126, + 68.421, + 75.713, + 74.414, + 68.457, + 69.613, + 66.798, + 63.373, + 55.089, + 66.399, + 71.766, + 71.455, + 65.843, + 72.462, + 68.225, + 66.458, + 73.911, + 69.862, + 76.09, + 72.752, + 71.15 + ], + "y":[ + 9308.41871, + 2961.699694, + 6950.283021, + 26342.88426, + 7596.125964, + 5444.648617, + 6160.416317, + 5592.843963, + 3044.214214, + 7103.702595, + 4444.2317, + 4439.45084, + 1456.309517, + 3081.694603, + 7404.923685, + 9472.384295, + 2170.151724, + 6618.74305, + 4196.411078, + 4446.380924, + 14641.58711, + 7370.990932, + 32003.93224, + 8137.004775, + 10733.92631 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 17481977, + 3437674 + ] + }, + "mode":"markers", + "x":[ + 77.56, + 76.33 + ], + "y":[ + 23424.76683, + 18363.32494 + ] + } + ], + "name":"1992" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 22227415, + 598561, + 123315288, + 11782962, + 1230075000, + 6495918, + 959000000, + 199278000, + 63327987, + 20775703, + 5531387, + 125956499, + 4526235, + 21585105, + 46173816, + 1765345, + 3430388, + 20476091, + 2494803, + 43247867, + 23001113, + 2283635, + 135564834, + 75012988, + 21229759, + 3802309, + 18698655, + 15081016, + 21628605, + 60216677, + 76048996, + 2826046, + 15826497 + ] + }, + "mode":"markers", + "x":[ + 41.763, + 73.925, + 59.412, + 56.534, + 70.426, + 80, + 61.765, + 66.041, + 68.042, + 58.811, + 78.269, + 80.69, + 69.772, + 67.727, + 74.647, + 76.156, + 70.265, + 71.938, + 63.625, + 60.328, + 59.426, + 72.499, + 61.818, + 68.564, + 70.533, + 77.158, + 70.457, + 71.527, + 75.25, + 67.521, + 70.672, + 71.096, + 58.02 + ], + "y":[ + 635.341351, + 20292.01679, + 972.7700352, + 734.28517, + 2289.234136, + 28377.63219, + 1458.817442, + 3119.335603, + 8263.590301, + 3076.239795, + 20896.60924, + 28816.58499, + 3645.379572, + 1690.756814, + 15993.52796, + 40300.61996, + 8754.96385, + 10132.90964, + 1902.2521, + 415, + 1010.892138, + 19702.05581, + 2049.350521, + 2536.534925, + 20586.69019, + 33519.4766, + 2664.477257, + 4014.238972, + 20206.82098, + 5852.625497, + 1385.896769, + 7110.667619, + 2117.484526 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3428038, + 8069876, + 10199787, + 3607000, + 8066057, + 4444595, + 10300707, + 5283663, + 5134406, + 58623428, + 82011073, + 10502372, + 10244684, + 271192, + 3667233, + 57479469, + 692651, + 15604464, + 4405672, + 38654957, + 10156415, + 22562458, + 10336594, + 5383010, + 2011612, + 39855442, + 8897619, + 7193761, + 63047647, + 58808266 + ] + }, + "mode":"markers", + "x":[ + 72.95, + 77.51, + 77.53, + 73.244, + 70.32, + 73.68, + 74.01, + 76.11, + 77.13, + 78.64, + 77.34, + 77.869, + 71.04, + 78.95, + 76.122, + 78.82, + 75.445, + 78.03, + 78.32, + 72.75, + 75.97, + 69.72, + 72.232, + 72.71, + 75.13, + 78.77, + 79.39, + 79.37, + 68.835, + 77.218 + ], + "y":[ + 3193.054604, + 29095.92066, + 27561.19663, + 4766.355904, + 5970.38876, + 9875.604515, + 16048.51424, + 29804.34567, + 23723.9502, + 25889.78487, + 27788.88416, + 18747.69814, + 11712.7768, + 28061.09966, + 24521.94713, + 24675.02446, + 6465.613349, + 30246.13063, + 41283.16433, + 10159.58368, + 17641.03156, + 7346.547557, + 7914.320304, + 12126.23065, + 17161.10735, + 20445.29896, + 25266.59499, + 32135.32301, + 6601.429915, + 26074.53136 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 29072015, + 9875024, + 6066080, + 1536536, + 10352843, + 6121610, + 14195809, + 3696513, + 7562011, + 527982, + 47798986, + 2800947, + 14625967, + 417908, + 66134291, + 439971, + 4058319, + 59861301, + 1126189, + 1235767, + 18418288, + 8048834, + 1193708, + 28263827, + 1982823, + 2200725, + 4759670, + 14165114, + 10419991, + 9384984, + 2444741, + 1149818, + 28529501, + 16603334, + 1774766, + 9666252, + 106207839, + 684810, + 7212583, + 145608, + 9535314, + 4578212, + 6633514, + 42835005, + 32160729, + 1054486, + 30686889, + 4320890, + 9231669, + 21210254, + 9417789, + 11404948 + ] + }, + "mode":"markers", + "x":[ + 69.152, + 40.963, + 54.777, + 52.556, + 50.324, + 45.326, + 52.199, + 46.066, + 51.573, + 60.66, + 42.587, + 52.962, + 47.991, + 53.157, + 67.217, + 48.245, + 53.378, + 49.402, + 60.461, + 55.861, + 58.556, + 51.455, + 44.873, + 54.407, + 55.558, + 42.221, + 71.555, + 54.978, + 47.495, + 49.903, + 60.43, + 70.736, + 67.66, + 46.344, + 58.909, + 51.313, + 47.464, + 74.772, + 36.087, + 63.306, + 60.187, + 39.897, + 43.795, + 60.236, + 55.373, + 54.289, + 48.466, + 58.39, + 71.973, + 44.578, + 40.238, + 46.809 + ], + "y":[ + 4797.295051, + 2277.140884, + 1232.975292, + 8647.142313, + 946.2949618, + 463.1151478, + 1694.337469, + 740.5063317, + 1004.961353, + 1173.618235, + 312.188423, + 3484.164376, + 1786.265407, + 1895.016984, + 4173.181797, + 2814.480755, + 913.47079, + 515.8894013, + 14722.84188, + 653.7301704, + 1005.245812, + 869.4497668, + 796.6644681, + 1360.485021, + 1186.147994, + 609.1739508, + 9467.446056, + 986.2958956, + 692.2758103, + 790.2579846, + 1483.136136, + 7425.705295, + 2982.101858, + 472.3460771, + 3899.52426, + 580.3052092, + 1624.941275, + 6071.941411, + 589.9445051, + 1339.076036, + 1392.368347, + 574.6481576, + 930.5964284, + 7479.188244, + 1632.210764, + 3876.76846, + 789.1862231, + 982.2869243, + 4876.798614, + 816.559081, + 1071.353818, + 792.4499603 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 36203463, + 7693188, + 168546719, + 30305843, + 14599929, + 37657830, + 3518107, + 10983007, + 7992357, + 11911819, + 5783439, + 9803875, + 6913545, + 5867957, + 2531311, + 95895146, + 4609572, + 2734531, + 5154123, + 24748122, + 3759430, + 1138101, + 272911760, + 3262838, + 22374398 + ] + }, + "mode":"markers", + "x":[ + 73.275, + 62.05, + 69.388, + 78.61, + 75.816, + 70.313, + 77.26, + 76.151, + 69.957, + 72.312, + 69.535, + 66.322, + 56.671, + 67.659, + 72.262, + 73.67, + 68.426, + 73.738, + 69.4, + 68.386, + 74.917, + 69.465, + 76.81, + 74.223, + 72.146 + ], + "y":[ + 10967.28195, + 3326.143191, + 7957.980824, + 28954.92589, + 10118.05318, + 6117.361746, + 6677.045314, + 5431.990415, + 3614.101285, + 7429.455877, + 5154.825496, + 4684.313807, + 1341.726931, + 3160.454906, + 7121.924704, + 9767.29753, + 2253.023004, + 7113.692252, + 4247.400261, + 5838.347657, + 16999.4333, + 8792.573126, + 35767.43303, + 9230.240708, + 10165.49518 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 18565243, + 3676187 + ] + }, + "mode":"markers", + "x":[ + 78.83, + 77.55 + ], + "y":[ + 26997.93657, + 21050.41377 + ] + } + ], + "name":"1997" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 25268405, + 656397, + 135656790, + 12926707, + 1280400000, + 6762476, + 1034172547, + 211060000, + 66907826, + 24001816, + 6029529, + 127065841, + 5307470, + 22215365, + 47969150, + 2111561, + 3677780, + 22662365, + 2674234, + 45598081, + 25873917, + 2713462, + 153403524, + 82995088, + 24501530, + 4197776, + 19576783, + 17155814, + 22454239, + 62806748, + 80908147, + 3389578, + 18701257 + ] + }, + "mode":"markers", + "x":[ + 42.129, + 74.795, + 62.013, + 56.752, + 72.028, + 81.495, + 62.879, + 68.588, + 69.451, + 57.046, + 79.696, + 82, + 71.263, + 66.662, + 77.045, + 76.904, + 71.028, + 73.044, + 65.033, + 59.908, + 61.34, + 74.193, + 63.61, + 70.303, + 71.626, + 78.77, + 70.815, + 73.053, + 76.99, + 68.564, + 73.017, + 72.37, + 60.308 + ], + "y":[ + 726.7340548, + 23403.55927, + 1136.39043, + 896.2260153, + 3119.280896, + 30209.01516, + 1746.769454, + 2873.91287, + 9240.761975, + 4390.717312, + 21905.59514, + 28604.5919, + 3844.917194, + 1646.758151, + 19233.98818, + 35110.10566, + 9313.93883, + 10206.97794, + 2140.739323, + 611, + 1057.206311, + 19774.83687, + 2092.712441, + 2650.921068, + 19014.54118, + 36023.1054, + 3015.378833, + 4090.925331, + 23235.42329, + 5913.187529, + 1764.456677, + 4515.487575, + 2234.820827 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3508512, + 8148312, + 10311970, + 4165416, + 7661799, + 4481020, + 10256295, + 5374693, + 5193039, + 59925035, + 82350671, + 10603863, + 10083313, + 288030, + 3879155, + 57926999, + 720230, + 16122830, + 4535591, + 38625976, + 10433867, + 22404337, + 10111559, + 5410052, + 2011497, + 40152517, + 8954175, + 7361757, + 67308928, + 59912431 + ] + }, + "mode":"markers", + "x":[ + 75.651, + 78.98, + 78.32, + 74.09, + 72.14, + 74.876, + 75.51, + 77.18, + 78.37, + 79.59, + 78.67, + 78.256, + 72.59, + 80.5, + 77.783, + 80.24, + 73.981, + 78.53, + 79.05, + 74.67, + 77.29, + 71.322, + 73.213, + 73.8, + 76.66, + 79.78, + 80.04, + 80.62, + 70.845, + 78.471 + ], + "y":[ + 4604.211737, + 32417.60769, + 30485.88375, + 6018.975239, + 7696.777725, + 11628.38895, + 17596.21022, + 32166.50006, + 28204.59057, + 28926.03234, + 30035.80198, + 22514.2548, + 14843.93556, + 31163.20196, + 34077.04939, + 27968.09817, + 6557.194282, + 33724.75778, + 44683.97525, + 12002.23908, + 19970.90787, + 7885.360081, + 7236.075251, + 13638.77837, + 20660.01936, + 24835.47166, + 29341.63093, + 34480.95771, + 6508.085718, + 29478.99919 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 31287142, + 10866106, + 7026113, + 1630347, + 12251209, + 7021078, + 15929988, + 4048013, + 8835739, + 614382, + 55379852, + 3328795, + 16252726, + 447416, + 73312559, + 495627, + 4414865, + 67946797, + 1299304, + 1457766, + 20550751, + 8807818, + 1332459, + 31386842, + 2046772, + 2814651, + 5368585, + 16473477, + 11824495, + 10580176, + 2828858, + 1200206, + 31167783, + 18473780, + 1972153, + 11140655, + 119901274, + 743981, + 7852401, + 170372, + 10870037, + 5359092, + 7753310, + 44433622, + 37090298, + 1130269, + 34593779, + 4977378, + 9770575, + 24739869, + 10595811, + 11926563 + ] + }, + "mode":"markers", + "x":[ + 70.994, + 41.003, + 54.406, + 46.634, + 50.65, + 47.36, + 49.856, + 43.308, + 50.525, + 62.974, + 44.966, + 52.97, + 46.832, + 53.373, + 69.806, + 49.348, + 55.24, + 50.725, + 56.761, + 58.041, + 58.453, + 53.676, + 45.504, + 50.992, + 44.593, + 43.753, + 72.737, + 57.286, + 45.009, + 51.818, + 62.247, + 71.954, + 69.615, + 44.026, + 51.479, + 54.496, + 46.608, + 75.744, + 43.413, + 64.337, + 61.6, + 41.012, + 45.936, + 53.365, + 56.369, + 43.869, + 49.651, + 57.561, + 73.042, + 47.813, + 39.193, + 39.989 + ], + "y":[ + 5288.040382, + 2773.287312, + 1372.877931, + 11003.60508, + 1037.645221, + 446.4035126, + 1934.011449, + 738.6906068, + 1156.18186, + 1075.811558, + 241.1658765, + 3484.06197, + 1648.800823, + 1908.260867, + 4754.604414, + 7703.4959, + 765.3500015, + 530.0535319, + 12521.71392, + 660.5855997, + 1111.984578, + 945.5835837, + 575.7047176, + 1287.514732, + 1275.184575, + 531.4823679, + 9534.677467, + 894.6370822, + 665.4231186, + 951.4097518, + 1579.019543, + 9021.815894, + 3258.495584, + 633.6179466, + 4072.324751, + 601.0745012, + 1615.286395, + 6316.1652, + 785.6537648, + 1353.09239, + 1519.635262, + 699.489713, + 882.0818218, + 7710.946444, + 1993.398314, + 4128.116943, + 899.0742111, + 886.2205765, + 5722.895655, + 927.7210018, + 1071.613938, + 672.0386227 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 38331121, + 8445134, + 179914212, + 31902268, + 15497046, + 41008227, + 3834934, + 11226999, + 8650322, + 12921234, + 6353681, + 11178650, + 7607651, + 6677328, + 2664659, + 102479927, + 5146848, + 2990875, + 5884491, + 26769436, + 3859606, + 1101832, + 287675526, + 3363085, + 24287670 + ] + }, + "mode":"markers", + "x":[ + 74.34, + 63.883, + 71.006, + 79.77, + 77.86, + 71.682, + 78.123, + 77.158, + 70.847, + 74.173, + 70.734, + 68.978, + 58.137, + 68.565, + 72.047, + 74.902, + 70.836, + 74.712, + 70.755, + 69.906, + 77.778, + 68.976, + 77.31, + 75.307, + 72.766 + ], + "y":[ + 8797.640716, + 3413.26269, + 8131.212843, + 33328.96507, + 10778.78385, + 5755.259962, + 7723.447195, + 6340.646683, + 4563.808154, + 5773.044512, + 5351.568666, + 4858.347495, + 1270.364932, + 3099.72866, + 6994.774861, + 10742.44053, + 2474.548819, + 7356.031934, + 3783.674243, + 5909.020073, + 18855.60618, + 11460.60023, + 39097.09955, + 7727.002004, + 8605.047831 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 19546792, + 3908037 + ] + }, + "mode":"markers", + "x":[ + 80.37, + 79.11 + ], + "y":[ + 30687.75473, + 23189.80135 + ] + } + ], + "name":"2002" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 31889923, + 708573, + 150448339, + 14131858, + 1318683096, + 6980412, + 1110396331, + 223547000, + 69453570, + 27499638, + 6426679, + 127467972, + 6053193, + 23301725, + 49044790, + 2505559, + 3921278, + 24821286, + 2874127, + 47761980, + 28901790, + 3204897, + 169270617, + 91077287, + 27601038, + 4553009, + 20378239, + 19314747, + 23174294, + 65068149, + 85262356, + 4018332, + 22211743 + ] + }, + "mode":"markers", + "x":[ + 43.828, + 75.635, + 64.062, + 59.723, + 72.961, + 82.208, + 64.698, + 70.65, + 70.964, + 59.545, + 80.745, + 82.603, + 72.535, + 67.297, + 78.623, + 77.588, + 71.993, + 74.241, + 66.803, + 62.069, + 63.785, + 75.64, + 65.483, + 71.688, + 72.777, + 79.972, + 72.396, + 74.143, + 78.4, + 70.616, + 74.249, + 73.422, + 62.698 + ], + "y":[ + 974.5803384, + 29796.04834, + 1391.253792, + 1713.778686, + 4959.114854, + 39724.97867, + 2452.210407, + 3540.651564, + 11605.71449, + 4471.061906, + 25523.2771, + 31656.06806, + 4519.461171, + 1593.06548, + 23348.13973, + 47306.98978, + 10461.05868, + 12451.6558, + 3095.772271, + 944, + 1091.359778, + 22316.19287, + 2605.94758, + 3190.481016, + 21654.83194, + 47143.17964, + 3970.095407, + 4184.548089, + 28718.27684, + 7458.396327, + 2441.576404, + 3025.349798, + 2280.769906 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3600523, + 8199783, + 10392226, + 4552198, + 7322858, + 4493312, + 10228744, + 5468120, + 5238460, + 61083916, + 82400996, + 10706290, + 9956108, + 301931, + 4109086, + 58147733, + 684736, + 16570613, + 4627926, + 38518241, + 10642836, + 22276056, + 10150265, + 5447502, + 2009245, + 40448191, + 9031088, + 7554661, + 71158647, + 60776238 + ] + }, + "mode":"markers", + "x":[ + 76.423, + 79.829, + 79.441, + 74.852, + 73.005, + 75.748, + 76.486, + 78.332, + 79.313, + 80.657, + 79.406, + 79.483, + 73.338, + 81.757, + 78.885, + 80.546, + 74.543, + 79.762, + 80.196, + 75.563, + 78.098, + 72.476, + 74.002, + 74.663, + 77.926, + 80.941, + 80.884, + 81.701, + 71.777, + 79.425 + ], + "y":[ + 5937.029526, + 36126.4927, + 33692.60508, + 7446.298803, + 10680.79282, + 14619.22272, + 22833.30851, + 35278.41874, + 33207.0844, + 30470.0167, + 32170.37442, + 27538.41188, + 18008.94444, + 36180.78919, + 40675.99635, + 28569.7197, + 9253.896111, + 36797.93332, + 49357.19017, + 15389.92468, + 20509.64777, + 10808.47561, + 9786.534714, + 18678.31435, + 25768.25759, + 28821.0637, + 33859.74835, + 37506.41907, + 8458.276384, + 33203.26128 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 33333216, + 12420476, + 8078314, + 1639131, + 14326203, + 8390505, + 17696293, + 4369038, + 10238807, + 710960, + 64606759, + 3800610, + 18013409, + 496374, + 80264543, + 551201, + 4906585, + 76511887, + 1454867, + 1688359, + 22873338, + 9947814, + 1472041, + 35610177, + 2012649, + 3193942, + 6036914, + 19167654, + 13327079, + 12031795, + 3270065, + 1250882, + 33757175, + 19951656, + 2055080, + 12894865, + 135031164, + 798094, + 8860588, + 199579, + 12267493, + 6144562, + 9118773, + 43997828, + 42292929, + 1133066, + 38139640, + 5701579, + 10276158, + 29170398, + 11746035, + 12311143 + ] + }, + "mode":"markers", + "x":[ + 72.301, + 42.731, + 56.728, + 50.728, + 52.295, + 49.58, + 50.43, + 44.741, + 50.651, + 65.152, + 46.462, + 55.322, + 48.328, + 54.791, + 71.338, + 51.579, + 58.04, + 52.947, + 56.735, + 59.448, + 60.022, + 56.007, + 46.388, + 54.11, + 42.592, + 45.678, + 73.952, + 59.443, + 48.303, + 54.467, + 64.164, + 72.801, + 71.164, + 42.082, + 52.906, + 56.867, + 46.859, + 76.442, + 46.242, + 65.528, + 63.062, + 42.568, + 48.159, + 49.339, + 58.556, + 39.613, + 52.517, + 58.42, + 73.923, + 51.542, + 42.384, + 43.487 + ], + "y":[ + 6223.367465, + 4797.231267, + 1441.284873, + 12569.85177, + 1217.032994, + 430.0706916, + 2042.09524, + 706.016537, + 1704.063724, + 986.1478792, + 277.5518587, + 3632.557798, + 1544.750112, + 2082.481567, + 5581.180998, + 12154.08975, + 641.3695236, + 690.8055759, + 13206.48452, + 752.7497265, + 1327.60891, + 942.6542111, + 579.231743, + 1463.249282, + 1569.331442, + 414.5073415, + 12057.49928, + 1044.770126, + 759.3499101, + 1042.581557, + 1803.151496, + 10956.99112, + 3820.17523, + 823.6856205, + 4811.060429, + 619.6768924, + 2013.977305, + 7670.122558, + 863.0884639, + 1598.435089, + 1712.472136, + 862.5407561, + 926.1410683, + 9269.657808, + 2602.394995, + 4513.480643, + 1107.482182, + 882.9699438, + 7092.923025, + 1056.380121, + 1271.211593, + 469.7092981 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 40301927, + 9119152, + 190010647, + 33390141, + 16284741, + 44227550, + 4133884, + 11416987, + 9319622, + 13755680, + 6939688, + 12572928, + 8502814, + 7483763, + 2780132, + 108700891, + 5675356, + 3242173, + 6667147, + 28674757, + 3942491, + 1056608, + 301139947, + 3447496, + 26084662 + ] + }, + "mode":"markers", + "x":[ + 75.32, + 65.554, + 72.39, + 80.653, + 78.553, + 72.889, + 78.782, + 78.273, + 72.235, + 74.994, + 71.878, + 70.259, + 60.916, + 70.198, + 72.567, + 76.195, + 72.899, + 75.537, + 71.752, + 71.421, + 78.746, + 69.819, + 78.242, + 76.384, + 73.747 + ], + "y":[ + 12779.37964, + 3822.137084, + 9065.800825, + 36319.23501, + 13171.63885, + 7006.580419, + 9645.06142, + 8948.102923, + 6025.374752, + 6873.262326, + 5728.353514, + 5186.050003, + 1201.637154, + 3548.330846, + 7320.880262, + 11977.57496, + 2749.320965, + 9809.185636, + 4172.838464, + 7408.905561, + 19328.70901, + 18008.50924, + 42951.65309, + 10611.46299, + 11415.80569 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 20434176, + 4115771 + ] + }, + "mode":"markers", + "x":[ + 81.235, + 80.204 + ], + "y":[ + 34435.36744, + 25185.00911 + ] + } + ], + "name":"2007" + } + ], + "layout":{ + "xaxis":{ + "title":"Life Expectancy", + "range":[ + 30, + 85 + ] + }, + "yaxis":{ + "title":"GDP per Capita", + "type":"log" + }, + "hovermode":"closest", + "slider":{ + "visible":true, + "plotlycommand":"animate", + "args":[ + "slider.value", + { + "duration":400, + "ease":"cubic-in-out" + } + ], + "initialValue":"1952", + "values":[ + "1952", + "1957", + "1962", + "1967", + "1972", + "1977", + "1982", + "1987", + "1992", + "1997", + "2002", + "2007" + ] + }, + "updatemenus": [{ + "x": 0.1, + "y": 0, + "yanchor": "top", + "xanchor": "right", + "showactive": false, + "direction": "left", + "type": "buttons", + "pad": {"t": 87, "r": 10}, + "buttons": [{ + "method": "animate", + "args": [null, { + "fromcurrent": true, + "transition": { + "duration": 300, + "easing": "quadratic-in-out" + }, + "frame": { + "duration": 500, + "redraw": false + } + }], + "label": "Play" + }, { + "method": "animate", + "args": [ + [null], + { + "mode": "immediate", + "transition": { + "duration": 0 + }, + "frame": { + "duration": 0, + "redraw": false + } + } + ], + "label": "Pause" + }] + }], + "sliders": [{ + "active": 0, + "steps": [{ + "label": "1952", + "method": "animate", + "args": [["1952"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1957", + "method": "animate", + "args": [["1957"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1962", + "method": "animate", + "args": [["1962"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1967", + "method": "animate", + "args": [["1967"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1972", + "method": "animate", + "args": [["1972"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1977", + "method": "animate", + "args": [["1977"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1982", + "method": "animate", + "args": [["1982"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1987", + "method": "animate", + "args": [["1987"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1992", + "method": "animate", + "args": [["1992"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1997", + "method": "animate", + "args": [["1997"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "2002", + "method": "animate", + "args": [["2002"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "2007", + "method": "animate", + "args": [["2007"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }], + "x": 0.1, + "len": 0.9, + "xanchor": "left", + "y": 0, + "yanchor": "top", + "pad": {"t": 50, "b": 10}, + "currentvalue": { + "visible": true, + "prefix": "Year:", + "xanchor": "right", + "font": { + "size": 20, + "color": "#666" + } + }, + "transition": { + "duration": 300, + "easing": "cubic-in-out" + } + }] + }, + "config": { + "scrollzoom": true + } +} diff --git a/content/plotly_js/animations/animations/animations-animating-many-frames-quickly.html b/content/plotly_js/animations/animations/animations-animating-many-frames-quickly.html new file mode 100644 index 00000000000..cbc5bc9f0c9 --- /dev/null +++ b/content/plotly_js/animations/animations/animations-animating-many-frames-quickly.html @@ -0,0 +1,72 @@ +--- +name: Animating Many Frames Quickly +plot_url: https://codepen.io/plotly/embed/NRNJpv/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: animations +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + By default and to ensure any properties that cannot be animated are applied to the plot, a full redraw occurs after each transition. This is generally desirable, but hurts performance when you wish to animate frames as quickly as possible. The example below performs a live simulation of the Lorenz attractor and greatly improves the performance by eliminating the redraw with `redraw: false`. +--- +var n = 100; +var x = [], y = [], z = []; +var dt = 0.015; + +for (i = 0; i < n; i++) { + x[i] = Math.random() * 2 - 1; + y[i] = Math.random() * 2 - 1; + z[i] = 30 + Math.random() * 10; +} + +Plotly.newPlot('myDiv', [{ + x: x, + y: z, + mode: 'markers' +}], { + xaxis: {range: [-40, 40]}, + yaxis: {range: [0, 60]} +}) + +function compute () { + var s = 10, b = 8/3, r = 28; + var dx, dy, dz; + var xh, yh, zh; + for (var i = 0; i < n; i++) { + dx = s * (y[i] - x[i]); + dy = x[i] * (r - z[i]) - y[i]; + dz = x[i] * y[i] - b * z[i]; + + xh = x[i] + dx * dt * 0.5; + yh = y[i] + dy * dt * 0.5; + zh = z[i] + dz * dt * 0.5; + + dx = s * (yh - xh); + dy = xh * (r - zh) - yh; + dz = xh * yh - b * zh; + + x[i] += dx * dt; + y[i] += dy * dt; + z[i] += dz * dt; + } +} + +function update () { + compute(); + + Plotly.animate('myDiv', { + data: [{x: x, y: z}] + }, { + transition: { + duration: 0 + }, + frame: { + duration: 0, + redraw: false + } + }); + + requestAnimationFrame(update); +} + +requestAnimationFrame(update); diff --git a/content/plotly_js/animations/animations/animations-animating-sequences-of-frames.html b/content/plotly_js/animations/animations/animations-animating-sequences-of-frames.html new file mode 100644 index 00000000000..84eb2840151 --- /dev/null +++ b/content/plotly_js/animations/animations/animations-animating-sequences-of-frames.html @@ -0,0 +1,44 @@ +--- +name: Animating Sequences of Frames +plot_url: https://codepen.io/plotly/embed/qakvRz/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: animations +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + The above examples have used one frame at a time. Whether passing objects as frames or referring to frames by name, you may pass multiple frames together in an array. If `null` or `undefined` is passed as the second argument (i.e. `Plotly.animate('myDiv')`), then all defined frames will be animated in sequence. + + The third argument of `Plotly.animate` contains animation options. The transition duration defines the amount of time spent interpolating a trace from one state to another (currently limited to scatter traces), while the frame duration defines the total time spent in that state, including time spent transitioning. The example below has two frames, each with their own transition and frame timing. +--- +Plotly.newPlot('myDiv', [{ + x: [0, 0], + y: [-1, 1], +}], { + xaxis: {range: [-Math.PI, Math.PI]}, + yaxis: {range: [-1.3, 1.3]} +}).then(function () { + Plotly.addFrames('myDiv', [ + { + data: [{x: [1, -1], y: [0, 0]}], + name: 'frame1' + }, { + data: [{x: [0, 0], y: [-1, 1]}], + name: 'frame2' + } + ]); +}) + +function startAnimation() { + Plotly.animate('myDiv', ['frame1', 'frame2'], { + frame: [ + {duration: 1500}, + {duration: 500}, + ], + transition: [ + {duration: 800, easing: 'elastic-in'}, + {duration: 100, easing: 'cubic-in'}, + ], + mode: 'afterall' + }) +} diff --git a/content/plotly_js/animations/animations/animations-animating-the-data.html b/content/plotly_js/animations/animations/animations-animating-the-data.html new file mode 100644 index 00000000000..a65733ec553 --- /dev/null +++ b/content/plotly_js/animations/animations/animations-animating-the-data.html @@ -0,0 +1,34 @@ +--- +name: Animating the Data +plot_url: https://codepen.io/plotly/embed/ZpWPpj/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: animations +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + The animate command lets you add dynamic behavior to Plotly graphs in a number of different ways. At its core, `Plotly.animate` transitions traces to a new state or sequence of states. When you tell Plotly to animate, it merges the properties you've supplied into the current state of the plot. Therefore to animate a trace, *you must first plot the trace you wish to animate*. + + The example below transitions to new y-values each time the button is pressed. Since the transition animation occurs within a frame, `frame.duration` must be set at least as long as `transition.duration`. Note that to prevent artifacts while animating, the default line simplification algorithm is explicitly disabled. Currently, only scatter traces may be smoothly transitioned from one state to the next. Other traces are compatible with frames and animations but will be updated instantaneously. +--- +Plotly.newPlot('myDiv', [{ + x: [1, 2, 3], + y: [0, 0.5, 1], + line: {simplify: false}, +}]); + +function randomize() { + Plotly.animate('myDiv', { + data: [{y: [Math.random(), Math.random(), Math.random()]}], + traces: [0], + layout: {} + }, { + transition: { + duration: 500, + easing: 'cubic-in-out' + }, + frame: { + duration: 500 + } + }) +} diff --git a/content/plotly_js/animations/animations/animations-animating-the-layout.html b/content/plotly_js/animations/animations/animations-animating-the-layout.html new file mode 100644 index 00000000000..19074620127 --- /dev/null +++ b/content/plotly_js/animations/animations/animations-animating-the-layout.html @@ -0,0 +1,42 @@ +--- +name: Animating the Layout +plot_url: https://codepen.io/plotly/embed/GjkZNk/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: animations +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + The example below transitions to a new axis range each time the button is pressed. A present limitation of the animate API is that only one of either data or layout may be smoothly transitioned at a time. If both are provided, the data will be updated instantaneously after the layout is transitioned. +--- +var n = 500; +var x = [], y = []; +for (var i = 0; i < n; i++) { + x[i] = i / (n - 1); + y[i] = x[i] + 0.2 * (Math.random() - 0.5); +} + +Plotly.newPlot('myDiv', [{ + x: x, + y: y, + mode: 'markers' +}], { + xaxis: {range: [0, 1]}, + yaxis: {range: [0, 1]} +}); + +function zoom() { + var min = 0.45 * Math.random(); + var max = 0.55 + 0.45 * Math.random(); + Plotly.animate('myDiv', { + layout: { + xaxis: {range: [min, max]}, + yaxis: {range: [min, max]} + } + }, { + transition: { + duration: 500, + easing: 'cubic-in-out' + } + }) +} diff --git a/content/plotly_js/animations/animations/animations-defining-named-frames.html b/content/plotly_js/animations/animations/animations-defining-named-frames.html new file mode 100644 index 00000000000..029360171f4 --- /dev/null +++ b/content/plotly_js/animations/animations/animations-defining-named-frames.html @@ -0,0 +1,55 @@ +--- +name: Defining Named Frames with Plotly.addFrames +plot_url: https://codepen.io/plotly/embed/wzGOgd/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: animations +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + The above examples pass the data itself through the Plotly.animate command. You may instead predefine named frames through the Plotly.addFrames command. Then, instead of passing frames through `Plotly.animate`, you may simply refer to a frame by name. + + Similar to traces, frames are assigned a serial index as they are added. Frames may be updated by passing an array of frame indices. For example, the command to update the frame with index 2 would be `Plotly.addFrames('myDiv', [{...}], [2])`. Frames can be similarly deleted with, for example, `Plotly.deleteFrames('myDiv', [2])`. + + The following example uses frames together with an `updatemenu` for interactive transitions. +--- +var frames = [ + {name: 'sine', data: [{x: [], y: []}]}, + {name: 'cosine', data: [{x: [], y: []}]}, + {name: 'circle', data: [{x: [], y: []}]}, +]; + +var n = 100; +for (var i = 0; i < n; i++) { + var t = i / (n - 1) * 2 - 1; + + // A sine wave: + frames[0].data[0].x[i] = t * Math.PI; + frames[0].data[0].y[i] = Math.sin(t * Math.PI); + + // A cosine wave: + frames[1].data[0].x[i] = t * Math.PI; + frames[1].data[0].y[i] = Math.cos(t * Math.PI); + + // A circle: + frames[2].data[0].x[i] = Math.sin(t * Math.PI); + frames[2].data[0].y[i] = Math.cos(t * Math.PI); +} + +Plotly.newPlot('myDiv', [{ + x: frames[0].data[0].x, + y: frames[0].data[0].y, + line: {simplify: false}, +}], { + xaxis: {range: [-Math.PI, Math.PI]}, + yaxis: {range: [-1.2, 1.2]}, + updatemenus: [{ + buttons: [ + {method: 'animate', args: [['sine']], label: 'sine'}, + {method: 'animate', args: [['cosine']], label: 'cosine'}, + {method: 'animate', args: [['circle']], label: 'circle'} + ] + }] +}).then(function() { + Plotly.addFrames('myDiv', frames); +}); diff --git a/content/plotly_js/animations/animations/animations-frame-groups-and-animation-modes.html b/content/plotly_js/animations/animations/animations-frame-groups-and-animation-modes.html new file mode 100644 index 00000000000..2297f29b98d --- /dev/null +++ b/content/plotly_js/animations/animations/animations-frame-groups-and-animation-modes.html @@ -0,0 +1,94 @@ +--- +name: Frame Groups and Animation Modes +plot_url: https://codepen.io/plotly/embed/rrZRmA/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: animations +order: 7 +sitemap: false +arrangement: horizontal +markdown_content: | + The following example combines many of these concepts to draw a glass filling with water. + + The first row of buttons animates a different set of predefined frames by changing the second argument of `Plotly.animate`. Passing `null` or `undefined` animates all defined frames in sequence, while passing an array of strings (here, the frames in reverse) animates a specific sequence of frames. By passing a plain string (here, `lower` or `upper`), it filters the animated frames to those with a `group` property equal to that name. The stop button is accomplished by interrupting the current animation with an empty list of frames, therefore simply stopping the animation at the end of the current frame. + + The second row of buttons animates all frames with different animation modes. The `mode` option defines whether an animation either interrupts or follows the current animation. `immediate` mode discards all queued frames and begins a new sequence immediately. The `next` mode is very similar but doesn't begin the new animation until the *end* of the current frame. Finally, `afterall` queues the new frames so that the new animation begins only after all previous animations have completed. +--- +var i, j, t, x, y, name; +var frames = []; +var nFrames = 10; +var n = 80; +var reverseFrames = []; + +for (i = 0; i < nFrames; i++) { + var fill = 0.1 + 0.9 * i / (nFrames - 1); + x = [-1]; + y = [0]; + + // A wave across the top: + for (j = 0; j < n; j++) { + t = j / (n - 1); + x.push(-1 - fill + (2 + 2 * fill) * t); + y.push(fill + 0.05 * Math.sin(t * Math.PI * 2 * i)); + } + + // Close the loop to draw the water: + x.push(1, -1); + y.push(0, 0); + + // Choose a name: + name = 'frame' + i; + + // Store it in an array so we can animate in reverse order: + reverseFrames.unshift(name); + + // Create the frame: + frames.push({ + name: name, + data: [{x: x, y: y}], + group: i < nFrames / 2 ? 'lower' : 'upper' + }) +} + +Plotly.newPlot('myDiv', [{ + // Set up the initial water: + x: frames[0].data[0].x, + y: frames[0].data[0].y, + mode: 'lines', + fill: 'toself', + showlegend: false, + line: {simplify: false} +}, { + // Draw a glass: + x: [-1, 1, 2.1, -2.1, -1], + y: [0, 0, 1.1, 1.1, 0], + mode: 'lines', + fill: 'toself', + showlegend: false, + fillcolor: 'rgba(0, 0, 0, 0.1)', + line: {color: 'rgba(100,100,100,0.2)'} +}], { + xaxis: {range: [-3, 3]}, + yaxis: {range: [-0.1, 1.5]} +}).then(function() { + // Add the frames so we can animate them: + Plotly.addFrames('myDiv', frames); +}); + +// Stop the animation by animating to an empty set of frames: +function stopAnimation () { + Plotly.animate('myDiv', [], {mode: 'next'}); +} + +function startAnimation (groupOrFrames, mode) { + Plotly.animate('myDiv', groupOrFrames, { + transition: { + duration: 500, + easing: 'linear' + }, + frame: { + duration: 500, + redraw: false, + }, + mode: mode + }); +} diff --git a/content/plotly_js/animations/animations/animations-gapminder.html b/content/plotly_js/animations/animations/animations-gapminder.html new file mode 100644 index 00000000000..9248dd7b7bf --- /dev/null +++ b/content/plotly_js/animations/animations/animations-gapminder.html @@ -0,0 +1,10 @@ +--- +name: Animating with a Slider +language: plotly_js +suite: animations +order: 8 +sitemap: false +arrangement: horizontal +markdown_content: | + See [Adding Sliders to Animations](https://plotly.com/javascript/gapminder-example/). +--- diff --git a/content/plotly_js/animations/animations/animations-object-constancy.html b/content/plotly_js/animations/animations/animations-object-constancy.html new file mode 100644 index 00000000000..68aeb0c8797 --- /dev/null +++ b/content/plotly_js/animations/animations/animations-object-constancy.html @@ -0,0 +1,41 @@ +--- +name: Object Constancy +plot_url: https://codepen.io/plotly/embed/LRNaWw/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: animations +order: 6 +sitemap: false +arrangement: horizontal +markdown_content: | + For scatter traces, you may wish to retain a marker's identity as it is updated. If you include an array of string ids with the trace, the marker identity will be retained. By shuffling the ids, the example below shuffles the markers each time the button is pressed. +--- +function shuffleInPlace(array) { + for (var i = array.length - 1; i > 0; i--) { + var j = Math.floor(Math.random() * (i + 1)); + var temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } +} + +var ids = ['1', '2', '3', '4', '5', '6']; + +Plotly.newPlot('myDiv', [{ + x: [1, 0.5, -0.5, -1, -0.5, 0.5], + y: [0, 0.866, 0.866, 0, -0.866, -0.866], + marker:{size:14, + color:['#631357', '#880E4F', '#AD1457', + '#F06292', '#F48FB1']}, + ids: ids, + mode: 'markers' +}], { + xaxis: {range: [-3, 3]}, + yaxis: {range: [-2, 2]} +}); + +function animateShuffle() { + shuffleInPlace(ids); + Plotly.animate('myDiv', [{ + data: [{ids: ids}] + }]); +} diff --git a/content/plotly_js/animations/animations/gapminder-with-frames.json b/content/plotly_js/animations/animations/gapminder-with-frames.json new file mode 100644 index 00000000000..843dc88bad5 --- /dev/null +++ b/content/plotly_js/animations/animations/gapminder-with-frames.json @@ -0,0 +1,8705 @@ +{ + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 8425333, + 120447, + 46886859, + 4693836, + 556263527.999989, + 2125900, + 372000000, + 82052000, + 17272000, + 5441766, + 1620914, + 86459025, + 607914, + 8865488, + 20947571, + 160000, + 1439529, + 6748378, + 800663, + 20092996, + 9182536, + 507833, + 41346560, + 22438691, + 4005677, + 1127000, + 7982342, + 3661549, + 8550362, + 21289402, + 26246839, + 1030585, + 4963829 + ] + }, + "mode":"markers", + "x":[ + 28.801, + 50.939, + 37.484, + 39.417, + 44, + 60.96, + 37.373, + 37.468, + 44.869, + 45.32, + 65.39, + 63.03, + 43.158, + 50.056, + 47.453, + 55.565, + 55.928, + 48.463, + 42.244, + 36.319, + 36.157, + 37.578, + 43.436, + 47.752, + 39.875, + 60.396, + 57.593, + 45.883, + 58.5, + 50.848, + 40.412, + 43.16, + 32.548 + ], + "y":[ + 779.4453145, + 9867.084765, + 684.2441716, + 368.4692856, + 400.448610699994, + 3054.421209, + 546.5657493, + 749.6816546, + 3035.326002, + 4129.766056, + 4086.522128, + 3216.956347, + 1546.907807, + 1088.277758, + 1030.592226, + 108382.3529, + 4834.804067, + 1831.132894, + 786.5668575, + 331, + 545.8657229, + 1828.230307, + 684.5971438, + 1272.880995, + 6459.554823, + 2315.138227, + 1083.53203, + 1643.485354, + 1206.947913, + 757.7974177, + 605.0664917, + 1515.592329, + 781.7175761 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1282697, + 6927772, + 8730405, + 2791000, + 7274900, + 3882229, + 9125183, + 4334000, + 4090500, + 42459667, + 69145952, + 7733250, + 9504000, + 147962, + 2952156, + 47666000, + 413834, + 10381988, + 3327728, + 25730551, + 8526050, + 16630000, + 6860147, + 3558137, + 1489518, + 28549870, + 7124673, + 4815000, + 22235677, + 50430000 + ] + }, + "mode":"markers", + "x":[ + 55.23, + 66.8, + 68, + 53.82, + 59.6, + 61.21, + 66.87, + 70.78, + 66.55, + 67.41, + 67.5, + 65.86, + 64.03, + 72.49, + 66.91, + 65.94, + 59.164, + 72.13, + 72.67, + 61.31, + 59.82, + 61.05, + 57.996, + 64.36, + 65.57, + 64.94, + 71.86, + 69.62, + 43.585, + 69.18 + ], + "y":[ + 1601.056136, + 6137.076492, + 8343.105127, + 973.5331948, + 2444.286648, + 3119.23652, + 6876.14025, + 9692.385245, + 6424.519071, + 7029.809327, + 7144.114393, + 3530.690067, + 5263.673816, + 7267.688428, + 5210.280328, + 4931.404155, + 2647.585601, + 8941.571858, + 10095.42172, + 4029.329699, + 3068.319867, + 3144.613186, + 3581.459448, + 5074.659104, + 4215.041741, + 3834.034742, + 8527.844662, + 14734.23275, + 1969.10098, + 9979.508487 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 9279525, + 4232095, + 1738315, + 442308, + 4469979, + 2445618, + 5009067, + 1291695, + 2682462, + 153936, + 14100005, + 854885, + 2977019, + 63149, + 22223309, + 216964, + 1438760, + 20860941, + 420702, + 284320, + 5581001, + 2664249, + 580653, + 6464046, + 748747, + 863308, + 1019729, + 4762912, + 2917802, + 3838168, + 1022556, + 516556, + 9939217, + 6446316, + 485831, + 3379468, + 33119096, + 257700, + 2534927, + 60011, + 2755589, + 2143249, + 2526994, + 14264935, + 8504667, + 290243, + 8322925, + 1219113, + 3647735, + 5824797, + 2672000, + 3080907 + ] + }, + "mode":"markers", + "x":[ + 43.077, + 30.015, + 38.223, + 47.622, + 31.975, + 39.031, + 38.523, + 35.463, + 38.092, + 40.715, + 39.143, + 42.111, + 40.477, + 34.812, + 41.893, + 34.482, + 35.928, + 34.078, + 37.003, + 30, + 43.149, + 33.609, + 32.5, + 42.27, + 42.138, + 38.48, + 42.723, + 36.681, + 36.256, + 33.685, + 40.543, + 50.986, + 42.873, + 31.286, + 41.725, + 37.444, + 36.324, + 52.724, + 40, + 46.471, + 37.278, + 30.331, + 32.978, + 45.009, + 38.635, + 41.407, + 41.215, + 38.596, + 44.6, + 39.978, + 42.038, + 48.451 + ], + "y":[ + 2449.008185, + 3520.610273, + 1062.7522, + 851.2411407, + 543.2552413, + 339.2964587, + 1172.667655, + 1071.310713, + 1178.665927, + 1102.990936, + 780.5423257, + 2125.621418, + 1388.594732, + 2669.529475, + 1418.822445, + 375.6431231, + 328.9405571, + 362.1462796, + 4293.476475, + 485.2306591, + 911.2989371, + 510.1964923, + 299.850319, + 853.540919, + 298.8462121, + 575.5729961, + 2387.54806, + 1443.011715, + 369.1650802, + 452.3369807, + 743.1159097, + 1967.955707, + 1688.20357, + 468.5260381, + 2423.780443, + 761.879376, + 1077.281856, + 2718.885295, + 493.3238752, + 879.5835855, + 1450.356983, + 879.7877358, + 1135.749842, + 4725.295531, + 1615.991129, + 1148.376626, + 716.6500721, + 859.8086567, + 1468.475631, + 734.753484, + 1147.388831, + 406.8841148 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 17876956, + 2883315, + 56602560, + 14785584, + 6377619, + 12350771, + 926317, + 6007797, + 2491346, + 3548753, + 2042865, + 3146381, + 3201488, + 1517453, + 1426095, + 30144317, + 1165790, + 940080, + 1555876, + 8025700, + 2227000, + 662850, + 157553000, + 2252965, + 5439568 + ] + }, + "mode":"markers", + "x":[ + 62.485, + 40.414, + 50.917, + 68.75, + 54.745, + 50.643, + 57.206, + 59.421, + 45.928, + 48.357, + 45.262, + 42.023, + 37.579, + 41.912, + 58.53, + 50.789, + 42.314, + 55.191, + 62.649, + 43.902, + 64.28, + 59.1, + 68.44, + 66.071, + 55.088 + ], + "y":[ + 5911.315053, + 2677.326347, + 2108.944355, + 11367.16112, + 3939.978789, + 2144.115096, + 2627.009471, + 5586.53878, + 1397.717137, + 3522.110717, + 3048.3029, + 2428.237769, + 1840.366939, + 2194.926204, + 2898.530881, + 3478.125529, + 3112.363948, + 2480.380334, + 1952.308701, + 3758.523437, + 3081.959785, + 3023.271928, + 13990.48208, + 5716.766744, + 7689.799761 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 8691212, + 1994794 + ] + }, + "mode":"markers", + "x":[ + 69.12, + 69.39 + ], + "y":[ + 10039.59564, + 10556.57566 + ] + } + ], + "frames":[ + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 8425333, + 120447, + 46886859, + 4693836, + 556263527.999989, + 2125900, + 372000000, + 82052000, + 17272000, + 5441766, + 1620914, + 86459025, + 607914, + 8865488, + 20947571, + 160000, + 1439529, + 6748378, + 800663, + 20092996, + 9182536, + 507833, + 41346560, + 22438691, + 4005677, + 1127000, + 7982342, + 3661549, + 8550362, + 21289402, + 26246839, + 1030585, + 4963829 + ] + }, + "mode":"markers", + "x":[ + 28.801, + 50.939, + 37.484, + 39.417, + 44, + 60.96, + 37.373, + 37.468, + 44.869, + 45.32, + 65.39, + 63.03, + 43.158, + 50.056, + 47.453, + 55.565, + 55.928, + 48.463, + 42.244, + 36.319, + 36.157, + 37.578, + 43.436, + 47.752, + 39.875, + 60.396, + 57.593, + 45.883, + 58.5, + 50.848, + 40.412, + 43.16, + 32.548 + ], + "y":[ + 779.4453145, + 9867.084765, + 684.2441716, + 368.4692856, + 400.448610699994, + 3054.421209, + 546.5657493, + 749.6816546, + 3035.326002, + 4129.766056, + 4086.522128, + 3216.956347, + 1546.907807, + 1088.277758, + 1030.592226, + 108382.3529, + 4834.804067, + 1831.132894, + 786.5668575, + 331, + 545.8657229, + 1828.230307, + 684.5971438, + 1272.880995, + 6459.554823, + 2315.138227, + 1083.53203, + 1643.485354, + 1206.947913, + 757.7974177, + 605.0664917, + 1515.592329, + 781.7175761 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1282697, + 6927772, + 8730405, + 2791000, + 7274900, + 3882229, + 9125183, + 4334000, + 4090500, + 42459667, + 69145952, + 7733250, + 9504000, + 147962, + 2952156, + 47666000, + 413834, + 10381988, + 3327728, + 25730551, + 8526050, + 16630000, + 6860147, + 3558137, + 1489518, + 28549870, + 7124673, + 4815000, + 22235677, + 50430000 + ] + }, + "mode":"markers", + "x":[ + 55.23, + 66.8, + 68, + 53.82, + 59.6, + 61.21, + 66.87, + 70.78, + 66.55, + 67.41, + 67.5, + 65.86, + 64.03, + 72.49, + 66.91, + 65.94, + 59.164, + 72.13, + 72.67, + 61.31, + 59.82, + 61.05, + 57.996, + 64.36, + 65.57, + 64.94, + 71.86, + 69.62, + 43.585, + 69.18 + ], + "y":[ + 1601.056136, + 6137.076492, + 8343.105127, + 973.5331948, + 2444.286648, + 3119.23652, + 6876.14025, + 9692.385245, + 6424.519071, + 7029.809327, + 7144.114393, + 3530.690067, + 5263.673816, + 7267.688428, + 5210.280328, + 4931.404155, + 2647.585601, + 8941.571858, + 10095.42172, + 4029.329699, + 3068.319867, + 3144.613186, + 3581.459448, + 5074.659104, + 4215.041741, + 3834.034742, + 8527.844662, + 14734.23275, + 1969.10098, + 9979.508487 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 9279525, + 4232095, + 1738315, + 442308, + 4469979, + 2445618, + 5009067, + 1291695, + 2682462, + 153936, + 14100005, + 854885, + 2977019, + 63149, + 22223309, + 216964, + 1438760, + 20860941, + 420702, + 284320, + 5581001, + 2664249, + 580653, + 6464046, + 748747, + 863308, + 1019729, + 4762912, + 2917802, + 3838168, + 1022556, + 516556, + 9939217, + 6446316, + 485831, + 3379468, + 33119096, + 257700, + 2534927, + 60011, + 2755589, + 2143249, + 2526994, + 14264935, + 8504667, + 290243, + 8322925, + 1219113, + 3647735, + 5824797, + 2672000, + 3080907 + ] + }, + "mode":"markers", + "x":[ + 43.077, + 30.015, + 38.223, + 47.622, + 31.975, + 39.031, + 38.523, + 35.463, + 38.092, + 40.715, + 39.143, + 42.111, + 40.477, + 34.812, + 41.893, + 34.482, + 35.928, + 34.078, + 37.003, + 30, + 43.149, + 33.609, + 32.5, + 42.27, + 42.138, + 38.48, + 42.723, + 36.681, + 36.256, + 33.685, + 40.543, + 50.986, + 42.873, + 31.286, + 41.725, + 37.444, + 36.324, + 52.724, + 40, + 46.471, + 37.278, + 30.331, + 32.978, + 45.009, + 38.635, + 41.407, + 41.215, + 38.596, + 44.6, + 39.978, + 42.038, + 48.451 + ], + "y":[ + 2449.008185, + 3520.610273, + 1062.7522, + 851.2411407, + 543.2552413, + 339.2964587, + 1172.667655, + 1071.310713, + 1178.665927, + 1102.990936, + 780.5423257, + 2125.621418, + 1388.594732, + 2669.529475, + 1418.822445, + 375.6431231, + 328.9405571, + 362.1462796, + 4293.476475, + 485.2306591, + 911.2989371, + 510.1964923, + 299.850319, + 853.540919, + 298.8462121, + 575.5729961, + 2387.54806, + 1443.011715, + 369.1650802, + 452.3369807, + 743.1159097, + 1967.955707, + 1688.20357, + 468.5260381, + 2423.780443, + 761.879376, + 1077.281856, + 2718.885295, + 493.3238752, + 879.5835855, + 1450.356983, + 879.7877358, + 1135.749842, + 4725.295531, + 1615.991129, + 1148.376626, + 716.6500721, + 859.8086567, + 1468.475631, + 734.753484, + 1147.388831, + 406.8841148 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 17876956, + 2883315, + 56602560, + 14785584, + 6377619, + 12350771, + 926317, + 6007797, + 2491346, + 3548753, + 2042865, + 3146381, + 3201488, + 1517453, + 1426095, + 30144317, + 1165790, + 940080, + 1555876, + 8025700, + 2227000, + 662850, + 157553000, + 2252965, + 5439568 + ] + }, + "mode":"markers", + "x":[ + 62.485, + 40.414, + 50.917, + 68.75, + 54.745, + 50.643, + 57.206, + 59.421, + 45.928, + 48.357, + 45.262, + 42.023, + 37.579, + 41.912, + 58.53, + 50.789, + 42.314, + 55.191, + 62.649, + 43.902, + 64.28, + 59.1, + 68.44, + 66.071, + 55.088 + ], + "y":[ + 5911.315053, + 2677.326347, + 2108.944355, + 11367.16112, + 3939.978789, + 2144.115096, + 2627.009471, + 5586.53878, + 1397.717137, + 3522.110717, + 3048.3029, + 2428.237769, + 1840.366939, + 2194.926204, + 2898.530881, + 3478.125529, + 3112.363948, + 2480.380334, + 1952.308701, + 3758.523437, + 3081.959785, + 3023.271928, + 13990.48208, + 5716.766744, + 7689.799761 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 8691212, + 1994794 + ] + }, + "mode":"markers", + "x":[ + 69.12, + 69.39 + ], + "y":[ + 10039.59564, + 10556.57566 + ] + } + ], + "name":"1952" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 9240934, + 138655, + 51365468, + 5322536, + 637408000, + 2736300, + 409000000, + 90124000, + 19792000, + 6248643, + 1944401, + 91563009, + 746559, + 9411381, + 22611552, + 212846, + 1647412, + 7739235, + 882134, + 21731844, + 9682338, + 561977, + 46679944, + 26072194, + 4419650, + 1445929, + 9128546, + 4149908, + 10164215, + 25041917, + 28998543, + 1070439, + 5498090 + ] + }, + "mode":"markers", + "x":[ + 30.332, + 53.832, + 39.348, + 41.366, + 50.54896, + 64.75, + 40.249, + 39.918, + 47.181, + 48.437, + 67.84, + 65.5, + 45.669, + 54.081, + 52.681, + 58.033, + 59.489, + 52.102, + 45.248, + 41.905, + 37.686, + 40.08, + 45.557, + 51.334, + 42.868, + 63.179, + 61.456, + 48.284, + 62.4, + 53.63, + 42.887, + 45.671, + 33.97 + ], + "y":[ + 820.8530296, + 11635.79945, + 661.6374577, + 434.0383364, + 575.9870009, + 3629.076457, + 590.061996, + 858.9002707, + 3290.257643, + 6229.333562, + 5385.278451, + 4317.694365, + 1886.080591, + 1571.134655, + 1487.593537, + 113523.1329, + 6089.786934, + 1810.066992, + 912.6626085, + 350, + 597.9363558, + 2242.746551, + 747.0835292, + 1547.944844, + 8157.591248, + 2843.104409, + 1072.546602, + 2117.234893, + 1507.86129, + 793.5774148, + 676.2854478, + 1827.067742, + 804.8304547 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1476505, + 6965860, + 8989111, + 3076000, + 7651254, + 3991242, + 9513758, + 4487831, + 4324000, + 44310863, + 71019069, + 8096218, + 9839000, + 165110, + 2878220, + 49182000, + 442829, + 11026383, + 3491938, + 28235346, + 8817650, + 17829327, + 7271135, + 3844277, + 1533070, + 29841614, + 7363802, + 5126000, + 25670939, + 51430000 + ] + }, + "mode":"markers", + "x":[ + 59.28, + 67.48, + 69.24, + 58.45, + 66.61, + 64.77, + 69.03, + 71.81, + 67.49, + 68.93, + 69.1, + 67.86, + 66.41, + 73.47, + 68.9, + 67.81, + 61.448, + 72.99, + 73.44, + 65.77, + 61.51, + 64.1, + 61.685, + 67.45, + 67.85, + 66.66, + 72.49, + 70.56, + 48.079, + 70.42 + ], + "y":[ + 1942.284244, + 8842.59803, + 9714.960623, + 1353.989176, + 3008.670727, + 4338.231617, + 8256.343918, + 11099.65935, + 7545.415386, + 8662.834898, + 10187.82665, + 4916.299889, + 6040.180011, + 9244.001412, + 5599.077872, + 6248.656232, + 3682.259903, + 11276.19344, + 11653.97304, + 4734.253019, + 3774.571743, + 3943.370225, + 4981.090891, + 6093.26298, + 5862.276629, + 4564.80241, + 9911.878226, + 17909.48973, + 2218.754257, + 11283.17795 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 10270856, + 4561361, + 1925173, + 474639, + 4713416, + 2667518, + 5359923, + 1392284, + 2894855, + 170928, + 15577932, + 940458, + 3300000, + 71851, + 25009741, + 232922, + 1542611, + 22815614, + 434904, + 323150, + 6391288, + 2876726, + 601095, + 7454779, + 813338, + 975950, + 1201578, + 5181679, + 3221238, + 4241884, + 1076852, + 609816, + 11406350, + 7038035, + 548080, + 3692184, + 37173340, + 308700, + 2822082, + 61325, + 3054547, + 2295678, + 2780415, + 16151549, + 9753392, + 326741, + 9452826, + 1357445, + 3950849, + 6675501, + 3016000, + 3646340 + ] + }, + "mode":"markers", + "x":[ + 45.685, + 31.999, + 40.358, + 49.618, + 34.906, + 40.533, + 40.428, + 37.464, + 39.881, + 42.46, + 40.652, + 45.053, + 42.469, + 37.328, + 44.444, + 35.983, + 38.047, + 36.667, + 38.999, + 32.065, + 44.779, + 34.558, + 33.489, + 44.686, + 45.047, + 39.486, + 45.289, + 38.865, + 37.207, + 35.307, + 42.338, + 58.089, + 45.423, + 33.779, + 45.226, + 38.598, + 37.802, + 55.09, + 41.5, + 48.945, + 39.329, + 31.57, + 34.977, + 47.985, + 39.624, + 43.424, + 42.974, + 41.208, + 47.1, + 42.571, + 44.077, + 50.469 + ], + "y":[ + 3013.976023, + 3827.940465, + 959.6010805, + 918.2325349, + 617.1834648, + 379.5646281, + 1313.048099, + 1190.844328, + 1308.495577, + 1211.148548, + 905.8602303, + 2315.056572, + 1500.895925, + 2864.969076, + 1458.915272, + 426.0964081, + 344.1618859, + 378.9041632, + 4976.198099, + 520.9267111, + 1043.561537, + 576.2670245, + 431.7904566, + 944.4383152, + 335.9971151, + 620.9699901, + 3448.284395, + 1589.20275, + 416.3698064, + 490.3821867, + 846.1202613, + 2034.037981, + 1642.002314, + 495.5868333, + 2621.448058, + 835.5234025, + 1100.592563, + 2769.451844, + 540.2893983, + 860.7369026, + 1567.653006, + 1004.484437, + 1258.147413, + 5487.104219, + 1770.337074, + 1244.708364, + 698.5356073, + 925.9083202, + 1395.232468, + 774.3710692, + 1311.956766, + 518.7642681 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 19610538, + 3211738, + 65551171, + 17010154, + 7048426, + 14485993, + 1112300, + 6640752, + 2923186, + 4058385, + 2355805, + 3640876, + 3507701, + 1770390, + 1535090, + 35015548, + 1358828, + 1063506, + 1770902, + 9146100, + 2260000, + 764900, + 171984000, + 2424959, + 6702668 + ] + }, + "mode":"markers", + "x":[ + 64.399, + 41.89, + 53.285, + 69.96, + 56.074, + 55.118, + 60.026, + 62.325, + 49.828, + 51.356, + 48.57, + 44.142, + 40.696, + 44.665, + 62.61, + 55.19, + 45.432, + 59.201, + 63.196, + 46.263, + 68.54, + 61.8, + 69.49, + 67.044, + 57.907 + ], + "y":[ + 6856.856212, + 2127.686326, + 2487.365989, + 12489.95006, + 4315.622723, + 2323.805581, + 2990.010802, + 6092.174359, + 1544.402995, + 3780.546651, + 3421.523218, + 2617.155967, + 1726.887882, + 2220.487682, + 4756.525781, + 4131.546641, + 3457.415947, + 2961.800905, + 2046.154706, + 4245.256698, + 3907.156189, + 4100.3934, + 14847.12712, + 6150.772969, + 9802.466526 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 9712569, + 2229407 + ] + }, + "mode":"markers", + "x":[ + 70.33, + 70.26 + ], + "y":[ + 10949.64959, + 12247.39532 + ] + } + ], + "name":"1957" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 10267083, + 171863, + 56839289, + 6083619, + 665770000, + 3305200, + 454000000, + 99028000, + 22874000, + 7240260, + 2310904, + 95831757, + 933559, + 10917494, + 26420307, + 358266, + 1886848, + 8906385, + 1010280, + 23634436, + 10332057, + 628164, + 53100671, + 30325264, + 4943029, + 1750200, + 10421936, + 4834621, + 11918938, + 29263397, + 33796140, + 1133134, + 6120081 + ] + }, + "mode":"markers", + "x":[ + 31.997, + 56.923, + 41.216, + 43.415, + 44.50136, + 67.65, + 43.605, + 42.518, + 49.325, + 51.457, + 69.39, + 68.73, + 48.126, + 56.656, + 55.292, + 60.47, + 62.094, + 55.737, + 48.251, + 45.108, + 39.393, + 43.165, + 47.67, + 54.757, + 45.914, + 65.798, + 62.192, + 50.305, + 65.2, + 56.061, + 45.363, + 48.127, + 35.18 + ], + "y":[ + 853.10071, + 12753.27514, + 686.3415538, + 496.9136476, + 487.6740183, + 4692.648272, + 658.3471509, + 849.2897701, + 4187.329802, + 8341.737815, + 7105.630706, + 6576.649461, + 2348.009158, + 1621.693598, + 1536.344387, + 95458.11176, + 5714.560611, + 2036.884944, + 1056.353958, + 388, + 652.3968593, + 2924.638113, + 803.3427418, + 1649.552153, + 11626.41975, + 3674.735572, + 1074.47196, + 2193.037133, + 1822.879028, + 1002.199172, + 772.0491602, + 2198.956312, + 825.6232006 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1728137, + 7129864, + 9218400, + 3349000, + 8012946, + 4076557, + 9620282, + 4646899, + 4491443, + 47124000, + 73739117, + 8448233, + 10063000, + 182053, + 2830000, + 50843200, + 474528, + 11805689, + 3638919, + 30329617, + 9019800, + 18680721, + 7616060, + 4237384, + 1582962, + 31158061, + 7561588, + 5666000, + 29788695, + 53292000 + ] + }, + "mode":"markers", + "x":[ + 64.82, + 69.54, + 70.25, + 61.93, + 69.51, + 67.13, + 69.9, + 72.35, + 68.75, + 70.51, + 70.3, + 69.51, + 67.96, + 73.68, + 70.29, + 69.24, + 63.728, + 73.23, + 73.47, + 67.64, + 64.39, + 66.8, + 64.531, + 70.33, + 69.15, + 69.69, + 73.37, + 71.32, + 52.098, + 70.76 + ], + "y":[ + 2312.888958, + 10750.72111, + 10991.20676, + 1709.683679, + 4254.337839, + 5477.890018, + 10136.86713, + 13583.31351, + 9371.842561, + 10560.48553, + 12902.46291, + 6017.190733, + 7550.359877, + 10350.15906, + 6631.597314, + 8243.58234, + 4649.593785, + 12790.84956, + 13450.40151, + 5338.752143, + 4727.954889, + 4734.997586, + 6289.629157, + 7481.107598, + 7402.303395, + 5693.843879, + 12329.44192, + 20431.0927, + 2322.869908, + 12477.17707 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 11000948, + 4826015, + 2151895, + 512764, + 4919632, + 2961915, + 5793633, + 1523478, + 3150417, + 191689, + 17486434, + 1047924, + 3832408, + 89898, + 28173309, + 249220, + 1666618, + 25145372, + 455661, + 374020, + 7355248, + 3140003, + 627820, + 8678557, + 893143, + 1112796, + 1441863, + 5703324, + 3628608, + 4690372, + 1146757, + 701016, + 13056604, + 7788944, + 621392, + 4076008, + 41871351, + 358900, + 3051242, + 65345, + 3430243, + 2467895, + 3080153, + 18356657, + 11183227, + 370006, + 10863958, + 1528098, + 4286552, + 7688797, + 3421000, + 4277736 + ] + }, + "mode":"markers", + "x":[ + 48.303, + 34, + 42.618, + 51.52, + 37.814, + 42.045, + 42.643, + 39.475, + 41.716, + 44.467, + 42.122, + 48.435, + 44.93, + 39.693, + 46.992, + 37.485, + 40.158, + 40.059, + 40.489, + 33.896, + 46.452, + 35.753, + 34.488, + 47.949, + 47.747, + 40.502, + 47.808, + 40.848, + 38.41, + 36.936, + 44.248, + 60.246, + 47.924, + 36.161, + 48.386, + 39.487, + 39.36, + 57.666, + 43, + 51.893, + 41.454, + 32.767, + 36.981, + 49.951, + 40.87, + 44.992, + 44.246, + 43.922, + 49.579, + 45.344, + 46.023, + 52.358 + ], + "y":[ + 2550.81688, + 4269.276742, + 949.4990641, + 983.6539764, + 722.5120206, + 355.2032273, + 1399.607441, + 1193.068753, + 1389.817618, + 1406.648278, + 896.3146335, + 2464.783157, + 1728.869428, + 3020.989263, + 1693.335853, + 582.8419714, + 380.9958433, + 419.4564161, + 6631.459222, + 599.650276, + 1190.041118, + 686.3736739, + 522.0343725, + 896.9663732, + 411.8006266, + 634.1951625, + 6757.030816, + 1643.38711, + 427.9010856, + 496.1743428, + 1055.896036, + 2529.067487, + 1566.353493, + 556.6863539, + 3173.215595, + 997.7661127, + 1150.927478, + 3173.72334, + 597.4730727, + 1071.551119, + 1654.988723, + 1116.639877, + 1369.488336, + 5768.729717, + 1959.593767, + 1856.182125, + 722.0038073, + 1067.53481, + 1660.30321, + 767.2717398, + 1452.725766, + 527.2721818 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 21283783, + 3593918, + 76039390, + 18985849, + 7961258, + 17009885, + 1345187, + 7254373, + 3453434, + 4681707, + 2747687, + 4208858, + 3880130, + 2090162, + 1665128, + 41121485, + 1590597, + 1215725, + 2009813, + 10516500, + 2448046, + 887498, + 186538000, + 2598466, + 8143375 + ] + }, + "mode":"markers", + "x":[ + 65.142, + 43.428, + 55.665, + 71.3, + 57.924, + 57.863, + 62.842, + 65.246, + 53.459, + 54.64, + 52.307, + 46.954, + 43.59, + 48.041, + 65.61, + 58.299, + 48.632, + 61.817, + 64.361, + 49.096, + 69.62, + 64.9, + 70.21, + 68.253, + 60.77 + ], + "y":[ + 7133.166023, + 2180.972546, + 3336.585802, + 13462.48555, + 4519.094331, + 2492.351109, + 3460.937025, + 5180.75591, + 1662.137359, + 4086.114078, + 3776.803627, + 2750.364446, + 1796.589032, + 2291.156835, + 5246.107524, + 4581.609385, + 3634.364406, + 3536.540301, + 2148.027146, + 4957.037982, + 5108.34463, + 4997.523971, + 16173.14586, + 5603.357717, + 8422.974165 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 10794968, + 2488550 + ] + }, + "mode":"markers", + "x":[ + 70.93, + 71.24 + ], + "y":[ + 12217.22686, + 13175.678 + ] + } + ], + "name":"1962" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 11537966, + 202182, + 62821884, + 6960067, + 754550000, + 3722800, + 506000000, + 109343000, + 26538000, + 8519282, + 2693585, + 100825279, + 1255058, + 12617009, + 30131000, + 575003, + 2186894, + 10154878, + 1149500, + 25870271, + 11261690, + 714775, + 60641899, + 35356600, + 5618198, + 1977600, + 11737396, + 5680812, + 13648692, + 34024249, + 39463910, + 1142636, + 6740785 + ] + }, + "mode":"markers", + "x":[ + 34.02, + 59.923, + 43.453, + 45.415, + 58.38112, + 70, + 47.193, + 45.964, + 52.469, + 54.459, + 70.75, + 71.43, + 51.629, + 59.942, + 57.716, + 64.624, + 63.87, + 59.371, + 51.253, + 49.379, + 41.472, + 46.988, + 49.8, + 56.393, + 49.901, + 67.946, + 64.266, + 53.655, + 67.5, + 58.285, + 47.838, + 51.631, + 36.984 + ], + "y":[ + 836.1971382, + 14804.6727, + 721.1860862, + 523.4323142, + 612.7056934, + 6197.962814, + 700.7706107, + 762.4317721, + 5906.731805, + 8931.459811, + 8393.741404, + 9847.788607, + 2741.796252, + 2143.540609, + 2029.228142, + 80894.88326, + 6006.983042, + 2277.742396, + 1226.04113, + 349, + 676.4422254, + 4720.942687, + 942.4082588, + 1814.12743, + 16903.04886, + 4977.41854, + 1135.514326, + 1881.923632, + 2643.858681, + 1295.46066, + 637.1232887, + 2649.715007, + 862.4421463 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 1984060, + 7376998, + 9556500, + 3585000, + 8310226, + 4174366, + 9835109, + 4838800, + 4605744, + 49569000, + 76368453, + 8716441, + 10223422, + 198676, + 2900100, + 52667100, + 501035, + 12596822, + 3786019, + 31785378, + 9103000, + 19284814, + 7971222, + 4442238, + 1646912, + 32850275, + 7867931, + 6063000, + 33411317, + 54959000 + ] + }, + "mode":"markers", + "x":[ + 66.22, + 70.14, + 70.94, + 64.79, + 70.42, + 68.5, + 70.38, + 72.96, + 69.83, + 71.55, + 70.8, + 71, + 69.5, + 73.73, + 71.08, + 71.06, + 67.178, + 73.82, + 74.08, + 69.61, + 66.6, + 66.8, + 66.914, + 70.98, + 69.18, + 71.44, + 74.16, + 72.77, + 54.336, + 71.36 + ], + "y":[ + 2760.196931, + 12834.6024, + 13149.04119, + 2172.352423, + 5577.0028, + 6960.297861, + 11399.44489, + 15937.21123, + 10921.63626, + 12999.91766, + 14745.62561, + 8513.097016, + 9326.64467, + 13319.89568, + 7655.568963, + 10022.40131, + 5907.850937, + 15363.25136, + 16361.87647, + 6557.152776, + 6361.517993, + 6470.866545, + 7991.707066, + 8412.902397, + 9405.489397, + 7993.512294, + 15258.29697, + 22966.14432, + 2826.356387, + 14142.85089 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 12760499, + 5247469, + 2427334, + 553541, + 5127935, + 3330989, + 6335506, + 1733638, + 3495967, + 217378, + 19941073, + 1179760, + 4744870, + 127617, + 31681188, + 259864, + 1820319, + 27860297, + 489004, + 439593, + 8490213, + 3451418, + 601287, + 10191512, + 996380, + 1279406, + 1759224, + 6334556, + 4147252, + 5212416, + 1230542, + 789309, + 14770296, + 8680909, + 706640, + 4534062, + 47287752, + 414024, + 3451079, + 70787, + 3965841, + 2662190, + 3428839, + 20997321, + 12716129, + 420690, + 12607312, + 1735550, + 4786986, + 8900294, + 3900000, + 4995432 + ] + }, + "mode":"markers", + "x":[ + 51.407, + 35.985, + 44.885, + 53.298, + 40.697, + 43.548, + 44.799, + 41.478, + 43.601, + 46.472, + 44.056, + 52.04, + 47.35, + 42.074, + 49.293, + 38.987, + 42.189, + 42.115, + 44.598, + 35.857, + 48.072, + 37.197, + 35.492, + 50.654, + 48.492, + 41.536, + 50.227, + 42.881, + 39.487, + 38.487, + 46.289, + 61.557, + 50.335, + 38.113, + 51.159, + 40.118, + 41.04, + 60.542, + 44.1, + 54.425, + 43.563, + 34.113, + 38.977, + 51.927, + 42.858, + 46.633, + 45.757, + 46.769, + 52.053, + 48.051, + 47.768, + 53.995 + ], + "y":[ + 3246.991771, + 5522.776375, + 1035.831411, + 1214.709294, + 794.8265597, + 412.9775136, + 1508.453148, + 1136.056615, + 1196.810565, + 1876.029643, + 861.5932424, + 2677.939642, + 2052.050473, + 3020.050513, + 1814.880728, + 915.5960025, + 468.7949699, + 516.1186438, + 8358.761987, + 734.7829124, + 1125.69716, + 708.7595409, + 715.5806402, + 1056.736457, + 498.6390265, + 713.6036483, + 18772.75169, + 1634.047282, + 495.5147806, + 545.0098873, + 1421.145193, + 2475.387562, + 1711.04477, + 566.6691539, + 3793.694753, + 1054.384891, + 1014.514104, + 4021.175739, + 510.9637142, + 1384.840593, + 1612.404632, + 1206.043465, + 1284.73318, + 7114.477971, + 1687.997641, + 2613.101665, + 848.2186575, + 1477.59676, + 1932.360167, + 908.9185217, + 1777.077318, + 569.7950712 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 22934225, + 4040665, + 88049823, + 20819767, + 8858908, + 19764027, + 1588717, + 8139332, + 4049146, + 5432424, + 3232927, + 4690773, + 4318137, + 2500689, + 1861096, + 47995559, + 1865490, + 1405486, + 2287985, + 12132200, + 2648961, + 960155, + 198712000, + 2748579, + 9709552 + ] + }, + "mode":"markers", + "x":[ + 65.634, + 45.032, + 57.632, + 72.13, + 60.523, + 59.963, + 65.424, + 68.29, + 56.751, + 56.678, + 55.855, + 50.016, + 46.243, + 50.924, + 67.51, + 60.11, + 51.884, + 64.071, + 64.951, + 51.445, + 71.1, + 65.4, + 70.76, + 68.468, + 63.479 + ], + "y":[ + 8052.953021, + 2586.886053, + 3429.864357, + 16076.58803, + 5106.654313, + 2678.729839, + 4161.727834, + 5690.268015, + 1653.723003, + 4579.074215, + 4358.595393, + 3242.531147, + 1452.057666, + 2538.269358, + 6124.703451, + 5754.733883, + 4643.393534, + 4421.009084, + 2299.376311, + 5788.09333, + 6929.277714, + 5621.368472, + 19530.36557, + 5444.61962, + 9541.474188 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 11872264, + 2728150 + ] + }, + "mode":"markers", + "x":[ + 71.1, + 71.52 + ], + "y":[ + 14526.12465, + 14463.91893 + ] + } + ], + "name":"1967" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 13079460, + 230800, + 70759295, + 7450606, + 862030000, + 4115700, + 567000000, + 121282000, + 30614000, + 10061506, + 3095893, + 107188273, + 1613551, + 14781241, + 33505000, + 841934, + 2680018, + 11441462, + 1320500, + 28466390, + 12412593, + 829050, + 69325921, + 40850141, + 6472756, + 2152400, + 13016733, + 6701172, + 15226039, + 39276153, + 44655014, + 1089572, + 7407075 + ] + }, + "mode":"markers", + "x":[ + 36.088, + 63.3, + 45.252, + 40.317, + 63.11888, + 72, + 50.651, + 49.203, + 55.234, + 56.95, + 71.63, + 73.42, + 56.528, + 63.983, + 62.612, + 67.712, + 65.421, + 63.01, + 53.754, + 53.07, + 43.971, + 52.143, + 51.929, + 58.065, + 53.886, + 69.521, + 65.042, + 57.296, + 69.39, + 60.405, + 50.254, + 56.532, + 39.848 + ], + "y":[ + 739.9811058, + 18268.65839, + 630.2336265, + 421.6240257, + 676.9000921, + 8315.928145, + 724.032527, + 1111.107907, + 9613.818607, + 9576.037596, + 12786.93223, + 14778.78636, + 2110.856309, + 3701.621503, + 3030.87665, + 109347.867, + 7486.384341, + 2849.09478, + 1421.741975, + 357, + 674.7881296, + 10618.03855, + 1049.938981, + 1989.37407, + 24837.42865, + 8597.756202, + 1213.39553, + 2571.423014, + 4062.523897, + 1524.358936, + 699.5016441, + 3133.409277, + 1265.047031 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 2263554, + 7544201, + 9709100, + 3819000, + 8576200, + 4225310, + 9862158, + 4991596, + 4639657, + 51732000, + 78717088, + 8888628, + 10394091, + 209275, + 3024400, + 54365564, + 527678, + 13329874, + 3933004, + 33039545, + 8970450, + 20662648, + 8313288, + 4593433, + 1694510, + 34513161, + 8122293, + 6401400, + 37492953, + 56079000 + ] + }, + "mode":"markers", + "x":[ + 67.69, + 70.63, + 71.44, + 67.45, + 70.9, + 69.61, + 70.29, + 73.47, + 70.87, + 72.38, + 71, + 72.34, + 69.76, + 74.46, + 71.28, + 72.19, + 70.636, + 73.75, + 74.34, + 70.85, + 69.26, + 69.21, + 68.7, + 70.35, + 69.82, + 73.06, + 74.72, + 73.78, + 57.005, + 72.01 + ], + "y":[ + 3313.422188, + 16661.6256, + 16672.14356, + 2860.16975, + 6597.494398, + 9164.090127, + 13108.4536, + 18866.20721, + 14358.8759, + 16107.19171, + 18016.18027, + 12724.82957, + 10168.65611, + 15798.06362, + 9530.772896, + 12269.27378, + 7778.414017, + 18794.74567, + 18965.05551, + 8006.506993, + 9022.247417, + 8011.414402, + 10522.06749, + 9674.167626, + 12383.4862, + 10638.75131, + 17832.02464, + 27195.11304, + 3450.69638, + 15895.11641 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 14760787, + 5894858, + 2761407, + 619351, + 5433886, + 3529983, + 7021028, + 1927260, + 3899068, + 250027, + 23007669, + 1340458, + 6071696, + 178848, + 34807417, + 277603, + 2260187, + 30770372, + 537977, + 517101, + 9354120, + 3811387, + 625361, + 12044785, + 1116779, + 1482628, + 2183877, + 7082430, + 4730997, + 5828158, + 1332786, + 851334, + 16660670, + 9809596, + 821782, + 5060262, + 53740085, + 461633, + 3992121, + 76595, + 4588696, + 2879013, + 3840161, + 23935810, + 14597019, + 480105, + 14706593, + 2056351, + 5303507, + 10190285, + 4506497, + 5861135 + ] + }, + "mode":"markers", + "x":[ + 54.518, + 37.928, + 47.014, + 56.024, + 43.591, + 44.057, + 47.049, + 43.457, + 45.569, + 48.944, + 45.989, + 54.907, + 49.801, + 44.366, + 51.137, + 40.516, + 44.142, + 43.515, + 48.69, + 38.308, + 49.875, + 38.842, + 36.486, + 53.559, + 49.767, + 42.614, + 52.773, + 44.851, + 41.766, + 39.977, + 48.437, + 62.944, + 52.862, + 40.328, + 53.867, + 40.546, + 42.821, + 64.274, + 44.6, + 56.48, + 45.815, + 35.4, + 40.973, + 53.696, + 45.083, + 49.552, + 47.62, + 49.759, + 55.602, + 51.016, + 50.107, + 55.635 + ], + "y":[ + 4182.663766, + 5473.288005, + 1085.796879, + 2263.611114, + 854.7359763, + 464.0995039, + 1684.146528, + 1070.013275, + 1104.103987, + 1937.577675, + 904.8960685, + 3213.152683, + 2378.201111, + 3694.212352, + 2024.008147, + 672.4122571, + 514.3242082, + 566.2439442, + 11401.94841, + 756.0868363, + 1178.223708, + 741.6662307, + 820.2245876, + 1222.359968, + 496.5815922, + 803.0054535, + 21011.49721, + 1748.562982, + 584.6219709, + 581.3688761, + 1586.851781, + 2575.484158, + 1930.194975, + 724.9178037, + 3746.080948, + 954.2092363, + 1698.388838, + 5047.658563, + 590.5806638, + 1532.985254, + 1597.712056, + 1353.759762, + 1254.576127, + 7765.962636, + 1659.652775, + 3364.836625, + 915.9850592, + 1649.660188, + 2753.285994, + 950.735869, + 1773.498265, + 799.3621758 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 24779799, + 4565872, + 100840058, + 22284500, + 9717524, + 22542890, + 1834796, + 8831348, + 4671329, + 6298651, + 3790903, + 5149581, + 4698301, + 2965146, + 1997616, + 55984294, + 2182908, + 1616384, + 2614104, + 13954700, + 2847132, + 975199, + 209896000, + 2829526, + 11515649 + ] + }, + "mode":"markers", + "x":[ + 67.065, + 46.714, + 59.504, + 72.88, + 63.441, + 61.623, + 67.849, + 70.723, + 59.631, + 58.796, + 58.207, + 53.738, + 48.042, + 53.884, + 69, + 62.361, + 55.151, + 66.216, + 65.815, + 55.448, + 72.16, + 65.9, + 71.34, + 68.673, + 65.712 + ], + "y":[ + 9443.038526, + 2980.331339, + 4985.711467, + 18970.57086, + 5494.024437, + 3264.660041, + 5118.146939, + 5305.445256, + 2189.874499, + 5280.99471, + 4520.246008, + 4031.408271, + 1654.456946, + 2529.842345, + 7433.889293, + 6809.40669, + 4688.593267, + 5364.249663, + 2523.337977, + 5937.827283, + 9123.041742, + 6619.551419, + 21806.03594, + 5703.408898, + 10505.25966 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 13177000, + 2929100 + ] + }, + "mode":"markers", + "x":[ + 71.93, + 71.89 + ], + "y":[ + 16788.62948, + 16046.03728 + ] + } + ], + "name":"1972" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 14880372, + 297410, + 80428306, + 6978607, + 943455000, + 4583700, + 634000000, + 136725000, + 35480679, + 11882916, + 3495918, + 113872473, + 1937652, + 16325320, + 36436000, + 1140357, + 3115787, + 12845381, + 1528000, + 31528087, + 13933198, + 1004533, + 78152686, + 46850962, + 8128505, + 2325300, + 14116836, + 7932503, + 16785196, + 44148285, + 50533506, + 1261091, + 8403990 + ] + }, + "mode":"markers", + "x":[ + 38.438, + 65.593, + 46.923, + 31.22, + 63.96736, + 73.6, + 54.208, + 52.702, + 57.702, + 60.413, + 73.06, + 75.38, + 61.134, + 67.159, + 64.766, + 69.343, + 66.099, + 65.256, + 55.491, + 56.059, + 46.748, + 57.367, + 54.043, + 60.06, + 58.69, + 70.795, + 65.949, + 61.195, + 70.59, + 62.494, + 55.764, + 60.765, + 44.175 + ], + "y":[ + 786.11336, + 19340.10196, + 659.8772322, + 524.9721832, + 741.2374699, + 11186.14125, + 813.337323, + 1382.702056, + 11888.59508, + 14688.23507, + 13306.61921, + 16610.37701, + 2852.351568, + 4106.301249, + 4657.22102, + 59265.47714, + 8659.696836, + 3827.921571, + 1647.511665, + 371, + 694.1124398, + 11848.34392, + 1175.921193, + 2373.204287, + 34167.7626, + 11210.08948, + 1348.775651, + 3195.484582, + 5596.519826, + 1961.224635, + 713.5371196, + 3682.831494, + 1829.765177 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 2509048, + 7568430, + 9821800, + 4086000, + 8797022, + 4318673, + 10161915, + 5088419, + 4738902, + 53165019, + 78160773, + 9308479, + 10637171, + 221823, + 3271900, + 56059245, + 560073, + 13852989, + 4043205, + 34621254, + 9662600, + 21658597, + 8686367, + 4827803, + 1746919, + 36439000, + 8251648, + 6316424, + 42404033, + 56179000 + ] + }, + "mode":"markers", + "x":[ + 68.93, + 72.17, + 72.8, + 69.86, + 70.81, + 70.64, + 70.71, + 74.69, + 72.52, + 73.83, + 72.5, + 73.68, + 69.95, + 76.11, + 72.03, + 73.48, + 73.066, + 75.24, + 75.37, + 70.67, + 70.41, + 69.46, + 70.3, + 70.45, + 70.97, + 74.39, + 75.44, + 75.39, + 59.507, + 72.76 + ], + "y":[ + 3533.00391, + 19749.4223, + 19117.97448, + 3528.481305, + 7612.240438, + 11305.38517, + 14800.16062, + 20422.9015, + 15605.42283, + 18292.63514, + 20512.92123, + 14195.52428, + 11674.83737, + 19654.96247, + 11150.98113, + 14255.98475, + 9595.929905, + 21209.0592, + 23311.34939, + 9508.141454, + 10172.48572, + 9356.39724, + 12980.66956, + 10922.66404, + 15277.03017, + 13236.92117, + 18855.72521, + 26982.29052, + 4269.122326, + 17428.74846 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 17152804, + 6162675, + 3168267, + 781472, + 5889574, + 3834415, + 7959865, + 2167533, + 4388260, + 304739, + 26480870, + 1536769, + 7459574, + 228694, + 38783863, + 192675, + 2512642, + 34617799, + 706367, + 608274, + 10538093, + 4227026, + 745228, + 14500404, + 1251524, + 1703617, + 2721783, + 8007166, + 5637246, + 6491649, + 1456688, + 913025, + 18396941, + 11127868, + 977026, + 5682086, + 62209173, + 492095, + 4657072, + 86796, + 5260855, + 3140897, + 4353666, + 27129932, + 17104986, + 551425, + 17129565, + 2308582, + 6005061, + 11457758, + 5216550, + 6642107 + ] + }, + "mode":"markers", + "x":[ + 58.014, + 39.483, + 49.19, + 59.319, + 46.137, + 45.91, + 49.355, + 46.775, + 47.383, + 50.939, + 47.804, + 55.625, + 52.374, + 46.519, + 53.319, + 42.024, + 44.535, + 44.51, + 52.79, + 41.842, + 51.756, + 40.762, + 37.465, + 56.155, + 52.208, + 43.764, + 57.442, + 46.881, + 43.767, + 41.714, + 50.852, + 64.93, + 55.73, + 42.495, + 56.437, + 41.291, + 44.514, + 67.064, + 45, + 58.55, + 48.879, + 36.788, + 41.974, + 55.527, + 47.8, + 52.537, + 49.919, + 52.887, + 59.837, + 50.35, + 51.386, + 57.674 + ], + "y":[ + 4910.416756, + 3008.647355, + 1029.161251, + 3214.857818, + 743.3870368, + 556.1032651, + 1783.432873, + 1109.374338, + 1133.98495, + 1172.603047, + 795.757282, + 3259.178978, + 2517.736547, + 3081.761022, + 2785.493582, + 958.5668124, + 505.7538077, + 556.8083834, + 21745.57328, + 884.7552507, + 993.2239571, + 874.6858643, + 764.7259628, + 1267.613204, + 745.3695408, + 640.3224383, + 21951.21176, + 1544.228586, + 663.2236766, + 686.3952693, + 1497.492223, + 3710.982963, + 2370.619976, + 502.3197334, + 3876.485958, + 808.8970728, + 1981.951806, + 4319.804067, + 670.0806011, + 1737.561657, + 1561.769116, + 1348.285159, + 1450.992513, + 8028.651439, + 2202.988423, + 3781.410618, + 962.4922932, + 1532.776998, + 3120.876811, + 843.7331372, + 1588.688299, + 685.5876821 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 26983828, + 5079716, + 114313951, + 23796400, + 10599793, + 25094412, + 2108457, + 9537988, + 5302800, + 7278866, + 4282586, + 5703430, + 4908554, + 3055235, + 2156814, + 63759976, + 2554598, + 1839782, + 2984494, + 15990099, + 3080828, + 1039009, + 220239000, + 2873520, + 13503563 + ] + }, + "mode":"markers", + "x":[ + 68.481, + 50.023, + 61.489, + 74.21, + 67.052, + 63.837, + 70.75, + 72.649, + 61.788, + 61.31, + 56.696, + 56.029, + 49.923, + 57.402, + 70.11, + 65.032, + 57.47, + 68.681, + 66.353, + 58.447, + 73.44, + 68.3, + 73.38, + 69.481, + 67.456 + ], + "y":[ + 10079.02674, + 3548.097832, + 6660.118654, + 22090.88306, + 4756.763836, + 3815.80787, + 5926.876967, + 6380.494966, + 2681.9889, + 6679.62326, + 5138.922374, + 4879.992748, + 1874.298931, + 3203.208066, + 6650.195573, + 7674.929108, + 5486.371089, + 5351.912144, + 3248.373311, + 6281.290855, + 9770.524921, + 7899.554209, + 24072.63213, + 6504.339663, + 13143.95095 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 14074100, + 3164900 + ] + }, + "mode":"markers", + "x":[ + 73.49, + 72.22 + ], + "y":[ + 18334.19751, + 16233.7177 + ] + } + ], + "name":"1977" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 12881816, + 377967, + 93074406, + 7272485, + 1000281000, + 5264500, + 708000000, + 153343000, + 43072751, + 14173318, + 3858421, + 118454974, + 2347031, + 17647518, + 39326000, + 1497494, + 3086876, + 14441916, + 1756032, + 34680442, + 15796314, + 1301048, + 91462088, + 53456774, + 11254672, + 2651869, + 15410151, + 9410494, + 18501390, + 48827160, + 56142181, + 1425876, + 9657618 + ] + }, + "mode":"markers", + "x":[ + 39.854, + 69.052, + 50.009, + 50.957, + 65.525, + 75.45, + 56.596, + 56.159, + 59.62, + 62.038, + 74.45, + 77.11, + 63.739, + 69.1, + 67.123, + 71.309, + 66.983, + 68, + 57.489, + 58.056, + 49.594, + 62.728, + 56.158, + 62.082, + 63.012, + 71.76, + 68.757, + 64.59, + 72.16, + 64.597, + 58.816, + 64.406, + 49.113 + ], + "y":[ + 978.0114388, + 19211.14731, + 676.9818656, + 624.4754784, + 962.4213805, + 14560.53051, + 855.7235377, + 1516.872988, + 7608.334602, + 14517.90711, + 15367.0292, + 19384.10571, + 4161.415959, + 4106.525293, + 5622.942464, + 31354.03573, + 7640.519521, + 4920.355951, + 2000.603139, + 424, + 718.3730947, + 12954.79101, + 1443.429832, + 2603.273765, + 33693.17525, + 15169.16112, + 1648.079789, + 3761.837715, + 7426.354774, + 2393.219781, + 707.2357863, + 4336.032082, + 1977.55701 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 2780097, + 7574613, + 9856303, + 4172693, + 8892098, + 4413368, + 10303704, + 5117810, + 4826933, + 54433565, + 78335266, + 9786480, + 10705535, + 233997, + 3480000, + 56535636, + 562548, + 14310401, + 4114787, + 36227381, + 9859650, + 22356726, + 9032824, + 5048043, + 1861252, + 37983310, + 8325260, + 6468126, + 47328791, + 56339704 + ] + }, + "mode":"markers", + "x":[ + 70.42, + 73.18, + 73.93, + 70.69, + 71.08, + 70.46, + 70.96, + 74.63, + 74.55, + 74.89, + 73.8, + 75.24, + 69.39, + 76.99, + 73.1, + 74.98, + 74.101, + 76.05, + 75.97, + 71.32, + 72.77, + 69.66, + 70.162, + 70.8, + 71.063, + 76.3, + 76.42, + 76.21, + 61.036, + 74.04 + ], + "y":[ + 3630.880722, + 21597.08362, + 20979.84589, + 4126.613157, + 8224.191647, + 13221.82184, + 15377.22855, + 21688.04048, + 18533.15761, + 20293.89746, + 22031.53274, + 15268.42089, + 12545.99066, + 23269.6075, + 12618.32141, + 16537.4835, + 11222.58762, + 21399.46046, + 26298.63531, + 8451.531004, + 11753.84291, + 9605.314053, + 15181.0927, + 11348.54585, + 17866.72175, + 13926.16997, + 20667.38125, + 28397.71512, + 4241.356344, + 18232.42452 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 20033753, + 7016384, + 3641603, + 970347, + 6634596, + 4580410, + 9250831, + 2476971, + 4875118, + 348643, + 30646495, + 1774735, + 9025951, + 305991, + 45681811, + 285483, + 2637297, + 38111756, + 753874, + 715523, + 11400338, + 4710497, + 825987, + 17661452, + 1411807, + 1956875, + 3344074, + 9171477, + 6502825, + 6998256, + 1622136, + 992040, + 20198730, + 12587223, + 1099010, + 6437188, + 73039376, + 517810, + 5507565, + 98593, + 6147783, + 3464522, + 5828892, + 31140029, + 20367053, + 649901, + 19844382, + 2644765, + 6734098, + 12939400, + 6100407, + 7636524 + ] + }, + "mode":"markers", + "x":[ + 61.368, + 39.942, + 50.904, + 61.484, + 48.122, + 47.471, + 52.961, + 48.295, + 49.517, + 52.933, + 47.784, + 56.695, + 53.983, + 48.812, + 56.006, + 43.662, + 43.89, + 44.916, + 56.564, + 45.58, + 53.744, + 42.891, + 39.327, + 58.766, + 55.078, + 44.852, + 62.155, + 48.969, + 45.642, + 43.916, + 53.599, + 66.711, + 59.65, + 42.795, + 58.968, + 42.598, + 45.826, + 69.885, + 46.218, + 60.351, + 52.379, + 38.445, + 42.955, + 58.161, + 50.338, + 55.561, + 50.608, + 55.471, + 64.048, + 49.849, + 51.821, + 60.363 + ], + "y":[ + 5745.160213, + 2756.953672, + 1277.897616, + 4551.14215, + 807.1985855, + 559.603231, + 2367.983282, + 956.7529907, + 797.9081006, + 1267.100083, + 673.7478181, + 4879.507522, + 2602.710169, + 2879.468067, + 3503.729636, + 927.8253427, + 524.8758493, + 577.8607471, + 15113.36194, + 835.8096108, + 876.032569, + 857.2503577, + 838.1239671, + 1348.225791, + 797.2631074, + 572.1995694, + 17364.27538, + 1302.878658, + 632.8039209, + 618.0140641, + 1481.150189, + 3688.037739, + 2702.620356, + 462.2114149, + 4191.100511, + 909.7221354, + 1576.97375, + 5267.219353, + 881.5706467, + 1890.218117, + 1518.479984, + 1465.010784, + 1176.807031, + 8568.266228, + 1895.544073, + 3895.384018, + 874.2426069, + 1344.577953, + 3560.233174, + 682.2662268, + 1408.678565, + 788.8550411 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 29341374, + 5642224, + 128962939, + 25201900, + 11487112, + 27764644, + 2424367, + 9789224, + 5968349, + 8365850, + 4474873, + 6395630, + 5198399, + 3669448, + 2298309, + 71640904, + 2979423, + 2036305, + 3366439, + 18125129, + 3279001, + 1116479, + 232187835, + 2953997, + 15620766 + ] + }, + "mode":"markers", + "x":[ + 69.942, + 53.859, + 63.336, + 75.76, + 70.565, + 66.653, + 73.45, + 73.717, + 63.727, + 64.342, + 56.604, + 58.137, + 51.461, + 60.909, + 71.21, + 67.405, + 59.298, + 70.472, + 66.874, + 61.406, + 73.75, + 68.832, + 74.65, + 70.805, + 68.557 + ], + "y":[ + 8997.897412, + 3156.510452, + 7030.835878, + 22898.79214, + 5095.665738, + 4397.575659, + 5262.734751, + 7316.918107, + 2861.092386, + 7213.791267, + 4098.344175, + 4820.49479, + 2011.159549, + 3121.760794, + 6068.05135, + 9611.147541, + 3470.338156, + 7009.601598, + 4258.503604, + 6434.501797, + 10330.98915, + 9119.528607, + 25009.55914, + 6920.223051, + 11152.41011 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 15184200, + 3210650 + ] + }, + "mode":"markers", + "x":[ + 74.74, + 73.84 + ], + "y":[ + 19477.00928, + 17632.4104 + ] + } + ], + "name":"1982" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 13867957, + 454612, + 103764241, + 8371791, + 1084035000, + 5584510, + 788000000, + 169276000, + 51889696, + 16543189, + 4203148, + 122091325, + 2820042, + 19067554, + 41622000, + 1891487, + 3089353, + 16331785, + 2015133, + 38028578, + 17917180, + 1593882, + 105186881, + 60017788, + 14619745, + 2794552, + 16495304, + 11242847, + 19757799, + 52910342, + 62826491, + 1691210, + 11219340 + ] + }, + "mode":"markers", + "x":[ + 40.822, + 70.75, + 52.819, + 53.914, + 67.274, + 76.2, + 58.553, + 60.137, + 63.04, + 65.044, + 75.6, + 78.67, + 65.869, + 70.647, + 69.81, + 74.174, + 67.926, + 69.5, + 60.222, + 58.339, + 52.537, + 67.734, + 58.245, + 64.151, + 66.295, + 73.56, + 69.011, + 66.974, + 73.4, + 66.084, + 62.82, + 67.046, + 52.922 + ], + "y":[ + 852.3959448, + 18524.02406, + 751.9794035, + 683.8955732, + 1378.904018, + 20038.47269, + 976.5126756, + 1748.356961, + 6642.881371, + 11643.57268, + 17122.47986, + 22375.94189, + 4448.679912, + 4106.492315, + 8533.088805, + 28118.42998, + 5377.091329, + 5249.802653, + 2338.008304, + 385, + 775.6324501, + 18115.22313, + 1704.686583, + 2189.634995, + 21198.26136, + 18861.53081, + 1876.766827, + 3116.774285, + 11054.56175, + 2982.653773, + 820.7994449, + 5107.197384, + 1971.741538 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3075321, + 7578903, + 9870200, + 4338977, + 8971958, + 4484310, + 10311597, + 5127024, + 4931729, + 55630100, + 77718298, + 9974490, + 10612740, + 244676, + 3539900, + 56729703, + 569473, + 14665278, + 4186147, + 37740710, + 9915289, + 22686371, + 9230783, + 5199318, + 1945870, + 38880702, + 8421403, + 6649942, + 52881328, + 56981620 + ] + }, + "mode":"markers", + "x":[ + 72, + 74.94, + 75.35, + 71.14, + 71.34, + 71.52, + 71.58, + 74.8, + 74.83, + 76.34, + 74.847, + 76.67, + 69.58, + 77.23, + 74.36, + 76.42, + 74.865, + 76.83, + 75.89, + 70.98, + 74.06, + 69.53, + 71.218, + 71.08, + 72.25, + 76.9, + 77.19, + 77.41, + 63.108, + 75.007 + ], + "y":[ + 3738.932735, + 23687.82607, + 22525.56308, + 4314.114757, + 8239.854824, + 13822.58394, + 16310.4434, + 25116.17581, + 21141.01223, + 22066.44214, + 24639.18566, + 16120.52839, + 12986.47998, + 26923.20628, + 13872.86652, + 19207.23482, + 11732.51017, + 23651.32361, + 31540.9748, + 9082.351172, + 13039.30876, + 9696.273295, + 15870.87851, + 12037.26758, + 18678.53492, + 15764.98313, + 23586.92927, + 30281.70459, + 5089.043686, + 21664.78767 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 23254956, + 7874230, + 4243788, + 1151184, + 7586551, + 5126023, + 10780667, + 2840009, + 5498955, + 395114, + 35481645, + 2064095, + 10761098, + 311025, + 52799062, + 341244, + 2915959, + 42999530, + 880397, + 848406, + 14168101, + 5650262, + 927524, + 21198082, + 1599200, + 2269414, + 3799845, + 10568642, + 7824747, + 7634008, + 1841240, + 1042663, + 22987397, + 12891952, + 1278184, + 7332638, + 81551520, + 562035, + 6349365, + 110812, + 7171347, + 3868905, + 6921858, + 35933379, + 24725960, + 779348, + 23040630, + 3154264, + 7724976, + 15283050, + 7272406, + 9216418 + ] + }, + "mode":"markers", + "x":[ + 65.799, + 39.906, + 52.337, + 63.622, + 49.557, + 48.211, + 54.985, + 50.485, + 51.051, + 54.926, + 47.412, + 57.47, + 54.655, + 50.04, + 59.797, + 45.664, + 46.453, + 46.684, + 60.19, + 49.265, + 55.729, + 45.552, + 41.245, + 59.339, + 57.18, + 46.027, + 66.234, + 49.35, + 47.457, + 46.364, + 56.145, + 68.74, + 62.677, + 42.861, + 60.835, + 44.555, + 46.886, + 71.913, + 44.02, + 61.728, + 55.769, + 40.006, + 44.501, + 60.834, + 51.744, + 57.678, + 51.535, + 56.941, + 66.894, + 51.509, + 50.821, + 62.351 + ], + "y":[ + 5681.358539, + 2430.208311, + 1225.85601, + 6205.88385, + 912.0631417, + 621.8188189, + 2602.664206, + 844.8763504, + 952.386129, + 1315.980812, + 672.774812, + 4201.194937, + 2156.956069, + 2880.102568, + 3885.46071, + 966.8968149, + 521.1341333, + 573.7413142, + 11864.40844, + 611.6588611, + 847.0061135, + 805.5724718, + 736.4153921, + 1361.936856, + 773.9932141, + 506.1138573, + 11770.5898, + 1155.441948, + 635.5173634, + 684.1715576, + 1421.603576, + 4783.586903, + 2755.046991, + 389.8761846, + 3693.731337, + 668.3000228, + 1385.029563, + 5303.377488, + 847.991217, + 1516.525457, + 1441.72072, + 1294.447788, + 1093.244963, + 7825.823398, + 1507.819159, + 3984.839812, + 831.8220794, + 1202.201361, + 3810.419296, + 617.7244065, + 1213.315116, + 706.1573059 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 31620918, + 6156369, + 142938076, + 26549700, + 12463354, + 30964245, + 2799811, + 10239839, + 6655297, + 9545158, + 4842194, + 7326406, + 5756203, + 4372203, + 2326606, + 80122492, + 3344353, + 2253639, + 3886512, + 20195924, + 3444468, + 1191336, + 242803533, + 3045153, + 17910182 + ] + }, + "mode":"markers", + "x":[ + 70.774, + 57.251, + 65.205, + 76.86, + 72.492, + 67.768, + 74.752, + 74.174, + 66.046, + 67.231, + 63.154, + 60.782, + 53.636, + 64.492, + 71.77, + 69.498, + 62.008, + 71.523, + 67.378, + 64.134, + 74.63, + 69.582, + 75.02, + 71.918, + 70.19 + ], + "y":[ + 9139.671389, + 2753.69149, + 7807.095818, + 26626.51503, + 5547.063754, + 4903.2191, + 5629.915318, + 7532.924763, + 2899.842175, + 6481.776993, + 4140.442097, + 4246.485974, + 1823.015995, + 3023.096699, + 6351.237495, + 8688.156003, + 2955.984375, + 7034.779161, + 3998.875695, + 6360.943444, + 12281.34191, + 7388.597823, + 29884.35041, + 7452.398969, + 9883.584648 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 16257249, + 3317166 + ] + }, + "mode":"markers", + "x":[ + 76.32, + 74.32 + ], + "y":[ + 21888.88903, + 19007.19129 + ] + } + ], + "name":"1987" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 16317921, + 529491, + 113704579, + 10150094, + 1164970000, + 5829696, + 872000000, + 184816000, + 60397973, + 17861905, + 4936550, + 124329269, + 3867409, + 20711375, + 43805450, + 1418095, + 3219994, + 18319502, + 2312802, + 40546538, + 20326209, + 1915208, + 120065004, + 67185766, + 16945857, + 3235865, + 17587060, + 13219062, + 20686918, + 56667095, + 69940728, + 2104779, + 13367997 + ] + }, + "mode":"markers", + "x":[ + 41.674, + 72.601, + 56.018, + 55.803, + 68.69, + 77.601, + 60.223, + 62.681, + 65.742, + 59.461, + 76.93, + 79.36, + 68.015, + 69.978, + 72.244, + 75.19, + 69.292, + 70.693, + 61.271, + 59.32, + 55.727, + 71.197, + 60.838, + 66.458, + 68.768, + 75.788, + 70.379, + 69.249, + 74.26, + 67.298, + 67.662, + 69.718, + 55.599 + ], + "y":[ + 649.3413952, + 19035.57917, + 837.8101643, + 682.3031755, + 1655.784158, + 24757.60301, + 1164.406809, + 2383.140898, + 7235.653188, + 3745.640687, + 18051.52254, + 26824.89511, + 3431.593647, + 3726.063507, + 12104.27872, + 34932.91959, + 6890.806854, + 7277.912802, + 1785.402016, + 347, + 897.7403604, + 18616.70691, + 1971.829464, + 2279.324017, + 24841.61777, + 24769.8912, + 2153.739222, + 3340.542768, + 15215.6579, + 4616.896545, + 989.0231487, + 6017.654756, + 1879.496673 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3326498, + 7914969, + 10045622, + 4256013, + 8658506, + 4494013, + 10315702, + 5171393, + 5041039, + 57374179, + 80597764, + 10325429, + 10348684, + 259012, + 3557761, + 56840847, + 621621, + 15174244, + 4286357, + 38370697, + 9927680, + 22797027, + 9826397, + 5302888, + 1999210, + 39549438, + 8718867, + 6995447, + 58179144, + 57866349 + ] + }, + "mode":"markers", + "x":[ + 71.581, + 76.04, + 76.46, + 72.178, + 71.19, + 72.527, + 72.4, + 75.33, + 75.7, + 77.46, + 76.07, + 77.03, + 69.17, + 78.77, + 75.467, + 77.44, + 75.435, + 77.42, + 77.32, + 70.99, + 74.86, + 69.36, + 71.659, + 71.38, + 73.64, + 77.57, + 78.16, + 78.03, + 66.146, + 76.42 + ], + "y":[ + 2497.437901, + 27042.01868, + 25575.57069, + 2546.781445, + 6302.623438, + 8447.794873, + 14297.02122, + 26406.73985, + 20647.16499, + 24703.79615, + 26505.30317, + 17541.49634, + 10535.62855, + 25144.39201, + 17558.81555, + 22013.64486, + 7003.339037, + 26790.94961, + 33965.66115, + 7738.881247, + 16207.26663, + 6598.409903, + 9325.068238, + 9498.467723, + 14214.71681, + 18603.06452, + 23880.01683, + 31871.5303, + 5678.348271, + 22705.09254 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 26298373, + 8735988, + 4981671, + 1342614, + 8878303, + 5809236, + 12467171, + 3265124, + 6429417, + 454429, + 41672143, + 2409073, + 12772596, + 384156, + 59402198, + 387838, + 3668440, + 52088559, + 985739, + 1025384, + 16278738, + 6990574, + 1050938, + 25020539, + 1803195, + 1912974, + 4364501, + 12210395, + 10014249, + 8416215, + 2119465, + 1096202, + 25798239, + 13160731, + 1554253, + 8392818, + 93364244, + 622191, + 7290203, + 125911, + 8307920, + 4260884, + 6099799, + 39964159, + 28227588, + 962344, + 26605473, + 3747553, + 8523077, + 18252190, + 8381163, + 10704340 + ] + }, + "mode":"markers", + "x":[ + 67.744, + 40.647, + 53.919, + 62.745, + 50.26, + 44.736, + 54.314, + 49.396, + 51.724, + 57.939, + 45.548, + 56.433, + 52.044, + 51.604, + 63.674, + 47.545, + 49.991, + 48.091, + 61.366, + 52.644, + 57.501, + 48.576, + 43.266, + 59.285, + 59.685, + 40.802, + 68.755, + 52.214, + 49.42, + 48.388, + 58.333, + 69.745, + 65.393, + 44.284, + 61.999, + 47.391, + 47.472, + 73.615, + 23.599, + 62.742, + 58.196, + 38.333, + 39.658, + 61.888, + 53.556, + 58.474, + 50.44, + 58.061, + 70.001, + 48.825, + 46.1, + 60.377 + ], + "y":[ + 5023.216647, + 2627.845685, + 1191.207681, + 7954.111645, + 931.7527731, + 631.6998778, + 1793.163278, + 747.9055252, + 1058.0643, + 1246.90737, + 457.7191807, + 4016.239529, + 1648.073791, + 2377.156192, + 3794.755195, + 1132.055034, + 582.8585102, + 421.3534653, + 13522.15752, + 665.6244126, + 925.060154, + 794.3484384, + 745.5398706, + 1341.921721, + 977.4862725, + 636.6229191, + 9640.138501, + 1040.67619, + 563.2000145, + 739.014375, + 1361.369784, + 6058.253846, + 2948.047252, + 410.8968239, + 3804.537999, + 581.182725, + 1619.848217, + 6101.255823, + 737.0685949, + 1428.777814, + 1367.899369, + 1068.696278, + 926.9602964, + 7225.069258, + 1492.197043, + 3553.0224, + 825.682454, + 1034.298904, + 4332.720164, + 644.1707969, + 1210.884633, + 693.4207856 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 33958947, + 6893451, + 155975974, + 28523502, + 13572994, + 34202721, + 3173216, + 10723260, + 7351181, + 10748394, + 5274649, + 8486949, + 6326682, + 5077347, + 2378618, + 88111030, + 4017939, + 2484997, + 4483945, + 22430449, + 3585176, + 1183669, + 256894189, + 3149262, + 20265563 + ] + }, + "mode":"markers", + "x":[ + 71.868, + 59.957, + 67.057, + 77.95, + 74.126, + 68.421, + 75.713, + 74.414, + 68.457, + 69.613, + 66.798, + 63.373, + 55.089, + 66.399, + 71.766, + 71.455, + 65.843, + 72.462, + 68.225, + 66.458, + 73.911, + 69.862, + 76.09, + 72.752, + 71.15 + ], + "y":[ + 9308.41871, + 2961.699694, + 6950.283021, + 26342.88426, + 7596.125964, + 5444.648617, + 6160.416317, + 5592.843963, + 3044.214214, + 7103.702595, + 4444.2317, + 4439.45084, + 1456.309517, + 3081.694603, + 7404.923685, + 9472.384295, + 2170.151724, + 6618.74305, + 4196.411078, + 4446.380924, + 14641.58711, + 7370.990932, + 32003.93224, + 8137.004775, + 10733.92631 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 17481977, + 3437674 + ] + }, + "mode":"markers", + "x":[ + 77.56, + 76.33 + ], + "y":[ + 23424.76683, + 18363.32494 + ] + } + ], + "name":"1992" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 22227415, + 598561, + 123315288, + 11782962, + 1230075000, + 6495918, + 959000000, + 199278000, + 63327987, + 20775703, + 5531387, + 125956499, + 4526235, + 21585105, + 46173816, + 1765345, + 3430388, + 20476091, + 2494803, + 43247867, + 23001113, + 2283635, + 135564834, + 75012988, + 21229759, + 3802309, + 18698655, + 15081016, + 21628605, + 60216677, + 76048996, + 2826046, + 15826497 + ] + }, + "mode":"markers", + "x":[ + 41.763, + 73.925, + 59.412, + 56.534, + 70.426, + 80, + 61.765, + 66.041, + 68.042, + 58.811, + 78.269, + 80.69, + 69.772, + 67.727, + 74.647, + 76.156, + 70.265, + 71.938, + 63.625, + 60.328, + 59.426, + 72.499, + 61.818, + 68.564, + 70.533, + 77.158, + 70.457, + 71.527, + 75.25, + 67.521, + 70.672, + 71.096, + 58.02 + ], + "y":[ + 635.341351, + 20292.01679, + 972.7700352, + 734.28517, + 2289.234136, + 28377.63219, + 1458.817442, + 3119.335603, + 8263.590301, + 3076.239795, + 20896.60924, + 28816.58499, + 3645.379572, + 1690.756814, + 15993.52796, + 40300.61996, + 8754.96385, + 10132.90964, + 1902.2521, + 415, + 1010.892138, + 19702.05581, + 2049.350521, + 2536.534925, + 20586.69019, + 33519.4766, + 2664.477257, + 4014.238972, + 20206.82098, + 5852.625497, + 1385.896769, + 7110.667619, + 2117.484526 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3428038, + 8069876, + 10199787, + 3607000, + 8066057, + 4444595, + 10300707, + 5283663, + 5134406, + 58623428, + 82011073, + 10502372, + 10244684, + 271192, + 3667233, + 57479469, + 692651, + 15604464, + 4405672, + 38654957, + 10156415, + 22562458, + 10336594, + 5383010, + 2011612, + 39855442, + 8897619, + 7193761, + 63047647, + 58808266 + ] + }, + "mode":"markers", + "x":[ + 72.95, + 77.51, + 77.53, + 73.244, + 70.32, + 73.68, + 74.01, + 76.11, + 77.13, + 78.64, + 77.34, + 77.869, + 71.04, + 78.95, + 76.122, + 78.82, + 75.445, + 78.03, + 78.32, + 72.75, + 75.97, + 69.72, + 72.232, + 72.71, + 75.13, + 78.77, + 79.39, + 79.37, + 68.835, + 77.218 + ], + "y":[ + 3193.054604, + 29095.92066, + 27561.19663, + 4766.355904, + 5970.38876, + 9875.604515, + 16048.51424, + 29804.34567, + 23723.9502, + 25889.78487, + 27788.88416, + 18747.69814, + 11712.7768, + 28061.09966, + 24521.94713, + 24675.02446, + 6465.613349, + 30246.13063, + 41283.16433, + 10159.58368, + 17641.03156, + 7346.547557, + 7914.320304, + 12126.23065, + 17161.10735, + 20445.29896, + 25266.59499, + 32135.32301, + 6601.429915, + 26074.53136 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 29072015, + 9875024, + 6066080, + 1536536, + 10352843, + 6121610, + 14195809, + 3696513, + 7562011, + 527982, + 47798986, + 2800947, + 14625967, + 417908, + 66134291, + 439971, + 4058319, + 59861301, + 1126189, + 1235767, + 18418288, + 8048834, + 1193708, + 28263827, + 1982823, + 2200725, + 4759670, + 14165114, + 10419991, + 9384984, + 2444741, + 1149818, + 28529501, + 16603334, + 1774766, + 9666252, + 106207839, + 684810, + 7212583, + 145608, + 9535314, + 4578212, + 6633514, + 42835005, + 32160729, + 1054486, + 30686889, + 4320890, + 9231669, + 21210254, + 9417789, + 11404948 + ] + }, + "mode":"markers", + "x":[ + 69.152, + 40.963, + 54.777, + 52.556, + 50.324, + 45.326, + 52.199, + 46.066, + 51.573, + 60.66, + 42.587, + 52.962, + 47.991, + 53.157, + 67.217, + 48.245, + 53.378, + 49.402, + 60.461, + 55.861, + 58.556, + 51.455, + 44.873, + 54.407, + 55.558, + 42.221, + 71.555, + 54.978, + 47.495, + 49.903, + 60.43, + 70.736, + 67.66, + 46.344, + 58.909, + 51.313, + 47.464, + 74.772, + 36.087, + 63.306, + 60.187, + 39.897, + 43.795, + 60.236, + 55.373, + 54.289, + 48.466, + 58.39, + 71.973, + 44.578, + 40.238, + 46.809 + ], + "y":[ + 4797.295051, + 2277.140884, + 1232.975292, + 8647.142313, + 946.2949618, + 463.1151478, + 1694.337469, + 740.5063317, + 1004.961353, + 1173.618235, + 312.188423, + 3484.164376, + 1786.265407, + 1895.016984, + 4173.181797, + 2814.480755, + 913.47079, + 515.8894013, + 14722.84188, + 653.7301704, + 1005.245812, + 869.4497668, + 796.6644681, + 1360.485021, + 1186.147994, + 609.1739508, + 9467.446056, + 986.2958956, + 692.2758103, + 790.2579846, + 1483.136136, + 7425.705295, + 2982.101858, + 472.3460771, + 3899.52426, + 580.3052092, + 1624.941275, + 6071.941411, + 589.9445051, + 1339.076036, + 1392.368347, + 574.6481576, + 930.5964284, + 7479.188244, + 1632.210764, + 3876.76846, + 789.1862231, + 982.2869243, + 4876.798614, + 816.559081, + 1071.353818, + 792.4499603 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 36203463, + 7693188, + 168546719, + 30305843, + 14599929, + 37657830, + 3518107, + 10983007, + 7992357, + 11911819, + 5783439, + 9803875, + 6913545, + 5867957, + 2531311, + 95895146, + 4609572, + 2734531, + 5154123, + 24748122, + 3759430, + 1138101, + 272911760, + 3262838, + 22374398 + ] + }, + "mode":"markers", + "x":[ + 73.275, + 62.05, + 69.388, + 78.61, + 75.816, + 70.313, + 77.26, + 76.151, + 69.957, + 72.312, + 69.535, + 66.322, + 56.671, + 67.659, + 72.262, + 73.67, + 68.426, + 73.738, + 69.4, + 68.386, + 74.917, + 69.465, + 76.81, + 74.223, + 72.146 + ], + "y":[ + 10967.28195, + 3326.143191, + 7957.980824, + 28954.92589, + 10118.05318, + 6117.361746, + 6677.045314, + 5431.990415, + 3614.101285, + 7429.455877, + 5154.825496, + 4684.313807, + 1341.726931, + 3160.454906, + 7121.924704, + 9767.29753, + 2253.023004, + 7113.692252, + 4247.400261, + 5838.347657, + 16999.4333, + 8792.573126, + 35767.43303, + 9230.240708, + 10165.49518 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 18565243, + 3676187 + ] + }, + "mode":"markers", + "x":[ + 78.83, + 77.55 + ], + "y":[ + 26997.93657, + 21050.41377 + ] + } + ], + "name":"1997" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 25268405, + 656397, + 135656790, + 12926707, + 1280400000, + 6762476, + 1034172547, + 211060000, + 66907826, + 24001816, + 6029529, + 127065841, + 5307470, + 22215365, + 47969150, + 2111561, + 3677780, + 22662365, + 2674234, + 45598081, + 25873917, + 2713462, + 153403524, + 82995088, + 24501530, + 4197776, + 19576783, + 17155814, + 22454239, + 62806748, + 80908147, + 3389578, + 18701257 + ] + }, + "mode":"markers", + "x":[ + 42.129, + 74.795, + 62.013, + 56.752, + 72.028, + 81.495, + 62.879, + 68.588, + 69.451, + 57.046, + 79.696, + 82, + 71.263, + 66.662, + 77.045, + 76.904, + 71.028, + 73.044, + 65.033, + 59.908, + 61.34, + 74.193, + 63.61, + 70.303, + 71.626, + 78.77, + 70.815, + 73.053, + 76.99, + 68.564, + 73.017, + 72.37, + 60.308 + ], + "y":[ + 726.7340548, + 23403.55927, + 1136.39043, + 896.2260153, + 3119.280896, + 30209.01516, + 1746.769454, + 2873.91287, + 9240.761975, + 4390.717312, + 21905.59514, + 28604.5919, + 3844.917194, + 1646.758151, + 19233.98818, + 35110.10566, + 9313.93883, + 10206.97794, + 2140.739323, + 611, + 1057.206311, + 19774.83687, + 2092.712441, + 2650.921068, + 19014.54118, + 36023.1054, + 3015.378833, + 4090.925331, + 23235.42329, + 5913.187529, + 1764.456677, + 4515.487575, + 2234.820827 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3508512, + 8148312, + 10311970, + 4165416, + 7661799, + 4481020, + 10256295, + 5374693, + 5193039, + 59925035, + 82350671, + 10603863, + 10083313, + 288030, + 3879155, + 57926999, + 720230, + 16122830, + 4535591, + 38625976, + 10433867, + 22404337, + 10111559, + 5410052, + 2011497, + 40152517, + 8954175, + 7361757, + 67308928, + 59912431 + ] + }, + "mode":"markers", + "x":[ + 75.651, + 78.98, + 78.32, + 74.09, + 72.14, + 74.876, + 75.51, + 77.18, + 78.37, + 79.59, + 78.67, + 78.256, + 72.59, + 80.5, + 77.783, + 80.24, + 73.981, + 78.53, + 79.05, + 74.67, + 77.29, + 71.322, + 73.213, + 73.8, + 76.66, + 79.78, + 80.04, + 80.62, + 70.845, + 78.471 + ], + "y":[ + 4604.211737, + 32417.60769, + 30485.88375, + 6018.975239, + 7696.777725, + 11628.38895, + 17596.21022, + 32166.50006, + 28204.59057, + 28926.03234, + 30035.80198, + 22514.2548, + 14843.93556, + 31163.20196, + 34077.04939, + 27968.09817, + 6557.194282, + 33724.75778, + 44683.97525, + 12002.23908, + 19970.90787, + 7885.360081, + 7236.075251, + 13638.77837, + 20660.01936, + 24835.47166, + 29341.63093, + 34480.95771, + 6508.085718, + 29478.99919 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 31287142, + 10866106, + 7026113, + 1630347, + 12251209, + 7021078, + 15929988, + 4048013, + 8835739, + 614382, + 55379852, + 3328795, + 16252726, + 447416, + 73312559, + 495627, + 4414865, + 67946797, + 1299304, + 1457766, + 20550751, + 8807818, + 1332459, + 31386842, + 2046772, + 2814651, + 5368585, + 16473477, + 11824495, + 10580176, + 2828858, + 1200206, + 31167783, + 18473780, + 1972153, + 11140655, + 119901274, + 743981, + 7852401, + 170372, + 10870037, + 5359092, + 7753310, + 44433622, + 37090298, + 1130269, + 34593779, + 4977378, + 9770575, + 24739869, + 10595811, + 11926563 + ] + }, + "mode":"markers", + "x":[ + 70.994, + 41.003, + 54.406, + 46.634, + 50.65, + 47.36, + 49.856, + 43.308, + 50.525, + 62.974, + 44.966, + 52.97, + 46.832, + 53.373, + 69.806, + 49.348, + 55.24, + 50.725, + 56.761, + 58.041, + 58.453, + 53.676, + 45.504, + 50.992, + 44.593, + 43.753, + 72.737, + 57.286, + 45.009, + 51.818, + 62.247, + 71.954, + 69.615, + 44.026, + 51.479, + 54.496, + 46.608, + 75.744, + 43.413, + 64.337, + 61.6, + 41.012, + 45.936, + 53.365, + 56.369, + 43.869, + 49.651, + 57.561, + 73.042, + 47.813, + 39.193, + 39.989 + ], + "y":[ + 5288.040382, + 2773.287312, + 1372.877931, + 11003.60508, + 1037.645221, + 446.4035126, + 1934.011449, + 738.6906068, + 1156.18186, + 1075.811558, + 241.1658765, + 3484.06197, + 1648.800823, + 1908.260867, + 4754.604414, + 7703.4959, + 765.3500015, + 530.0535319, + 12521.71392, + 660.5855997, + 1111.984578, + 945.5835837, + 575.7047176, + 1287.514732, + 1275.184575, + 531.4823679, + 9534.677467, + 894.6370822, + 665.4231186, + 951.4097518, + 1579.019543, + 9021.815894, + 3258.495584, + 633.6179466, + 4072.324751, + 601.0745012, + 1615.286395, + 6316.1652, + 785.6537648, + 1353.09239, + 1519.635262, + 699.489713, + 882.0818218, + 7710.946444, + 1993.398314, + 4128.116943, + 899.0742111, + 886.2205765, + 5722.895655, + 927.7210018, + 1071.613938, + 672.0386227 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 38331121, + 8445134, + 179914212, + 31902268, + 15497046, + 41008227, + 3834934, + 11226999, + 8650322, + 12921234, + 6353681, + 11178650, + 7607651, + 6677328, + 2664659, + 102479927, + 5146848, + 2990875, + 5884491, + 26769436, + 3859606, + 1101832, + 287675526, + 3363085, + 24287670 + ] + }, + "mode":"markers", + "x":[ + 74.34, + 63.883, + 71.006, + 79.77, + 77.86, + 71.682, + 78.123, + 77.158, + 70.847, + 74.173, + 70.734, + 68.978, + 58.137, + 68.565, + 72.047, + 74.902, + 70.836, + 74.712, + 70.755, + 69.906, + 77.778, + 68.976, + 77.31, + 75.307, + 72.766 + ], + "y":[ + 8797.640716, + 3413.26269, + 8131.212843, + 33328.96507, + 10778.78385, + 5755.259962, + 7723.447195, + 6340.646683, + 4563.808154, + 5773.044512, + 5351.568666, + 4858.347495, + 1270.364932, + 3099.72866, + 6994.774861, + 10742.44053, + 2474.548819, + 7356.031934, + 3783.674243, + 5909.020073, + 18855.60618, + 11460.60023, + 39097.09955, + 7727.002004, + 8605.047831 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 19546792, + 3908037 + ] + }, + "mode":"markers", + "x":[ + 80.37, + 79.11 + ], + "y":[ + 30687.75473, + 23189.80135 + ] + } + ], + "name":"2002" + }, + { + "data":[ + { + "name":"Asia", + "text":[ + "Afghanistan", + "Bahrain", + "Bangladesh", + "Cambodia", + "China", + "Hong Kong, China", + "India", + "Indonesia", + "Iran", + "Iraq", + "Israel", + "Japan", + "Jordan", + "Korea, Dem. Rep.", + "Korea, Rep.", + "Kuwait", + "Lebanon", + "Malaysia", + "Mongolia", + "Myanmar", + "Nepal", + "Oman", + "Pakistan", + "Philippines", + "Saudi Arabia", + "Singapore", + "Sri Lanka", + "Syria", + "Taiwan", + "Thailand", + "Vietnam", + "West Bank and Gaza", + "Yemen, Rep." + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 31889923, + 708573, + 150448339, + 14131858, + 1318683096, + 6980412, + 1110396331, + 223547000, + 69453570, + 27499638, + 6426679, + 127467972, + 6053193, + 23301725, + 49044790, + 2505559, + 3921278, + 24821286, + 2874127, + 47761980, + 28901790, + 3204897, + 169270617, + 91077287, + 27601038, + 4553009, + 20378239, + 19314747, + 23174294, + 65068149, + 85262356, + 4018332, + 22211743 + ] + }, + "mode":"markers", + "x":[ + 43.828, + 75.635, + 64.062, + 59.723, + 72.961, + 82.208, + 64.698, + 70.65, + 70.964, + 59.545, + 80.745, + 82.603, + 72.535, + 67.297, + 78.623, + 77.588, + 71.993, + 74.241, + 66.803, + 62.069, + 63.785, + 75.64, + 65.483, + 71.688, + 72.777, + 79.972, + 72.396, + 74.143, + 78.4, + 70.616, + 74.249, + 73.422, + 62.698 + ], + "y":[ + 974.5803384, + 29796.04834, + 1391.253792, + 1713.778686, + 4959.114854, + 39724.97867, + 2452.210407, + 3540.651564, + 11605.71449, + 4471.061906, + 25523.2771, + 31656.06806, + 4519.461171, + 1593.06548, + 23348.13973, + 47306.98978, + 10461.05868, + 12451.6558, + 3095.772271, + 944, + 1091.359778, + 22316.19287, + 2605.94758, + 3190.481016, + 21654.83194, + 47143.17964, + 3970.095407, + 4184.548089, + 28718.27684, + 7458.396327, + 2441.576404, + 3025.349798, + 2280.769906 + ] + }, + { + "name":"Europe", + "text":[ + "Albania", + "Austria", + "Belgium", + "Bosnia and Herzegovina", + "Bulgaria", + "Croatia", + "Czech Republic", + "Denmark", + "Finland", + "France", + "Germany", + "Greece", + "Hungary", + "Iceland", + "Ireland", + "Italy", + "Montenegro", + "Netherlands", + "Norway", + "Poland", + "Portugal", + "Romania", + "Serbia", + "Slovak Republic", + "Slovenia", + "Spain", + "Sweden", + "Switzerland", + "Turkey", + "United Kingdom" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 3600523, + 8199783, + 10392226, + 4552198, + 7322858, + 4493312, + 10228744, + 5468120, + 5238460, + 61083916, + 82400996, + 10706290, + 9956108, + 301931, + 4109086, + 58147733, + 684736, + 16570613, + 4627926, + 38518241, + 10642836, + 22276056, + 10150265, + 5447502, + 2009245, + 40448191, + 9031088, + 7554661, + 71158647, + 60776238 + ] + }, + "mode":"markers", + "x":[ + 76.423, + 79.829, + 79.441, + 74.852, + 73.005, + 75.748, + 76.486, + 78.332, + 79.313, + 80.657, + 79.406, + 79.483, + 73.338, + 81.757, + 78.885, + 80.546, + 74.543, + 79.762, + 80.196, + 75.563, + 78.098, + 72.476, + 74.002, + 74.663, + 77.926, + 80.941, + 80.884, + 81.701, + 71.777, + 79.425 + ], + "y":[ + 5937.029526, + 36126.4927, + 33692.60508, + 7446.298803, + 10680.79282, + 14619.22272, + 22833.30851, + 35278.41874, + 33207.0844, + 30470.0167, + 32170.37442, + 27538.41188, + 18008.94444, + 36180.78919, + 40675.99635, + 28569.7197, + 9253.896111, + 36797.93332, + 49357.19017, + 15389.92468, + 20509.64777, + 10808.47561, + 9786.534714, + 18678.31435, + 25768.25759, + 28821.0637, + 33859.74835, + 37506.41907, + 8458.276384, + 33203.26128 + ] + }, + { + "name":"Africa", + "text":[ + "Algeria", + "Angola", + "Benin", + "Botswana", + "Burkina Faso", + "Burundi", + "Cameroon", + "Central African Republic", + "Chad", + "Comoros", + "Congo, Dem. Rep.", + "Congo, Rep.", + "Cote d'Ivoire", + "Djibouti", + "Egypt", + "Equatorial Guinea", + "Eritrea", + "Ethiopia", + "Gabon", + "Gambia", + "Ghana", + "Guinea", + "Guinea-Bissau", + "Kenya", + "Lesotho", + "Liberia", + "Libya", + "Madagascar", + "Malawi", + "Mali", + "Mauritania", + "Mauritius", + "Morocco", + "Mozambique", + "Namibia", + "Niger", + "Nigeria", + "Reunion", + "Rwanda", + "Sao Tome and Principe", + "Senegal", + "Sierra Leone", + "Somalia", + "South Africa", + "Sudan", + "Swaziland", + "Tanzania", + "Togo", + "Tunisia", + "Uganda", + "Zambia", + "Zimbabwe" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 33333216, + 12420476, + 8078314, + 1639131, + 14326203, + 8390505, + 17696293, + 4369038, + 10238807, + 710960, + 64606759, + 3800610, + 18013409, + 496374, + 80264543, + 551201, + 4906585, + 76511887, + 1454867, + 1688359, + 22873338, + 9947814, + 1472041, + 35610177, + 2012649, + 3193942, + 6036914, + 19167654, + 13327079, + 12031795, + 3270065, + 1250882, + 33757175, + 19951656, + 2055080, + 12894865, + 135031164, + 798094, + 8860588, + 199579, + 12267493, + 6144562, + 9118773, + 43997828, + 42292929, + 1133066, + 38139640, + 5701579, + 10276158, + 29170398, + 11746035, + 12311143 + ] + }, + "mode":"markers", + "x":[ + 72.301, + 42.731, + 56.728, + 50.728, + 52.295, + 49.58, + 50.43, + 44.741, + 50.651, + 65.152, + 46.462, + 55.322, + 48.328, + 54.791, + 71.338, + 51.579, + 58.04, + 52.947, + 56.735, + 59.448, + 60.022, + 56.007, + 46.388, + 54.11, + 42.592, + 45.678, + 73.952, + 59.443, + 48.303, + 54.467, + 64.164, + 72.801, + 71.164, + 42.082, + 52.906, + 56.867, + 46.859, + 76.442, + 46.242, + 65.528, + 63.062, + 42.568, + 48.159, + 49.339, + 58.556, + 39.613, + 52.517, + 58.42, + 73.923, + 51.542, + 42.384, + 43.487 + ], + "y":[ + 6223.367465, + 4797.231267, + 1441.284873, + 12569.85177, + 1217.032994, + 430.0706916, + 2042.09524, + 706.016537, + 1704.063724, + 986.1478792, + 277.5518587, + 3632.557798, + 1544.750112, + 2082.481567, + 5581.180998, + 12154.08975, + 641.3695236, + 690.8055759, + 13206.48452, + 752.7497265, + 1327.60891, + 942.6542111, + 579.231743, + 1463.249282, + 1569.331442, + 414.5073415, + 12057.49928, + 1044.770126, + 759.3499101, + 1042.581557, + 1803.151496, + 10956.99112, + 3820.17523, + 823.6856205, + 4811.060429, + 619.6768924, + 2013.977305, + 7670.122558, + 863.0884639, + 1598.435089, + 1712.472136, + 862.5407561, + 926.1410683, + 9269.657808, + 2602.394995, + 4513.480643, + 1107.482182, + 882.9699438, + 7092.923025, + 1056.380121, + 1271.211593, + 469.7092981 + ] + }, + { + "name":"Americas", + "text":[ + "Argentina", + "Bolivia", + "Brazil", + "Canada", + "Chile", + "Colombia", + "Costa Rica", + "Cuba", + "Dominican Republic", + "Ecuador", + "El Salvador", + "Guatemala", + "Haiti", + "Honduras", + "Jamaica", + "Mexico", + "Nicaragua", + "Panama", + "Paraguay", + "Peru", + "Puerto Rico", + "Trinidad and Tobago", + "United States", + "Uruguay", + "Venezuela" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 40301927, + 9119152, + 190010647, + 33390141, + 16284741, + 44227550, + 4133884, + 11416987, + 9319622, + 13755680, + 6939688, + 12572928, + 8502814, + 7483763, + 2780132, + 108700891, + 5675356, + 3242173, + 6667147, + 28674757, + 3942491, + 1056608, + 301139947, + 3447496, + 26084662 + ] + }, + "mode":"markers", + "x":[ + 75.32, + 65.554, + 72.39, + 80.653, + 78.553, + 72.889, + 78.782, + 78.273, + 72.235, + 74.994, + 71.878, + 70.259, + 60.916, + 70.198, + 72.567, + 76.195, + 72.899, + 75.537, + 71.752, + 71.421, + 78.746, + 69.819, + 78.242, + 76.384, + 73.747 + ], + "y":[ + 12779.37964, + 3822.137084, + 9065.800825, + 36319.23501, + 13171.63885, + 7006.580419, + 9645.06142, + 8948.102923, + 6025.374752, + 6873.262326, + 5728.353514, + 5186.050003, + 1201.637154, + 3548.330846, + 7320.880262, + 11977.57496, + 2749.320965, + 9809.185636, + 4172.838464, + 7408.905561, + 19328.70901, + 18008.50924, + 42951.65309, + 10611.46299, + 11415.80569 + ] + }, + { + "name":"Oceania", + "text":[ + "Australia", + "New Zealand" + ], + "marker":{ + "sizemode":"area", + "sizeref":200000, + "size":[ + 20434176, + 4115771 + ] + }, + "mode":"markers", + "x":[ + 81.235, + 80.204 + ], + "y":[ + 34435.36744, + 25185.00911 + ] + } + ], + "name":"2007" + } + ], + "layout":{ + "xaxis":{ + "title":"Life Expectancy", + "range":[ + 30, + 85 + ] + }, + "yaxis":{ + "title":"GDP per Capita", + "type":"log" + }, + "hovermode":"closest", + "slider":{ + "visible":true, + "plotlycommand":"animate", + "args":[ + "slider.value", + { + "duration":400, + "ease":"cubic-in-out" + } + ], + "initialValue":"1952", + "values":[ + "1952", + "1957", + "1962", + "1967", + "1972", + "1977", + "1982", + "1987", + "1992", + "1997", + "2002", + "2007" + ] + }, + "updatemenus": [{ + "x": 0.1, + "y": 0, + "yanchor": "top", + "xanchor": "right", + "showactive": false, + "direction": "left", + "type": "buttons", + "pad": {"t": 87, "r": 10}, + "buttons": [{ + "method": "animate", + "args": [null, { + "fromcurrent": true, + "transition": { + "duration": 300, + "easing": "quadratic-in-out" + }, + "frame": { + "duration": 500, + "redraw": false + } + }], + "label": "Play" + }, { + "method": "animate", + "args": [ + [null], + { + "mode": "immediate", + "transition": { + "duration": 0 + }, + "frame": { + "duration": 0, + "redraw": false + } + } + ], + "label": "Pause" + }] + }], + "sliders": [{ + "active": 0, + "steps": [{ + "label": "1952", + "method": "animate", + "args": [["1952"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1957", + "method": "animate", + "args": [["1957"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1962", + "method": "animate", + "args": [["1962"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1967", + "method": "animate", + "args": [["1967"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1972", + "method": "animate", + "args": [["1972"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1977", + "method": "animate", + "args": [["1977"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1982", + "method": "animate", + "args": [["1982"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1987", + "method": "animate", + "args": [["1987"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1992", + "method": "animate", + "args": [["1992"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "1997", + "method": "animate", + "args": [["1997"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "2002", + "method": "animate", + "args": [["2002"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }, { + "label": "2007", + "method": "animate", + "args": [["2007"], { + "mode": "immediate", + "transition": {"duration": 300}, + "frame": {"duration": 300, "redraw": false} + } + ] + }], + "x": 0.1, + "len": 0.9, + "xanchor": "left", + "y": 0, + "yanchor": "top", + "pad": {"t": 50, "b": 10}, + "currentvalue": { + "visible": true, + "prefix": "Year:", + "xanchor": "right", + "font": { + "size": 20, + "color": "#666" + } + }, + "transition": { + "duration": 300, + "easing": "cubic-in-out" + } + }] + }, + "config": { + "scrollzoom": true + } +} diff --git a/content/plotly_js/animations/animations_plotly_js_index.html b/content/plotly_js/animations/animations_plotly_js_index.html new file mode 100644 index 00000000000..77c1ea97b60 --- /dev/null +++ b/content/plotly_js/animations/animations_plotly_js_index.html @@ -0,0 +1,13 @@ +--- +name: Animations +permalink: javascript/animations/ +description: How to animate charts in JavaScript with the animate API. +layout: base +thumbnail: thumbnail/animations.gif +language: plotly_js +page_type: example_index +display_as: animations +order: 1 +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","animations" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/animations/filled-area-animations/filled-area-animations.html b/content/plotly_js/animations/filled-area-animations/filled-area-animations.html new file mode 100644 index 00000000000..7b085e4b219 --- /dev/null +++ b/content/plotly_js/animations/filled-area-animations/filled-area-animations.html @@ -0,0 +1,96 @@ +--- +name: Filled-Area-Animation +plot_url: https://codepen.io/bcd/embed/ayVXvY/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: filled-area-animations +order: 1 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + + var frames = [] + var x = unpack(rows, 'AAPL_x') + var y = unpack(rows, 'AAPL_y') + + var n = 100; + for (var i = 0; i < n; i++) { + frames[i] = {data: [{x: [], y: []}]} + frames[i].data[0].x = x.slice(0, i+1); + frames[i].data[0].y = y.slice(0, i+1); + } + + Plotly.newPlot('myDiv', [{ + x: frames[1].data[0].x, + y: frames[1].data[0].y, + fill: 'tozeroy', + type: 'scatter', + mode: 'lines', + line: {color: 'green'} + }], { + title: { + text: "Filled-Area Animation" + }, + xaxis: { + type: 'date', + range: [ + frames[99].data[0].x[0], + frames[99].data[0].x[99] + ] + }, + yaxis: { + range: [ + 0, + 90 + ] + }, + updatemenus: [{ + x: 0.1, + y: 0, + yanchor: "top", + xanchor: "right", + showactive: false, + direction: "left", + type: "buttons", + pad: {"t": 87, "r": 10}, + buttons: [{ + method: "animate", + args: [null, { + fromcurrent: true, + transition: { + duration: 0, + }, + frame: { + duration: 40, + redraw: false + } + }], + label: "Play" + }, { + method: "animate", + args: [ + [null], + { + mode: "immediate", + transition: { + duration: 0 + }, + frame: { + duration: 0, + redraw: false + } + } + ], + label: "Pause" + }] + }] + }).then(function() { + Plotly.addFrames('myDiv', frames); + }); + +}) diff --git a/content/plotly_js/animations/filled-area-animations/multiple-filled-area-animations.html b/content/plotly_js/animations/filled-area-animations/multiple-filled-area-animations.html new file mode 100644 index 00000000000..848164df064 --- /dev/null +++ b/content/plotly_js/animations/filled-area-animations/multiple-filled-area-animations.html @@ -0,0 +1,116 @@ +--- +name: Multiple Trace Filled-Area +plot_url: https://codepen.io/bcd/embed/BdJXpP/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: filled-area-animations +order: 2 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + + var frames = [] + var x = unpack(rows, 'Date') + var y = unpack(rows, 'AAPL.High') + var x2 = unpack(rows, 'Date') + var y2 = unpack(rows, 'AAPL.Low') + + var n = 100; + for (var i = 0; i < n; i++) { + frames[i] = {data: [{x: [], y: []}, {x: [], y: []}]} + frames[i].data[1].x = x.slice(0, i+1); + frames[i].data[1].y = y.slice(0, i+1); + frames[i].data[0].x = x2.slice(0, i+1); + frames[i].data[0].y = y2.slice(0, i+1); + } + + var trace2 = { + type: "scatter", + mode: "lines", + name: 'AAPL High', + fill: 'tonexty', + x: frames[5].data[1].x, + y: frames[5].data[1].y, + line: {color: 'grey'} + } + + var trace1 = { + type: "scatter", + mode: "lines", + name: 'AAPL Low', + x: frames[5].data[0].x, + y: frames[5].data[0].y, + line: {color: 'lightgrey'} + } + + var data = [trace1,trace2]; + + var layout = { + title: { + text: 'Multiple Trace Filled-Area Animation' + }, + xaxis: { + range: [frames[99].data[0].x[0], frames[99].data[0].x[99]], + showgrid: false + }, + yaxis: { + range: [120, 140], + showgrid: false + }, + legend: { + orientation: 'h', + x: 0.5, + y: 1.2, + xanchor: 'center' + }, + updatemenus: [{ + x: 0.5, + y: 0, + yanchor: "top", + xanchor: "center", + showactive: false, + direction: "left", + type: "buttons", + pad: {"t": 87, "r": 10}, + buttons: [{ + method: "animate", + args: [null, { + fromcurrent: true, + transition: { + duration: 0, + }, + frame: { + duration: 40, + redraw: false + } + }], + label: "Play" + }, { + method: "animate", + args: [ + [null], + { + mode: "immediate", + transition: { + duration: 0 + }, + frame: { + duration: 0, + redraw: false + } + } + ], + label: "Pause" + }] + }] + }; + + Plotly.newPlot('myDiv', data, layout).then(function() { + Plotly.addFrames('myDiv', frames); + }); +}) diff --git a/content/plotly_js/animations/map-animations/choropleth-animation.html b/content/plotly_js/animations/map-animations/choropleth-animation.html new file mode 100644 index 00000000000..552dff20a5b --- /dev/null +++ b/content/plotly_js/animations/map-animations/choropleth-animation.html @@ -0,0 +1,130 @@ +--- +name: Map Animations +language: plotly_js +suite: map-animations +order: 1 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/gapminder_with_codes.csv", function(err, rows){ + + function filter_and_unpack(rows, key, year) { + return rows.filter(row => row['year'] == year).map(row => row[key]) + } + + var frames = [] + var slider_steps = [] + + var n = 11; + var num = 1952; + for (var i = 0; i <= n; i++) { + var z = filter_and_unpack(rows, 'lifeExp', num) + var locations = filter_and_unpack(rows, 'iso_alpha', num) + frames[i] = {data: [{z: z, locations: locations, text: locations}], name: num} + slider_steps.push ({ + label: num.toString(), + method: "animate", + args: [[num], { + mode: "immediate", + transition: {duration: 300}, + frame: {duration: 300} + } + ] + }) + num = num + 5 + } + +var data = [{ + type: 'choropleth', + locationmode: 'world', + locations: frames[0].data[0].locations, + z: frames[0].data[0].z, + text: frames[0].data[0].locations, + zauto: false, + zmin: 30, + zmax: 90 + +}]; +var layout = { + title: { + text: 'World Life Expectency
1952 - 2007' + }, + geo:{ + scope: 'world', + countrycolor: 'rgb(255, 255, 255)', + showland: true, + landcolor: 'rgb(217, 217, 217)', + showlakes: true, + lakecolor: 'rgb(255, 255, 255)', + subunitcolor: 'rgb(255, 255, 255)', + lonaxis: {}, + lataxis: {} + }, + updatemenus: [{ + x: 0.1, + y: 0, + yanchor: "top", + xanchor: "right", + showactive: false, + direction: "left", + type: "buttons", + pad: {"t": 87, "r": 10}, + buttons: [{ + method: "animate", + args: [null, { + fromcurrent: true, + transition: { + duration: 200, + }, + frame: { + duration: 500 + } + }], + label: "Play" + }, { + method: "animate", + args: [ + [null], + { + mode: "immediate", + transition: { + duration: 0 + }, + frame: { + duration: 0 + } + } + ], + label: "Pause" + }] + }], + sliders: [{ + active: 0, + steps: slider_steps, + x: 0.1, + len: 0.9, + xanchor: "left", + y: 0, + yanchor: "top", + pad: {t: 50, b: 10}, + currentvalue: { + visible: true, + prefix: "Year:", + xanchor: "right", + font: { + size: 20, + color: "#666" + } + }, + transition: { + duration: 300, + easing: "cubic-in-out" + } + }] +}; + +Plotly.newPlot('myDiv', data, layout).then(function() { + Plotly.addFrames('myDiv', frames); + }); +}) diff --git a/content/plotly_js/animations/map-animations/map-animations-plotlyjs_index.html b/content/plotly_js/animations/map-animations/map-animations-plotlyjs_index.html new file mode 100644 index 00000000000..63a17107247 --- /dev/null +++ b/content/plotly_js/animations/map-animations/map-animations-plotlyjs_index.html @@ -0,0 +1,13 @@ +--- +name: Map Animation +permalink: javascript/map-animations/ +description: How to make an animated map with Plotly JS +layout: base +thumbnail: thumbnail/map-animation.gif +language: plotly_js +page_type: example_index +display_as: animations +order: 4 +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","map-animations" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/basic/WebGL/webgl_100000-points.html b/content/plotly_js/basic/WebGL/webgl_100000-points.html new file mode 100644 index 00000000000..d3056fa53db --- /dev/null +++ b/content/plotly_js/basic/WebGL/webgl_100000-points.html @@ -0,0 +1,40 @@ +--- +name: WebGL with 100,000 points +language: plotly_js +suite: webgl-vs-svg +order: 1 +sitemap: false +arrangement: horizontal +--- + +function gaussianRand() { + var rand = 0; + for (var i = 0; i < 6; i += 1) { + rand += Math.random(); + } + return (rand / 6)-0.5; +} + +var X = [], + Y = [], + n = 100000, + i; + +for (i = 0; i < n; i += 1) { + X.push(gaussianRand()); + Y.push(gaussianRand()); +} + +var data = [{ + type: "scattergl", + mode: "markers", + marker: { + line: { + width: 1, + color: '#404040'} + }, + x: X, + y: Y +}] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/basic/WebGL/webgl_1mill-points.html b/content/plotly_js/basic/WebGL/webgl_1mill-points.html new file mode 100644 index 00000000000..a28a12268fa --- /dev/null +++ b/content/plotly_js/basic/WebGL/webgl_1mill-points.html @@ -0,0 +1,41 @@ +--- +name: WebGL with 1 Million points +language: plotly_js +suite: webgl-vs-svg +order: 2 +sitemap: false +arrangement: horizontal +--- + +function gaussianRand() { + var rand = 0; + for (var i = 0; i < 6; i += 1) { + rand += Math.random(); + } + return (rand / 6)-0.5; +} + +var X = [], + Y = [], + n = 1000000, + i; + +for (i = 0; i < n; i += 1) { + X.push(gaussianRand()); + Y.push(gaussianRand()); +} + +var data = [{ + type: "scattergl", + mode: "markers", + marker: { + color : 'rgb(152, 0, 0)', + line: { + width: 1, + color: 'rgb(0,0,0)'} + }, + x: X, + y: Y +}] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/basic/WebGL/webgl_many-traces.html b/content/plotly_js/basic/WebGL/webgl_many-traces.html new file mode 100644 index 00000000000..74f908f827a --- /dev/null +++ b/content/plotly_js/basic/WebGL/webgl_many-traces.html @@ -0,0 +1,42 @@ +--- +name: WebGL with many traces +language: plotly_js +suite: webgl-vs-svg +order: 3 +sitemap: false +arrangement: horizontal +--- + +function gaussianRand() { + var rand = 0; + for (var i = 0; i < 6; i += 1) { + rand += Math.random(); + } + return (rand / 6)-0.5; +} + + +var start_value = 0, + stop_value = 1, + point_num = 5000, + trace_num = 10; +var curr_value = start_value; +var step = (stop_value - start_value) / (point_num - 1); + +var data = []; +for (var j = 0; j < trace_num; j++) { + var X = [], + Y = []; + for (var i = 0; i < point_num; i++) { + X.push(curr_value + (step * i)); + Y.push((gaussianRand()*8)+(j*5)); + } + data.push({ + type: "scattergl", + mode: "line", + x: X, + y: Y + }) +} +var layout = {showlegend: false} +Plotly.newPlot('myDiv', data = data, layout = layout) diff --git a/content/plotly_js/basic/WebGL/webgl_plotlyjs_index.html b/content/plotly_js/basic/WebGL/webgl_plotlyjs_index.html new file mode 100644 index 00000000000..2b4d888e251 --- /dev/null +++ b/content/plotly_js/basic/WebGL/webgl_plotlyjs_index.html @@ -0,0 +1,30 @@ +--- +description: Implement WebGL for increased speed, improved interactivity, and the + ability to plot even more data! +display_as: basic +language: plotly_js +layout: base +name: WebGL vs SVG +order: 14 +permalink: javascript/webgl-vs-svg/ +thumbnail: thumbnail/webgl.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","webgl-vs-svg"| sort: "order" %} +{% include posts/auto_examples.html examples=examples %} +
+

+ Multiple WebGL Contexts +

+

+Most browsers have a limit of between 8 and 16 WebGL contexts per page. A Plotly WebGL-based figure may use multiple WebGL contexts, but generally you'll be able to render between 4 and 8 figures on one page. + +If you exceed the browser limit on WebGL contexts, some figures won't render and you'll see an error. In the console in Chrome, for example, you'll see the error: "Too many active WebGL contexts. Oldest context will be lost". + +If you encounter WebGL context limits when using WebGL-based figures, you can use [Virtual WebGL](https://github.com/greggman/virtual-webgl), which virtualizes a single WebGL context into multiple contexts. + +To use it, add the following script on your page: +

<script src="https://unpkg.com/virtual-webgl@1.0.6/src/virtual-webgl.js"></script>
+

+
+ diff --git a/content/plotly_js/basic/area/area_plotly_js_index.html b/content/plotly_js/basic/area/area_plotly_js_index.html new file mode 100644 index 00000000000..9adfcb51438 --- /dev/null +++ b/content/plotly_js/basic/area/area_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make a D3.js-based filled area plot in javascript. An area chart + displays a solid color between the traces of a graph. +display_as: basic +language: plotly_js +layout: base +name: Filled Area Plots +order: 7 +permalink: javascript/filled-area-plots/ +redirect_from: javascript-graphing-library/filled-area-plots/ +thumbnail: thumbnail/area1.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","area" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/area/basic-area.html b/content/plotly_js/basic/area/basic-area.html new file mode 100644 index 00000000000..01c0f8b49dc --- /dev/null +++ b/content/plotly_js/basic/area/basic-area.html @@ -0,0 +1,25 @@ +--- +name: Basic Overlaid Area Chart +language: plotly_js +suite: area +order: 1 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3, 4], + y: [0, 2, 3, 5], + fill: 'tozeroy', + type: 'scatter' +}; + +var trace2 = { + x: [1, 2, 3, 4], + y: [3, 5, 1, 7], + fill: 'tonexty', + type: 'scatter' +}; + +var data = [trace1, trace2]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/area/filled-area-plotlyjs_index.html b/content/plotly_js/basic/area/filled-area-plotlyjs_index.html new file mode 100644 index 00000000000..0698468240a --- /dev/null +++ b/content/plotly_js/basic/area/filled-area-plotlyjs_index.html @@ -0,0 +1,13 @@ +--- +name: Filled-Area Animation +permalink: javascript/filled-area-animation/ +description: How to make an animated filled-area plot with Plotly JS +layout: base +thumbnail: thumbnail/apple_stock_animation.gif +language: plotly_js +page_type: example_index +display_as: animations +order: 3 +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","filled-area-animations" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/basic/area/hoveron.html b/content/plotly_js/basic/area/hoveron.html new file mode 100644 index 00000000000..2e55b664ed8 --- /dev/null +++ b/content/plotly_js/basic/area/hoveron.html @@ -0,0 +1,48 @@ +--- +name: Select Hover Points +language: plotly_js +suite: area +order: 3 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + x: [0,0.5,1,1.5,2], + y: [0,1,2,1,0], + fill: 'toself', + fillcolor: '#ab63fa', + hoveron: 'points+fills', + line: { + color: '#ab63fa' + }, + text: "Points + Fills", + hoverinfo: 'text' + }, + { + x: [3,3.5,4,4.5,5], + y: [0,1,2,1,0], + fill: 'toself', + fillcolor: '#e763fa', + hoveron: 'points', + line: { + color: '#e763fa' + }, + text: "Points only", + hoverinfo: 'text' + }] + +var layout = { + title: { + text: 'Hover on points or fill' + }, + xaxis: { + range: [0,5] + }, + yaxis: { + range: [0,3] + } +} + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/basic/area/normalized-stacked-area.html b/content/plotly_js/basic/area/normalized-stacked-area.html new file mode 100644 index 00000000000..7f221d8d290 --- /dev/null +++ b/content/plotly_js/basic/area/normalized-stacked-area.html @@ -0,0 +1,17 @@ +--- +name: Normalized Stacked Area Chart +language: plotly_js +suite: area +order: 2.1 +sitemap: false +arrangement: horizontal +--- +var plotDiv = document.getElementById('plot'); +var traces = [ + {x: [1,2,3], y: [2,1,4], stackgroup: 'one', groupnorm:'percent'}, + {x: [1,2,3], y: [1,1,2], stackgroup: 'one'}, + {x: [1,2,3], y: [3,0,2], stackgroup: 'one'} +]; + +Plotly.newPlot('myDiv', traces, {title: {text: 'Normalized stacked and filled line chart'}}); + diff --git a/content/plotly_js/basic/area/overlaid-area-char-without-boundary-lines.html b/content/plotly_js/basic/area/overlaid-area-char-without-boundary-lines.html new file mode 100644 index 00000000000..4a6ed4a5a02 --- /dev/null +++ b/content/plotly_js/basic/area/overlaid-area-char-without-boundary-lines.html @@ -0,0 +1,34 @@ +--- +name: Overlaid Area Chart Without Boundary Lines +language: plotly_js +suite: area +order: 2 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [0, 2, 3, 5], + fill: 'tozeroy', + type: 'scatter', + mode: 'none' +}; + +var trace2 = { + x: [1, 2, 3, 4], + y: [3, 5, 1, 7], + fill: 'tonexty', + type: 'scatter', + mode: 'none' +}; + +var layout = { + title: { + text: 'Overlaid Chart Without Boundary Lines' + } +}; + +var data = [trace1, trace2]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/area/stacked-area.html b/content/plotly_js/basic/area/stacked-area.html new file mode 100644 index 00000000000..22b2470ff47 --- /dev/null +++ b/content/plotly_js/basic/area/stacked-area.html @@ -0,0 +1,16 @@ +--- +name: Stacked Area Chart +language: plotly_js +suite: area +order: 2 +sitemap: false +arrangement: horizontal +--- +var plotDiv = document.getElementById('plot'); +var traces = [ + {x: [1,2,3], y: [2,1,4], stackgroup: 'one'}, + {x: [1,2,3], y: [1,1,2], stackgroup: 'one'}, + {x: [1,2,3], y: [3,0,2], stackgroup: 'one'} +]; + +Plotly.newPlot('myDiv', traces, {title: {text: 'stacked and filled line chart'}}); diff --git a/content/plotly_js/basic/bar/Rotated-bar-chart-labels.html b/content/plotly_js/basic/bar/Rotated-bar-chart-labels.html new file mode 100644 index 00000000000..29b7a059420 --- /dev/null +++ b/content/plotly_js/basic/bar/Rotated-bar-chart-labels.html @@ -0,0 +1,44 @@ +--- +name: Bar Chart with Rotated Labels +language: plotly_js +suite: bar +order: 6 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + 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], + type: 'bar', + name: 'Primary Product', + marker: { + color: 'rgb(49,130,189)', + opacity: 0.7, + } +}; + +var trace2 = { + 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], + type: 'bar', + name: 'Secondary Product', + marker: { + color: 'rgb(204,204,204)', + opacity: 0.5 + } +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: '2013 Sales Report' + }, + xaxis: { + tickangle: -45 + }, + barmode: 'group' +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bar/bar-base.html b/content/plotly_js/basic/bar/bar-base.html new file mode 100644 index 00000000000..658704ffdee --- /dev/null +++ b/content/plotly_js/basic/bar/bar-base.html @@ -0,0 +1,33 @@ +--- +name: Customizing Individual Bar Base +language: plotly_js +suite: bar +order: 8.5 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + type: 'bar', + x: ['2016','2017','2018'], + y: [500,600,700], + base: [-500,-600,-700], + hovertemplate: '%{base}', + marker: { + color: 'red' + }, + name: 'expenses' + }, + { + type: 'bar', + x: ['2016','2017','2018'], + y: [300,400,700], + base: 0, + marker: { + color: 'blue' + }, + name: 'revenue' + }] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/bar/bar-chart-with-hover-text.html b/content/plotly_js/basic/bar/bar-chart-with-hover-text.html new file mode 100644 index 00000000000..454b4930915 --- /dev/null +++ b/content/plotly_js/basic/bar/bar-chart-with-hover-text.html @@ -0,0 +1,40 @@ +--- +name: Bar Chart with Hover Text +language: plotly_js +suite: bar +order: 4 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: ['Liam', 'Sophie', 'Jacob', 'Mia', 'William', 'Olivia'], + y: [8.0, 8.0, 12.0, 12.0, 13.0, 20.0], + type: 'bar', + 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)' + } +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Number of Graphs Made this Week' + }, + font:{ + family: 'Raleway, sans-serif' + }, + showlegend: false, + xaxis: { + tickangle: -45 + }, + yaxis: { + zeroline: false, + gridwidth: 2 + }, + bargap :0.05 +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bar/bar-marker-array.html b/content/plotly_js/basic/bar/bar-marker-array.html new file mode 100644 index 00000000000..bf7b6bced0f --- /dev/null +++ b/content/plotly_js/basic/bar/bar-marker-array.html @@ -0,0 +1,26 @@ +--- +name: Customizing Individual Bar Colors +language: plotly_js +suite: bar +order: 7 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: ['Feature A', 'Feature B', 'Feature C', 'Feature D', 'Feature 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)'] + }, + type: 'bar' +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Least Used Feature' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bar/bar-widths.html b/content/plotly_js/basic/bar/bar-widths.html new file mode 100644 index 00000000000..248ba5cabf0 --- /dev/null +++ b/content/plotly_js/basic/bar/bar-widths.html @@ -0,0 +1,19 @@ +--- +name: Customizing Individual Bar Widths +language: plotly_js +suite: bar +order: 8 +sitemap: false +arrangement: horizontal +--- + +var trace0 = { + type: 'bar', + x: [1, 2, 3, 5.5, 10], + y: [10, 8, 6, 4, 2], + width: [0.8, 0.8, 0.8, 3.5, 4] +} + +var data = [trace0] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/bar/bar_plotly_js_index.html b/content/plotly_js/basic/bar/bar_plotly_js_index.html new file mode 100644 index 00000000000..80fa221364e --- /dev/null +++ b/content/plotly_js/basic/bar/bar_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make a D3.js-based bar chart in javascript. Seven examples of + grouped, stacked, overlaid, and colored bar charts. +display_as: basic +language: plotly_js +layout: base +name: Bar Charts +order: 3 +page_type: example_index +permalink: javascript/bar-charts/ +redirect_from: javascript-graphing-library/bar-charts/ +thumbnail: thumbnail/bar.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","bar" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/bar/barchart-direct-labels-grouped.html b/content/plotly_js/basic/bar/barchart-direct-labels-grouped.html new file mode 100644 index 00000000000..13aa38f57ac --- /dev/null +++ b/content/plotly_js/basic/bar/barchart-direct-labels-grouped.html @@ -0,0 +1,56 @@ +--- +name: Grouped Bar Chart with Direct Labels +language: plotly_js +suite: bar +order: 5.5 +sitemap: false +arrangement: horizontal +--- + +var xValue = ['Product A', 'Product B', 'Product C']; + +var yValue = [20, 14, 23]; +var yValue2 = [24, 16, 20]; + +var trace1 = { + x: xValue, + y: yValue, + type: 'bar', + text: yValue.map(String), + textposition: 'auto', + hoverinfo: 'none', + opacity: 0.5, + marker: { + color: 'rgb(158,202,225)', + line: { + color: 'rgb(8,48,107)', + width: 1.5 + } + } +}; + +var trace2 = { + x: xValue, + y: yValue2, + type: 'bar', + text: yValue2.map(String), + textposition: 'auto', + hoverinfo: 'none', + marker: { + color: 'rgba(58,200,225,.5)', + line: { + color: 'rgb(8,48,107)', + width: 1.5 + } + } +}; + +var data = [trace1,trace2]; + +var layout = { + title: { + text: 'January 2013 Sales Report' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bar/barchart-direct-labels.html b/content/plotly_js/basic/bar/barchart-direct-labels.html new file mode 100644 index 00000000000..adf00fe5ae3 --- /dev/null +++ b/content/plotly_js/basic/bar/barchart-direct-labels.html @@ -0,0 +1,40 @@ +--- +name: Bar Chart with Direct Labels +language: plotly_js +suite: bar +order: 5 +sitemap: false +arrangement: horizontal +--- + +var xValue = ['Product A', 'Product B', 'Product C']; + +var yValue = [20, 14, 23]; + +var trace1 = { + x: xValue, + y: yValue, + type: 'bar', + text: yValue.map(String), + textposition: 'auto', + hoverinfo: 'none', + marker: { + color: 'rgb(158,202,225)', + opacity: 0.6, + line: { + color: 'rgb(8,48,107)', + width: 1.5 + } + } +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'January 2013 Sales Report' + }, + barmode: 'stack' +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bar/barmode-relative.html b/content/plotly_js/basic/bar/barmode-relative.html new file mode 100644 index 00000000000..9ecbe396ea5 --- /dev/null +++ b/content/plotly_js/basic/bar/barmode-relative.html @@ -0,0 +1,54 @@ +--- +name: Bar Chart with Relative Barmode +language: plotly_js +suite: bar +order: 11 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [1, 4, 9, 16], + name: 'Trace1', + type: 'bar' +}; +var trace2 = { + x: [1, 2, 3, 4], + y: [6, -8, -4.5, 8], + name: 'Trace2', + type: 'bar' +}; +var trace3 = { + x: [1, 2, 3, 4], + y: [-15, -3, 4.5, -8], + name: 'Trace3', + type: 'bar' + } + + var trace4 = { + x: [1, 2, 3, 4], + y: [-1, 3, -3, -4], + name: 'Trace4', + type: 'bar' + } + +var data = [trace1, trace2, trace3, trace4]; +var layout = { + xaxis: { + title: { + text: 'X axis' + } + }, + yaxis: { + title: { + text: 'Y axis' + } + }, + barmode: 'relative', + title: { + text: 'Relative Barmode' + } +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/basic/bar/basic-bar.html b/content/plotly_js/basic/bar/basic-bar.html new file mode 100644 index 00000000000..061b1c03d95 --- /dev/null +++ b/content/plotly_js/basic/bar/basic-bar.html @@ -0,0 +1,17 @@ +--- +name: Basic Bar Chart +language: plotly_js +suite: bar +order: 1 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: ['giraffes', 'orangutans', 'monkeys'], + y: [20, 14, 23], + type: 'bar' + } +]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/bar/colored-and-styled-bar-chart.html b/content/plotly_js/basic/bar/colored-and-styled-bar-chart.html new file mode 100644 index 00000000000..6cf80fb4b10 --- /dev/null +++ b/content/plotly_js/basic/bar/colored-and-styled-bar-chart.html @@ -0,0 +1,60 @@ +--- +name: Colored and Styled Bar Chart +language: plotly_js +suite: bar +order: 9 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 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)'}, + type: 'bar' +}; + +var trace2 = { + x: [1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 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)'}, + type: 'bar' +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'US Export of Plastic Scrap' + }, + xaxis: {tickfont: { + size: 14, + color: 'rgb(107, 107, 107)' + }}, + yaxis: { + title: { + text: 'USD (millions)', + font: { + size: 16, + color: 'rgb(107, 107, 107)' + } + }, + tickfont: { + size: 14, + color: 'rgb(107, 107, 107)' + } + }, + legend: { + 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 +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bar/grouped-bar.html b/content/plotly_js/basic/bar/grouped-bar.html new file mode 100644 index 00000000000..c9a5d164d82 --- /dev/null +++ b/content/plotly_js/basic/bar/grouped-bar.html @@ -0,0 +1,27 @@ +--- +name: Grouped Bar Chart +language: plotly_js +suite: bar +order: 2 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: ['giraffes', 'orangutans', 'monkeys'], + y: [20, 14, 23], + name: 'SF Zoo', + type: 'bar' +}; + +var trace2 = { + x: ['giraffes', 'orangutans', 'monkeys'], + y: [12, 18, 29], + name: 'LA Zoo', + type: 'bar' +}; + +var data = [trace1, trace2]; + +var layout = {barmode: 'group'}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bar/rounded-bars.html b/content/plotly_js/basic/bar/rounded-bars.html new file mode 100644 index 00000000000..d4d95b0600b --- /dev/null +++ b/content/plotly_js/basic/bar/rounded-bars.html @@ -0,0 +1,56 @@ +--- +name: Rounded Corners on Bars +language: plotly_js +suite: bar +order: 9 +sitemap: false +arrangement: horizontal +markdown_content: | + To create rounded corners on bars, set `barcornerradius` on the layout to a number of pixels, or a string with a percentage of the bar width, for example, 25%. + You can also configure traces individually with `marker.cornerradius` on the trace. +--- + +var trace1 = { + x: ['South Korea', 'China', 'Canada'], + y: [24, 10, 9], + name: 'Gold', + type: 'bar', +}; + +var trace2 = { + x: ['South Korea', 'China', 'Canada'], + y: [13, 15, 12], + name: 'Silver', + type: 'bar', +}; + +var trace3 = { + x: ['South Korea', 'China', 'Canada'], + y: [11, 8, 12], + name: 'Bronze', + type: 'bar', +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + scattermode: 'group', + title: { + text: 'Grouped by Country' + }, + xaxis: { + title: { + text: 'Country' + } + }, + yaxis: { + title: { + text: 'Medals' + } + }, + barcornerradius: 15, +}; + +Plotly.newPlot('myDiv', data, layout); + + diff --git a/content/plotly_js/basic/bar/stacked-bar.html b/content/plotly_js/basic/bar/stacked-bar.html new file mode 100644 index 00000000000..a3d1fafcad2 --- /dev/null +++ b/content/plotly_js/basic/bar/stacked-bar.html @@ -0,0 +1,27 @@ +--- +name: Stacked Bar Chart +language: plotly_js +suite: bar +order: 3 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: ['giraffes', 'orangutans', 'monkeys'], + y: [20, 14, 23], + name: 'SF Zoo', + type: 'bar' +}; + +var trace2 = { + x: ['giraffes', 'orangutans', 'monkeys'], + y: [12, 18, 29], + name: 'LA Zoo', + type: 'bar' +}; + +var data = [trace1, trace2]; + +var layout = {barmode: 'stack'}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bar/waterfall-bar-chart.html b/content/plotly_js/basic/bar/waterfall-bar-chart.html new file mode 100644 index 00000000000..886a9c4dc90 --- /dev/null +++ b/content/plotly_js/basic/bar/waterfall-bar-chart.html @@ -0,0 +1,107 @@ +--- +name: Waterfall Bar Chart +language: plotly_js +suite: bar +order: 10 +sitemap: false +arrangement: horizontal +--- + +// Base + +var xData = ['Product
Revenue', 'Services
Revenue', + 'Total
Revenue', 'Fixed
Costs', + 'Variable
Costs', 'Total
Costs', 'Total' +]; + +var yData = [400, 660, 660, 590, 400, 400, 340]; + +var textList = ['$430K', '$260K', '$690K', '$-120K', '$-200K', '$-320K', '$370K']; + +//Base + +var trace1 = { + x: xData, + y: [0, 430, 0, 570, 370, 370, 0], + marker: { + color: 'rgba(1,1,1,0.0)' + }, + type: 'bar' +}; + +//Revenue + +var trace2 = { + x: xData, + y: [430, 260, 690, 0, 0, 0, 0], + type: 'bar', + marker: { + color: 'rgba(55,128,191,0.7)', + line: { + color: 'rgba(55,128,191,1.0)', + width: 2 + } + } +}; + +//Cost + +var trace3 = { + x: xData, + y: [0, 0, 0, 120, 200, 320, 0], + type: 'bar', + marker: { + color: 'rgba(219, 64, 82, 0.7)', + line: { + color: 'rgba(219, 64, 82, 1.0)', + width: 2 + } + } +}; + +//Profit + +var trace4 = { + x: xData, + y: [0, 0, 0, 0, 0, 0, 370], + type: 'bar', + marker: { + color: 'rgba(50,171, 96, 0.7)', + line: { + color: 'rgba(50,171,96,1.0)', + width: 2 + } + } +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + title: { + text: '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, + annotations: [] +}; + +for ( var i = 0 ; i < 7 ; i++ ) { + var result = { + x: xData[i], + y: yData[i], + text: textList[i], + font: { + family: 'Arial', + size: 14, + color: 'rgba(245,246,249,1)' + }, + showarrow: false + }; + layout.annotations.push(result); +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bubble/bubble_plotly_js_index.html b/content/plotly_js/basic/bubble/bubble_plotly_js_index.html new file mode 100644 index 00000000000..7859a8cf6e3 --- /dev/null +++ b/content/plotly_js/basic/bubble/bubble_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make a D3.js-based bubble chart in javascript. Examples of scatter + charts whose markers have variable color, size, and symbols. +display_as: basic +language: plotly_js +layout: base +name: Bubble Charts +order: 5 +page_type: example_index +permalink: javascript/bubble-charts/ +redirect_from: javascript-graphing-library/bubble-charts/ +thumbnail: thumbnail/bubble.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","bubble" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/bubble/bubblechart.html b/content/plotly_js/basic/bubble/bubblechart.html new file mode 100644 index 00000000000..9cbb99505ff --- /dev/null +++ b/content/plotly_js/basic/bubble/bubblechart.html @@ -0,0 +1,52 @@ +--- +name: Marker Size, Color, and Symbol as an Array +language: plotly_js +suite: bubble +order: 5 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 11, 12, 13], + mode: 'markers', + marker: { + color: ['hsl(0,100,40)', 'hsl(33,100,40)', 'hsl(66,100,40)', 'hsl(99,100,40)'], + size: [12, 22, 32, 42], + opacity: [0.6, 0.7, 0.8, 0.9] + }, + type: 'scatter' +}; + +var trace2 = { + x: [1, 2, 3, 4], + y: [11, 12, 13, 14], + mode: 'markers', + marker: { + color: 'rgb(31, 119, 180)', + size: 18, + symbol: ['circle', 'square', 'diamond', 'cross'] + }, + type: 'scatter' +}; + +var trace3 = { + x: [1, 2, 3, 4], + y: [12, 13, 14, 15], + mode: 'markers', + marker: { + size: 18, + line: { + color: ['rgb(120,120,120)', 'rgb(120,120,120)', 'red', 'rgb(120,120,120)'], + width: [2, 2, 6, 2] + } + }, + type: 'scatter' +}; + +var data = [trace1, trace2, trace3]; + +var layout = {showlegend: false}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bubble/hover-text-bubblechart.html b/content/plotly_js/basic/bubble/hover-text-bubblechart.html new file mode 100644 index 00000000000..e9b1dce152e --- /dev/null +++ b/content/plotly_js/basic/bubble/hover-text-bubblechart.html @@ -0,0 +1,32 @@ +--- +name: Hover Text on Bubble Charts +language: plotly_js +suite: bubble +order: 2 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 11, 12, 13], + text: ['A
size: 40', 'B
size: 60', 'C
size: 80', 'D
size: 100'], + mode: 'markers', + marker: { + color: ['rgb(93, 164, 214)', 'rgb(255, 144, 14)', 'rgb(44, 160, 101)', 'rgb(255, 65, 54)'], + size: [40, 60, 80, 100] + } +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Bubble Chart Hover Text' + }, + showlegend: false, + height: 600, + width: 600 +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bubble/marker-size-and-color.html b/content/plotly_js/basic/bubble/marker-size-and-color.html new file mode 100644 index 00000000000..a14498624fe --- /dev/null +++ b/content/plotly_js/basic/bubble/marker-size-and-color.html @@ -0,0 +1,32 @@ +--- +name: Marker Size and Color on Bubble Charts +language: plotly_js +suite: bubble +order: 2 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 11, 12, 13], + mode: 'markers', + marker: { + color: ['rgb(93, 164, 214)', 'rgb(255, 144, 14)', 'rgb(44, 160, 101)', 'rgb(255, 65, 54)'], + opacity: [1, 0.8, 0.6, 0.4], + size: [40, 60, 80, 100] + } +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Marker Size and Color' + }, + showlegend: false, + height: 600, + width: 600 +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bubble/markersize-bubblechart.html b/content/plotly_js/basic/bubble/markersize-bubblechart.html new file mode 100644 index 00000000000..7c782c21a3c --- /dev/null +++ b/content/plotly_js/basic/bubble/markersize-bubblechart.html @@ -0,0 +1,30 @@ +--- +name: Marker Size on Bubble Charts +language: plotly_js +suite: bubble +order: 1 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 11, 12, 13], + mode: 'markers', + marker: { + size: [40, 60, 80, 100] + } +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Marker Size' + }, + showlegend: false, + height: 600, + width: 600 +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/bubble/size-scaling-bubblechart.html b/content/plotly_js/basic/bubble/size-scaling-bubblechart.html new file mode 100644 index 00000000000..a9379ce5d90 --- /dev/null +++ b/content/plotly_js/basic/bubble/size-scaling-bubblechart.html @@ -0,0 +1,77 @@ +--- +name: Bubble Size Scaling on Charts +language: plotly_js +suite: bubble +order: 4 +sitemap: false +arrangement: horizontal +--- +// To scale the bubble size, use the attribute sizeref. We recommend using the following formula to calculate a sizeref value: +// sizeref = 2.0 * Math.max(...size) / (desired_maximum_marker_size**2) +// Note that setting 'sizeref' to a value greater than 1, decreases the rendered marker sizes, while setting 'sizeref' to less than 1, increases the rendered marker sizes. See https://plotly.com/python/reference/scatter/#scatter-marker-sizeref for more information. Additionally, we recommend setting the sizemode attribute: https://plotly.com/python/reference/scatter/#scatter-marker-sizemode to area. + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 11, 12, 13], + text: ['A
size: 40', 'B
size: 60', 'C
size: 80', 'D
size: 100'], + mode: 'markers', + marker: { + size: [400, 600, 800, 1000], + sizemode: 'area' + } +}; + +var trace2 = { + x: [1, 2, 3, 4], + y: [14, 15, 16, 17], + text: ['A
size: 40
sixeref: 0.2', 'B
size: 60
sixeref: 0.2', 'C
size: 80
sixeref: 0.2', 'D
size: 100
sixeref: 0.2'], + mode: 'markers', + marker: { + size: [400, 600, 800, 1000], + //setting 'sizeref' to lower than 1 decreases the rendered size + sizeref: 2, + sizemode: 'area' + } +}; + +var trace3 = { + x: [1, 2, 3, 4], + y: [20, 21, 22, 23], + text: ['A
size: 40
sixeref: 2', 'B
size: 60
sixeref: 2', 'C
size: 80
sixeref: 2', 'D
size: 100
sixeref: 2'], + mode: 'markers', + marker: { + size: [400, 600, 800, 1000], + //setting 'sizeref' to less than 1, increases the rendered marker sizes + sizeref: 0.2, + sizemode: 'area' + } +}; + +// sizeref using above formula +var desired_maximum_marker_size = 40; +var size = [400, 600, 800, 1000]; +var trace4 = { + x: [1, 2, 3, 4], + y: [26, 27, 28, 29], + text: ['A
size: 40
sixeref: 1.25', 'B
size: 60
sixeref: 1.25', 'C
size: 80
sixeref: 1.25', 'D
size: 100
sixeref: 1.25'], + mode: 'markers', + marker: { + size: size, + //set 'sizeref' to an 'ideal' size given by the formula sizeref = 2. * max(array_of_size_values) / (desired_maximum_marker_size ** 2) + sizeref: 2.0 * Math.max(...size) / (desired_maximum_marker_size**2), + sizemode: 'area' + } +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + title: { + text: 'Size Scaling in Bubble Charts' + }, + showlegend: false, + height: 600, + width: 600 +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/dot/categorical-dot-plot.html b/content/plotly_js/basic/dot/categorical-dot-plot.html new file mode 100644 index 00000000000..6e3f8e3d08b --- /dev/null +++ b/content/plotly_js/basic/dot/categorical-dot-plot.html @@ -0,0 +1,91 @@ +--- +name: Categorical Dot Plot +language: plotly_js +suite: dot +order: 1 +sitemap: false +arrangement: horizontal +--- +var country = ['Switzerland (2011)', 'Chile (2013)', 'Japan (2014)', 'United States (2012)', 'Slovenia (2014)', 'Canada (2011)', 'Poland (2010)', 'Estonia (2015)', 'Luxembourg (2013)', 'Portugal (2011)']; + +var votingPop = [40, 45.7, 52, 53.6, 54.1, 54.2, 54.5, 54.7, 55.1, 56.6]; + +var regVoters = [49.1, 42, 52.7, 84.3, 51.7, 61.1, 55.3, 64.2, 91.1, 58.9]; + +var trace1 = { + type: 'scatter', + x: votingPop, + y: country, + mode: 'markers', + name: 'Percent of estimated voting age population', + marker: { + color: 'rgba(156, 165, 196, 0.95)', + line: { + color: 'rgba(156, 165, 196, 1.0)', + width: 1, + }, + symbol: 'circle', + size: 16 + } +}; + +var trace2 = { + x: regVoters, + y: country, + mode: 'markers', + name: 'Percent of estimated registered voters', + marker: { + color: 'rgba(204, 204, 204, 0.95)', + line: { + color: 'rgba(217, 217, 217, 1.0)', + width: 1, + }, + symbol: 'circle', + size: 16 + } +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'Votes cast for ten lowest voting age population in OECD countries', + font: { + color: 'rgb(204, 204, 204)' + } + }, + xaxis: { + showgrid: false, + showline: true, + linecolor: 'rgb(102, 102, 102)', + tickfont: { + font: { + color: 'rgb(102, 102, 102)' + } + }, + tickmode: 'linear', + dtick: 10, + ticks: 'outside', + tickcolor: 'rgb(102, 102, 102)' + }, + margin: { + l: 140, + r: 40, + b: 50, + t: 80 + }, + legend: { + font: { + size: 10, + }, + yanchor: 'middle', + xanchor: 'right' + }, + width: 600, + height: 600, + paper_bgcolor: 'rgb(254, 247, 234)', + plot_bgcolor: 'rgb(254, 247, 234)', + hovermode: 'closest' +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/dot/dot_plotly_js_index.html b/content/plotly_js/basic/dot/dot_plotly_js_index.html new file mode 100644 index 00000000000..fb45f9c94ed --- /dev/null +++ b/content/plotly_js/basic/dot/dot_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make D3.js-based dot plots in JavaScript. Example of a styled, + categorical dot plot. +display_as: basic +language: plotly_js +layout: base +name: Dot Plots +order: 6 +permalink: javascript/dot-plots/ +thumbnail: thumbnail/dot-plot.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","dot" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/horizontal-bar/barchart-with-line-plot.html b/content/plotly_js/basic/horizontal-bar/barchart-with-line-plot.html new file mode 100644 index 00000000000..45115cfbf52 --- /dev/null +++ b/content/plotly_js/basic/horizontal-bar/barchart-with-line-plot.html @@ -0,0 +1,136 @@ +--- +name: Bar Chart with Line Plot +language: plotly_js +suite: horizontal-bar +order: 4 +sitemap: false +arrangement: horizontal +--- +var xSavings = [1.3586, 2.2623000000000002, 4.9821999999999997, 6.5096999999999996, + 7.4812000000000003, 7.5133000000000001, 15.2148, 17.520499999999998 +]; + +var xNetworth = [93453.919999999998, 81666.570000000007, 69889.619999999995, 78381.529999999999, 141395.29999999999, 92969.020000000004, 66090.179999999993, 122379.3]; + +var ySavings = ['Japan', 'United Kingdom', 'Canada', 'Netherlands', 'United States', 'Belgium', 'Sweden', 'Switzerland']; + +var yNetworth = ['Japan', 'United Kingdom', 'Canada', 'Netherlands', 'United States', 'Belgium', 'Sweden', 'Switzerland']; + +var trace1 = { + x: xSavings, + y: ySavings, + xaxis: 'x1', + yaxis: 'y1', + type: 'bar', + marker: { + color: 'rgba(50,171,96,0.6)', + line: { + color: 'rgba(50,171,96,1.0)', + width: 1 + } + }, + name: 'Household savings, percentage of household disposable income', + orientation: 'h' +}; + +var trace2 = { + x: xNetworth, + y: yNetworth, + xaxis: 'x2', + yaxis: 'y1', + mode: 'lines+markers', + line: { + color: 'rgb(128,0,128)' + }, + name: 'Household net worth, Million USD/capita' +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'Household Savings & Net Worth for Eight OECD Countries' + }, + xaxis1: { + range: [0, 20], + domain: [0, 0.5], + zeroline: false, + showline: false, + showticklabels: true, + showgrid: true + }, + xaxis2: { + range: [25000, 150000], + domain: [0.5, 1], + zeroline: false, + showline: false, + showticklabels: true, + showgrid: true, + side: 'top', + dtick: 25000 + }, + legend: { + x: 0.029, + y: 1.238, + font: { + size: 10 + } + }, + margin: { + l: 100, + r: 20, + t: 200, + b: 70 + }, + width: 600, + height: 600, + paper_bgcolor: 'rgb(248,248,255)', + plot_bgcolor: 'rgb(248,248,255)', + annotations: [ + { + xref: 'paper', + yref: 'paper', + x: -0.2, + y: -0.109, + text: 'OECD ' + '(2015), Household savings (indicator), ' + 'Household net worth (indicator). doi: ' + '10.1787/cfc6f499-en (Accessed on 05 June 2015)', + showarrow: false, + font:{ + family: 'Arial', + size: 10, + color: 'rgb(150,150,150)' + } + } + ] +}; + +for ( var i = 0 ; i < xSavings.length ; i++ ) { + var result = { + xref: 'x1', + yref: 'y1', + x: xSavings[i]+2.3, + y: ySavings[i], + text: xSavings[i] + '%', + font: { + family: 'Arial', + size: 12, + color: 'rgb(50, 171, 96)' + }, + showarrow: false, + }; + var result2 = { + xref: 'x2', + yref: 'y1', + x: xNetworth[i] - 20000, + y: yNetworth[i], + text: xNetworth[i] + ' M', + font: { + family: 'Arial', + size: 12, + color: 'rgb(128, 0, 128)' + }, + showarrow: false + }; + layout.annotations.push(result, result2); +} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/horizontal-bar/basic-horizontal-bar.html b/content/plotly_js/basic/horizontal-bar/basic-horizontal-bar.html new file mode 100644 index 00000000000..081464988af --- /dev/null +++ b/content/plotly_js/basic/horizontal-bar/basic-horizontal-bar.html @@ -0,0 +1,17 @@ +--- +name: Basic Horizontal Bar Chart +language: plotly_js +suite: horizontal-bar +order: 0 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + type: 'bar', + x: [20, 14, 23], + y: ['giraffes', 'orangutans', 'monkeys'], + orientation: 'h' +}]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/horizontal-bar/colored-bar-chart.html b/content/plotly_js/basic/horizontal-bar/colored-bar-chart.html new file mode 100644 index 00000000000..df1e1be7b59 --- /dev/null +++ b/content/plotly_js/basic/horizontal-bar/colored-bar-chart.html @@ -0,0 +1,43 @@ +--- +name: Colored Bar Chart +language: plotly_js +suite: horizontal-bar +order: 1 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [20, 14, 23], + y: ['giraffes', 'orangutans', 'monkeys'], + name: 'SF Zoo', + orientation: 'h', + marker: { + color: 'rgba(55,128,191,0.6)', + width: 1 + }, + type: 'bar' +}; + +var trace2 = { + x: [12, 18, 29], + y: ['giraffes', 'orangutans', 'monkeys'], + name: 'LA Zoo', + orientation: 'h', + type: 'bar', + marker: { + color: 'rgba(255,153,51,0.6)', + width: 1 + } +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'Colored Bar Chart' + }, + barmode: 'stack' +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/horizontal-bar/horizontal_bar_plotlyjs_index.html b/content/plotly_js/basic/horizontal-bar/horizontal_bar_plotlyjs_index.html new file mode 100644 index 00000000000..7f3c77a1196 --- /dev/null +++ b/content/plotly_js/basic/horizontal-bar/horizontal_bar_plotlyjs_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a D3.js-based hortizontal bar chart in JavaScript. +display_as: basic +language: plotly_js +layout: base +name: Horizontal Bar Charts +order: 8 +permalink: javascript/horizontal-bar-charts/ +redirect_from: javascript-graphing-library/horizontal-bar-charts/ +thumbnail: thumbnail/horizontal-bar.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","horizontal-bar" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/line-plots/Connect-gaps-between-data.html b/content/plotly_js/basic/line-plots/Connect-gaps-between-data.html new file mode 100644 index 00000000000..50f3f582cdc --- /dev/null +++ b/content/plotly_js/basic/line-plots/Connect-gaps-between-data.html @@ -0,0 +1,33 @@ +--- +name: Connect Gaps Between Data +language: plotly_js +suite: line-plots +order: 12 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4, 5, 6, 7, 8], + y: [10, 15, null, 17, 14, 12, 10, null, 15], + mode: 'lines+markers', + connectgaps: true +}; + +var trace2 = { + x: [1, 2, 3, 4, 5, 6, 7, 8], + y: [16, null, 13, 10, 8, null, 11, 12], + mode: 'lines', + connectgaps: true +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'Connect the Gaps Between Data' + }, + showlegend: false +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line-plots/adding-names-to-line-and-scatter-plot.html b/content/plotly_js/basic/line-plots/adding-names-to-line-and-scatter-plot.html new file mode 100644 index 00000000000..43ef838fad0 --- /dev/null +++ b/content/plotly_js/basic/line-plots/adding-names-to-line-and-scatter-plot.html @@ -0,0 +1,37 @@ +--- +name: Adding Names to Line and Scatter Plot +language: plotly_js +suite: line-plots +order: 5 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + mode: 'markers', + name: 'Scatter' +}; + +var trace2 = { + x: [2, 3, 4, 5], + y: [16, 5, 11, 9], + mode: 'lines', + name: 'Lines' +}; + +var trace3 = { + x: [1, 2, 3, 4], + y: [12, 9, 15, 12], + mode: 'lines+markers', + name: 'Scatter + Lines' +}; + +var data = [ trace1, trace2, trace3 ]; + +var layout = { + title: {text: 'Adding Names to Line and Scatter Plot'} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line-plots/basic-line.html b/content/plotly_js/basic/line-plots/basic-line.html new file mode 100644 index 00000000000..fc430cbf200 --- /dev/null +++ b/content/plotly_js/basic/line-plots/basic-line.html @@ -0,0 +1,23 @@ +--- +name: Basic Line Plot +language: plotly_js +suite: line-plots +order: 1 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + type: 'scatter' +}; + +var trace2 = { + x: [1, 2, 3, 4], + y: [16, 5, 11, 9], + type: 'scatter' +}; + +var data = [trace1, trace2]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/line-plots/graph-and-axis-titles.html b/content/plotly_js/basic/line-plots/graph-and-axis-titles.html new file mode 100644 index 00000000000..092c9771b28 --- /dev/null +++ b/content/plotly_js/basic/line-plots/graph-and-axis-titles.html @@ -0,0 +1,49 @@ +--- +name: Graph and Axes Titles +language: plotly_js +suite: line-plots +order: 9 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + mode: 'markers', + name: 'Scatter' +}; + +var trace2 = { + x: [2, 3, 4, 5], + y: [16, 5, 11, 9], + mode: 'lines', + name: 'Lines' +}; + +var trace3 = { + x: [1, 2, 3, 4], + y: [12, 9, 15, 12], + mode: 'lines+markers', + name: 'Scatter and Lines' +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + title: { + text: 'Title of the Graph' + }, + xaxis: { + title: { + text: 'x-axis title' + } + }, + yaxis: { + title: { + text: 'y-axis title' + } + } +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/basic/line-plots/labelling-with-annotations.html b/content/plotly_js/basic/line-plots/labelling-with-annotations.html new file mode 100644 index 00000000000..03da9ccd6a6 --- /dev/null +++ b/content/plotly_js/basic/line-plots/labelling-with-annotations.html @@ -0,0 +1,158 @@ +--- +name: Labelling Lines with Annotations +language: plotly_js +suite: line-plots +order: 13 +sitemap: false +arrangement: horizontal +--- +var xData = [ + [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013], + [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013], + [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013], + [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013] +]; + +var yData = [ + [74, 82, 80, 74, 73, 72, 74, 70, 70, 66, 66, 69], + [45, 42, 50, 46, 36, 36, 34, 35, 32, 31, 31, 28], + [13, 14, 20, 24, 20, 24, 24, 40, 35, 41, 43, 50], + [18, 21, 18, 21, 16, 14, 13, 18, 17, 16, 19, 23] +]; + +var colors = ['rgba(67,67,67,1)', 'rgba(115,115,115,1)', 'rgba(49,130,189, 1)', + 'rgba(189,189,189,1)' +]; + +var lineSize = [2, 2, 4, 2]; + +var labels = ['Television', 'Newspaper', 'Internet', 'Radio']; + +var data = []; + +for ( var i = 0 ; i < xData.length ; i++ ) { + var result = { + x: xData[i], + y: yData[i], + type: 'scatter', + mode: 'lines', + line: { + color: colors[i], + width: lineSize[i] + } + }; + var result2 = { + x: [xData[i][0], xData[i][11]], + y: [yData[i][0], yData[i][11]], + type: 'scatter', + mode: 'markers', + marker: { + color: colors[i], + size: 12 + } + }; + data.push(result, result2); +} + +var layout = { + showlegend: false, + height: 600, + width: 600, + xaxis: { + showline: true, + showgrid: false, + showticklabels: true, + linecolor: 'rgb(204,204,204)', + linewidth: 2, + tickmode: 'linear', + ticks: 'outside', + tickcolor: 'rgb(204,204,204)', + tickwidth: 2, + ticklen: 5, + tickfont: { + family: 'Arial', + size: 12, + color: 'rgb(82, 82, 82)' + } + }, + yaxis: { + showgrid: false, + zeroline: false, + showline: false, + showticklabels: false + }, + autosize: false, + margin: { + autoexpand: false, + l: 100, + r: 20, + t: 100 + }, + annotations: [ + { + xref: 'paper', + yref: 'paper', + x: 0.0, + y: 1.05, + xanchor: 'left', + yanchor: 'bottom', + text: 'Main Source for News', + font:{ + family: 'Arial', + size: 30, + color: 'rgb(37,37,37)' + }, + showarrow: false + }, + { + xref: 'paper', + yref: 'paper', + x: 0.5, + y: -0.1, + xanchor: 'center', + yanchor: 'top', + text: 'Source: Pew Research Center & Storytelling with data', + showarrow: false, + font: { + family: 'Arial', + size: 12, + color: 'rgb(150,150,150)' + } + } + ] +}; + +for( var i = 0 ; i < xData.length ; i++ ) { + var result = { + xref: 'paper', + x: 0.05, + y: yData[i][0], + xanchor: 'right', + yanchor: 'middle', + text: labels[i] + ' ' + yData[i][0] +'%', + showarrow: false, + font: { + family: 'Arial', + size: 16, + color: 'black' + } + }; + var result2 = { + xref: 'paper', + x: 0.95, + y: yData[i][11], + xanchor: 'left', + yanchor: 'middle', + text: yData[i][11] +'%', + font: { + family: 'Arial', + size: 16, + color: 'black' + }, + showarrow: false + }; + + layout.annotations.push(result, result2); +} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line-plots/line-and-scatter-plot.html b/content/plotly_js/basic/line-plots/line-and-scatter-plot.html new file mode 100644 index 00000000000..628cfd29ae2 --- /dev/null +++ b/content/plotly_js/basic/line-plots/line-and-scatter-plot.html @@ -0,0 +1,34 @@ +--- +name: Line and Scatter Plot +language: plotly_js +suite: line-plots +order: 4 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + mode: 'markers' +}; + +var trace2 = { + x: [2, 3, 4, 5], + y: [16, 5, 11, 9], + mode: 'lines' +}; + +var trace3 = { + x: [1, 2, 3, 4], + y: [12, 9, 15, 12], + mode: 'lines+markers' +}; + +var data = [ trace1, trace2, trace3 ]; + +var layout = { + title: {text: 'Line and Scatter Plot'} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line-plots/line-and-scatter-styling.html b/content/plotly_js/basic/line-plots/line-and-scatter-styling.html new file mode 100644 index 00000000000..d7d6b300e60 --- /dev/null +++ b/content/plotly_js/basic/line-plots/line-and-scatter-styling.html @@ -0,0 +1,52 @@ +--- +name: Line and Scatter Styling +language: plotly_js +suite: line-plots +order: 6 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + mode: 'markers', + marker: { + color: 'rgb(219, 64, 82)', + size: 12 + } +}; + +var trace2 = { + x: [2, 3, 4, 5], + y: [16, 5, 11, 9], + mode: 'lines', + line: { + color: 'rgb(55, 128, 191)', + width: 3 + } +}; + +var trace3 = { + x: [1, 2, 3, 4], + y: [12, 9, 15, 12], + mode: 'lines+markers', + marker: { + color: 'rgb(128, 0, 128)', + size: 8 + }, + line: { + color: 'rgb(128, 0, 128)', + width: 1 + } +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + title: { + text: 'Line and Scatter Styling' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line-plots/line-dash.html b/content/plotly_js/basic/line-plots/line-dash.html new file mode 100644 index 00000000000..4c2eac39b95 --- /dev/null +++ b/content/plotly_js/basic/line-plots/line-dash.html @@ -0,0 +1,77 @@ +--- +name: Line Dash +language: plotly_js +suite: line-plots +order: 10 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3, 4, 5], + y: [1, 3, 2, 3, 1], + mode: 'lines', + name: 'Solid', + line: { + dash: 'solid', + width: 4 + } +}; + +var trace2 = { + x: [1, 2, 3, 4, 5], + y: [6, 8, 7, 8, 6], + mode: 'lines', + name: 'dashdot', + line: { + dash: 'dashdot', + width: 4 + } +}; + +var trace3 = { + x: [1, 2, 3, 4, 5], + y: [11, 13, 12, 13, 11], + mode: 'lines', + name: 'Solid', + line: { + dash: 'solid', + width: 4 + } +}; + +var trace4 = { + x: [1, 2, 3, 4, 5], + y: [16, 18, 17, 18, 16], + mode: 'lines', + name: 'dot', + line: { + dash: 'dot', + width: 4 + } +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + title: { + text: 'Line Dash' + }, + xaxis: { + range: [0.75, 5.25], + autorange: false + }, + yaxis: { + range: [0, 18.5], + autorange: false + }, + legend: { + y: 0.5, + traceorder: 'reversed', + font: { + size: 16 + } + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line-plots/line-plots-index.html b/content/plotly_js/basic/line-plots/line-plots-index.html new file mode 100644 index 00000000000..8da3cd95ef1 --- /dev/null +++ b/content/plotly_js/basic/line-plots/line-plots-index.html @@ -0,0 +1,15 @@ +--- +description: How to make D3.js-based line charts in JavaScript. +display_as: basic +language: plotly_js +layout: base +name: Line Charts +order: 2 +page_type: example_index +permalink: javascript/line-charts/ +redirect_from: javascript-graphing-library/line-charts/ +thumbnail: thumbnail/line-plots.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","line-plots" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/line-plots/line-shapes.html b/content/plotly_js/basic/line-plots/line-shapes.html new file mode 100644 index 00000000000..6eab4faad2a --- /dev/null +++ b/content/plotly_js/basic/line-plots/line-shapes.html @@ -0,0 +1,74 @@ +--- +name: Line Shape Options for Interpolation +language: plotly_js +suite: line-plots +order: 8 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3, 4, 5], + y: [1, 3, 2, 3, 1], + mode: 'lines+markers', + name: 'linear', + line: {shape: 'linear'}, + type: 'scatter' +}; + +var trace2 = { + x: [1, 2, 3, 4, 5], + y: [6, 8, 7, 8, 6], + mode: 'lines+markers', + name: 'spline', + text: ['tweak line smoothness
with "smoothing" in line object', 'tweak line smoothness
with "smoothing" in line object', 'tweak line smoothness
with "smoothing" in line object', 'tweak line smoothness
with "smoothing" in line object', 'tweak line smoothness
with "smoothing" in line object', 'tweak line smoothness
with "smoothing" in line object'], + line: {shape: 'spline'}, + type: 'scatter' +}; + +var trace3 = { + x: [1, 2, 3, 4, 5], + y: [11, 13, 12, 13, 11], + mode: 'lines+markers', + name: 'vhv', + line: {shape: 'vhv'}, + type: 'scatter' +}; + +var trace4 = { + x: [1, 2, 3, 4, 5], + y: [16, 18, 17, 18, 16], + mode: 'lines+markers', + name: 'hvh', + line: {shape: 'hvh'}, + type: 'scatter' +}; + +var trace5 = { + x: [1, 2, 3, 4, 5], + y: [21, 23, 22, 23, 21], + mode: 'lines+markers', + name: 'vh', + line: {shape: 'vh'}, + type: 'scatter' +}; + +var trace6 = { + x: [1, 2, 3, 4, 5], + y: [26, 28, 27, 28, 26], + mode: 'lines+markers', + name: 'hv', + line: {shape: 'hv'}, + type: 'scatter' +}; + +var data = [trace1, trace2, trace3, trace4, trace5, trace6]; + +var layout = { + legend: { + y: 0.5, + traceorder: 'reversed', + font: {size: 16}, + yref: 'paper' + }}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line-plots/line-style.html b/content/plotly_js/basic/line-plots/line-style.html new file mode 100644 index 00000000000..bd30dd9a2dd --- /dev/null +++ b/content/plotly_js/basic/line-plots/line-style.html @@ -0,0 +1,86 @@ +--- +name: Colored and Styled Scatter Plot +language: plotly_js +suite: line-plots +order: 7 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [52698, 43117], + y: [53, 31], + mode: 'markers', + name: 'North America', + text: ['United States', 'Canada'], + marker: { + color: 'rgb(164, 194, 244)', + size: 12, + line: { + color: 'white', + width: 0.5 + } + }, + type: 'scatter' +}; + +var trace2 = { + x: [39317, 37236, 35650, 30066, 29570, 27159, 23557, 21046, 18007], + y: [33, 20, 13, 19, 27, 19, 49, 44, 38], + mode: 'markers', + name: 'Europe', + text: ['Germany', 'Britain', 'France', 'Spain', 'Italy', 'Czech Rep.', 'Greece', 'Poland'], + marker: { + color: 'rgb(255, 217, 102)', + size: 12 + }, + type: 'scatter' +}; + +var trace3 = { + x: [42952, 37037, 33106, 17478, 9813, 5253, 4692, 3899], + y: [23, 42, 54, 89, 14, 99, 93, 70], + mode: 'markers', + name: 'Asia/Pacific', + text: ['Australia', 'Japan', 'South Korea', 'Malaysia', 'China', 'Indonesia', 'Philippines', 'India'], + marker: { + color: 'rgb(234, 153, 153)', + size: 12 + }, + type: 'scatter' +}; + +var trace4 = { + x: [19097, 18601, 15595, 13546, 12026, 7434, 5419], + y: [43, 47, 56, 80, 86, 93, 80], + mode: 'markers', + name: 'Latin America', + text: ['Chile', 'Argentina', 'Mexico', 'Venezuela', 'Venezuela', 'El Salvador', 'Bolivia'], + marker: { + color: 'rgb(142, 124, 195)', + size: 12 + }, + type: 'scatter' +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + title: { + text: 'Quarter 1 Growth' + }, + xaxis: { + title: { + text: 'GDP per Capita' + }, + showgrid: false, + zeroline: false + }, + yaxis: { + title: { + text: 'Percent' + }, + showline: false + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line-plots/styling-line-plot.html b/content/plotly_js/basic/line-plots/styling-line-plot.html new file mode 100644 index 00000000000..d1372b8c114 --- /dev/null +++ b/content/plotly_js/basic/line-plots/styling-line-plot.html @@ -0,0 +1,41 @@ +--- +name: Styling Line Plot +language: plotly_js +suite: line-plots +order: 7 +sitemap: false +arrangement: horizontal +--- + +trace1 = { + type: 'scatter', + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + mode: 'lines', + name: 'Red', + line: { + color: 'rgb(219, 64, 82)', + width: 3 + } +}; + +trace2 = { + type: 'scatter', + x: [1, 2, 3, 4], + y: [12, 9, 15, 12], + mode: 'lines', + name: 'Blue', + line: { + color: 'rgb(55, 128, 191)', + width: 1 + } +}; + +var layout = { + width: 500, + height: 500 +}; + +var data = [trace1, trace2]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line_and_scatter/data-label-hover.html b/content/plotly_js/basic/line_and_scatter/data-label-hover.html new file mode 100644 index 00000000000..0f9f3af4301 --- /dev/null +++ b/content/plotly_js/basic/line_and_scatter/data-label-hover.html @@ -0,0 +1,41 @@ +--- +name: Data Labels Hover +language: plotly_js +suite: line_and_scatter +order: 2 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3, 4, 5], + y: [1, 6, 3, 6, 1], + mode: 'markers', + type: 'scatter', + name: 'Team A', + text: ['A-1', 'A-2', 'A-3', 'A-4', 'A-5'], + marker: { size: 12 } +}; + +var trace2 = { + x: [1.5, 2.5, 3.5, 4.5, 5.5], + y: [4, 1, 7, 1, 4], + mode: 'markers', + type: 'scatter', + name: 'Team B', + text: ['B-a', 'B-b', 'B-c', 'B-d', 'B-e'], + marker: { size: 12 } +}; + +var data = [ trace1, trace2 ]; + +var layout = { + xaxis: { + range: [ 0.75, 5.25 ] + }, + yaxis: { + range: [0, 8] + }, + title: {text: 'Data Labels Hover'} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line_and_scatter/data-label-on-the-plot.html b/content/plotly_js/basic/line_and_scatter/data-label-on-the-plot.html new file mode 100644 index 00000000000..d097358f37d --- /dev/null +++ b/content/plotly_js/basic/line_and_scatter/data-label-on-the-plot.html @@ -0,0 +1,58 @@ +--- +name: Data Labels on The Plot +language: plotly_js +suite: line_and_scatter +order: 3 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3, 4, 5], + y: [1, 6, 3, 6, 1], + mode: 'markers+text', + type: 'scatter', + 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 } +}; + +var trace2 = { + x: [1.5, 2.5, 3.5, 4.5, 5.5], + y: [4, 1, 7, 1, 4], + mode: 'markers+text', + type: 'scatter', + name: 'Team B', + text: ['B-a', 'B-b', 'B-c', 'B-d', 'B-e'], + textfont : { + family:'Times New Roman' + }, + textposition: 'bottom center', + marker: { size: 12 } +}; + +var data = [ trace1, trace2 ]; + +var layout = { + xaxis: { + range: [ 0.75, 5.25 ] + }, + yaxis: { + range: [0, 8] + }, + legend: { + y: 0.5, + yref: 'paper', + font: { + family: 'Arial, sans-serif', + size: 20, + color: 'grey', + } + }, + title: {text: 'Data Labels on the Plot'} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/line_and_scatter/group-scatter-setting-gap.html b/content/plotly_js/basic/line_and_scatter/group-scatter-setting-gap.html new file mode 100644 index 00000000000..827cceefb28 --- /dev/null +++ b/content/plotly_js/basic/line_and_scatter/group-scatter-setting-gap.html @@ -0,0 +1,56 @@ +--- +name: Grouped Scatter Plot with Custom Scatter Gap +language: plotly_js +suite: line_and_scatter +order: 6 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: ['South Korea', 'China', 'Canada'], + y: [24, 10, 9], + name: 'Gold', + type: 'scatter', + mode: 'markers' +}; + +var trace2 = { + x: ['South Korea', 'China', 'Canada'], + y: [13, 15, 12], + name: 'Silver', + type: 'scatter', + mode: 'markers' +}; + +var trace3 = { + x: ['South Korea', 'China', 'Canada'], + y: [11, 8, 12], + name: 'Bronze', + type: 'scatter', + mode: 'markers' +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + scattermode: 'group', + title: { + text: 'Grouped by Country' + }, + xaxis: { + title: { + text: 'Country' + } + }, + yaxis: { + title: { + text: 'Medals' + } + }, + scattergap: 0.7 +}; + +Plotly.newPlot('myDiv', data, layout); + + diff --git a/content/plotly_js/basic/line_and_scatter/group-scatter.html b/content/plotly_js/basic/line_and_scatter/group-scatter.html new file mode 100644 index 00000000000..539059bfddc --- /dev/null +++ b/content/plotly_js/basic/line_and_scatter/group-scatter.html @@ -0,0 +1,55 @@ +--- +name: Grouped Scatter Plot +language: plotly_js +suite: line_and_scatter +order: 5 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: ['South Korea', 'China', 'Canada'], + y: [24, 10, 9], + name: 'Gold', + type: 'scatter', + mode: 'markers' +}; + +var trace2 = { + x: ['South Korea', 'China', 'Canada'], + y: [13, 15, 12], + name: 'Silver', + type: 'scatter', + mode: 'markers' +}; + +var trace3 = { + x: ['South Korea', 'China', 'Canada'], + y: [11, 8, 12], + name: 'Bronze', + type: 'scatter', + mode: 'markers' +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + scattermode: 'group', + title: { + text: 'Grouped by Country' + }, + xaxis: { + title: { + text: 'Country' + } + }, + yaxis: { + title: { + text: 'Medals' + } + } +}; + +Plotly.newPlot('myDiv', data, layout); + + diff --git a/content/plotly_js/basic/line_and_scatter/line-scatter.html b/content/plotly_js/basic/line_and_scatter/line-scatter.html new file mode 100644 index 00000000000..f41f2a2f38a --- /dev/null +++ b/content/plotly_js/basic/line_and_scatter/line-scatter.html @@ -0,0 +1,32 @@ +--- +name: Line and Scatter Plot +language: plotly_js +suite: line_and_scatter +order: 1 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + mode: 'markers', + type: 'scatter' +}; + +var trace2 = { + x: [2, 3, 4, 5], + y: [16, 5, 11, 9], + mode: 'lines', + type: 'scatter' +}; + +var trace3 = { + x: [1, 2, 3, 4], + y: [12, 9, 15, 12], + mode: 'lines+markers', + type: 'scatter' +}; + +var data = [trace1, trace2, trace3]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/line_and_scatter/line_and_scatter_plotly_js_index.html b/content/plotly_js/basic/line_and_scatter/line_and_scatter_plotly_js_index.html new file mode 100644 index 00000000000..d201e80fc06 --- /dev/null +++ b/content/plotly_js/basic/line_and_scatter/line_and_scatter_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make D3.js-based line and scatter plots in JavaScript. Examples + of basic and colored line and scatter plots. +display_as: basic +language: plotly_js +layout: base +name: Scatter Plots +order: 1 +page_type: example_index +permalink: javascript/line-and-scatter/ +redirect_from: javascript-graphing-library/line-and-scatter/ +thumbnail: thumbnail/line-and-scatter.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","line_and_scatter" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/line_and_scatter/scater-with-color-dimension.html b/content/plotly_js/basic/line_and_scatter/scater-with-color-dimension.html new file mode 100644 index 00000000000..67b5b23e5e2 --- /dev/null +++ b/content/plotly_js/basic/line_and_scatter/scater-with-color-dimension.html @@ -0,0 +1,27 @@ +--- +name: Scatter Plot with a Color Dimension +language: plotly_js +suite: line_and_scatter +order: 4 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + y: [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], + mode: 'markers', + marker: { + size: 40, + color: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] + } +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Scatter Plot with a Color Dimension' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/mixed/bar-line.html b/content/plotly_js/basic/mixed/bar-line.html new file mode 100644 index 00000000000..3e66be13d83 --- /dev/null +++ b/content/plotly_js/basic/mixed/bar-line.html @@ -0,0 +1,23 @@ +--- +name: Line Chart and a Bar Chart +language: plotly_js +suite: mixed +order: 0 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5], + y: [1.5, 1, 1.3, 0.7, 0.8, 0.9], + type: 'scatter' +}; + +var trace2 = { + x: [0, 1, 2, 3, 4, 5], + y: [1, 0.5, 0.7, -1.2, 0.3, 0.4], + type: 'bar' +}; + +var data = [trace1, trace2]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/mixed/contour-scatter.html b/content/plotly_js/basic/mixed/contour-scatter.html new file mode 100644 index 00000000000..54a6660cf3a --- /dev/null +++ b/content/plotly_js/basic/mixed/contour-scatter.html @@ -0,0 +1,29 @@ +--- +name: A Contour and Scatter Plot
of the Method of Steepest Descent +language: plotly_js +suite: mixed +order: 0 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + z: [[1.5, 1.23469387755, 1.01020408163, 0.826530612245, 0.683673469388, 0.581632653061, 0.520408163265, 0.5, 0.520408163265, 0.581632653061, 0.683673469388, 0.826530612245, 1.01020408163, 1.23469387755, 1.5], [1.36734693878, 1.10204081633, 0.877551020408, 0.69387755102, 0.551020408163, 0.448979591837, 0.387755102041, 0.367346938776, 0.387755102041, 0.448979591837, 0.551020408163, 0.69387755102, 0.877551020408, 1.10204081633, 1.36734693878], [1.25510204082, 0.989795918367, 0.765306122449, 0.581632653061, 0.438775510204, 0.336734693878, 0.275510204082, 0.255102040816, 0.275510204082, 0.336734693878, 0.438775510204, 0.581632653061, 0.765306122449, 0.989795918367, 1.25510204082], [1.16326530612, 0.897959183673, 0.673469387755, 0.489795918367, 0.34693877551, 0.244897959184, 0.183673469388, 0.163265306122, 0.183673469388, 0.244897959184, 0.34693877551, 0.489795918367, 0.673469387755, 0.897959183673, 1.16326530612], [1.09183673469, 0.826530612245, 0.602040816327, 0.418367346939, 0.275510204082, 0.173469387755, 0.112244897959, 0.0918367346939, 0.112244897959, 0.173469387755, 0.275510204082, 0.418367346939, 0.602040816327, 0.826530612245, 1.09183673469], [1.04081632653, 0.775510204082, 0.551020408163, 0.367346938776, 0.224489795918, 0.122448979592, 0.0612244897959, 0.0408163265306, 0.0612244897959, 0.122448979592, 0.224489795918, 0.367346938776, 0.551020408163, 0.775510204082, 1.04081632653], [1.01020408163, 0.744897959184, 0.520408163265, 0.336734693878, 0.19387755102, 0.0918367346939, 0.030612244898, 0.0102040816327, 0.030612244898, 0.0918367346939, 0.19387755102, 0.336734693878, 0.520408163265, 0.744897959184, 1.01020408163], [1.0, 0.734693877551, 0.510204081633, 0.326530612245, 0.183673469388, 0.0816326530612, 0.0204081632653, 0.0, 0.0204081632653, 0.0816326530612, 0.183673469388, 0.326530612245, 0.510204081633, 0.734693877551, 1.0], [1.01020408163, 0.744897959184, 0.520408163265, 0.336734693878, 0.19387755102, 0.0918367346939, 0.030612244898, 0.0102040816327, 0.030612244898, 0.0918367346939, 0.19387755102, 0.336734693878, 0.520408163265, 0.744897959184, 1.01020408163], [1.04081632653, 0.775510204082, 0.551020408163, 0.367346938776, 0.224489795918, 0.122448979592, 0.0612244897959, 0.0408163265306, 0.0612244897959, 0.122448979592, 0.224489795918, 0.367346938776, 0.551020408163, 0.775510204082, 1.04081632653], [1.09183673469, 0.826530612245, 0.602040816327, 0.418367346939, 0.275510204082, 0.173469387755, 0.112244897959, 0.0918367346939, 0.112244897959, 0.173469387755, 0.275510204082, 0.418367346939, 0.602040816327, 0.826530612245, 1.09183673469], [1.16326530612, 0.897959183673, 0.673469387755, 0.489795918367, 0.34693877551, 0.244897959184, 0.183673469388, 0.163265306122, 0.183673469388, 0.244897959184, 0.34693877551, 0.489795918367, 0.673469387755, 0.897959183673, 1.16326530612], [1.25510204082, 0.989795918367, 0.765306122449, 0.581632653061, 0.438775510204, 0.336734693878, 0.275510204082, 0.255102040816, 0.275510204082, 0.336734693878, 0.438775510204, 0.581632653061, 0.765306122449, 0.989795918367, 1.25510204082], [1.36734693878, 1.10204081633, 0.877551020408, 0.69387755102, 0.551020408163, 0.448979591837, 0.387755102041, 0.367346938776, 0.387755102041, 0.448979591837, 0.551020408163, 0.69387755102, 0.877551020408, 1.10204081633, 1.36734693878], [1.5, 1.23469387755, 1.01020408163, 0.826530612245, 0.683673469388, 0.581632653061, 0.520408163265, 0.5, 0.520408163265, 0.581632653061, 0.683673469388, 0.826530612245, 1.01020408163, 1.23469387755, 1.5]], + x: [-1.0, -0.857142857143, -0.714285714286, -0.571428571429, -0.428571428571, -0.285714285714, -0.142857142857, 0.0, 0.142857142857, 0.285714285714, 0.428571428571, 0.571428571429, 0.714285714286, 0.857142857143, 1.0], + y: [-1.0, -0.857142857143, -0.714285714286, -0.571428571429, -0.428571428571, -0.285714285714, -0.142857142857, 0.0, 0.142857142857, 0.285714285714, 0.428571428571, 0.571428571429, 0.714285714286, 0.857142857143, 1.0], + ncontours: 30, + showscale: false, + type: 'contour' +}; + +var trace2 = { + x: [-0.8, -0.48, -0.288, -0.1728, -0.10368, -0.062208, -0.0373248, -0.02239488, -0.013436928, -0.0080621568, -0.00483729408, -0.002902376448, -0.0017414258688, -0.00104485552128, -0.000626913312768, -0.000376147987661], + y: [-0.9, -0.72, -0.576, -0.4608, -0.36864, -0.294912, -0.2359296, -0.18874368, -0.150994944, -0.1207959552, -0.09663676416, -0.077309411328, -0.0618475290624, -0.0494780232499, -0.0395824185999, -0.0316659348799], + mode: 'markers+lines', + name: 'steepest', + line: {color: 'black'}, + type: 'scatter' +}; + +var data = [trace1, trace2]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/mixed/mixed_plotly_js_index.html b/content/plotly_js/basic/mixed/mixed_plotly_js_index.html new file mode 100644 index 00000000000..355319ad12a --- /dev/null +++ b/content/plotly_js/basic/mixed/mixed_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to makes figures with D3.js-based mixed chart types in JavaScript. + Examples of a contour plot with a scatter plot and a bar chart with a line chart. +display_as: basic +language: plotly_js +layout: base +name: Multiple Chart Types +order: 13 +permalink: javascript/graphing-multiple-chart-types/ +redirect_from: javascript-graphing-library/graphing-multiple-chart-types/ +thumbnail: thumbnail/mixed2.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","mixed" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/pie/basic-pie-chart.html b/content/plotly_js/basic/pie/basic-pie-chart.html new file mode 100644 index 00000000000..b3bf0172fab --- /dev/null +++ b/content/plotly_js/basic/pie/basic-pie-chart.html @@ -0,0 +1,21 @@ +--- +name: Basic Pie Chart +language: plotly_js +suite: pie +order: 1 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + values: [19, 26, 55], + labels: ['Residential', 'Non-Residential', 'Utility'], + type: 'pie' +}]; + +var layout = { + height: 400, + width: 500 +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/pie/donut-chart.html b/content/plotly_js/basic/pie/donut-chart.html new file mode 100644 index 00000000000..66043363db4 --- /dev/null +++ b/content/plotly_js/basic/pie/donut-chart.html @@ -0,0 +1,60 @@ +--- +name: Donut Chart +language: plotly_js +suite: pie +order: 3 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + values: [16, 15, 12, 6, 5, 4, 42], + labels: ['US', 'China', 'European Union', 'Russian Federation', 'Brazil', 'India', 'Rest of World' ], + domain: {column: 0}, + name: 'GHG Emissions', + hoverinfo: 'label+percent+name', + hole: .4, + type: 'pie' +},{ + values: [27, 11, 25, 8, 1, 3, 25], + labels: ['US', 'China', 'European Union', 'Russian Federation', 'Brazil', 'India', 'Rest of World' ], + text: 'CO2', + textposition: 'inside', + domain: {column: 1}, + name: 'CO2 Emissions', + hoverinfo: 'label+percent+name', + hole: .4, + type: 'pie' +}]; + +var layout = { + title: { + text: 'Global Emissions 1990-2011' + }, + annotations: [ + { + font: { + size: 20 + }, + showarrow: false, + text: 'GHG', + x: 0.17, + y: 0.5 + }, + { + font: { + size: 20 + }, + showarrow: false, + text: 'CO2', + x: 0.82, + y: 0.5 + } + ], + height: 400, + width: 600, + showlegend: false, + grid: {rows: 1, columns: 2} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/pie/inside-text-orientation.html b/content/plotly_js/basic/pie/inside-text-orientation.html new file mode 100644 index 00000000000..85ec5d096fe --- /dev/null +++ b/content/plotly_js/basic/pie/inside-text-orientation.html @@ -0,0 +1,24 @@ +--- +name: Control Text Orientation Inside Pie Chart Sectors +language: plotly_js +suite: pie +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + The `insidetextorientation` attribute controls the orientation of the text inside chart sectors. When set to *auto*, text may be oriented in any direction in order to be as big as possible in the middle of a sector. The *horizontal* option orients text to be parallel with the bottom of the chart, and may make text smaller in order to achieve that goal. The *radial* option orients text along the radius of the sector. The *tangential* option orients text perpendicular to the radius of the sector. +--- +var data = [{ + type: "pie", + values: [2, 3, 4, 4], + labels: ["Wages", "Operating expenses", "Cost of sales", "Insurance"], + textinfo: "label+percent", + insidetextorientation: "radial" +}] + +var layout = [{ + height: 700, + width: 700 +}] + +Plotly.newPlot('myDiv', data, layout) \ No newline at end of file diff --git a/content/plotly_js/basic/pie/pie-chart-automargin.html b/content/plotly_js/basic/pie/pie-chart-automargin.html new file mode 100644 index 00000000000..2dc72bce757 --- /dev/null +++ b/content/plotly_js/basic/pie/pie-chart-automargin.html @@ -0,0 +1,27 @@ +--- +name: Automatically Adjust Margins +language: plotly_js +suite: pie +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + The following example sets [automargin](https://plotly.com/javascript/setting-graph-size/#automatically-adjust-margins) attribute to true, which automatically increases the margin size. +--- +var data = [{ + type: "pie", + values: [2, 3, 4, 4], + labels: ["Wages", "Operating expenses", "Cost of sales", "Insurance"], + textinfo: "label+percent", + textposition: "outside", + automargin: true +}] + +var layout = { + height: 400, + width: 400, + margin: {"t": 0, "b": 0, "l": 0, "r": 0}, + showlegend: false + } + +Plotly.newPlot('myDiv', data, layout) \ No newline at end of file diff --git a/content/plotly_js/basic/pie/pie-chart-subplots.html b/content/plotly_js/basic/pie/pie-chart-subplots.html new file mode 100644 index 00000000000..36d70bf6ac5 --- /dev/null +++ b/content/plotly_js/basic/pie/pie-chart-subplots.html @@ -0,0 +1,92 @@ +--- +name: Pie Chart Subplots +language: plotly_js +suite: pie +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + In order to create pie chart subplots, you need to use the [domain](https://plotly.com/javascript/reference/pie/#pie-domain) attribute. `domain` allows you to place each trace on a [grid](https://plotly.com/javascript/reference/layout/#layout-grid) of rows and columns defined in the layout or within a rectangle defined by `X` and `Y` arrays. The example below uses the `grid` method (with a 2 x 2 grid defined in the layout) for the first three traces and the X and Y method for the fourth trace. +--- + +var allLabels = ['1st', '2nd', '3rd', '4th', '5th']; + +var allValues = [ + [38, 27, 18, 10, 7], + [28, 26, 21, 15, 10], + [38, 19, 16, 14, 13], + [31, 24, 19, 18, 8] +]; + +var ultimateColors = [ + ['rgb(56, 75, 126)', 'rgb(18, 36, 37)', 'rgb(34, 53, 101)', 'rgb(36, 55, 57)', 'rgb(6, 4, 4)'], + ['rgb(177, 127, 38)', 'rgb(205, 152, 36)', 'rgb(99, 79, 37)', 'rgb(129, 180, 179)', 'rgb(124, 103, 37)'], + ['rgb(33, 75, 99)', 'rgb(79, 129, 102)', 'rgb(151, 179, 100)', 'rgb(175, 49, 35)', 'rgb(36, 73, 147)'], + ['rgb(146, 123, 21)', 'rgb(177, 180, 34)', 'rgb(206, 206, 40)', 'rgb(175, 51, 21)', 'rgb(35, 36, 21)'] +]; + +var data = [{ + values: allValues[0], + labels: allLabels, + type: 'pie', + name: 'Starry Night', + marker: { + colors: ultimateColors[0] + }, + domain: { + row: 0, + column: 0 + }, + hoverinfo: 'label+percent+name', + textinfo: 'none' +},{ + values: allValues[1], + labels: allLabels, + type: 'pie', + name: 'Sunflowers', + marker: { + colors: ultimateColors[1] + }, + domain: { + row: 1, + column: 0 + }, + hoverinfo: 'label+percent+name', + textinfo: 'none' +},{ + values: allValues[2], + labels: allLabels, + type: 'pie', + name: 'Irises', + marker: { + colors: ultimateColors[2] + }, + domain: { + row: 0, + column: 1 + }, + hoverinfo: 'label+percent+name', + textinfo: 'none' +},{ + values: allValues[3], + labels: allLabels, + type: 'pie', + name: 'The Night Cafe', + marker: { + colors: ultimateColors[3] + }, + domain: { + x: [0.52,1], + y: [0, 0.48] + }, + hoverinfo: 'label+percent+name', + textinfo: 'none' +}]; + +var layout = { + height: 400, + width: 500, + grid: {rows: 2, columns: 2} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/pie/pie_plotly_js_index.html b/content/plotly_js/basic/pie/pie_plotly_js_index.html new file mode 100644 index 00000000000..eebd9e8496c --- /dev/null +++ b/content/plotly_js/basic/pie/pie_plotly_js_index.html @@ -0,0 +1,18 @@ +--- +description: How to graph D3.js-based pie charts in javascript with D3.js. Examples + of pie charts, donut charts and pie chart subplots. +display_as: basic +language: plotly_js +layout: base +name: Pie Charts +order: 4 +page_type: example_index +permalink: javascript/pie-charts/ +redirect_from: +- javascript-graphing-library/pie-chart/ +- javascript/pie-chart/ +thumbnail: thumbnail/pie-chart.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","pie" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/plotly_js-basic-index.html b/content/plotly_js/basic/plotly_js-basic-index.html new file mode 100644 index 00000000000..52500c39db8 --- /dev/null +++ b/content/plotly_js/basic/plotly_js-basic-index.html @@ -0,0 +1,27 @@ +--- +description: Plotly.js makes interactive, publication-quality graphs online. Examples + of how to make basic charts. +language: plotly_js +layout: langindex +name: Basic Charts +display_as: basic +permalink: javascript/basic-charts/ +thumbnail: thumbnail/mixed.jpg +--- + +
+
+ +
+ +
+

Plotly.js Basic Charts

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","basic" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/basic/sankey/add_links.html b/content/plotly_js/basic/sankey/add_links.html new file mode 100644 index 00000000000..e602514e14f --- /dev/null +++ b/content/plotly_js/basic/sankey/add_links.html @@ -0,0 +1,55 @@ +--- +name: Add Links +language: plotly_js +suite: sankey +order: 4 +sitemap: false +arrangement: horizontal +description: +--- + +d3.json('https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/mocks/sankey_energy.json', function(fig){ + +var data = { + type: "sankey", + domain: { + x: [0,1], + y: [0,1] + }, + orientation: "h", + valueformat: ".0f", + valuesuffix: "TWh", + node: { + pad: 15, + thickness: 15, + line: { + color: "black", + width: 0.5 + }, + label: fig.data[0].node.label, + color: fig.data[0].node.color + }, + + link: { + source: fig.data[0].link.source, + target: fig.data[0].link.target, + value: fig.data[0].link.value, + label: fig.data[0].link.label + } +} + +var data = [data] + +var layout = { + title: { + text: "Energy forecast for 2050
Source: Department of Energy & Climate Change, Tom Counsell via Mike Bostock" + }, + width: 1118, + height: 772, + font: { + size: 10 + } +} + +Plotly.newPlot('myDiv', data, layout) +}); diff --git a/content/plotly_js/basic/sankey/add_nodes.html b/content/plotly_js/basic/sankey/add_nodes.html new file mode 100644 index 00000000000..2f88e09df3d --- /dev/null +++ b/content/plotly_js/basic/sankey/add_nodes.html @@ -0,0 +1,50 @@ +--- +name: Add Nodes +language: plotly_js +suite: sankey +order: 3 +sitemap: false +arrangement: horizontal +description: +--- + +d3.json('https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/mocks/sankey_energy.json', function(fig){ + +var data = { + type: "sankey", + domain: { + x: [0,1], + y: [0,1] + }, + orientation: "h", + valueformat: ".0f", + valuesuffix: "TWh", + + node: { + pad: 15, + thickness: 15, + line: { + color: "black", + width: 0.5 + }, + label: fig.data[0].node.label, + color: fig.data[0].node.color + } +} + +var data = [data] + +var layout = { + title: { + text: "Energy forecast for 2050
Source: Department of Energy & Climate Change, Tom Counsell via Mike Bostock" + }, + width: 1118, + height: 772, + font: { + size: 10 + } +} + +Plotly.newPlot('myDiv', data, layout) + +}); diff --git a/content/plotly_js/basic/sankey/align-example.html b/content/plotly_js/basic/sankey/align-example.html new file mode 100644 index 00000000000..2dd8c887ed1 --- /dev/null +++ b/content/plotly_js/basic/sankey/align-example.html @@ -0,0 +1,38 @@ +--- +name: Node Alignment +language: plotly_js +suite: sankey +order: 7 +sitemap: false +arrangement: horizontal +markdown_content : | + You can set the alignment of nodes using `node.align`. In this example, we align nodes to the "right". `node.align` can also be set to "left", "center", or "justify". The default is "justify" if ``node.align` is not set, and is similar to aligning to the "left", except that nodes without outgoing links are moved to the right of the figure. +--- + +var data = { + type: "sankey", + orientation: "h", + node: { + label: ["0", "1", "2", "3", "4", "5"], + align: "right", + }, + + link: { + source: [0, 1, 4, 2, 1], + target: [1, 4, 5, 4, 3], + value: [4, 2, 3, 1, 2], + }, +}; + +var data = [data]; + +var layout = { + title: { + text: "Align Nodes (Right)" + }, + font: { + size: 10, + }, +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/sankey/basic-example.html b/content/plotly_js/basic/sankey/basic-example.html new file mode 100644 index 00000000000..85bce263878 --- /dev/null +++ b/content/plotly_js/basic/sankey/basic-example.html @@ -0,0 +1,43 @@ +--- +name: Basic Sankey Diagram +language: plotly_js +suite: sankey +order: 1 +sitemap: false +arrangement: horizontal +description: +--- + +var data = { + type: "sankey", + orientation: "h", + node: { + pad: 15, + thickness: 30, + line: { + color: "black", + width: 0.5 + }, + label: ["A1", "A2", "B1", "B2", "C1", "C2"], + color: ["blue", "blue", "blue", "blue", "blue", "blue"] + }, + + link: { + source: [0,1,0,2,3,3], + target: [2,3,3,4,4,5], + value: [8,4,2,8,4,2] + } +} + +var data = [data] + +var layout = { + title: { + text: "Basic Sankey" + }, + font: { + size: 10 + } +} + +Plotly.react('myDiv', data, layout) diff --git a/content/plotly_js/basic/sankey/basic.html b/content/plotly_js/basic/sankey/basic.html new file mode 100644 index 00000000000..25c79ff0077 --- /dev/null +++ b/content/plotly_js/basic/sankey/basic.html @@ -0,0 +1,33 @@ +--- +name: Create Sankey Canvas +language: plotly_js +suite: sankey +order: 2 +sitemap: false +arrangement: horizontal +description: +--- + +var data = { + type: "sankey", + domain: { + x: [0,1], + y: [0,1] + }, + orientation: "h", + valueformat: ".0f", + valuesuffix: "TWh" +} + +var data = [data] + +var layout = { + title: { + text: "Energy forecast for 2050
Source: Department of Energy & Climate Change, Tom Counsell via Mike Bostock" + }, + width: 1118, + height: 772, + font: { + size: 10 + } +} diff --git a/content/plotly_js/basic/sankey/nodes-position.html b/content/plotly_js/basic/sankey/nodes-position.html new file mode 100644 index 00000000000..15f4544f276 --- /dev/null +++ b/content/plotly_js/basic/sankey/nodes-position.html @@ -0,0 +1,35 @@ +--- +name: Define Node Position +language: plotly_js +suite: sankey +order: 6 +sitemap: false +arrangement: horizontal +description: +markdown_content: | + The following example sets [node.x](https://plotly.com/javascript/reference/sankey/#sankey-node-x) and `node.y` to place nodes in the specified locations, except in the `snap arrangement` (default behaviour when `node.x` and `node.y` are not defined) to avoid overlapping of the nodes, therefore, an automatic snapping of elements will be set to define the padding between nodes via [nodepad](https://plotly.com/javascript/reference/sankey/#sankey-node-pad). The other possible arrangements are: 1) perpendicular 2) freeform 3) fixed + +--- +var data = [{ + type: "sankey", + arrangement: "snap", + node:{ + label: ["A", "B", "C", "D", "E", "F"], + x: [0.2, 0.1, 0.5, 0.7, 0.3, 0.5], + y: [0.7, 0.5, 0.2, 0.4, 0.2, 0.3], + pad:10}, // 10 Pixels + link: { + source: [0, 0, 1, 2, 5, 4, 3, 5], + target: [5, 3, 4, 3, 0, 2, 2, 3], + value: [1, 2, 1, 1, 1, 1, 1, 2]} + }] + +var layout = { + title: { + text: "Sankey with manually positioned node" + } +} + +Plotly.newPlot('myDiv', data, layout) + + diff --git a/content/plotly_js/basic/sankey/sankey_index.html b/content/plotly_js/basic/sankey/sankey_index.html new file mode 100644 index 00000000000..b39b8a3227a --- /dev/null +++ b/content/plotly_js/basic/sankey/sankey_index.html @@ -0,0 +1,13 @@ +--- +description: How to make D3.js-based sankey diagrams in Plotly.js. +display_as: basic +language: plotly_js +layout: base +name: Sankey Diagrams +order: 10 +permalink: javascript/sankey-diagram/ +thumbnail: thumbnail/sankey.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","sankey" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/sankey/style_sankey.html b/content/plotly_js/basic/sankey/style_sankey.html new file mode 100644 index 00000000000..eaf7e3fd7c9 --- /dev/null +++ b/content/plotly_js/basic/sankey/style_sankey.html @@ -0,0 +1,57 @@ +--- +name: Style Sankey Diagram +language: plotly_js +suite: sankey +order: 5 +sitemap: false +arrangement: horizontal +description: +--- + +d3.json('https://raw.githubusercontent.com/plotly/plotly.js/master/test/image/mocks/sankey_energy_dark.json', function(fig){ + +var data = { + type: "sankey", + domain: { + x: [0,1], + y: [0,1] + }, + orientation: "h", + valueformat: ".0f", + valuesuffix: "TWh", + node: { + pad: 15, + thickness: 15, + line: { + color: "black", + width: 0.5 + }, + label: fig.data[0].node.label, + color: fig.data[0].node.color + }, + link: { + source: fig.data[0].link.source, + target: fig.data[0].link.target, + value: fig.data[0].link.value, + label: fig.data[0].link.label + } +} + +var data = [data] + +var layout = { + title: { + text: "Energy forecast for 2050
Source: Department of Energy & Climate Change, Tom Counsell via Mike Bostock" + }, + width: 1118, + height: 772, + font: { + size: 10, + color: 'white' + }, + plot_bgcolor: 'black', + paper_bgcolor: 'black' +} + +Plotly.newPlot('myDiv', data, layout) +}); diff --git a/content/plotly_js/basic/sunburst/basic-area.html b/content/plotly_js/basic/sunburst/basic-area.html new file mode 100644 index 00000000000..5e61f50fab5 --- /dev/null +++ b/content/plotly_js/basic/sunburst/basic-area.html @@ -0,0 +1,26 @@ +--- +name: Basic Sunburst Chart +language: plotly_js +suite: sunburst +order: 1 +sitemap: false +arrangement: horizontal +--- +var data = [{ + type: "sunburst", + labels: ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"], + parents: ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ], + values: [10, 14, 12, 10, 2, 6, 6, 4, 4], + outsidetextfont: {size: 20, color: "#377eb8"}, + leaf: {opacity: 0.4}, + marker: {line: {width: 2}}, +}]; + +var layout = { + margin: {l: 0, r: 0, b: 0, t: 0}, + width: 500, + height: 500 +}; + + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/sunburst/basic-branchvalues-total.html b/content/plotly_js/basic/sunburst/basic-branchvalues-total.html new file mode 100644 index 00000000000..79dd390f4ef --- /dev/null +++ b/content/plotly_js/basic/sunburst/basic-branchvalues-total.html @@ -0,0 +1,34 @@ +--- +name: Branchvalues +language: plotly_js +suite: sunburst +order: 1.5 +sitemap: false +arrangement: horizontal +markdown_content: | + With branchvalues "total", the value of the parent represents the width of its wedge. In the example below, + "Enoch" is 4 and "Awan" is 6 and so Enoch's width is 4/6ths of Awans. With branchvalues "remainder", the + parent's width is determined by its own value plus those of its children. So, Enoch's width is 4/10ths of + Awan's (4 / (6 + 4)).

Note that this means that the sum of the values of the children cannot exceed the + value of their parent when branchvalues "total". When branchvalues "relative" (the default), children will not take + up all of the space below their parent (unless the parent is the root and it has a value of 0). +--- +var data = [ +{ + "type": "sunburst", + "labels": ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"], + "parents": ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ], + "values": [65, 14, 12, 10, 2, 6, 6, 4, 4], + "leaf": {"opacity": 0.4}, + "marker": {"line": {"width": 2}}, + "branchvalues": 'total' +}]; + +var layout = { + "margin": {"l": 0, "r": 0, "b": 0, "t": 0}, +}; + + +Plotly.newPlot('myDiv', data, layout, {showSendToCloud: true}) + +myPlot = document.getElementById("myDiv"); diff --git a/content/plotly_js/basic/sunburst/inside-text-orientation.html b/content/plotly_js/basic/sunburst/inside-text-orientation.html new file mode 100644 index 00000000000..94d9e34d94d --- /dev/null +++ b/content/plotly_js/basic/sunburst/inside-text-orientation.html @@ -0,0 +1,29 @@ +--- +name: Control Text Orientation Inside Sunburst Chart Sectors +language: plotly_js +suite: sunburst +order: 6 +sitemap: false +arrangement: horizontal +markdown_content: | + The `insidetextorientation` attribute controls the orientation of the text inside chart sectors. When set to *auto*, text may be oriented in any direction in order to be as big as possible in the middle of a sector. The *horizontal* option orients text to be parallel with the bottom of the chart, and may make text smaller in order to achieve that goal. The *radial* option orients text along the radius of the sector. The *tangential* option orients text perpendicular to the radius of the sector. +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/coffee-flavors.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) {return row[key]}) +} + + var data = [{ + type: "sunburst", + maxdepth: 2, + ids: unpack(rows, 'ids'), + labels: unpack(rows, 'labels'), + parents: unpack(rows, 'parents'), + textposition: 'inside', + insidetextorientation: 'radial' + }] + + var layout = {margin: {l: 0, r: 0, b: 0, t:0}} + + Plotly.newPlot('myDiv', data, layout) +}) diff --git a/content/plotly_js/basic/sunburst/large-number-of-slices.html b/content/plotly_js/basic/sunburst/large-number-of-slices.html new file mode 100644 index 00000000000..4f547131c56 --- /dev/null +++ b/content/plotly_js/basic/sunburst/large-number-of-slices.html @@ -0,0 +1,35 @@ +--- +name: Large Number of Slices +language: plotly_js +suite: sunburst +order: 4 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/coffee-flavors.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var data = [ + { + type: "sunburst", + maxdepth: 3, + ids: unpack(rows, 'ids'), + labels: unpack(rows, 'labels'), + parents:unpack(rows, 'parents') + } + ]; + +var layout = { + margin: {l: 0, r: 0, b: 0, t:0}, + sunburstcolorway:[ + "#636efa","#EF553B","#00cc96","#ab63fa","#19d3f3", + "#e763fa", "#FECB52","#FFA15A","#FF6692","#B6E880" + ], + extendsunburstcolorway: true +}; + + +Plotly.newPlot('myDiv', data, layout, {showSendToCloud: true}); +}) diff --git a/content/plotly_js/basic/sunburst/repeated-labels.html b/content/plotly_js/basic/sunburst/repeated-labels.html new file mode 100644 index 00000000000..260daf4bbf2 --- /dev/null +++ b/content/plotly_js/basic/sunburst/repeated-labels.html @@ -0,0 +1,42 @@ +--- +name: Sunburst with Repeated Labels +language: plotly_js +suite: sunburst +order: 3 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + type: "sunburst", + ids: [ + "North America", "Europe", "Australia", "North America - Football", "Soccer", + "North America - Rugby", "Europe - Football", "Rugby", + "Europe - American Football","Australia - Football", "Association", + "Australian Rules", "Autstralia - American Football", "Australia - Rugby", + "Rugby League", "Rugby Union" + ], + labels: [ + "North
America", "Europe", "Australia", "Football", "Soccer", "Rugby", + "Football", "Rugby", "American
Football", "Football", "Association", + "Australian
Rules", "American
Football", "Rugby", "Rugby
League", + "Rugby
Union" + ], + parents: [ + "", "", "", "North America", "North America", "North America", "Europe", + "Europe", "Europe","Australia", "Australia - Football", "Australia - Football", + "Australia - Football", "Australia - Football", "Australia - Rugby", + "Australia - Rugby" + ], + outsidetextfont: {size: 20, color: "#377eb8"}, + // leaf: {opacity: 0.4}, + marker: {line: {width: 2}}, +}]; + +var layout = { + margin: {l: 0, r: 0, b: 0, t:0}, + sunburstcolorway:["#636efa","#ef553b","#00cc96"], +}; + + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/basic/sunburst/sunburst_plotly_js_index.html b/content/plotly_js/basic/sunburst/sunburst_plotly_js_index.html new file mode 100644 index 00000000000..11a4f3bdb1c --- /dev/null +++ b/content/plotly_js/basic/sunburst/sunburst_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make a D3.js-based sunburst chart in javascript. Visualize hierarchical + data spanning outward radially from root to leaves. +display_as: basic +language: plotly_js +layout: base +name: Sunburst Charts +order: 9 +permalink: javascript/sunburst-charts/ +thumbnail: thumbnail/sunburst.gif +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","sunburst" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} + +See https://plotly/.com/javascript/reference/sunburst/ for more information and chart attribute options! \ No newline at end of file diff --git a/content/plotly_js/basic/table/alternating-rows.html b/content/plotly_js/basic/table/alternating-rows.html new file mode 100644 index 00000000000..6bcce02aa4c --- /dev/null +++ b/content/plotly_js/basic/table/alternating-rows.html @@ -0,0 +1,41 @@ +--- +name: Alternating Row Colors +language: plotly_js +suite: tables +order: 5 +sitemap: false +arrangement: horizontal +--- + +var values = [ + ['Salaries', 'Office', 'Merchandise', 'Legal', 'TOTAL'], + [1200000, 20000, 80000, 2000, 12120000], + [1300000, 20000, 70000, 2000, 130902000], + [1300000, 20000, 120000, 2000, 131222000], + [1400000, 20000, 90000, 2000, 14102000]] + +var headerColor = "grey"; +var rowEvenColor = "lightgrey"; +var rowOddColor = "white"; + +var data = [{ + type: 'table', + header: { + values: [["EXPENSES"], ["Q1"], + ["Q2"], ["Q3"], ["Q4"]], + align: "center", + line: {width: 1, color: 'black'}, + fill: {color: headerColor}, + font: {family: "Arial", size: 12, color: "white"} + }, + cells: { + values: values, + align: "center", + line: {color: "black", width: 1}, + fill: {color: [[rowOddColor,rowEvenColor,rowOddColor, + rowEvenColor,rowOddColor]]}, + font: {family: "Arial", size: 11, color: ["black"]} + } +}] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/table/basic-example.html b/content/plotly_js/basic/table/basic-example.html new file mode 100644 index 00000000000..5a736e181a2 --- /dev/null +++ b/content/plotly_js/basic/table/basic-example.html @@ -0,0 +1,35 @@ +--- +name: Basic Table +language: plotly_js +suite: tables +order: 1 +sitemap: false +arrangement: horizontal +--- + +var values = [ + ['Salaries', 'Office', 'Merchandise', 'Legal', 'TOTAL'], + [1200000, 20000, 80000, 2000, 12120000], + [1300000, 20000, 70000, 2000, 130902000], + [1300000, 20000, 120000, 2000, 131222000], + [1400000, 20000, 90000, 2000, 14102000]] + +var data = [{ + type: 'table', + header: { + values: [["EXPENSES"], ["Q1"], + ["Q2"], ["Q3"], ["Q4"]], + align: "center", + line: {width: 1, color: 'black'}, + fill: {color: "grey"}, + font: {family: "Arial", size: 12, color: "white"} + }, + cells: { + values: values, + align: "center", + line: {color: "black", width: 1}, + font: {family: "Arial", size: 11, color: ["black"]} + } +}] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/table/from-a-csv.html b/content/plotly_js/basic/table/from-a-csv.html new file mode 100644 index 00000000000..674ebe81256 --- /dev/null +++ b/content/plotly_js/basic/table/from-a-csv.html @@ -0,0 +1,61 @@ +--- +name: Table From a CSV +language: plotly_js +suite: tables +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var headerNames = d3.keys(rows[0]); + + var headerValues = []; + var cellValues = []; + for (i = 0; i < headerNames.length; i++) { + headerValue = [headerNames[i]]; + headerValues[i] = headerValue; + cellValue = unpack(rows, headerNames[i]); + cellValues[i] = cellValue; + } + + // clean date + for (i = 0; i < cellValues[1].length; i++) { + var dateValue = cellValues[1][i].split(' ')[0] + cellValues[1][i] = dateValue + } + + +var data = [{ + type: 'table', + columnwidth: [150,600,1000,900,600,500,1000,1000,1000], + columnorder: [0,1,2,3,4,5,6,7,8,9], + header: { + values: headerValues, + align: "center", + line: {width: 1, color: 'rgb(50, 50, 50)'}, + fill: {color: ['rgb(235, 100, 230)']}, + font: {family: "Arial", size: 8, color: "white"} + }, + cells: { + values: cellValues, + align: ["center", "center"], + line: {color: "black", width: 1}, + fill: {color: ['rgba(228, 222, 249, 0.65)','rgb(235, 193, 238)', 'rgba(228, 222, 249, 0.65)']}, + font: {family: "Arial", size: 9, color: ["black"]} + } +}] + +var layout = { + title: { + text: "Bitcoin mining stats for 180 days" + } +} + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/basic/table/sizing-rows-columns.html b/content/plotly_js/basic/table/sizing-rows-columns.html new file mode 100644 index 00000000000..af3cd8e02b9 --- /dev/null +++ b/content/plotly_js/basic/table/sizing-rows-columns.html @@ -0,0 +1,40 @@ +--- +name: Changing Size of Rows and Columns +language: plotly_js +suite: tables +order: 4 +sitemap: false +arrangement: horizontal +--- + +var values = [ + ['Salaries', 'Office', 'Merchandise', 'Legal', 'TOTAL
EXPENSES
'], + ["Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad", + "Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad", + "Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad", + "Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad", + "Lorem ipsum dolor sit amet, tollit discere inermis pri ut. Eos ea iusto timeam, an prima laboramus vim. Id usu aeterno adversarium, summo mollis timeam vel ad"]] + +var data = [{ + type: 'table', + columnorder: [1,2], + columnwidth: [80,400], + header: { + values: [["EXPENSES
as of July 2017"], ["DESCRIPTION"]], + align: ["left", "center"], + height: 40, + line: {width: 1, color: '#506784'}, + fill: {color: '#119DFF'}, + font: {family: "Arial", size: 12, color: "white"} + }, + cells: { + values: values, + align: ["left", "center"], + height: 30, + line: {color: "#506784", width: 1}, + fill: {color: ['#25FEFD', 'white']}, + font: {family: "Arial", size: 11, color: ["#506784"]} + } +}] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/table/styled-example.html b/content/plotly_js/basic/table/styled-example.html new file mode 100644 index 00000000000..14e24ad39e6 --- /dev/null +++ b/content/plotly_js/basic/table/styled-example.html @@ -0,0 +1,36 @@ +--- +name: Styled Table +language: plotly_js +suite: tables +order: 2 +sitemap: false +arrangement: horizontal +--- + +var values = [ + ['Salaries', 'Office', 'Merchandise', 'Legal', 'TOTAL'], + [1200000, 20000, 80000, 2000, 12120000], + [1300000, 20000, 70000, 2000, 130902000], + [1300000, 20000, 120000, 2000, 131222000], + [1400000, 20000, 90000, 2000, 14102000]] + +var data = [{ + type: 'table', + header: { + values: [["EXPENSES"], ["Q1"], + ["Q2"], ["Q3"], ["Q4"]], + align: ["left", "center"], + line: {width: 1, color: '#506784'}, + fill: {color: '#119DFF'}, + font: {family: "Arial", size: 12, color: "white"} + }, + cells: { + values: values, + align: ["left", "center"], + line: {color: "#506784", width: 1}, + fill: {color: ['#25FEFD', 'white']}, + font: {family: "Arial", size: 11, color: ["#506784"]} + } +}] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/basic/table/table-subplot.html b/content/plotly_js/basic/table/table-subplot.html new file mode 100644 index 00000000000..47b3b4ef3ad --- /dev/null +++ b/content/plotly_js/basic/table/table-subplot.html @@ -0,0 +1,10 @@ +--- +name: Table Subplots +language: plotly_js +suite: tables +order: 6 +sitemap: false +arrangement: horizontal +markdown_content: | + Please see [Table Subplots](https://plotly.com/javascript/table-subplots) documentation. +--- diff --git a/content/plotly_js/basic/table/tables-plotly_js_index.html b/content/plotly_js/basic/table/tables-plotly_js_index.html new file mode 100644 index 00000000000..0a6c56f6738 --- /dev/null +++ b/content/plotly_js/basic/table/tables-plotly_js_index.html @@ -0,0 +1,13 @@ +--- +description: How to make a D3.js-based tables in javascript. +display_as: basic +language: plotly_js +layout: base +name: Tables +order: 12 +permalink: javascript/table/ +thumbnail: thumbnail/table.gif +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","tables" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/basic/treemap/basic-treemap.html b/content/plotly_js/basic/treemap/basic-treemap.html new file mode 100644 index 00000000000..8eade33f0c8 --- /dev/null +++ b/content/plotly_js/basic/treemap/basic-treemap.html @@ -0,0 +1,17 @@ +--- +name: Basic Treemap +language: plotly_js +suite: treemap +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + [Treemap charts](https://en.wikipedia.org/wiki/Treemapping) visualize hierarchical data using nested rectangles. Same as [Sunburst](https://plotly.com/javascript/sunburst-charts/) the hierarchy is defined by [labels](https://plotly.com/javascript/reference/treemap/#treemap-labels) and [parents](https://plotly.com/javascript/reference/treemap/#treemap-parents) attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well. +--- +data = [{ + type: "treemap", + labels: ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"], + parents: ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ] +}] + +Plotly.newPlot('myDiv', data) \ No newline at end of file diff --git a/content/plotly_js/basic/treemap/nested-layers-treemap.html b/content/plotly_js/basic/treemap/nested-layers-treemap.html new file mode 100644 index 00000000000..ab8561039d3 --- /dev/null +++ b/content/plotly_js/basic/treemap/nested-layers-treemap.html @@ -0,0 +1,24 @@ +--- +name: Nested Layers in Treemap +language: plotly_js +suite: treemap +order: 6 +sitemap: false +arrangement: horizontal +markdown_content: | + The following example uses hierarchical data that includes layers and grouping. Treemap and [Sunburst](https://plotly.com/javascript/sunburst-charts/) charts reveal insights into the data, and the format of your hierarchical data. [maxdepth](https://plotly.com/javascript/reference/treemap/#treemap-maxdepth) attribute sets the number of rendered sectors from the given level. +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/coffee-flavors.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]}); +} + +var data = [{ + type: "treemap", + ids: unpack(rows, 'ids'), + labels: unpack(rows, 'labels'), + parents: unpack(rows, 'parents') + }]; + +Plotly.newPlot('myDiv', data); +}) diff --git a/content/plotly_js/basic/treemap/set-colorscale-treemap.html b/content/plotly_js/basic/treemap/set-colorscale-treemap.html new file mode 100644 index 00000000000..c5937b115a5 --- /dev/null +++ b/content/plotly_js/basic/treemap/set-colorscale-treemap.html @@ -0,0 +1,23 @@ +--- +name: +language: plotly_js +suite: treemap +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + This example uses marker.colorscale to change the sector's color. +--- +var values = ["11", "12", "13", "14", "15", "20", "30"] +var labels = ["A1", "A2", "A3", "A4", "A5", "B1", "B2"] +var parents = ["", "A1", "A2", "A3", "A4", "", "B1"] + +var data = [{ + type: 'treemap', + values: values, + labels: labels, + parents: parents, + marker: {colorscale: 'Blues'} +}] + +Plotly.newPlot('myDiv', data) \ No newline at end of file diff --git a/content/plotly_js/basic/treemap/set-colorway-treemap.html b/content/plotly_js/basic/treemap/set-colorway-treemap.html new file mode 100644 index 00000000000..a8f67b46a67 --- /dev/null +++ b/content/plotly_js/basic/treemap/set-colorway-treemap.html @@ -0,0 +1,20 @@ +--- +name: +language: plotly_js +suite: treemap +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + This example uses `treemapcolorway` attribute, which should be set in layout. +--- +var labels = ["A1", "A2", "A3", "A4", "A5", "B1", "B2"]; +var parents = ["", "A1", "A2", "A3", "A4", "", "B1"]; +var data = [{ + type: 'treemap', + labels: labels, + parents: parents +}] +var layout = {treemapcolorway: ["pink", "lightgray"]} + +Plotly.newPlot('myDiv', data, layout) \ No newline at end of file diff --git a/content/plotly_js/basic/treemap/set-marker-color-treemap.html b/content/plotly_js/basic/treemap/set-marker-color-treemap.html new file mode 100644 index 00000000000..50c5f7b2538 --- /dev/null +++ b/content/plotly_js/basic/treemap/set-marker-color-treemap.html @@ -0,0 +1,21 @@ +--- +name: Set Color of Treemap Sectors +language: plotly_js +suite: treemap +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + There are three different ways to change the color of the sectors in Treemap: + 1) [marker.colors](https://plotly.com/javascript/reference/treemap/#treemap-marker-colors), 2) [colorway](https://plotly.com/javascript/reference/layout/#layout-colorway), 3) [colorscale](https://plotly.com/javascript/reference/treemap/#treemap-marker-colorscale). The following examples show how to use each of them. +--- +var labels = ["A1", "A2", "A3", "A4", "A5", "B1", "B2"]; +var parents = ["", "A1", "A2", "A3", "A4", "", "B1"]; +var data = [{ + type: 'treemap', + labels: labels, + parents: parents, + marker: {colors: ["pink", "royalblue", "lightgray", "purple", "cyan", "lightgray", "lightblue"]} +}] + +Plotly.newPlot('myDiv', data) \ No newline at end of file diff --git a/content/plotly_js/basic/treemap/treemap_attributes.html b/content/plotly_js/basic/treemap/treemap_attributes.html new file mode 100644 index 00000000000..494ea0dad9d --- /dev/null +++ b/content/plotly_js/basic/treemap/treemap_attributes.html @@ -0,0 +1,59 @@ +--- +name: Set Different Attributes in Treemap +language: plotly_js +suite: treemap +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + This example uses the following attributes: +
    +
  1. [values](https://plotly.com/javascript/reference/treemap/#treemap-values): sets the values associated with each of the sectors.
  2. +
  3. [textinfo](https://plotly.com/javascript/reference/treemap/#treemap-textinfo): determines which trace information appear on the graph that can be 'text', 'value', 'current path', 'percent root', 'percent entry', and 'percent parent', or any combination of them.
  4. +
  5. [pathbar](https://plotly.com/javascript/reference/treemap/#treemap-pathbar): a main extra feature of treemap to display the current path of the visible portion of the hierarchical map. It may also be useful for zooming out of the graph.
  6. +
  7. [branchvalues](https://plotly.com/javascript/reference/treemap/#treemap-branchvalues): determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. In the example below Eva = 65, which is equal to 14 + 12 + 10 + 2 + 6 + 6 + 1 + 4.
  8. +
+ When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. +--- +var labels = ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"] +var parents = ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"] +var data = [{ + type: "treemap", + labels: labels, + parents: parents, + values: [10, 14, 12, 10, 2, 6, 6, 1, 4], + textinfo: "label+value+percent parent+percent entry", + domain: {"x": [0, 0.48]}, + outsidetextfont: {"size": 20, "color": "#377eb8"}, + marker: {"line": {"width": 2}}, + pathbar: {"visible": false} + },{ + type: "treemap", + branchvalues: "total", + labels: labels, + parents: parents, + domain: {x: [0.52, 1]}, + values: [65, 14, 12, 10, 2, 6, 6, 1, 4], + textinfo: "label+value+percent parent+percent entry", + outsidetextfont: {"size": 20, "color": "#377eb8"}, + marker: {"line": {"width": 2}}, + pathbar: {"visible": false} + }]; +var layout = { + annotations: [{ + showarrow: false, + text: "branchvalues: remainder", + x: 0.25, + xanchor: "center", + y: 1.1, + yanchor: "bottom" + }, { + showarrow: false, + text: "branchvalues: total", + x: 0.75, + xanchor: "center", + y: 1.1, + yanchor: "bottom" + }]} + +Plotly.newPlot('myDiv', data, layout) \ No newline at end of file diff --git a/content/plotly_js/basic/treemap/treemap_plotly_js_index.html b/content/plotly_js/basic/treemap/treemap_plotly_js_index.html new file mode 100644 index 00000000000..2b9b034cb3b --- /dev/null +++ b/content/plotly_js/basic/treemap/treemap_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make a D3.js-based treemap chart in javascript to visualize hierarchical + data. +display_as: basic +language: plotly_js +layout: base +name: Treemaps +order: 11 +permalink: javascript/treemaps/ +thumbnail: thumbnail/treemap.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","treemap" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} + +See https://plotly/.com/javascript/reference/treemap/ for more information and chart attribute options! \ No newline at end of file diff --git a/content/plotly_js/chart-events/callbacks-click/click-annotation.html b/content/plotly_js/chart-events/callbacks-click/click-annotation.html new file mode 100644 index 00000000000..f37cc608913 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-click/click-annotation.html @@ -0,0 +1,44 @@ +--- +name: Create annotation on click event +plot_url: https://codepen.io/plotly/embed/Kzjamd/?height=465&theme-id=15263&default-tab=result +arrangement: horizontal +language: plotly_js +suite: click-events +sitemap: false +order: 2 +--- + +var myPlot = document.getElementById('myDiv'), + N = 100, + x = d3.range(N), + y1 = d3.range(N).map( d3.random.normal() ), + y2 = d3.range(N).map( d3.random.normal(-2) ), + y3 = d3.range(N).map( d3.random.normal(2) ), + trace1 = { x:x, y:y1, type:'scatter', mode:'lines', name:'Jeff' }, + trace2 = { x:x, y:y2, type:'scatter', mode:'lines', name:'Terren' }, + trace3 = { x:x, y:y3, type:'scatter', mode:'lines', name:'Arthur' }, + data = [ trace1, trace2, trace3 ], + layout = { + hovermode:'closest', + title: {text: 'Click on Points to add an Annotation on it'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_click', function(data){ + var pts = ''; + for(var i=0; i < data.points.length; i++){ + annotate_text = 'x = '+data.points[i].x + + 'y = '+data.points[i].y.toPrecision(4); + + annotation = { + text: annotate_text, + x: data.points[i].x, + y: parseFloat(data.points[i].y.toPrecision(4)) + } + + annotations = self.layout.annotations || []; + annotations.push(annotation); + Plotly.relayout('myDiv',{annotations: annotations}) + } +}); diff --git a/content/plotly_js/chart-events/callbacks-click/click-event-data.html b/content/plotly_js/chart-events/callbacks-click/click-event-data.html new file mode 100644 index 00000000000..5a3f3d6dc32 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-click/click-event-data.html @@ -0,0 +1,22 @@ +--- +name: Click Event Data +language: plotly_js +suite: click-events +sitemap: false +order: 0 +--- + +{ + points: [{ + curveNumber: 2, // index in data of the trace associated with the selected point + pointNumber: 2, // index of the selected point + x: 5, // x value + y: 600, // y value + data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point + fullData: {/* */}, // ref to the trace including all the defaults + xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point + yaxis: {/* */} // ref to y-axis object " " + }, { + /* similarly for other selected points */ + }] +} diff --git a/content/plotly_js/chart-events/callbacks-click/click.html b/content/plotly_js/chart-events/callbacks-click/click.html new file mode 100644 index 00000000000..750302195f7 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-click/click.html @@ -0,0 +1,30 @@ +--- +name: Binding to Click Events +plot_url: https://codepen.io/plotly/embed/QbZmZY/?height=465&theme-id=15263&default-tab=result +arrangement: horizontal +language: plotly_js +suite: click-events +sitemap: false +order: 1 +--- +var myPlot = document.getElementById('myDiv'), + N = 16, + x = d3.range(N), + y = d3.range(N).map( d3.random.normal() ), + data = [ { x:x, y:y, type:'scatter', + mode:'markers', marker:{size:16} } ], + layout = { + hovermode:'closest', + title: {text: 'Click on Points'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_click', function(data){ + var pts = ''; + for(var i=0; i < data.points.length; i++){ + pts = 'x = '+data.points[i].x +'\ny = '+ + data.points[i].y.toPrecision(4) + '\n\n'; + } + alert('Closest point clicked:\n\n'+pts); +}); diff --git a/content/plotly_js/chart-events/callbacks-click/click_index.html b/content/plotly_js/chart-events/callbacks-click/click_index.html new file mode 100644 index 00000000000..832148489a1 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-click/click_index.html @@ -0,0 +1,14 @@ +--- +name: Click Events +permalink: javascript/click-events/ +description: How to bind callback functions to click events in D3.js-based JavaScript charts. +layout: base +thumbnail: thumbnail/click.jpg +language: plotly_js +page_type: example_index +display_as: chart_events +order: 1 +redirect_from: javascript-graphing-library/click-events/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","click-events" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/chart-events/callbacks-hover/hover-bind.html b/content/plotly_js/chart-events/callbacks-hover/hover-bind.html new file mode 100644 index 00000000000..9d655212e9e --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-hover/hover-bind.html @@ -0,0 +1,36 @@ +--- +name: Capturing Hover Events: Data +plot_url: https://codepen.io/plotly/embed/oXadPM/?height=550&theme-id=15263&default-tab=result +language: plotly_js +suite: hover-events +sitemap: false +arrangement: horizontal +order: 1 +--- +var myPlot = document.getElementById('myDiv'), + hoverInfo = document.getElementById('hoverinfo'), + N = 16, + x = d3.range(N), + y1 = d3.range(N).map( d3.random.normal() ), + y2 = d3.range(N).map( d3.random.normal() ), + data = [ { x:x, y:y1, type:'scatter', name:'Trial 1', + mode:'markers', marker:{size:16} }, + { x:x, y:y2, type:'scatter', name:'Trial 2', + mode:'markers', marker:{size:16} } ]; + layout = { + hovermode:'closest', + title: {text: 'Hover on Points'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_hover', function(data){ + var infotext = data.points.map(function(d){ + return (d.data.name+': x= '+d.x+', y= '+d.y.toPrecision(3)); + }); + + hoverInfo.innerHTML = infotext.join('
'); +}) + .on('plotly_unhover', function(data){ + hoverInfo.innerHTML = ''; +}); diff --git a/content/plotly_js/chart-events/callbacks-hover/hover-complex.html b/content/plotly_js/chart-events/callbacks-hover/hover-complex.html new file mode 100644 index 00000000000..333ff05c6b7 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-hover/hover-complex.html @@ -0,0 +1,12 @@ +--- +name: Combined Click and Hover Events +plot_url: https://codepen.io/plotly/embed/eJOyej/?height=600&theme-id=15263&default-tab=result +language: plotly_js +suite: hover-events +sitemap: false +arrangement: horizontal +height: 600 +order: 4 +--- + +This is a more complex example that uses both hover, and click events to display traces. Take a look in the codepen javascript! diff --git a/content/plotly_js/chart-events/callbacks-hover/hover-coupled.html b/content/plotly_js/chart-events/callbacks-hover/hover-coupled.html new file mode 100644 index 00000000000..19fda3d62af --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-hover/hover-coupled.html @@ -0,0 +1,48 @@ +--- +name: Coupled Hover Events +plot_url: https://codepen.io/plotly/embed/zvzdGb/?height=550&theme-id=15263&default-tab=result +language: plotly_js +suite: hover-events +sitemap: false +arrangement: horizontal +order: 3 +--- +var myPlot = document.getElementById('myDiv'), + N = 12, + x1 = d3.range(N).map( d3.random.normal() ), + x2 = d3.range(N).map( d3.random.normal() ), + x3 = d3.range(N).map( d3.random.normal() ), + y1 = d3.range(N).map( d3.random.normal() ), + y2 = d3.range(N).map( d3.random.normal() ), + y3 = d3.range(N).map( d3.random.normal() ), + months = ['January', 'February', 'March', 'April', + 'May', 'June', 'July', 'August', + 'September', 'October', 'November', 'December'] + data = [{ x: x1, y: y1, text: months, type: 'scatter', name: '2014', hoverinfo: 'text+x+y', + mode: 'markers', marker: {color: 'rgba(200, 50, 100, .7)', size: 16} + }, + { x: x2, y: y2, text: months, type: 'scatter', name: '2015', hoverinfo: 'text+x+y', + mode: 'markers', marker: {color: 'rgba(120, 20, 130, .7)', size: 16} + }, + { x: x3, y: y3, text: months, type: 'scatter', name: '2016', hoverinfo: 'text+x+y', + mode: 'markers', marker: {color: 'rgba(10, 180, 180, .8)', size: 16} + }]; + layout = { + hovermode:'closest', + title: {text: 'Display Hover Info for Related Points'}, + xaxis:{zeroline:false, hoverformat: '.2r'}, + yaxis:{zeroline:false, hoverformat: '.2r'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_hover', function (eventdata){ + var points = eventdata.points[0], + pointNum = points.pointNumber; + + Plotly.Fx.hover('myDiv',[ + { curveNumber:0, pointNumber:pointNum }, + { curveNumber:1, pointNumber:pointNum }, + { curveNumber:2, pointNumber:pointNum }, + ]); +}); diff --git a/content/plotly_js/chart-events/callbacks-hover/hover-event-data.html b/content/plotly_js/chart-events/callbacks-hover/hover-event-data.html new file mode 100644 index 00000000000..7841f4404c4 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-hover/hover-event-data.html @@ -0,0 +1,23 @@ +--- +name: Hover Event Data +language: plotly_js +suite: hover-events +sitemap: false +arrangement: horizontal +order: 0 +--- + +{ + points: [{ + curveNumber: 2, // index in data of the trace associated with the selected point + pointNumber: 2, // index of the selected point + x: 5, // x value + y: 600, // y value + data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point + fullData: {/* */}, // ref to the trace including all the defaults + xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point + yaxis: {/* */} // ref to y-axis object " " + }, { + /* similarly for other selected points */ + }] +} diff --git a/content/plotly_js/chart-events/callbacks-hover/hover-manual.html b/content/plotly_js/chart-events/callbacks-hover/hover-manual.html new file mode 100644 index 00000000000..2d04f984221 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-hover/hover-manual.html @@ -0,0 +1,40 @@ +--- +name: Triggering Hover Events +plot_url: https://codepen.io/plotly/embed/bdmMQN/?height=550&theme-id=15263&default-tab=result +language: plotly_js +suite: hover-events +sitemap: false +arrangement: horizontal +order: 2 +--- +var myPlot = document.getElementById('myDiv'), + hoverButton = document.getElementById('hoverbutton'), + N = 16, + x = d3.range(N), + y1 = d3.range(N).map( d3.random.normal() ), + y2 = d3.range(N).map( d3.random.normal() ), + data = [ { x:x, y:y1, type:'scatter', name:'Trial 1', + mode:'markers', marker:{size:16} }, + { x:x, y:y2, type:'scatter', name:'Trial 2', + mode:'markers', marker:{size:16} } ]; + layout = { + hovermode:'closest', + title: {text: 'Click "Go" button to trigger hover'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_beforehover',function(){ + return false; +}); + +hoverButton.addEventListener('click', function(){ + var curve1 = Math.floor(Math.random()*2), + curve2 = Math.floor(Math.random()*2), + point1 = Math.floor(Math.random()*14), + point2 = Math.floor(Math.random()*14); + Plotly.Fx.hover('myDiv',[ + {curveNumber:curve1, pointNumber:point1}, + {curveNumber:curve2, pointNumber:point2} + ]); +}); diff --git a/content/plotly_js/chart-events/callbacks-hover/hover_index.html b/content/plotly_js/chart-events/callbacks-hover/hover_index.html new file mode 100644 index 00000000000..64a7f4a8d3b --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-hover/hover_index.html @@ -0,0 +1,15 @@ +--- +name: Hover Events +permalink: javascript/hover-events/ +description: How to bind callback functions to hover events in D3.js-based JavaScript charts. +layout: base +thumbnail: thumbnail/hover.jpg +language: plotly_js +page_type: example_index +display_as: chart_events +order: 2 +arrangement: horizontal +redirect_from: javascript-graphing-library/hover-events/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","hover-events" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/chart-events/callbacks-hover/pixel-hover.html b/content/plotly_js/chart-events/callbacks-hover/pixel-hover.html new file mode 100644 index 00000000000..1e3c5b73cc2 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-hover/pixel-hover.html @@ -0,0 +1,37 @@ +--- +name: Capturing Hover Events: Pixels +plot_url: https://codepen.io/plotly/embed/xgaEaR/?height=550&theme-id=15263&default-tab=result +language: plotly_js +suite: hover-events +order: 1.5 +sitemap: false +arrangement: horizontal +--- + +var myPlot = document.getElementById('myDiv'), + hoverInfo = document.getElementById('hoverinfo'), + N = 16, + x = d3.range(N), + y1 = d3.range(N).map(d3.random.normal()), + y2 = d3.range(N).map(d3.random.normal()), + data = [{x:x, y:y1, type:'scatter', name:'Trial 1', + mode:'markers', marker:{size:16}}, + {x:x, y:y2, type:'scatter', name:'Trial 2', + mode:'markers', marker:{size:16}}], + layout = {hovermode:'closest', + title: {text: 'Hover on Points to see
Pixel Coordinates'}}; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_hover', function(data){ + var xaxis = data.points[0].xaxis, + yaxis = data.points[0].yaxis; + var infotext = data.points.map(function(d){ + return ('width: '+xaxis.l2p(d.x)+', height: '+yaxis.l2p(d.y)); + }); + + hoverInfo.innerHTML = infotext.join('
'); +}) + .on('plotly_unhover', function(data){ + hoverInfo.innerHTML = ''; +}); diff --git a/content/plotly_js/chart-events/callbacks-zoom/zoom-bind.html b/content/plotly_js/chart-events/callbacks-zoom/zoom-bind.html new file mode 100644 index 00000000000..01b4174e973 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-zoom/zoom-bind.html @@ -0,0 +1,27 @@ +--- +name: Binding to Zoom Events +plot_url: https://codepen.io/plotly/embed/dogexw/?height=530&theme-id=15263&default-tab=result +language: plotly_js +suite: zoom-events +sitemap: false +order: 0 +arrangement: horizontal +--- +var graphDiv = document.getElementById('myDiv'); + +var N = 40, + x = d3.range(N), + y = d3.range(N).map( d3.random.normal() ), + data = [ { x:x, y:y } ]; + layout = { title: {text: 'Click-drag to zoom' }}; + +Plotly.newPlot(graphDiv, data, layout); + +graphDiv.on('plotly_relayout', + function(eventdata){ + alert( 'ZOOM!' + '\n\n' + + 'Event data:' + '\n' + + JSON.stringify(eventdata) + '\n\n' + + 'x-axis start:' + eventdata['xaxis.range[0]'] + '\n' + + 'x-axis end:' + eventdata['xaxis.range[1]'] ); + }); diff --git a/content/plotly_js/chart-events/callbacks-zoom/zoom_index.html b/content/plotly_js/chart-events/callbacks-zoom/zoom_index.html new file mode 100644 index 00000000000..0be89456838 --- /dev/null +++ b/content/plotly_js/chart-events/callbacks-zoom/zoom_index.html @@ -0,0 +1,14 @@ +--- +name: Zoom Events +permalink: javascript/zoom-events/ +description: How to bind callback functions to zoom events in D3.js-based JavaScript charts. +layout: base +thumbnail: thumbnail/zoom.jpg +language: plotly_js +page_type: example_index +display_as: chart_events +order: 4 +redirect_from: javascript-graphing-library/zoom-events/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","zoom-events" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/chart-events/events/order10_afterplot.html b/content/plotly_js/chart-events/events/order10_afterplot.html new file mode 100644 index 00000000000..d24ef1687cc --- /dev/null +++ b/content/plotly_js/chart-events/events/order10_afterplot.html @@ -0,0 +1,27 @@ +--- +name: Afterplot Event +plot_url: https://codepen.io/plotly/embed/YeGGdy/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: events +order: 10.2 +sitemap: false +arrangement: horizontal +markdown_content: | + The event handler: `plotly_afterplot`, can be used to trigger an event each time a chart is plotted. This also includes re-plotting after the restyling or relayout of a plot. + Users also have the option of adding a post-plot handler to the plot call with the following syntax: `Plotly.newPlot('myDiv', data, layout, config).then(postPlotHandler);` + + The simple example below logs a console message each time the chart is plotted. Zoom or pan on the graph below to trigger the `plotly_afterplot` handler. +--- +var myPlot = document.getElementById('myDiv'), + N = 20, + x = d3.range(N), + y = d3.range(N).map( d3.random.normal() ), + data = [{x:x, y:y, type:'scatter', + mode:'markers', marker:{size:14}} + ]; + +Plotly.newPlot('myDiv', data); + +myPlot.on('plotly_afterplot', function(){ + console.log('done plotting'); +}); diff --git a/content/plotly_js/chart-events/events/order1_using_events.html b/content/plotly_js/chart-events/events/order1_using_events.html new file mode 100644 index 00000000000..6251316c17e --- /dev/null +++ b/content/plotly_js/chart-events/events/order1_using_events.html @@ -0,0 +1,17 @@ +--- +name: Using Plotly.js Events +plot_url: +language: plotly_js +suite: events +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + Plotly graphs emit events prefixed with plotly_ (i.e. `'plotly_click'`, `'plotly_hover'`, `'plotly_relayout'`) when interacted with (clicked, hovered, zoomed). Event handlers can be bound to events using the `.on` method that is exposed by the plot div object. + + In addition to the event handler, some events emit additional information about the point(s) or plot interacted with. The following documentation organizes Plotly events based on the accessible information emitted with the event: [event data](), [update data](), or [no additional data](). The following page provides a description and example of each Plotly event as well as the structure of the data or update returned with the event. +--- +myDiv.on('plotly_event', function(){ + // do something; + }); + diff --git a/content/plotly_js/chart-events/events/order2_simple_event_ex.html b/content/plotly_js/chart-events/events/order2_simple_event_ex.html new file mode 100644 index 00000000000..3966f722a11 --- /dev/null +++ b/content/plotly_js/chart-events/events/order2_simple_event_ex.html @@ -0,0 +1,26 @@ +--- +name: Simple Event Example +plot_url: https://codepen.io/plotly/embed/NbvPLa/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: events +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + Here's a simple example using a Plotly event. Click on a point on the chart below to see an alert triggered by the `plotly_click` event. +--- +var myPlot = document.getElementById('myDiv'), + x = [1, 2, 3, 4, 5], + y = [10, 20, 30, 20, 10], + data = [{x:x, y:y, type:'scatter', + mode:'markers', marker:{size:20} + }], + layout = {hovermode:'closest', + title: {text: 'Click on Points'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_click', function(){ + alert('You clicked this Plotly chart!'); +}); diff --git a/content/plotly_js/chart-events/events/order3-1_event_data.html b/content/plotly_js/chart-events/events/order3-1_event_data.html new file mode 100644 index 00000000000..632066a8b51 --- /dev/null +++ b/content/plotly_js/chart-events/events/order3-1_event_data.html @@ -0,0 +1,77 @@ +--- +name: Event Data +plot_url: +language: plotly_js +suite: events +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + Many Plotly events emit event data when the event is triggered. Event data is information about the data point related to the event (i.e. the point clicked).
+ The following events emit event data: [`plotly_click`](), [`plotly_hover`](), [`plotly_unhover`](), [`plotly_selecting`](), and [`plotly_selected`](). +
Event data differs depending on the type of plot the user is interacting with. The event data structure for Cartesian (2D) plots, 3D plots, and maps can be found below, along with examples of each event. +--- +// Cartesian +{ + points: [{ + curveNumber: 1, // index in data of the trace associated with the selected point + pointNumber: 1, // index of the selected point + x: 1, // x value + y: 1, // y value + data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point + fullData: {/* */}, // ref to the trace including all of the default attributes + xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point + yaxis: {/* */} // ref to y-axis object " " + }, { + /* similarly for other selected points */ + }] +} + +// Cartesian Histograms +{ + points: [{ + curveNumber: 1, // index in data of the trace associated with the selected point + pointNumbers: [1, 5, 28, 33, 41, ...], // Array of indices of the points aggregated into selected bin + x: 1, // x value + y: 45, // y value + data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point + fullData: {/* */}, // ref to the trace including all of the default attributes + xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point + yaxis: {/* */} // ref to y-axis object " " + }, { + /* similarly for other selected points */ + }] +} + +// 3D +{ + points: [{ + curveNumber: 2, // index in data of the trace associated with the selected point + pointNumber: 2, // index of the selected point + x: 5, // x value + y: 600, // y value + z: 12, // z value + data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point + fullData: {/* */}, // ref to the trace including all of the default attributes + xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point + yaxis: {/* */} // ref to y-axis object " " + zaxis: {/* */} // ref to z-axis object " " + }, { + /* similarly for other selected points */ + }] +} + +// Maps +{ + points: [{ + curveNumber: 2, // index in data of the trace associated with the selected point + pointNumber: 2, // index of the selected point + lat: 50, // latitude value + lon: -12, // longitude value + data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point + fullData: {/* */}, // ref to the trace including all of the default attributes + location: // + }, { + /* similarly for other selected points */ + }] +} diff --git a/content/plotly_js/chart-events/events/order5_hover_event.html b/content/plotly_js/chart-events/events/order5_hover_event.html new file mode 100644 index 00000000000..30ccbe924b7 --- /dev/null +++ b/content/plotly_js/chart-events/events/order5_hover_event.html @@ -0,0 +1,56 @@ +--- +name: Hover Event +plot_url: https://codepen.io/plotly/embed/xgxbrj/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: events +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + Here's a simple example of using the data returned from the `plotly_hover` and `plotly_unhover` events to restyle the graph. After creating a plot, we can change the color of the point hovered on by updating the `marker.color` array at the index of the point we hovered on then using `Plotly.restyle()` to apply the update. Then we can use `plotly_unhover` to change the `marker.color` back to the original color. For more examples of using `plotly_hover` events, see: https://plotly.com/javascript/hover-events/ +--- +var myPlot = document.getElementById('myDiv'), + x = [1, 2, 3, 4, 5, 6, 7], + y = [1, 2, 3, 2, 3, 4, 3], + colors =['#00000','#00000','#00000', + '#00000','#00000','#00000', + '#00000'], + data = [{x:x, y:y, + type:'scatter', + mode:'markers', marker:{size:16, color:colors}}], + layout = { + hovermode:'closest', + title: {text: 'Hover on a Point
to Change Color'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_hover', function(data){ + var pn='', + tn='', + colors=[]; + for(var i=0; i < data.points.length; i++){ + pn = data.points[i].pointNumber; + tn = data.points[i].curveNumber; + colors = data.points[i].data.marker.color; + }; + colors[pn] = '#C54C82'; + + var update = {'marker':{color: colors, size:16}}; + Plotly.restyle('myDiv', update, [tn]); +}); + +myPlot.on('plotly_unhover', function(data){ + var pn='', + tn='', + colors=[]; + for(var i=0; i < data.points.length; i++){ + pn = data.points[i].pointNumber; + tn = data.points[i].curveNumber; + colors = data.points[i].data.marker.color; + }; + colors[pn] = '#00000'; + + var update = {'marker':{color: colors, size:16}}; + Plotly.restyle('myDiv', update, [tn]); +}); diff --git a/content/plotly_js/chart-events/events/order6_click_event.html b/content/plotly_js/chart-events/events/order6_click_event.html new file mode 100644 index 00000000000..8f26565b2c6 --- /dev/null +++ b/content/plotly_js/chart-events/events/order6_click_event.html @@ -0,0 +1,39 @@ +--- +name: Click Event +plot_url: https://codepen.io/plotly/embed/Obxbdv/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: events +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + Here's a simple example of using the data returned from the `plotly_click` event to restyle the graph. After creating a plot, we can change the color of the point clicked on by updating the `marker.color` array at the index of the point we clicked on then using `Plotly.restyle()` to apply the update. For more examples of using `plotly_click` events, see: [https://plotly.com/javascript/click-events/]() +--- +var myPlot = document.getElementById('myDiv'), + x = [1, 2, 3, 4, 5, 6], + y = [1, 2, 3, 2, 3, 4], + colors = ['#00000','#00000','#00000', + '#00000','#00000','#00000'], + data = [{x:x, y:y, type:'scatter', + mode:'markers', marker:{size:16, color:colors}}], + layout = { + hovermode:'closest', + title: {text: 'Click on a Point to Change Color
Double Click (anywhere) to Change it Back'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_click', function(data){ + var pn='', + tn='', + colors=[]; + for(var i=0; i < data.points.length; i++){ + pn = data.points[i].pointNumber; + tn = data.points[i].curveNumber; + colors = data.points[i].data.marker.color; + }; + colors[pn] = '#C54C82'; + + var update = {'marker':{color: colors, size:16}}; + Plotly.restyle('myDiv', update, [tn]); +}); diff --git a/content/plotly_js/chart-events/events/order6_legendclick_event.html b/content/plotly_js/chart-events/events/order6_legendclick_event.html new file mode 100644 index 00000000000..b28ff8fd3ea --- /dev/null +++ b/content/plotly_js/chart-events/events/order6_legendclick_event.html @@ -0,0 +1,51 @@ +--- +name: Legend Click Events +plot_url: https://codepen.io/plotly/embed/vazxKv/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: events +order: 4.1 +sitemap: false +arrangement: horizontal +markdown_content: | + `plotly_legendclick` and `plotly_legenddoubleclick` allow customization of the plotly legend. The default behaviour of `plotly_legendclick` is to hide a trace and the default behavior of `plotly_legenddoubleclick` is to select one trace and hide all the others. + We can add to the default behaviour by creating a new `plotly_legendclick` event with a function of our choice. We can also disable the default behaviour by creating a function that returns `false`. In the example below, we do both in order to create a `plotly_legendclick` event which changes the marker color back to black instead of erasing the trace. +--- +var myPlot = document.getElementById('myDiv'), + x = [1, 2, 3, 4, 5, 6], + y = [1, 2, 3, 2, 3, 4], + y2 = [1, 4, 7, 6, 1, 5], + colors = [['#5C636E','#5C636E','#5C636E','#5C636E','#5C636E','#5C636E'], + ['#393e46','#393e46','#393e46','#393e46','#393e46','#393e46']], + data = [{x:x, y:y, type:'scatter', + mode:'line', line:{ color:'#5C636E'},marker:{size:16, color:colors[0]}}, + {x:x, y:y2, type:'scatter', + mode:'line',line:{ color:'#393e46'}, marker:{size:16, color:colors[1]}}], + layout = { + showlegend: true, + hovermode:'closest', + title: {text: 'Click on a Point to Change Color
Click on a Trace in the Legend to Change Back One Trace Only'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_click', function(data){ + var pn='', + tn='', + colors=[]; + for(var i=0; i < data.points.length; i++){ + pn = data.points[i].pointNumber; + tn = data.points[i].curveNumber; + colors = data.points[i].data.marker.color; + }; + colors[pn] = '#C54C82'; + var update = {'marker':{color: colors, size:16}}; + Plotly.restyle('myDiv', update,[tn]); +}); + +myPlot.on('plotly_legendclick', function(data){ + var trColors = [['#5C636E','#5C636E','#5C636E','#5C636E','#5C636E','#5C636E'], + ['#393e46','#393e46','#393e46','#393e46','#393e46','#393e46']]; + var update = {'marker':{color: trColors[data.curveNumber], size:16}}; + Plotly.restyle('myDiv', update,[data.curveNumber]); + return false; +}); diff --git a/content/plotly_js/chart-events/events/order6_selected_event.html b/content/plotly_js/chart-events/events/order6_selected_event.html new file mode 100644 index 00000000000..151cd0040d4 --- /dev/null +++ b/content/plotly_js/chart-events/events/order6_selected_event.html @@ -0,0 +1,100 @@ +--- +name: Select Event +plot_url: https://codepen.io/plotly/embed/BpayyX/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: events +order: 6 +sitemap: false +arrangement: horizontal +markdown_content: | + Here's a simple example using the data returned from the `plotly_selected` event. `plotly_selected` returns event data for all points selected simultaneously. After creating a scatter plot with random data and two histograms that display the x and y distributions of that random data, we can select points by clicking and dragging on the plot. Upon `plotly_selected` the histograms will update to display the distribution of the x and y values of the selected points. The color of the scatter plot will be updated as well to highlight the selected points. For more examples of using `plotly_selected` and `plotly_selecting` events, see: https://plotly.com/javascript/lasso-selection/ +--- +var graphDiv = document.getElementById('myDiv'); +var N = 1000; +var color1 = '#7b3294'; +var color1Light = '#c2a5cf'; +var colorX = '#ffa7b5'; +var colorY = '#fdae61'; + +function randomArray() { + var out = new Array(N); + for(var i = 0; i < N; i++) { + out[i] = Math.random(); + } + return out; +} +var x = randomArray(); +var y = randomArray(); + +Plotly.newPlot(graphDiv, [{ + type: 'scatter', + mode: 'markers', + x: x, + y: y, + xaxis: 'x', + yaxis: 'y', + name: 'random data', + marker: {color: color1, size: 10} +}, { + type: 'histogram', + x: x, + xaxis: 'x2', + yaxis: 'y2', + name: 'x coord dist.', + marker: {color: colorX} +}, { + type: 'histogram', + x: y, + xaxis: 'x3', + yaxis: 'y3', + name: 'y coord dist.', + marker: {color: colorY} +}], { + title: { + text: 'Lasso around the scatter points to see sub-distributions' + }, + dragmode: 'lasso', + xaxis: { + zeroline: false, + }, + yaxis: { + domain: [0.55, 1], + }, + xaxis2: { + domain: [0, 0.45], + anchor: 'y2', + }, + yaxis2: { + domain: [0, 0.45], + anchor: 'x2' + }, + xaxis3: { + domain: [0.55, 1], + anchor: 'y3' + }, + yaxis3: { + domain: [0, 0.45], + anchor: 'x3' + } +}); + +graphDiv.on('plotly_selected', function(eventData) { + var x = []; + var y = []; + + var colors = []; + for(var i = 0; i < N; i++) colors.push(color1Light); + + eventData.points.forEach(function(pt) { + x.push(pt.x); + y.push(pt.y); + colors[pt.pointNumber] = color1; + }); + + Plotly.restyle(graphDiv, { + x: [x, y], + xbins: {} + }, [1, 2]); + + Plotly.restyle(graphDiv, 'marker.color', [colors], [0]); +}); diff --git a/content/plotly_js/chart-events/events/order7_doubleclick_event.html b/content/plotly_js/chart-events/events/order7_doubleclick_event.html new file mode 100644 index 00000000000..cd04eabd056 --- /dev/null +++ b/content/plotly_js/chart-events/events/order7_doubleclick_event.html @@ -0,0 +1,46 @@ +--- +name: Double Click Event +plot_url: https://codepen.io/plotly/embed/WoZOdq/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: events +order: 10.3 +sitemap: false +arrangement: horizontal +markdown_content: | + In addition to `plotly_click`, `plotly_doubleclick` can be used as an event handle in Plotly charts as well. You may already be familiar with `plotly_doubleclick` if you regularly use Plotly's zoom and pan functionality, double clicking on the graph will restore the axes ranges after zooming into a specific area. Unlike `plotly_click`, a `plotly_doubleclick` is registered upon clicking anywhere on the graph (not just data points), therefore, `plotly_doubleclick` does not return data. In the following example, we'll build off of our `plotly_click` example, and reset the color of our data points upon double clicking anywhere on the graph. +--- +var myPlot = document.getElementById('myDiv'), + x = [1, 2, 3, 4, 5, 6], + y = [1, 2, 3, 2, 3, 4], + colors = ['#00000','#00000','#00000', + '#00000','#00000','#00000'], + data = [{x:x, y:y, type:'scatter', + mode:'markers', marker:{size:16, color:colors}}], + layout = { + hovermode:'closest', + title: {text: 'Click on a Point to Change Color
Double Click (anywhere) to Change it Back'} + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_click', function(data){ + var pn='', + tn='', + colors=[]; + for(var i=0; i < data.points.length; i++){ + pn = data.points[i].pointNumber; + tn = data.points[i].curveNumber; + colors = data.points[i].data.marker.color; + }; + colors[pn] = '#C54C82'; + + var update = {'marker':{color: colors, size:16}}; + Plotly.restyle('myDiv', update, [tn]); +}); + +myPlot.on('plotly_doubleclick', function(data){ + var orgColors = ['#00000','#00000','#00000', + '#00000','#00000','#00000']; + var update = {'marker':{color: orgColors, size:16}}; + Plotly.restyle('myDiv', update); +}); diff --git a/content/plotly_js/chart-events/events/order7_update_data.html b/content/plotly_js/chart-events/events/order7_update_data.html new file mode 100644 index 00000000000..671f5a6c868 --- /dev/null +++ b/content/plotly_js/chart-events/events/order7_update_data.html @@ -0,0 +1,63 @@ +--- +name: Update Data +plot_url: +language: plotly_js +suite: events +order: 7 +sitemap: false +arrangement: horizontal +markdown_content: | + The following Plotly events emit update information when the event is triggered: [`plotly_restyle`]() and [`plotly_relayout`](). + The update emitted with `plotly_restyle` is similar across plot types and includes an array containing an object of the newly updated + attributes and an array of the trace numbers that were updated. + + For Cartesian (2D) plots, `plotly_relayout` emits only the xaxis and yaxis ranges which were directly changed by the triggering event. + For 3D plots, [`layout.scene.camera`](https://plotly.com/javascript/reference/layout/scene/#layout-scene-camera) data is similarly emitted. + See the full structures below: +--- +// plotly_restyle update +[ + {update}, // update object -- attribute updated: new value + [0] // array of traces updated +] + +// plotly_relayout update: Cartesian +//// Upon resizing plot: +{ + xaxis.range[0]: , // new value if xaxis.range[0] was updated + xaxis.range[1]: , + yaxis.range[0]: , // new value if yaxis.range[0] was updated + yaxis.range[1]: +} +//// Upon autosizing plot: +{ + xaxis.autorange: true, + yaxis.autorange: true +} + +// plotly_relayout update: 3D +// a subset of the following data will be emitted depending on +// which attributes were changed by the triggering event. +{ + scene: { + center: { // https://plotly.com/javascript/reference/layout/scene/#layout-scene-camera-center + x: 0, + y: 0, + z: 0 + } + }, + { + eye: { // https://plotly.com/javascript/reference/layout/scene/#layout-scene-camera-eye + x: 1.25, + y: 1.25, + z: 1.25 + } + }. + { + up: { // https://plotly.com/javascript/reference/layout/scene/#layout-scene-camera-up + x: 0, + y: 0, + z: 1 + } + } +} diff --git a/content/plotly_js/chart-events/events/order8_add_events.html b/content/plotly_js/chart-events/events/order8_add_events.html new file mode 100644 index 00000000000..ba06ad73872 --- /dev/null +++ b/content/plotly_js/chart-events/events/order8_add_events.html @@ -0,0 +1,17 @@ +--- +name: Additional Events +plot_url: +language: plotly_js +suite: events +order: 10 +sitemap: false +arrangement: horizontal +markdown_content: | + The following Plotly events do not emit additional data or update information: [`plotly_webglcontextlost`](#webgl-context-lost-event), [`plotly_afterplot`](#afterplot-event), [`plotly_autosize`](), [`plotly_deselect`](), [`plotly_doubleclick`](#double-click-event), [`plotly_redraw`](), and [`plotly_animated`](). These event handlers can be used to notify or trigger an additional event with the following syntax: +--- + +function eventTriggeredHandler() { + /* add your event triggered handler here */ +} + +myDiv.on('plotly_event', eventTriggeredHandler); \ No newline at end of file diff --git a/content/plotly_js/chart-events/events/plotly_js_events_index.html b/content/plotly_js/chart-events/events/plotly_js_events_index.html new file mode 100644 index 00000000000..91a980a453c --- /dev/null +++ b/content/plotly_js/chart-events/events/plotly_js_events_index.html @@ -0,0 +1,10 @@ +--- +name: Event Handlers +permalink: javascript/plotlyjs-events/ +description: Definitions and examples of how to use Plotly.js event handlers to add additional interactive capabilities to Plotly charts. +layout: base +language: plotly_js +page_type: example_index +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","events" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/chart-events/events/webglcontextlost.html b/content/plotly_js/chart-events/events/webglcontextlost.html new file mode 100644 index 00000000000..dd17a1e1ee0 --- /dev/null +++ b/content/plotly_js/chart-events/events/webglcontextlost.html @@ -0,0 +1,12 @@ +--- +name: Webgl Context Lost Event +language: plotly_js +suite: events +order: 10.1 +sitemap: false +arrangement: horizontal +markdown_content: | + Plotly graphs which use WebGL receive a "WebGL context" from the browser which gives them access to gpu resources. + A program may lose its WebGL context if the browser is overloaded with them and is forced to shut one down. + The event handler: `plotly_webglcontextlost`, can be used to trigger an event after a graph loses it's WebGL context. +--- diff --git a/content/plotly_js/chart-events/hover/basic-hovertemplate.html b/content/plotly_js/chart-events/hover/basic-hovertemplate.html new file mode 100644 index 00000000000..1cdb3a2afa5 --- /dev/null +++ b/content/plotly_js/chart-events/hover/basic-hovertemplate.html @@ -0,0 +1,36 @@ +--- +name: Hovertemplate +language: plotly_js +suite: hover +order: 3 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + type: 'scatter', + mode: 'lines+markers', + x: [1,2,3,4,5], + y: [2.02825,1.63728,6.83839,4.8485,4.73463], + hovertemplate: 'Price: $%{y:.2f}' + + '
X: %{x}
' + + '%{text}', + text: ["Text A", "Text B", "Text C", "Text D", "Text E"], + showlegend: false + }, + { + x: [1,2,3,4,5], + y: [3.02825,2.63728,4.83839,3.8485,1.73463], + hovertemplate: 'Price: %{y:$.2f}', + showlegend: false + } +]; + +var layout = { + title: { + text: "Set hover text with hovertemplate" + }, +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/chart-events/plotly_js-chart-events-index.html b/content/plotly_js/chart-events/plotly_js-chart-events-index.html new file mode 100644 index 00000000000..309c524f1c3 --- /dev/null +++ b/content/plotly_js/chart-events/plotly_js-chart-events-index.html @@ -0,0 +1,28 @@ +--- +permalink: javascript/chart-events/ +name: More Chart Events +description: Plotly.js makes interactive, publication-quality graphs online. Examples of binding callbacks to Plotly chart interactions. +layout: langindex +language: plotly_js +display_as: chart_events +thumbnail: thumbnail/mixed.jpg +page_type: example_index +--- + + +
+
+ +
+ +
+

Plotly.js Chart Events

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","chart_events" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/chart-events/remove-trace/remove-trace-example.html b/content/plotly_js/chart-events/remove-trace/remove-trace-example.html new file mode 100644 index 00000000000..37ec7d2d420 --- /dev/null +++ b/content/plotly_js/chart-events/remove-trace/remove-trace-example.html @@ -0,0 +1,41 @@ +--- +name: Remove Trace +plot_url: https://codepen.io/plotly/embed/963044d434248ee56d8236203c390017/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: remove-trace +order: 8 +sitemap: false +arrangement: horizontal +--- +function plotGraph(){ +var trace1 = { + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + type: 'scatter', + line: { + color: 'rgb(55, 128, 191)', + } +}; + +var trace2 = { + x: [1, 2, 3, 4], + y: [16, 5, 11, 9], + type: 'scatter', + line: { + color: 'rgb(255,140,0)', + } +}; + +var layout = { + title: {text: 'Click Buttons to Delete Traces'}, + showlegend:false +}; + +var data = [trace1, trace2]; + +Plotly.newPlot('myDiv', data, layout); +} + +function deleteTrace(divId){ + Plotly.deleteTraces('myDiv', 0); +}; diff --git a/content/plotly_js/chart-events/remove-trace/remove_trace_index.html b/content/plotly_js/chart-events/remove-trace/remove_trace_index.html new file mode 100644 index 00000000000..4d0764fff34 --- /dev/null +++ b/content/plotly_js/chart-events/remove-trace/remove_trace_index.html @@ -0,0 +1,13 @@ +--- +name: Remove Trace from Plot +permalink: javascript/remove-trace/ +description: How to remove a trace from a plot in JavaScript with D3.js. +layout: base +thumbnail: thumbnail/remove-trace.jpg +language: plotly_js +page_type: example_index +display_as: reference +redirect_from: javascript-graphing-library/remove-trace/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","remove-trace" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/chart-events/zoom-disable/zoom-unbind-both-axis.html b/content/plotly_js/chart-events/zoom-disable/zoom-unbind-both-axis.html new file mode 100644 index 00000000000..dbdf6bb285d --- /dev/null +++ b/content/plotly_js/chart-events/zoom-disable/zoom-unbind-both-axis.html @@ -0,0 +1,44 @@ +--- +name: Disabling Zoom Events for X and Y Axis +plot_url: https://codepen.io/plotly/embed/PZPPPj/?height=480&theme-id=15263&default-tab=result +language: plotly_js +suite: unbind-zoom-events +sitemap: false +order: 1 +arrangement: horizontal +--- +function makeplot() { + d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv", function(data){ processData(data) } ); + +}; + +function processData(allRows) { + + var x = [], y = [], standard_deviation = []; + + for (var i=0; i < allRows.length; i++) { + row = allRows[i]; + x.push( row['AAPL_x'] ); + y.push( row['AAPL_y'] ); + } + makePlotly( x, y, standard_deviation ); +} + +function makePlotly( x, y, standard_deviation ){ + var plotDiv = document.getElementById("myDiv"); + var traces = [{ + x: x, + y: y + }]; + + var layout = { + title: { + text: 'Plotting CSV data from AJAX call' + }, + yaxis: {fixedrange: true}, + xaxis: {fixedrange: true} + }; + + Plotly.newPlot('myDiv', traces, layout); +}; + makeplot(); diff --git a/content/plotly_js/chart-events/zoom-disable/zoom-unbind-x-axis.html b/content/plotly_js/chart-events/zoom-disable/zoom-unbind-x-axis.html new file mode 100644 index 00000000000..688d504a8ff --- /dev/null +++ b/content/plotly_js/chart-events/zoom-disable/zoom-unbind-x-axis.html @@ -0,0 +1,48 @@ +--- +name: Disabling Zoom Events for X Axis +plot_url: https://codepen.io/plotly/embed/LGppGV/?height=460&theme-id=15263&default-tab=result +language: plotly_js +suite: unbind-zoom-events +sitemap: false +order: 0 +arrangement: horizontal +--- +function makeplot() { + d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv", function(data){ processData(data) } ); + +}; + +function processData(allRows) { + + console.log(allRows); + var x = [], y = [], standard_deviation = []; + + for (var i=0; i < allRows.length; i++) { + row = allRows[i]; + x.push( row['AAPL_x'] ); + y.push( row['AAPL_y'] ); + } + console.log( 'X',x, 'Y',y, 'SD',standard_deviation ); + makePlotly( x, y, standard_deviation ); +} + +function makePlotly( x, y, standard_deviation ){ + var plotDiv = document.getElementById("myDiv"); + var traces = [{ + x: x, + y: y + }]; + + var layout = { + title: { + text: 'Plotting CSV data from AJAX call' + }, + xaxis: { + fixedrange: true + } + }; + + Plotly.newPlot('myDiv', traces, layout); +}; + makeplot(); + diff --git a/content/plotly_js/chart-events/zoom-disable/zoom-unbind_index.html b/content/plotly_js/chart-events/zoom-disable/zoom-unbind_index.html new file mode 100644 index 00000000000..f37c7581c8a --- /dev/null +++ b/content/plotly_js/chart-events/zoom-disable/zoom-unbind_index.html @@ -0,0 +1,14 @@ +--- +name: Disable Zoom Events +permalink: javascript/disable-zoom/ +description: How to disable zoom events in JavaScript charts. +layout: base +thumbnail: thumbnail/zoom.jpg +language: plotly_js +page_type: example_index +display_as: chart_events +order: 4.75 +redirect_from: javascript-graphing-library/disable-zoom/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","unbind-zoom-events" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/controls/callbacks-buttons/button-animate.html b/content/plotly_js/controls/callbacks-buttons/button-animate.html new file mode 100644 index 00000000000..f5ff4a67111 --- /dev/null +++ b/content/plotly_js/controls/callbacks-buttons/button-animate.html @@ -0,0 +1,10 @@ +--- +name: Animate Button +language: plotly_js +suite: button-events +sitemap: false +order: 5 +arrangement: horizontal +markdown_content: | + Refer to our animation docs: [https://plotly.com/javascript/#animations](https://plotly.com/javascript/#animations) for examples on how to use the animate method with Plotly buttons. +--- diff --git a/content/plotly_js/controls/callbacks-buttons/button-relayout.html b/content/plotly_js/controls/callbacks-buttons/button-relayout.html new file mode 100644 index 00000000000..f4ebf25c82e --- /dev/null +++ b/content/plotly_js/controls/callbacks-buttons/button-relayout.html @@ -0,0 +1,121 @@ +--- +name: Relayout Button +plot_url: https://codepen.io/plotly/embed/mzXQPQ/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: button-events +sitemap: false +order: 3 +arrangement: horizontal +markdown_content: | + The `relayout` method should be used when modifying the layout attributes of the graph. + **Update One Layout Attribute** + This example demonstrates how to update a layout attribute: chart type with the `relayout` method. +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/normal-clusters.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return parseFloat(row[key]); }); +} + +var button_layer_height = 1.2 +var x0 = unpack(rows,'x0') +var x1 = unpack(rows,'x1') +var x2 = unpack(rows,'x2') +var y0 = unpack(rows,'y0') +var y1 = unpack(rows,'y1') +var y2 = unpack(rows,'y2') + +var data = [{ + x: x0, + y: y0, + mode: 'markers', + marker: {color: '#835AF1'} + }, + { + x: x1, + y: y1, + mode: 'markers', + marker: {color: '#7FA6EE'} + }, + { + x: x2, + y: y2, + mode: 'markers', + marker: {color: '#B8F7D4'} + }, + +] + +var cluster0 = {type: 'circle', + xref: 'x', yref: 'y', + x0: Math.min(...x0), y0: Math.min(...y0), + x1: Math.max(...x0), y1: Math.max(...y0), + opacity: 0.25, + line: {color: '#835AF1'}, + fillcolor: '#835AF1'} + +var cluster1 = {type: 'circle', + xref: 'x', yref: 'y', + x0: Math.min(...x1), y0: Math.min(...y1), + x1: Math.max(...x1), y1: Math.max(...y1), + opacity: 0.25, + line: {color: '#7FA6EE'}, + fillcolor: '#7FA6EE'} + +var cluster2 = {type: 'circle', + xref: 'x', yref: 'y', + x0: Math.min(...x2), y0: Math.min(...y2), + x1: Math.max(...x2), y1: Math.max(...y2), + opacity: 0.25, + line: {color: '#B8F7D4'}, + fillcolor: '#B8F7D4'} + +var updatemenus=[ + { + buttons: [ + { + args: ['shapes', []], + label: 'None', + method: 'relayout' + }, + { + args: ['shapes', [cluster0]], + label: 'Cluster 0', + method: 'relayout' + }, + { + args: ['shapes', [cluster1]], + label: 'Cluster 1', + method: 'relayout' + }, + { + args: ['shapes', [cluster2]], + label: 'Cluster 2', + method: 'relayout' + }, + { + args: ['shapes', [cluster0, cluster1, cluster2]], + label: 'All', + method: 'relayout' + }, + ], + direction: 'left', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'buttons', + x: 0.1, + xanchor: 'left', + y: button_layer_height, + yanchor: 'top' + }, + +] + +var layout = { + updatemenus: updatemenus, + showlegend: false +} + + +Plotly.newPlot("myDiv", data, layout); + +}); diff --git a/content/plotly_js/controls/callbacks-buttons/button-restyle-multiple.html b/content/plotly_js/controls/callbacks-buttons/button-restyle-multiple.html new file mode 100644 index 00000000000..2b5baaba72b --- /dev/null +++ b/content/plotly_js/controls/callbacks-buttons/button-restyle-multiple.html @@ -0,0 +1,216 @@ +--- +name: Restyle Button Multiple Attributes +plot_url: https://codepen.io/plotly/embed/oaEymG/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: button-events +sitemap: false +order: 2 +arrangement: horizontal +markdown_content: | + This example demonstrates how to use a restyle button to update single attributes by passing a two element array + to a button's `args` attribute or update multiple attributes at the same time by passing an array containing an object. +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var button_layer_1_height = 1.12 +var button_layer_2_height = 1.0 +var annotation_offset = 0.04 + +var z_data=[ ] +for(i=0;i<24;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type:'surface', + colorscale:'Viridis' +}] + +var updatemenus=[ + { + buttons: [ + { + args: ['type', 'surface'], + label: '3D Surface', + method: 'restyle' + }, + { + args: ['type', 'heatmap'], + label:'Heatmap', + method:'restyle' + }, + { + args: ['type', 'contour'], + label:'Contour', + method:'restyle' + } + ], + direction: 'left', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'buttons', + x: 0.15, + xanchor: 'left', + y: button_layer_2_height, + yanchor: 'top' + }, + { + buttons: [ + { + args: ['reversescale', true], + label: 'Reverse', + method: 'restyle' + }, + { + args: ['reversescale', false], + label:'Undo Reverse', + method:'restyle' + } + ], + direction: 'down', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'dropdown', + x: 0.56, + xanchor: 'left', + y: button_layer_2_height, + yanchor: 'top' + }, + { + buttons: [ + { + args: [{'contours.showlines':false, 'type':'contour'}], + label: 'Hide lines', + method: 'restyle' + }, + { + args: [{'contours.showlines':true, 'type':'contour'}], + label:'Show lines', + method:'restyle' + } + ], + direction: 'down', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'dropdown', + x: 0.78, + xanchor: 'left', + y: button_layer_2_height, + yanchor: 'top' + }, + { + buttons: [ + { + args: ['colorscale', 'Viridis'], + label: 'Viridis', + method: 'restyle' + }, + { + args: ['colorscale', 'Electric'], + label:'Electric', + method:'restyle' + }, + { + args: ['colorscale', 'Earth'], + label:'Earth', + method:'restyle' + }, + { + args: ['colorscale', 'Hot'], + label:'Hot', + method:'restyle' + }, + { + args: ['colorscale', 'Jet'], + label:'Jet', + method:'restyle' + }, + { + args: ['colorscale', 'Portland'], + label:'Portland', + method:'restyle' + }, + { + args: ['colorscale', 'Rainbow'], + label:'Rainbow', + method:'restyle' + }, + { + args: ['colorscale', 'Blackbody'], + label:'Blackbody', + method:'restyle' + }, + + { + args: ['colorscale', 'Cividis'], + label:'Cividis', + method:'restyle' + } + ], + direction: 'left', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'buttons', + x: 0.15, + xanchor: 'left', + y: button_layer_1_height, + yanchor: 'top' + }, +] + +var annotations = [ + { + text: 'Trace type:', + x: 0, + y: button_layer_2_height - annotation_offset, + yref: 'paper', + align: 'left', + showarrow: false + }, + { + text: 'Colorscale:', + x: 0, + y: button_layer_1_height - annotation_offset, + yref: 'paper', + align: 'left', + showarrow: false + }, +] + +var layout = { + margin: {t: 0, b: 0, l: 0, r: 0}, + updatemenus: updatemenus, + annotations: annotations, + scene: { + xaxis:{ + gridcolor: 'rgb(255, 255, 255)', + zerolinecolor: 'rgb(255, 255, 255)', + showbackground: true, + backgroundcolor:'rgb(230, 230,230)' + }, + yaxis: { + gridcolor: 'rgb(255, 255, 255)', + zerolinecolor: 'rgb(255, 255, 255)', + showbackground: true, + backgroundcolor: 'rgb(230, 230, 230)' + }, + zaxis: { + gridcolor: 'rgb(255, 255, 255)', + zerolinecolor: 'rgb(255, 255, 255)', + showbackground: true, + backgroundcolor: 'rgb(230, 230,230)' + }, + aspectratio: {x: 1, y: 1, z: 0.7}, + aspectmode: 'manual' + } +} + + +Plotly.newPlot("myDiv", data, layout); + +}); diff --git a/content/plotly_js/controls/callbacks-buttons/button-restyle-simple.html b/content/plotly_js/controls/callbacks-buttons/button-restyle-simple.html new file mode 100644 index 00000000000..286b646bb5b --- /dev/null +++ b/content/plotly_js/controls/callbacks-buttons/button-restyle-simple.html @@ -0,0 +1,99 @@ +--- +name: Restyle Button Single Attribute +plot_url: https://codepen.io/plotly/embed/MPQGaQ/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: button-events +sitemap: false +order: 1 +arrangement: horizontal +markdown_content: | + The `restyle` method should be used when modifying the data and data attributes of the graph + This example demonstrates how to update a single data attribute: chart type with the `restyle` method. +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} +var z_data=[ ] +for(i=0;i<24;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type:'surface', + colorscale:'Viridis' +}] + +var updatemenus=[ + { + buttons: [ + { + args: ['type', 'surface'], + label: '3D Surface', + method: 'restyle' + }, + { + args: ['type', 'heatmap'], + label:'Heatmap', + method:'restyle' + } + ], + direction: 'left', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'buttons', + x: 0.1, + xanchor: 'left', + y: 1.1, + yanchor: 'top' + } +] + +var annotations = [ + { + text: 'Trace type:', + x: 0, + y: 1.085, + yref: 'paper', + align: 'left', + showarrow: false + } +] + +var layout = { + width: 800, + height: 900, + autosize: false, + margin: {t: 0, b: 0, l: 0, r: 0}, + updatemenus: updatemenus, + annotations: annotations, + scene: { + xaxis:{ + gridcolor: 'rgb(255, 255, 255)', + zerolinecolor: 'rgb(255, 255, 255)', + showbackground: true, + backgroundcolor:'rgb(230, 230,230)' + }, + yaxis: { + gridcolor: 'rgb(255, 255, 255)', + zerolinecolor: 'rgb(255, 255, 255)', + showbackground: true, + backgroundcolor: 'rgb(230, 230, 230)' + }, + zaxis: { + gridcolor: 'rgb(255, 255, 255)', + zerolinecolor: 'rgb(255, 255, 255)', + showbackground: true, + backgroundcolor: 'rgb(230, 230,230)' + }, + aspectratio: {x: 1, y: 1, z: 0.7}, + aspectmode: 'manual' + } +} + + +Plotly.newPlot("myDiv", data, layout); + +}); diff --git a/content/plotly_js/controls/callbacks-buttons/button-update.html b/content/plotly_js/controls/callbacks-buttons/button-update.html new file mode 100644 index 00000000000..462f8e2fadd --- /dev/null +++ b/content/plotly_js/controls/callbacks-buttons/button-update.html @@ -0,0 +1,154 @@ +--- +name: Update Button +plot_url: https://codepen.io/plotly/embed/BqYMqq/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: button-events +sitemap: false +order: 4 +arrangement: horizontal +markdown_content: | + The `update` method should be used when modifying the data and layout sections of the graph. + This example demonstrates how to update which traces are displayed while simulaneously updating + layout attributes such as the chart title and annotations. +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +const arrAvg = arr => arr.reduce((a,b) => a + b, 0) / arr.length + +var button_layer_2_height = 1.2 +var high = unpack(rows, 'AAPL.High').map(x => parseFloat(x)) +var low = unpack(rows, 'AAPL.Low').map(x => parseFloat(x)) +var date = unpack(rows, 'Date') + + +var high_ave = arrAvg(high) +var high_max = Math.max(...high) +var low_ave = arrAvg(low) +var low_min = Math.min(...low) + +var data = [{ + x: date, + y: high, + mode: 'lines', + name: 'High', + marker: {color: '#33CFA5'} + }, + { + x: date, + y: date.map(a => high_ave), + mode: 'lines', + name: 'Low Average', + line: {color: '#33CFA5', dash: 'dash'}, + visible: false + }, + { + x: date, + y: low, + name: 'Low', + mode: 'lines', + marker: {color: '#F06A6A'} + }, + { + x: date, + y: date.map(a => low_ave), + mode: 'lines', + name: 'High Average', + visible: false, + line: {color: '#F06A6A', dash: 'dash'} + }, + +] + +var high_annotations = [ + { + text: 'High Average:
' + high_ave.toFixed(2), + x: '2016-03-01', + y: high_ave, + yref: 'y', xref: 'x', + ay: -40, ax: 0 + }, + { + text: 'High Max:
' + high_max.toFixed(2), + x: date[high.indexOf(high_max)], + y: high_max, + yref: 'y', xref: 'x', + ay: -40, ax: 0 + }, +] + +var low_annotations = [{ + text: 'Low Average:
' + low_ave.toFixed(2), + x: '2015-05-01', + y: low_ave, + yref: 'y', xref: 'x', + ay: 40, ax: 0 + }, + { + text: 'Low Min:
' + low_min.toFixed(2), + x: date[low.indexOf(low_min)], + y: low_min, + yref: 'y', xref: 'x', + ay: 40, ax: 0 + } + ] + +var updatemenus=[ + { + buttons: [ + { + args: [{'visible': [true, true, false, false]}, + {'title': 'Yahoo High', + 'annotations': high_annotations}], + label: 'High', + method: 'update' + }, + { + args: [{'visible': [false, false, true, true,]}, + {'title': 'Yahoo Low', + 'annotations': low_annotations}], + label: 'Low', + method: 'update' + }, + { + args: [{'visible': [true, true, true, true,]}, + {'title': 'Yahoo', + 'annotations': [...low_annotations, ...high_annotations]}], + label: 'Both', + method: 'update' + }, + { + args: [{'visible': [true, false, true, false,]}, + {'title': 'Yahoo', + 'annotations': []}], + label: 'Reset', + method: 'update' + }, + + ], + direction: 'left', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'buttons', + x: 0.1, + xanchor: 'left', + y: button_layer_2_height, + yanchor: 'top' + }, + +] + +var layout = { + title: { + text: 'Yahoo' + }, + updatemenus: updatemenus, + showlegend: false +} + + +Plotly.newPlot("myDiv", data, layout); + +}); diff --git a/content/plotly_js/controls/callbacks-buttons/buttons_index.html b/content/plotly_js/controls/callbacks-buttons/buttons_index.html new file mode 100644 index 00000000000..5d8a1ed9542 --- /dev/null +++ b/content/plotly_js/controls/callbacks-buttons/buttons_index.html @@ -0,0 +1,14 @@ +--- +name: Button Events +permalink: javascript/custom-buttons/ +description: How to bind callback functions to custom buttons in D3.js-based JavaScript charts. +layout: base +thumbnail: thumbnail/custom-buttons.jpg +language: plotly_js +page_type: example_index +display_as: controls +order: 2 +redirect_from: javascript-graphing-library/custom-buttons/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","button-events" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/controls/callbacks-buttons/style-buttons.html b/content/plotly_js/controls/callbacks-buttons/style-buttons.html new file mode 100644 index 00000000000..ac7b0df1199 --- /dev/null +++ b/content/plotly_js/controls/callbacks-buttons/style-buttons.html @@ -0,0 +1,208 @@ +--- +name: Style the Buttons +plot_url: https://codepen.io/plotly/embed/ePrXVJ/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: button-events +sitemap: false +order: 6 +arrangement: horizontal +markdown_content: | + When adding buttons to Plotly charts, users have the option of styling the color, font, padding, + and position of the buttons. The example below demonstrates how to apply different styling options. + See all updatemenus styling attributes here: [https://plotly.com/javascript/reference/layout/#layout-updatemenus](https://plotly.com/javascript/reference/layout/updatemenus/). +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var button_layer_1_height = 1.12 +var button_layer_2_height = 1.0 +var annotation_offset = 0.04 + +var z_data=[ ] +for(i=0;i<24;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type:'surface', + colorscale:'Viridis' +}] + +var updatemenus=[ + { + buttons: [ + { + args: ['type', 'surface'], + label: '3D Surface', + method: 'restyle' + }, + { + args: ['type', 'heatmap'], + label:'Heatmap', + method:'restyle' + }, + { + args: ['type', 'contour'], + label:'Contour', + method:'restyle' + } + ], + direction: 'left', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'buttons', + x: 0.15, + xanchor: 'left', + y: button_layer_2_height, + yanchor: 'top', + font: {color: '#5072a8'} + }, + { + buttons: [ + { + args: ['reversescale', true], + label: 'Reverse', + method: 'restyle' + }, + { + args: ['reversescale', false], + label:'Undo Reverse', + method:'restyle' + } + ], + direction: 'down', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'dropdown', + x: 0.56, + xanchor: 'left', + y: button_layer_2_height, + yanchor: 'top', + active: 1, + font: {color: '#5072a8'} + }, + { + buttons: [ + { + args: [{'contours.showlines':false, 'type':'contour'}], + label: 'Hide lines', + method: 'restyle' + }, + { + args: [{'contours.showlines':true, 'type':'contour'}], + label:'Show lines', + method:'restyle' + } + ], + direction: 'down', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'dropdown', + x: 0.78, + xanchor: 'left', + y: button_layer_2_height, + yanchor: 'top', + font: {color: '#5072a8'} + }, + { + buttons: [ + { + args: ['colorscale', 'Viridis'], + label: 'Viridis', + method: 'restyle' + }, + { + args: ['colorscale', 'Electric'], + label:'Electric', + method:'restyle' + }, + { + args: ['colorscale', 'Earth'], + label:'Earth', + method:'restyle' + }, + { + args: ['colorscale', 'Hot'], + label:'Hot', + method:'restyle' + }, + { + args: ['colorscale', 'Jet'], + label:'Jet', + method:'restyle' + }, + { + args: ['colorscale', 'Portland'], + label:'Portland', + method:'restyle' + }, + { + args: ['colorscale', 'Rainbow'], + label:'Rainbow', + method:'restyle' + }, + { + args: ['colorscale', 'Blackbody'], + label:'Blackbody', + method:'restyle' + }, + + { + args: ['colorscale', 'Cividis'], + label:'Cividis', + method:'restyle' + } + ], + direction: 'left', + pad: {'r': 10, 't': 10}, + showactive: true, + type: 'buttons', + x: 0.15, + xanchor: 'left', + y: button_layer_1_height, + yanchor: 'top', + active: 1, + bgcolor: '#aaaaaa', + bordercolor: '#FFFFFF' + }, +] + +var annotations = [ + { + text: 'Trace type:', + x: 0, + y: button_layer_2_height - annotation_offset, + yref: 'paper', + align: 'left', + showarrow: false + }, + { + text: 'Colorscale:', + x: 0, + y: button_layer_1_height - annotation_offset, + yref: 'paper', + align: 'left', + showarrow: false + }, +] + +var layout = { + paper_bgcolor: 'black', + margin: {t: 0, b: 0, l: 0, r: 0}, + updatemenus: updatemenus, + annotations: annotations, + scene: { + bgcolor: 'black', + aspectratio: {x: 1, y: 1, z: 0.7}, + aspectmode: 'manual' + } +} + + +Plotly.newPlot("myDiv", data, layout); + +}); diff --git a/content/plotly_js/controls/callbacks-dropdowns/dropdowns_index.html b/content/plotly_js/controls/callbacks-dropdowns/dropdowns_index.html new file mode 100644 index 00000000000..0a4bc020c04 --- /dev/null +++ b/content/plotly_js/controls/callbacks-dropdowns/dropdowns_index.html @@ -0,0 +1,15 @@ +--- +name: Dropdown Events +permalink: javascript/dropdowns/ +description: Use Plotly to create custom dropdowns in D3.js-based JavaScript charts. +layout: base +thumbnail: thumbnail/dropdown.jpg +language: plotly_js +page_type: example_index +display_as: controls +order: 1 +redirect_from: javascript-graphing-library/high-dimension-data/ +redirect_from: javascript/high-dimension-data/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","dropdowns-events" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/controls/callbacks-dropdowns/dropdowns_menus.html b/content/plotly_js/controls/callbacks-dropdowns/dropdowns_menus.html new file mode 100644 index 00000000000..054ad49e64b --- /dev/null +++ b/content/plotly_js/controls/callbacks-dropdowns/dropdowns_menus.html @@ -0,0 +1,60 @@ +--- +name: Add Two Dropdown Menus to a Chart with Plotly.js +plot_url: https://codepen.io/etpinard/embed/pbxkNb/?height=558&theme-id=15263&default-tab=result +language: plotly_js +suite: dropdowns-events +sitemap: false +order: 1 +arrangement: horizontal +--- +function makeTrace(i) { + return { + y: Array.apply(null, Array(10)).map(() => Math.random()), + line: { + shape: 'spline' , + color: 'red' + }, + visible: i === 0, + name: 'Data set ' + i, + }; +} + +Plotly.newPlot('myDiv', [0, 1, 2, 3].map(makeTrace), { + updatemenus: [{ + y: 0.8, + yanchor: 'top', + buttons: [{ + method: 'restyle', + args: ['line.color', 'red'], + label: 'red' + }, { + method: 'restyle', + args: ['line.color', 'blue'], + label: 'blue' + }, { + method: 'restyle', + args: ['line.color', 'green'], + label: 'green' + }] + }, { + y: 1, + yanchor: 'top', + buttons: [{ + method: 'restyle', + args: ['visible', [true, false, false, false]], + label: 'Data set 0' + }, { + method: 'restyle', + args: ['visible', [false, true, false, false]], + label: 'Data set 1' + }, { + method: 'restyle', + args: ['visible', [false, false, true, false]], + label: 'Data set 2' + }, { + method: 'restyle', + args: ['visible', [false, false, false, true]], + label: 'Data set 3' + }] + }], +}); \ No newline at end of file diff --git a/content/plotly_js/controls/callbacks-dropdowns/simple-dropdown.html b/content/plotly_js/controls/callbacks-dropdowns/simple-dropdown.html new file mode 100644 index 00000000000..64f922e96a7 --- /dev/null +++ b/content/plotly_js/controls/callbacks-dropdowns/simple-dropdown.html @@ -0,0 +1,87 @@ +--- +name: Bind dropdown events to Plotly.js charts +plot_url: https://codepen.io/plotly/embed/xwBNXa/?height=558&theme-id=15263&default-tab=result +language: plotly_js +suite: dropdowns-events +sitemap: false +order: 2 +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var allCountryNames = unpack(rows, 'country'), + allYear = unpack(rows, 'year'), + allGdp = unpack(rows, 'gdpPercap'), + listofCountries = [], + currentCountry, + currentGdp = [], + currentYear = []; + + for (var i = 0; i < allCountryNames.length; i++ ){ + if (listofCountries.indexOf(allCountryNames[i]) === -1 ){ + listofCountries.push(allCountryNames[i]); + } + } + + function getCountryData(chosenCountry) { + currentGdp = []; + currentYear = []; + for (var i = 0 ; i < allCountryNames.length ; i++){ + if ( allCountryNames[i] === chosenCountry ) { + currentGdp.push(allGdp[i]); + currentYear.push(allYear[i]); + } + } + }; + + // Default Country Data + setBubblePlot('Afghanistan'); + + function setBubblePlot(chosenCountry) { + getCountryData(chosenCountry); + + var trace1 = { + x: currentYear, + y: currentGdp, + mode: 'lines+markers', + marker: { + size: 12, + opacity: 0.5 + } + }; + + var data = [trace1]; + + var layout = { + title: {text: 'Line and Scatter Plot'}, + height: 400, + width: 480 + }; + + Plotly.newPlot('myDiv', data, layout); + }; + + var innerContainer = document.querySelector('[data-num="0"'), + plotEl = innerContainer.querySelector('.plot'), + countrySelector = innerContainer.querySelector('.countrydata'); + + function assignOptions(textArray, selector) { + for (var i = 0; i < textArray.length; i++) { + var currentOption = document.createElement('option'); + currentOption.text = textArray[i]; + selector.appendChild(currentOption); + } + } + + assignOptions(listofCountries, countrySelector); + + function updateCountry(){ + setBubblePlot(countrySelector.value); + } + + countrySelector.addEventListener('change', updateCountry, false); +}); diff --git a/content/plotly_js/controls/callbacks-slider-components/adding-sliders-plotlyjs_index.html b/content/plotly_js/controls/callbacks-slider-components/adding-sliders-plotlyjs_index.html new file mode 100644 index 00000000000..31fd5dcad4a --- /dev/null +++ b/content/plotly_js/controls/callbacks-slider-components/adding-sliders-plotlyjs_index.html @@ -0,0 +1,13 @@ +--- +name: Adding Sliders to Animations +permalink: javascript/gapminder-example/ +description: How to make the classic Gapminder Animation using sliders and buttons in Plotly JS +layout: base +thumbnail: thumbnail/gapminder_animation.gif +language: plotly_js +page_type: example_index +display_as: animations +order: 2 +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","adding-sliders" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/controls/callbacks-slider-components/bindings.html b/content/plotly_js/controls/callbacks-slider-components/bindings.html new file mode 100644 index 00000000000..548539d3330 --- /dev/null +++ b/content/plotly_js/controls/callbacks-slider-components/bindings.html @@ -0,0 +1,64 @@ +--- +name: Bind Components to the Appearance of a Plot +plot_url: https://codepen.io/plotly/embed/ZBzZZO/?height=558&theme-id=15263&default-tab=result +language: plotly_js +suite: slider-components-events +sitemap: false +order: 2 +arrangement: horizontal +--- +Plotly.newPlot('myDiv', [{ + x: [1, 2, 3], + y: [2, 1, 3] +}], { + sliders: [{ + pad: {t: 30}, + len: 0.5, + x: 0.5, + currentvalue: { + xanchor: 'right', + prefix: 'color: ', + font: { + color: '#888', + size: 20 + } + }, + // If all of a component's commands affect a single attribute, the component + // will be bound to the plot and will automatically update to reflect changes. + steps: [{ + label: 'red', + method: 'restyle', + args: ['line.color', 'red'] + }, { + label: 'green', + method: 'restyle', + args: ['line.color', 'green'] + }, { + label: 'blue', + method: 'restyle', + args: ['line.color', 'blue'] + }] + }], + updatemenus: [{ + pad: {t: 60, r: 30}, + type: 'buttons', + xanchor: 'left', + yanchor: 'top', + x: 00, + y: 0, + direction: 'right', + buttons: [{ + label: 'red', + method: 'restyle', + args: ['line.color', 'red'] + }, { + label: 'green', + method: 'restyle', + args: ['line.color', 'green'] + }, { + label: 'blue', + method: 'restyle', + args: ['line.color', 'blue'] + }] + }] +}); diff --git a/content/plotly_js/controls/callbacks-slider-components/play-button.html b/content/plotly_js/controls/callbacks-slider-components/play-button.html new file mode 100644 index 00000000000..d015490db0e --- /dev/null +++ b/content/plotly_js/controls/callbacks-slider-components/play-button.html @@ -0,0 +1,99 @@ +--- +name: Add a Play Button to Control a Slider +plot_url: https://codepen.io/plotly/embed/NbKmmQ/?height=558&theme-id=15263&default-tab=result +language: plotly_js +suite: slider-components-events +sitemap: false +order: 3 +arrangement: horizontal +--- +Plotly.newPlot('myDiv', { + data: [{ + x: [1, 2, 3], + y: [2, 1, 3], + line: { + color: 'red', + simplify: false, + } + }], + layout: { + sliders: [{ + pad: {t: 30}, + x: 0.05, + len: 0.95, + currentvalue: { + xanchor: 'right', + prefix: 'color: ', + font: { + color: '#888', + size: 20 + } + }, + transition: {duration: 500}, + // By default, animate commands are bound to the most recently animated frame: + steps: [{ + label: 'red', + method: 'animate', + args: [['red'], { + mode: 'immediate', + frame: {redraw: false, duration: 500}, + transition: {duration: 500} + }] + }, { + label: 'green', + method: 'animate', + args: [['green'], { + mode: 'immediate', + frame: {redraw: false, duration: 500}, + transition: {duration: 500} + }] + }, { + label: 'blue', + method: 'animate', + args: [['blue'], { + mode: 'immediate', + frame: {redraw: false, duration: 500}, + transition: {duration: 500} + }] + }] + }], + updatemenus: [{ + type: 'buttons', + showactive: false, + x: 0.05, + y: 0, + xanchor: 'right', + yanchor: 'top', + pad: {t: 60, r: 20}, + buttons: [{ + label: 'Play', + method: 'animate', + args: [null, { + fromcurrent: true, + frame: {redraw: false, duration: 1000}, + transition: {duration: 500} + }] + }] + }] + }, + // The slider itself does not contain any notion of timing, so animating a slider + // must be accomplished through a sequence of frames. Here we'll change the color + // and the data of a single trace: + frames: [{ + name: 'red', + data: [{ + y: [2, 1, 3], + 'line.color': 'red' + }] + }, { + name: 'green', + data: [{ + y: [3, 2, 1], + 'line.color': 'green'}] + }, { + name: 'blue', + data: [{ + y: [1, 3, 2], + 'line.color': 'blue'}] + }] +}); diff --git a/content/plotly_js/controls/callbacks-slider-components/simple-slider.html b/content/plotly_js/controls/callbacks-slider-components/simple-slider.html new file mode 100644 index 00000000000..38489ebb739 --- /dev/null +++ b/content/plotly_js/controls/callbacks-slider-components/simple-slider.html @@ -0,0 +1,38 @@ +--- +name: Basic Slider +plot_url: https://codepen.io/plotly/embed/pNzBYJ/?height=558&theme-id=15263&default-tab=result +language: plotly_js +suite: slider-components-events +sitemap: false +order: 2 +arrangement: horizontal +--- +Plotly.newPlot('myDiv', [{ + x: [1, 2, 3], + y: [2, 1, 3] +}], { + sliders: [{ + pad: {t: 30}, + currentvalue: { + xanchor: 'right', + prefix: 'color: ', + font: { + color: '#888', + size: 20 + } + }, + steps: [{ + label: 'red', + method: 'restyle', + args: ['line.color', 'red'] + }, { + label: 'green', + method: 'restyle', + args: ['line.color', 'green'] + }, { + label: 'blue', + method: 'restyle', + args: ['line.color', 'blue'] + }] + }] +}); diff --git a/content/plotly_js/controls/callbacks-slider-components/sliders_index.html b/content/plotly_js/controls/callbacks-slider-components/sliders_index.html new file mode 100644 index 00000000000..564710fa159 --- /dev/null +++ b/content/plotly_js/controls/callbacks-slider-components/sliders_index.html @@ -0,0 +1,13 @@ +--- +name: Slider Events +permalink: javascript/sliders/ +description: Use Plotly to create custom sliders in D3.js-based JavaScript charts. +layout: base +thumbnail: thumbnail/slider-component.jpg +language: plotly_js +page_type: example_index +display_as: controls +order: 3 +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","slider-components-events" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/controls/lasso/lasso-selection.html b/content/plotly_js/controls/lasso/lasso-selection.html new file mode 100644 index 00000000000..55ccffa3fed --- /dev/null +++ b/content/plotly_js/controls/lasso/lasso-selection.html @@ -0,0 +1,100 @@ +--- +name: Lasso Selection +plot_url: https://codepen.io/plotly/embed/EPEGyE/?height=470&theme-id=15263&default-tab=result +language: plotly_js +suite: lasso-selection +sitemap: false +arrangement: horizontal +order: 0 +--- +var graphDiv = document.getElementById('myDiv'); +var N = 1000; +var color1 = '#7b3294'; +var color1Light = '#c2a5cf'; +var colorX = '#ffa7b5'; +var colorY = '#fdae61'; + +function randomArray() { + var out = new Array(N); + for(var i = 0; i < N; i++) { + out[i] = Math.random(); + } + return out; +} +var x = randomArray(); +var y = randomArray(); + +Plotly.newPlot(graphDiv, [{ + type: 'scatter', + mode: 'markers', + x: x, + y: y, + xaxis: 'x', + yaxis: 'y', + name: 'random data', + marker: {color: color1, size: 10} +}, { + type: 'histogram', + x: x, + xaxis: 'x2', + yaxis: 'y2', + name: 'x coord dist.', + marker: {color: colorX} +}, { + type: 'histogram', + x: y, + xaxis: 'x3', + yaxis: 'y3', + name: 'y coord dist.', + marker: {color: colorY} +}], { + title: { + text: 'Lasso around the scatter points to see sub-distributions' + }, + dragmode: 'lasso', + xaxis: { + zeroline: false, + }, + yaxis: { + domain: [0.55, 1], + }, + xaxis2: { + domain: [0, 0.45], + anchor: 'y2', + }, + yaxis2: { + domain: [0, 0.45], + anchor: 'x2' + }, + xaxis3: { + domain: [0.55, 1], + anchor: 'y3' + }, + yaxis3: { + domain: [0, 0.45], + anchor: 'x3' + } +}); + +graphDiv.on('plotly_selected', function(eventData) { + var x = []; + var y = []; + + var colors = []; + for(var i = 0; i < N; i++) colors.push(color1Light); + + console.log(eventData.points) + + eventData.points.forEach(function(pt) { + x.push(pt.x); + y.push(pt.y); + colors[pt.pointNumber] = color1; + }); + + Plotly.restyle(graphDiv, { + x: [x, y], + xbins: {} + }, [1, 2]); + + Plotly.restyle(graphDiv, 'marker.color', [colors], [0]); +}); \ No newline at end of file diff --git a/content/plotly_js/controls/lasso/lasso_plotly_js_index.html b/content/plotly_js/controls/lasso/lasso_plotly_js_index.html new file mode 100644 index 00000000000..bd43ee7b3b9 --- /dev/null +++ b/content/plotly_js/controls/lasso/lasso_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +name: Lasso Selection +permalink: javascript/lasso-selection/ +description: How to bind callback functions to lasso selection in JavaScript D3.js-based charts. +layout: base +thumbnail: thumbnail/lasso.jpg +language: plotly_js +page_type: example_index +display_as: controls +order: 4 +arrangement: horizontal +redirect_from: javascript-graphing-library/lasso-selection/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","lasso-selection" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/controls/plotly_js-controls-index.md b/content/plotly_js/controls/plotly_js-controls-index.md new file mode 100644 index 00000000000..89fab73b48c --- /dev/null +++ b/content/plotly_js/controls/plotly_js-controls-index.md @@ -0,0 +1,28 @@ +--- +permalink: javascript/controls/ +description: Plotly.js makes interactive, publication-quality graphs online. Examples of how to make controls in charts. +name: Add Custom Controls +layout: langindex +language: plotly_js +display_as: controls +thumbnail: thumbnail/mixed.jpg +page_type: example_index +--- + + +
+
+ +
+ +
+

Add Custom Controls

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","controls" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/controls/range-slider/range-slider-time-series.html b/content/plotly_js/controls/range-slider/range-slider-time-series.html new file mode 100644 index 00000000000..da5729f2a21 --- /dev/null +++ b/content/plotly_js/controls/range-slider/range-slider-time-series.html @@ -0,0 +1,76 @@ +--- +name: Basic Range Slider on Time Series +plot_url: https://codepen.io/plotly/embed/WwXEoV/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: range-slider +order: 1 +sitemap: false +arrangement: horizontal +--- + +var rawDataURL = 'https://raw.githubusercontent.com/plotly/datasets/master/2016-weather-data-seattle.csv'; +var xField = 'Date'; +var yField = 'Mean_TemperatureC'; + +var selectorOptions = { + buttons: [{ + step: 'month', + stepmode: 'backward', + count: 1, + label: '1m' + }, { + step: 'month', + stepmode: 'backward', + count: 6, + label: '6m' + }, { + step: 'year', + stepmode: 'todate', + count: 1, + label: 'YTD' + }, { + step: 'year', + stepmode: 'backward', + count: 1, + label: '1y' + }, { + step: 'all', + }], +}; + +d3.csv(rawDataURL, function(err, rawData) { + if(err) throw err; + + var data = prepData(rawData); + var layout = { + title: { + text: 'Time series with range slider and selectors' + }, + xaxis: { + rangeselector: selectorOptions, + rangeslider: {} + }, + yaxis: { + fixedrange: true + } + }; + + Plotly.newPlot('myDiv', data, layout); +}); + +function prepData(rawData) { + var x = []; + var y = []; + + rawData.forEach(function(datum, i) { + + x.push(new Date(datum[xField])); + y.push(datum[yField]); + }); + + return [{ + mode: 'lines', + x: x, + y: y + }]; +} diff --git a/content/plotly_js/controls/range-slider/range-slider_plotly_js_index.html b/content/plotly_js/controls/range-slider/range-slider_plotly_js_index.html new file mode 100644 index 00000000000..44420c47a1a --- /dev/null +++ b/content/plotly_js/controls/range-slider/range-slider_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +name: Range Slider and Selector +permalink: javascript/range-slider/ +description: How to add range sliders to a D3.js-based line or scatter chart. Examples of Range Sliders +layout: base +thumbnail: thumbnail/sliders.jpg +language: plotly_js +page_type: example_index +display_as: controls +order: 5 +redirect_from: javascript-graphing-library/range-slider/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","range-slider" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/financial/bullet/advance-bullet.html b/content/plotly_js/financial/bullet/advance-bullet.html new file mode 100644 index 00000000000..f813f29dbf3 --- /dev/null +++ b/content/plotly_js/financial/bullet/advance-bullet.html @@ -0,0 +1,41 @@ +--- +name: Add Steps, and Threshold +language: plotly_js +suite: bullet-charts +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + + Below is the same example using "steps" attribute, which is shown as shading, and "threshold" to determine boundaries that visually alert you if the value cross a defined threshold. +--- +var data = [ + { + type: "indicator", + mode: "number+gauge+delta", + value: 220, + domain: { x: [0, 1], y: [0, 1] }, + title: { + text: "Profit" + }, + delta: { reference: 200 }, + gauge: { + shape: "bullet", + axis: { range: [null, 300] }, + threshold: { + line: { color: "red", width: 2 }, + thickness: 0.75, + value: 280 + }, + steps: [ + { range: [0, 150], color: "lightgray" }, + { range: [150, 250], color: "gray" } + ] + } + } +]; + +var layout = { width: 600, height: 250 }; +var config = { responsive: true }; + +Plotly.newPlot('myDiv', data, layout, config); diff --git a/content/plotly_js/financial/bullet/basic-bullet.html b/content/plotly_js/financial/bullet/basic-bullet.html new file mode 100644 index 00000000000..7bf96d302cd --- /dev/null +++ b/content/plotly_js/financial/bullet/basic-bullet.html @@ -0,0 +1,26 @@ +--- +name: Basic Bullet Charts +language: plotly_js +suite: bullet-charts +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + + Stephen Few's Bullet Chart was invented to replace dashboard [gauges](https://plotly.com/javascript/gauge-charts/) and meters, combining both types of charts into simple bar charts with qualitative bars (steps), quantitative bar (bar) and performance line (threshold); all into one simple layout. + Steps typically are broken into several values, which are defined with an array. The bar represent the actual value that a particular variable reached, and the threshold usually indicate a goal point relative to the value achieved by the bar. See [indicator page](https://plotly.com/javascript/gauge-charts/) for more detail. +--- +var data = [ + { + type: "indicator", + mode: "number+gauge+delta", + gauge: { shape: "bullet" }, + delta: { reference: 300 }, + value: 220, + domain: { x: [0, 1], y: [0, 1] }, + title: { text: "Profit" } + } +]; + +var layout = { width: 600, height: 250 }; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/bullet/bullet-charts_plotly_js_index.html b/content/plotly_js/financial/bullet/bullet-charts_plotly_js_index.html new file mode 100644 index 00000000000..ca46a364036 --- /dev/null +++ b/content/plotly_js/financial/bullet/bullet-charts_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a D3.js-based bullet chart in javascript. +display_as: financial +language: plotly_js +layout: base +name: Bullet Charts +order: 8 +permalink: javascript/bullet-charts/ +redirect_from: javascript-graphing-library/bullet-charts +thumbnail: thumbnail/bullet.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","bullet-charts" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/financial/bullet/custom-bullet.html b/content/plotly_js/financial/bullet/custom-bullet.html new file mode 100644 index 00000000000..338f577e7ed --- /dev/null +++ b/content/plotly_js/financial/bullet/custom-bullet.html @@ -0,0 +1,42 @@ +--- +name: Custom Bullet Chart +language: plotly_js +suite: bullet-charts +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + + The following example shows how to customize your charts. For more information about all possible options check our [reference page](https://plotly.com/javascript/reference/indicator/). +--- +var data = [ + { + type: "indicator", + mode: "number+gauge+delta", + value: 220, + domain: { x: [0, 1], y: [0, 1] }, + delta: { reference: 280, position: "top" }, + title: { + text: + "Profit
U.S. $", + font: { size: 14 } + }, + gauge: { + shape: "bullet", + axis: { range: [null, 300] }, + threshold: { + line: { color: "red", width: 2, gradient: { yanchor: "vertical" } }, + thickness: 0.75, + value: 270 + }, + bgcolor: "white", + steps: [{ range: [0, 150], color: "cyan" }], + bar: { color: "darkblue" } + } + } +]; + +var layout = { width: 400, height: 230 }; +var config = { responsive: true }; + +Plotly.newPlot('myDiv', data, layout, config); diff --git a/content/plotly_js/financial/bullet/multi-bullet.html b/content/plotly_js/financial/bullet/multi-bullet.html new file mode 100644 index 00000000000..29d3abf7fa1 --- /dev/null +++ b/content/plotly_js/financial/bullet/multi-bullet.html @@ -0,0 +1,88 @@ +--- +name: Multi Bullet +language: plotly_js +suite: bullet-charts +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + + Bullet charts can be stacked for comparing several values at once as illustrated below: +--- +var data = [ + { + type: "indicator", + mode: "number+gauge+delta", + value: 180, + delta: { reference: 200 }, + domain: { x: [0.25, 1], y: [0.08, 0.25] }, + title: { text: "Revenue" }, + gauge: { + shape: "bullet", + axis: { range: [null, 300] }, + threshold: { + line: { color: "black", width: 2 }, + thickness: 0.75, + value: 170 + }, + steps: [ + { range: [0, 150], color: "gray" }, + { + range: [150, 250], + color: "lightgray" + } + ], + bar: { color: "black" } + } + }, + { + type: "indicator", + mode: "number+gauge+delta", + value: 35, + delta: { reference: 200 }, + domain: { x: [0.25, 1], y: [0.4, 0.6] }, + title: { text: "Profit" }, + gauge: { + shape: "bullet", + axis: { range: [null, 100] }, + threshold: { + line: { color: "black", width: 2 }, + thickness: 0.75, + value: 50 + }, + steps: [ + { range: [0, 25], color: "gray" }, + { range: [25, 75], color: "lightgray" } + ], + bar: { color: "black" } + } + }, + { + type: "indicator", + mode: "number+gauge+delta", + value: 220, + delta: { reference: 200 }, + domain: { x: [0.25, 1], y: [0.7, 0.9] }, + title: { text: "Satisfaction" }, + gauge: { + shape: "bullet", + axis: { range: [null, 300] }, + threshold: { + line: { color: "black", width: 2 }, + thickness: 0.75, + value: 210 + }, + steps: [ + { range: [0, 150], color: "gray" }, + { range: [150, 250], color: "lightgray" } + ], + bar: { color: "black" } + } + } +]; + +var layout = { + width: 600, height: 250, + margin: { t: 10, r: 25, l: 25, b: 10 } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/candlestick-charts/basic-candlestick-chart.html b/content/plotly_js/financial/candlestick-charts/basic-candlestick-chart.html new file mode 100644 index 00000000000..38279d91322 --- /dev/null +++ b/content/plotly_js/financial/candlestick-charts/basic-candlestick-chart.html @@ -0,0 +1,62 @@ +--- +name: Simple Candlestick Chart +language: plotly_js +suite: candlestick +order: 1 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + + x: ['2017-01-04', '2017-01-05', '2017-01-06', '2017-01-09', '2017-01-10', '2017-01-11', '2017-01-12', '2017-01-13', '2017-01-17', '2017-01-18', '2017-01-19', '2017-01-20', '2017-01-23', '2017-01-24', '2017-01-25', '2017-01-26', '2017-01-27', '2017-01-30', '2017-01-31', '2017-02-01', '2017-02-02', '2017-02-03', '2017-02-06', '2017-02-07', '2017-02-08', '2017-02-09', '2017-02-10', '2017-02-13', '2017-02-14', '2017-02-15'], + + close: [116.019997, 116.610001, 117.910004, 118.989998, 119.110001, 119.75, 119.25, 119.040001, 120, 119.989998, 119.779999, 120, 120.080002, 119.970001, 121.879997, 121.940002, 121.949997, 121.629997, 121.349998, 128.75, 128.529999, 129.080002, 130.289993, 131.529999, 132.039993, 132.419998, 132.119995, 133.289993, 135.020004, 135.509995], + + decreasing: {line: {color: '#7F7F7F'}}, + + high: [116.510002, 116.860001, 118.160004, 119.43, 119.379997, 119.93, 119.300003, 119.620003, 120.239998, 120.5, 120.089996, 120.449997, 120.809998, 120.099998, 122.099998, 122.440002, 122.349998, 121.629997, 121.389999, 130.490005, 129.389999, 129.190002, 130.5, 132.089996, 132.220001, 132.449997, 132.940002, 133.820007, 135.089996, 136.270004], + + increasing: {line: {color: '#17BECF'}}, + + line: {color: 'rgba(31,119,180,1)'}, + + low: [115.75, 115.809998, 116.470001, 117.940002, 118.300003, 118.599998, 118.209999, 118.809998, 118.220001, 119.709999, 119.370003, 119.730003, 119.769997, 119.5, 120.279999, 121.599998, 121.599998, 120.660004, 120.620003, 127.010002, 127.779999, 128.160004, 128.899994, 130.449997, 131.220001, 131.119995, 132.050003, 132.75, 133.25, 134.619995], + + open: [115.849998, 115.919998, 116.779999, 117.949997, 118.769997, 118.739998, 118.900002, 119.110001, 118.339996, 120, 119.400002, 120.449997, 120, 119.550003, 120.419998, 121.669998, 122.139999, 120.93, 121.150002, 127.029999, 127.980003, 128.309998, 129.130005, 130.539993, 131.350006, 131.649994, 132.460007, 133.080002, 133.470001, 135.520004], + + type: 'candlestick', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace1]; + +var layout = { + dragmode: 'zoom', + margin: { + r: 10, + t: 25, + b: 40, + l: 60 + }, + showlegend: false, + xaxis: { + autorange: true, + domain: [0, 1], + range: ['2017-01-03 12:00', '2017-02-15 12:00'], + rangeslider: {range: ['2017-01-03 12:00', '2017-02-15 12:00']}, + title: { + text: 'Date' + }, + type: 'date' + }, + yaxis: { + autorange: true, + domain: [0, 1], + range: [114.609999778, 137.410004222], + type: 'linear' + } +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/candlestick-charts/candlestick-colors.html b/content/plotly_js/financial/candlestick-charts/candlestick-colors.html new file mode 100644 index 00000000000..69e8e7b5357 --- /dev/null +++ b/content/plotly_js/financial/candlestick-charts/candlestick-colors.html @@ -0,0 +1,51 @@ +--- +name: Customizing Candlestick Chart Colors +language: plotly_js +suite: candlestick +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var trace = { + x: unpack(rows, 'Date'), + close: unpack(rows, 'AAPL.Close'), + high: unpack(rows, 'AAPL.High'), + low: unpack(rows, 'AAPL.Low'), + open: unpack(rows, 'AAPL.Open'), + + // cutomise colors + increasing: {line: {color: 'black'}}, + decreasing: {line: {color: 'red'}}, + + type: 'candlestick', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace]; + +var layout = { + dragmode: 'zoom', + showlegend: false, + xaxis: { + title: { + text: 'Date' + }, + range: ['2016-06-01 12:00', '2017-01-01 12:00'] + }, + yaxis: { + autorange: true, + } +}; + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/financial/candlestick-charts/candlestick-rangeselector.html b/content/plotly_js/financial/candlestick-charts/candlestick-rangeselector.html new file mode 100644 index 00000000000..98edcc99ab8 --- /dev/null +++ b/content/plotly_js/financial/candlestick-charts/candlestick-rangeselector.html @@ -0,0 +1,71 @@ +--- +name: Add Rangeselector +language: plotly_js +suite: candlestick +order: 4 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var trace = { + x: unpack(rows, 'Date'), + close: unpack(rows, 'AAPL.Close'), + high: unpack(rows, 'AAPL.High'), + low: unpack(rows, 'AAPL.Low'), + open: unpack(rows, 'AAPL.Open'), + + // cutomise colors + increasing: {line: {color: 'black'}}, + decreasing: {line: {color: 'red'}}, + + type: 'candlestick', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace]; + +var layout = { + dragmode: 'zoom', + showlegend: false, + xaxis: { + autorange: true, + title: { + text: 'Date' + }, + rangeselector: { + x: 0, + y: 1.2, + xanchor: 'left', + font: {size:8}, + buttons: [{ + step: 'month', + stepmode: 'backward', + count: 1, + label: '1 month' + }, { + step: 'month', + stepmode: 'backward', + count: 6, + label: '6 months' + }, { + step: 'all', + label: 'All dates' + }] + } + }, + yaxis: { + autorange: true, + } +}; + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/financial/candlestick-charts/candlestick-rangeslider.html b/content/plotly_js/financial/candlestick-charts/candlestick-rangeslider.html new file mode 100644 index 00000000000..d871e646f85 --- /dev/null +++ b/content/plotly_js/financial/candlestick-charts/candlestick-rangeslider.html @@ -0,0 +1,47 @@ +--- +name: Candlestick Chart without Rangeslider +language: plotly_js +suite: candlestick +order: 1.5 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var trace = { + x: unpack(rows, 'Date'), + close: unpack(rows, 'AAPL.Close'), + high: unpack(rows, 'AAPL.High'), + low: unpack(rows, 'AAPL.Low'), + open: unpack(rows, 'AAPL.Open'), + + // cutomise colors + increasing: {line: {color: 'black'}}, + decreasing: {line: {color: 'red'}}, + + type: 'candlestick', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace]; + +var layout = { + dragmode: 'zoom', + showlegend: false, + xaxis: { + rangeslider: { + visible: false + } + } +}; + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/financial/candlestick-charts/candlestick_index.html b/content/plotly_js/financial/candlestick-charts/candlestick_index.html new file mode 100644 index 00000000000..47acac812cb --- /dev/null +++ b/content/plotly_js/financial/candlestick-charts/candlestick_index.html @@ -0,0 +1,15 @@ +--- +description: How to graph D3.js-based candlestick charts in javascript. Examples of + candlestick charts. +display_as: financial +language: plotly_js +layout: base +name: Candlestick Charts +order: 3 +page_type: example_index +permalink: javascript/candlestick-charts/ +thumbnail: thumbnail/candlestick.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","candlestick" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/financial/candlestick-charts/customizing-candlestick-chart.html b/content/plotly_js/financial/candlestick-charts/customizing-candlestick-chart.html new file mode 100644 index 00000000000..2fb6b58e660 --- /dev/null +++ b/content/plotly_js/financial/candlestick-charts/customizing-candlestick-chart.html @@ -0,0 +1,90 @@ +--- +name: Customise Candlestick Chart with Shapes and Annotations +language: plotly_js +suite: candlestick +order: 2 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + + x: ['2017-01-17', '2017-01-18', '2017-01-19', '2017-01-20', '2017-01-23', '2017-01-24', '2017-01-25', '2017-01-26', '2017-01-27', '2017-01-30', '2017-01-31', '2017-02-01', '2017-02-02', '2017-02-03', '2017-02-06', '2017-02-07', '2017-02-08', '2017-02-09', '2017-02-10'], + + close: [120, 119.989998, 119.779999, 120, 120.080002, 119.970001, 121.879997, 121.940002, 121.949997, 121.629997, 121.349998, 128.75, 128.529999, 129.080002, 130.289993, 131.529999, 132.039993, 132.419998, 132.119995], + + decreasing: {line: {color: '#7F7F7F'}}, + + high: [120.239998, 120.5, 120.089996, 120.449997, 120.809998, 120.099998, 122.099998, 122.440002, 122.349998, 121.629997, 121.389999, 130.490005, 129.389999, 129.190002, 130.5, 132.089996, 132.220001, 132.449997, 132.940002], + + increasing: {line: {color: '#17BECF'}}, + + line: {color: 'rgba(31,119,180,1)'}, + + low: [118.220001, 119.709999, 119.370003, 119.730003, 119.769997, 119.5, 120.279999, 121.599998, 121.599998, 120.660004, 120.620003, 127.010002, 127.779999, 128.160004, 128.899994, 130.449997, 131.220001, 131.119995, 132.050003], + + open: [118.339996, 120, 119.400002, 120.449997, 120, 119.550003, 120.419998, 121.669998, 122.139999, 120.93, 121.150002, 127.029999, 127.980003, 128.309998, 129.130005, 130.539993, 131.350006, 131.649994, 132.460007], + + type: 'candlestick', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace1]; + +var layout = { + dragmode: 'zoom', + margin: { + r: 10, + t: 25, + b: 40, + l: 60 + }, + showlegend: false, + xaxis: { + autorange: true, + rangeslider: {range: ['2017-01-17 12:00', '2017-02-10 12:00']}, + title: { + text: 'Date' + }, + type: 'date' + }, + yaxis: { + autorange: true, + type: 'linear' + }, + + annotations: [ + { + x: '2017-01-31', + y: 0.9, + xref: 'x', + yref: 'paper', + text: 'largest movement', + font: {color: 'magenta'}, + showarrow: true, + xanchor: 'right', + ax: -20, + ay: 0 + } + ], + + shapes: [ + { + type: 'rect', + xref: 'x', + yref: 'paper', + x0: '2017-01-31', + y0: 0, + x1: '2017-02-01', + y1: 1, + fillcolor: '#d3d3d3', + opacity: 0.2, + line: { + width: 0 + } + } + ] +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/funnel/funnel_plotly_js_index.html b/content/plotly_js/financial/funnel/funnel_plotly_js_index.html new file mode 100644 index 00000000000..8930eb05e07 --- /dev/null +++ b/content/plotly_js/financial/funnel/funnel_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a D3.js-based funnel chart in javascript. +display_as: financial +language: plotly_js +layout: base +name: Funnel and Funnelarea Charts +order: 4 +page_type: example_index +permalink: javascript/funnel-charts/ +thumbnail: thumbnail/funnel.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","funnel" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/financial/funnel/funnelarea.html b/content/plotly_js/financial/funnel/funnelarea.html new file mode 100644 index 00000000000..fd5d4c05975 --- /dev/null +++ b/content/plotly_js/financial/funnel/funnelarea.html @@ -0,0 +1,17 @@ +--- +name: Funnelarea Plot +language: plotly_js +suite: funnel +order: 4 +sitemap: false +arrangement: horizontal +--- +var gd = document.getElementById('myDiv'); +var data = [{type: 'funnelarea', values: [5, 4, 3, 2, 1], text: ["The 1st", "The 2nd", "The 3rd", "The 4th", "The 5th"], + marker: {colors: ["59D4E8", "DDB6C6", "A696C8", "67EACA", "94D2E6"], + line: {color: ["3E4E88", "606470", "3E4E88", "606470", "3E4E88"], width: [2, 1, 5, 0, 3]}}, + textfont: {family: "Old Standard TT", size: 13, color: "black"}, opacity: 0.65}]; + +var layout = {margin: {l: 200 , r: 200}, funnelmode: "stack", showlegend: 'True'} + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/funnel/multi-funnelarea.html b/content/plotly_js/financial/funnel/multi-funnelarea.html new file mode 100644 index 00000000000..e17d19b76e5 --- /dev/null +++ b/content/plotly_js/financial/funnel/multi-funnelarea.html @@ -0,0 +1,32 @@ +--- +name: Multi Funnelarea +language: plotly_js +suite: funnel +order: 5 +sitemap: false +arrangement: horizontal +--- +var gd = document.getElementById('myDiv'); +var data = [{type: 'funnelarea', scalegroup: "first", values: [500, 450, 340, 230, 220, 110], + textinfo: "value", title: {position: "top center", text: "Sales for Sale Person A in U.S."}, + domain: {x: [0, 0.5], y: [0, 0.5]}}, +{ + type: 'funnelarea', scalegroup: "first", values: [600, 500, 400, 300, 200, 100], textinfo: "value", + title: {position: "top center", text: "Sales of Sale Person B in Canada"}, + domain: {x: [0, 0.5], y: [0.55, 1]}}, +{ + type:'funnelarea', scalegroup: "second", values: [510, 480, 440, 330, 220, 100], textinfo: "value", + title: {position: "top left", text: "Sales of Sale Person A in Canada"}, + domain: {x: [0.55, 1], y: [0, 0.5]}}, +{ + type: 'funnelarea', scalegroup: "second", values: [360, 250, 240, 130, 120, 60], + textinfo: "value", title: {position: "top left", text: "Sales of Sale Person B in U.S."}, + domain: {x: [0.55, 1], y: [0.55, 1]}}]; + +var layout = {width: 600,shapes: [ + {x0: 0, x1: 0.5, y0: 0, y1: 0.5}, + {x0: 0, x1: 0.5, y0: 0.55, y1: 1}, + {x0: 0.55, x1: 1, y0: 0, y1: 0.5}, + {x0: 0.55, x1: 1, y0: 0.55, y1: 1}]} + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/funnel/part-of-previous-funnel.html b/content/plotly_js/financial/funnel/part-of-previous-funnel.html new file mode 100644 index 00000000000..d25a0b2c751 --- /dev/null +++ b/content/plotly_js/financial/funnel/part-of-previous-funnel.html @@ -0,0 +1,14 @@ +--- +name: Basic Funnel Plot +language: plotly_js +suite: funnel +order: 1 +sitemap: false +arrangement: horizontal +--- +var gd = document.getElementById('myDiv'); +var data = [{type: 'funnel', y: ["Website visit", "Downloads", "Potential customers", "Invoice sent", "Closed delas"], x: [13873, 10533, 5443, 2703, 908], hoverinfo: 'x+percent previous+percent initial'}]; + +var layout = {margin: {l: 150}, width:600, height: 500} + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/funnel/part-of-whole-funnel.html b/content/plotly_js/financial/funnel/part-of-whole-funnel.html new file mode 100644 index 00000000000..eab16fd2c93 --- /dev/null +++ b/content/plotly_js/financial/funnel/part-of-whole-funnel.html @@ -0,0 +1,20 @@ +--- +name: Setting Marker Size and Color +language: plotly_js +suite: funnel +order: 2 +sitemap: false +arrangement: horizontal +--- +var gd = document.getElementById('myDiv'); + +var data = [{type: 'funnel', + y: ["Sales person A", "Sales person B", "Sales person C", "Sales person D", "Sales person E"], + x: [1200, 909.4, 600.6, 300, 80], textposition: "inside", textinfo: "value+percent initial", + hoverinfo: 'percent total+x', opacity: 0.65, marker: {color: ["59D4E8", "DDB6C6", "A696C8", "67EACA", "94D2E6"], + line: {"width": [4, 2, 2, 3, 1, 1], color: ["3E4E88", "606470", "3E4E88", "606470", "3E4E88"]}}, + connector: {line: {color: "royalblue", dash: "dot", width: 3}}}]; + +var layout = {margin: {l: 100}, width: 600, height: 500} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/funnel/stacked-funnel.html b/content/plotly_js/financial/funnel/stacked-funnel.html new file mode 100644 index 00000000000..2dda1b7ee23 --- /dev/null +++ b/content/plotly_js/financial/funnel/stacked-funnel.html @@ -0,0 +1,25 @@ +--- +name: Stacked Funnel +language: plotly_js +suite: funnel +order: 3 +sitemap: false +arrangement: horizontal +--- +var gd = document.getElementById('myDiv'); +var data = [{type: 'funnel', name: 'Montreal', + y: ["Website visit", "Downloads", "Potential customers", "Requested price"], + x: [120, 60, 30, 20], + textinfo: "value+percent initial"}, + { + type: 'funnel',name: 'Toronto', + y: ["Website visit", "Downloads", "Potential customers", "Requested price", "invoice sent"], + x: [100, 60, 40, 30, 20], textposition: "inside", textinfo: "value+percent previous"}, + { + type: 'funnel',name: 'Vancouver', + y: ["Website visit", "Downloads", "Potential customers", "Requested price", "invoice sent", "closed deals"], + x: [90, 70, 50, 30, 10, 5], textposition: "outside", textinfo: "value+percent total"}]; + +var layout = {margin: {l: 130, r: 0}, width: 600, funnelmode: "stack", showlegend: 'true'} + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/gauge/advance-gauge.html b/content/plotly_js/financial/gauge/advance-gauge.html new file mode 100644 index 00000000000..6cc9cb0d8b9 --- /dev/null +++ b/content/plotly_js/financial/gauge/advance-gauge.html @@ -0,0 +1,37 @@ +--- +name: Add Steps, Threshold, and Delta +language: plotly_js +suite: gauge-charts +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + + The following examples include "steps" attribute shown as shading inside the radial arc, "delta" which is the + difference of the value and goal (reference - value), and "threshold" to determine boundaries that visually alert you if the value cross a defined threshold. +--- +var data = [ + { + domain: { x: [0, 1], y: [0, 1] }, + value: 450, + title: { text: "Speed" }, + type: "indicator", + mode: "gauge+number+delta", + delta: { reference: 380 }, + gauge: { + axis: { range: [null, 500] }, + steps: [ + { range: [0, 250], color: "lightgray" }, + { range: [250, 400], color: "gray" } + ], + threshold: { + line: { color: "red", width: 4 }, + thickness: 0.75, + value: 490 + } + } + } +]; + +var layout = { width: 600, height: 450, margin: { t: 0, b: 0 } }; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/gauge/basic-gauge.html b/content/plotly_js/financial/gauge/basic-gauge.html new file mode 100644 index 00000000000..3d58d769eef --- /dev/null +++ b/content/plotly_js/financial/gauge/basic-gauge.html @@ -0,0 +1,27 @@ +--- +name: Basic Gauge +language: plotly_js +suite: gauge-charts +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + + A radial gauge chart has a circular arc, which displays a single value to estimate progress toward a goal. + The bar shows the target value, and the shading represents the progress toward that goal. Gauge charts, known as + speedometer charts as well. This chart type is usually used to illustrate key business indicators. + + The example below displays a basic gauge chart with default attributes. For more information about different added attributes check [indicator](https://plotly.com/javascript/indicator/) tutorial. +--- +var data = [ + { + domain: { x: [0, 1], y: [0, 1] }, + value: 270, + title: { text: "Speed" }, + type: "indicator", + mode: "gauge+number" + } +]; + +var layout = { width: 600, height: 500, margin: { t: 0, b: 0 } }; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/gauge/custom-gauge.html b/content/plotly_js/financial/gauge/custom-gauge.html new file mode 100644 index 00000000000..23bf3ead505 --- /dev/null +++ b/content/plotly_js/financial/gauge/custom-gauge.html @@ -0,0 +1,46 @@ +--- +name: Custom Gauge Chart +language: plotly_js +suite: gauge-charts +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + + The following example shows how to style your gauge charts. For more information about all possible options check our [reference page](https://plotly.com/javascript/reference/indicator/). +--- +var data = [ + { + type: "indicator", + mode: "gauge+number+delta", + value: 420, + title: { text: "Speed", font: { size: 24 } }, + delta: { reference: 400, increasing: { color: "RebeccaPurple" } }, + gauge: { + axis: { range: [null, 500], tickwidth: 1, tickcolor: "darkblue" }, + bar: { color: "darkblue" }, + bgcolor: "white", + borderwidth: 2, + bordercolor: "gray", + steps: [ + { range: [0, 250], color: "cyan" }, + { range: [250, 400], color: "royalblue" } + ], + threshold: { + line: { color: "red", width: 4 }, + thickness: 0.75, + value: 490 + } + } + } +]; + +var layout = { + width: 500, + height: 400, + margin: { t: 25, r: 25, l: 25, b: 25 }, + paper_bgcolor: "lavender", + font: { color: "darkblue", family: "Arial" } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/gauge/gauge-charts_plotly_js_index.html b/content/plotly_js/financial/gauge/gauge-charts_plotly_js_index.html new file mode 100644 index 00000000000..615b97019dd --- /dev/null +++ b/content/plotly_js/financial/gauge/gauge-charts_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a D3.js-based gauge chart in javascript. +display_as: financial +language: plotly_js +layout: base +name: Gauge Charts +order: 7 +permalink: javascript/gauge-charts/ +redirect_from: javascript-graphing-library/gauge-charts +thumbnail: thumbnail/gauge.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","gauge-charts" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/financial/indicator1/above-other-traces.html b/content/plotly_js/financial/indicator1/above-other-traces.html new file mode 100644 index 00000000000..12b238a974c --- /dev/null +++ b/content/plotly_js/financial/indicator1/above-other-traces.html @@ -0,0 +1,27 @@ +--- +name: Showing Information above Your Chart +language: plotly_js +suite: indicator +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + + Another interesting feature is that indicator trace sits above the other traces (even the 3d ones). This way, it can be easily used as an overlay as demonstrated below: +--- +var data = [ + { + type: "indicator", + mode: "number+delta", + value: 492, + delta: { reference: 512, valueformat: ".0f" }, + domain: { y: [0, 1], x: [0.25, 0.75] }, + title: { text: "Users online" } + }, + { + y: [325, 324, 405, 400, 424, 404, 417, 432, 419, 394, 410, 426, 413, 419, 404, 408, 401, 377, 368, 361, 356, 359, 375, 397, 394, 418, 437, 450, 430, 442, 424, 443, 420, 418, 423, 423, 426, 440, 437, 436, 447, 460, 478, 472, 450, 456, 436, 418, 429, 412, 429, 442, 464, 447, 434, 457, 474, 480, 499, 497, 480, 502, 512, 492] + } +]; + +var layout = { width: 600, height: 450, xaxis: { range: [0, 62] } }; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/indicator1/angular-gauge.html b/content/plotly_js/financial/indicator1/angular-gauge.html new file mode 100644 index 00000000000..b911af13af5 --- /dev/null +++ b/content/plotly_js/financial/indicator1/angular-gauge.html @@ -0,0 +1,23 @@ +--- +name: A Single Angular Gauge Chart +language: plotly_js +suite: indicator +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | +--- +var data = [ + { + domain: { x: [0, 1], y: [0, 1] }, + value: 450, + title: { text: "Speed" }, + type: "indicator", + mode: "gauge+number", + delta: { reference: 400 }, + gauge: { axis: { range: [null, 500] } } + } +]; + +var layout = { width: 600, height: 400 }; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/indicator1/basic-data-card.html b/content/plotly_js/financial/indicator1/basic-data-card.html new file mode 100644 index 00000000000..59aa78b224f --- /dev/null +++ b/content/plotly_js/financial/indicator1/basic-data-card.html @@ -0,0 +1,31 @@ +--- +name: Data Cards / Big Numbers +language: plotly_js +suite: indicator +order: 4.1 +sitemap: false +arrangement: horizontal +markdown_content: | + + Data card helps to display more contextual information about the data. Sometimes one number is all you want to see in a report, such as total sales, annual revenue, etc. This example shows how to visualize these big numbers: +--- +var data = [ + { + type: "indicator", + mode: "number+delta", + value: 400, + number: { prefix: "$" }, + delta: { position: "top", reference: 320 }, + domain: { x: [0, 1], y: [0, 1] } + } +]; + +var layout = { + paper_bgcolor: "lightgray", + width: 600, + height: 200, + margin: { t: 0, b: 0, l: 0, r: 0 } +}; + +Plotly.newPlot('myDiv', data, layout); + diff --git a/content/plotly_js/financial/indicator1/bullet.html b/content/plotly_js/financial/indicator1/bullet.html new file mode 100644 index 00000000000..110225c26c4 --- /dev/null +++ b/content/plotly_js/financial/indicator1/bullet.html @@ -0,0 +1,27 @@ +--- +name: Bullet Gauge +language: plotly_js +suite: indicator +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + + The equivalent of above "angular gauge": + +--- +var data = [ + { + type: "indicator", + mode: "number+gauge+delta", + gauge: { shape: "bullet" }, + delta: { reference: 300 }, + value: 220, + domain: { x: [0, 1], y: [0, 1] }, + title: { text: "Profit" } + } +]; + +var layout = { width: 600, height: 250 }; +Plotly.newPlot('myDiv', data, layout); + diff --git a/content/plotly_js/financial/indicator1/indicator_plotly_js_index.html b/content/plotly_js/financial/indicator1/indicator_plotly_js_index.html new file mode 100644 index 00000000000..cedfee0520f --- /dev/null +++ b/content/plotly_js/financial/indicator1/indicator_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a D3.js-based gauge chart in javascript. +display_as: financial +language: plotly_js +layout: base +name: Indicators +order: 2 +page_type: example_index +permalink: javascript/indicator/ +thumbnail: thumbnail/indicator.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","indicator" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/financial/indicator1/overview.html b/content/plotly_js/financial/indicator1/overview.html new file mode 100644 index 00000000000..0a411b3a89b --- /dev/null +++ b/content/plotly_js/financial/indicator1/overview.html @@ -0,0 +1,88 @@ +--- +name: Overview +language: plotly_js +suite: indicator +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + + In this tutorial we introduce a new trace named "Indicator". The purpose of "indicator" is to visualize a single value specified by the "value" attribute. + Three distinct visual elements are available to represent that value: number, delta and gauge. Any combination of them can be specified via the "mode" attribute. + Top-level attributes are: +
    +
  1. value: the value to visualize
  2. +
  3. mode: which visual elements to draw
  4. +
  5. align: how to align number and delta (left, center, right)
  6. +
  7. domain: the extent of the figure
  8. +
+ + Then we can configure the 3 different visual elements via their respective container: +
    +
  1. number is simply a representation of the number in text. It has attributes: +
  2. valueformat: to format the number
  3. +
  4. prefix: a string before the number
  5. +
  6. suffix: a string after the number
  7. +
  8. font.(family|size): to control the font
  9. +
+ "delta" simply displays the difference between the value with respect to a reference. It has attributes: +
    +
  1. reference: the number to compare the value with
  2. +
  3. relative: whether that difference is absolute or relative
  4. +
  5. valueformat: to format the delta
  6. +
  7. (increasing|decreasing).color: color to be used for positive or decreasing delta
  8. +
  9. (increasing|decreasing).symbol: symbol displayed on the left of the delta
  10. +
  11. font.(family|size): to control the font
  12. +
  13. position: position relative to `number` (either top, left, bottom, right)
  14. +
+ Finally, we can have a simple title for the indicator via `title` with 'text' attribute which is a string, and 'align' which can be set to left, center, and right. + There are two gauge types: [angular](https://plotly.com/javascript/gauge-charts/) and [bullet](https://plotly.com/javascript/bullet-charts/). Here is a combination of both shapes (angular, bullet), and different modes (guage, delta, and value): +--- +var data = [ + { + type: "indicator", + value: 200, + delta: { reference: 160 }, + gauge: { axis: { visible: false, range: [0, 250] } }, + domain: { row: 0, column: 0 } + }, + { + type: "indicator", + value: 120, + gauge: { + shape: "bullet", + axis: { + visible: false, + range: [-200, 200] + } + }, + domain: { x: [0.1, 0.5], y: [0.15, 0.35] } + }, + { + type: "indicator", + mode: "number+delta", + value: 300, + domain: { row: 0, column: 1 } + }, + { type: "indicator", mode: "delta", value: 40, domain: { row: 1, column: 1 } } +]; + +var layout = { + width: 600, + height: 400, + margin: { t: 25, b: 25, l: 25, r: 25 }, + grid: { rows: 2, columns: 2, pattern: "independent" }, + template: { + data: { + indicator: [ + { + title: { text: "Speed" }, + mode: "number+delta+gauge", + delta: { reference: 90 } + } + ] + } + } +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/indicator1/several-big-numbers.html b/content/plotly_js/financial/indicator1/several-big-numbers.html new file mode 100644 index 00000000000..c67d03e5141 --- /dev/null +++ b/content/plotly_js/financial/indicator1/several-big-numbers.html @@ -0,0 +1,47 @@ +--- +name: +language: plotly_js +suite: indicator +order: 7 +sitemap: false +arrangement: horizontal +markdown_content: | + + It's possible to display several numbers +--- +var data = [ + { + type: "indicator", + mode: "number+delta", + value: 200, + domain: { x: [0, 0.5], y: [0, 0.5] }, + delta: { reference: 400, relative: true, position: "top" } + }, + { + type: "indicator", + mode: "number+delta", + value: 350, + delta: { reference: 400, relative: true }, + domain: { x: [0, 0.5], y: [0.5, 1] } + }, + { + type: "indicator", + mode: "number+delta", + value: 450, + title: { + text: + "Accounts
Subtitle
Subsubtitle" + }, + delta: { reference: 400, relative: true }, + domain: { x: [0.6, 1], y: [0, 1] } + } +]; + +var layout = { + width: 600, + height: 400, + margin: { t: 25, r: 25, l: 25, b: 25 } +}; + +Plotly.newPlot('myDiv', data, layout); + diff --git a/content/plotly_js/financial/ohlc/customise-colors.html b/content/plotly_js/financial/ohlc/customise-colors.html new file mode 100644 index 00000000000..af36f3ec069 --- /dev/null +++ b/content/plotly_js/financial/ohlc/customise-colors.html @@ -0,0 +1,51 @@ +--- +name: Customise OHLC Chart Colors +language: plotly_js +suite: ohlc +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var trace = { + x: unpack(rows, 'Date'), + close: unpack(rows, 'AAPL.Close'), + high: unpack(rows, 'AAPL.High'), + low: unpack(rows, 'AAPL.Low'), + open: unpack(rows, 'AAPL.Open'), + + // cutomise colors + increasing: {line: {color: 'black'}}, + decreasing: {line: {color: 'red'}}, + + type: 'ohlc', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace]; + +var layout = { + dragmode: 'zoom', + showlegend: false, + xaxis: { + autorange: true, + title: { + text: 'Date' + }, + }, + yaxis: { + autorange: true, + } +}; + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/financial/ohlc/customizing-ohlc-figure-with-annotations.html b/content/plotly_js/financial/ohlc/customizing-ohlc-figure-with-annotations.html new file mode 100644 index 00000000000..a90bf0d03c9 --- /dev/null +++ b/content/plotly_js/financial/ohlc/customizing-ohlc-figure-with-annotations.html @@ -0,0 +1,91 @@ +--- +name: Customizing the Figure with Shapes and Annotations +language: plotly_js +suite: ohlc +order: 2 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + + x: ['2017-01-17', '2017-01-18', '2017-01-19', '2017-01-20', '2017-01-23', '2017-01-24', '2017-01-25', '2017-01-26', '2017-01-27', '2017-01-30', '2017-01-31', '2017-02-01', '2017-02-02', '2017-02-03', '2017-02-06', '2017-02-07', '2017-02-08', '2017-02-09', '2017-02-10'], + + close: [120, 119.989998, 119.779999, 120, 120.080002, 119.970001, 121.879997, 121.940002, 121.949997, 121.629997, 121.349998, 128.75, 128.529999, 129.080002, 130.289993, 131.529999, 132.039993, 132.419998, 132.119995], + + decreasing: {line: {color: '#7F7F7F'}}, + + high: [120.239998, 120.5, 120.089996, 120.449997, 120.809998, 120.099998, 122.099998, 122.440002, 122.349998, 121.629997, 121.389999, 130.490005, 129.389999, 129.190002, 130.5, 132.089996, 132.220001, 132.449997, 132.940002], + + increasing: {line: {color: '#17BECF'}}, + + line: {color: 'rgba(31,119,180,1)'}, + + low: [118.220001, 119.709999, 119.370003, 119.730003, 119.769997, 119.5, 120.279999, 121.599998, 121.599998, 120.660004, 120.620003, 127.010002, + 127.779999, 128.160004, 128.899994, 130.449997, 131.220001, 131.119995, 132.050003], + + open: [118.339996, 120, 119.400002, 120.449997, 120, 119.550003, 120.419998, 121.669998, 122.139999, 120.93, 121.150002, 127.029999, 127.980003, 128.309998, 129.130005, 130.539993, 131.350006, 131.649994, 132.460007], + + type: 'ohlc', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace1]; + +var layout = { + dragmode: 'zoom', + margin: { + r: 10, + t: 25, + b: 40, + l: 60 + }, + showlegend: false, + xaxis: { + autorange: true, + rangeslider: {range: ['2017-01-17 12:00', '2017-02-10 12:00']}, + title: { + text: 'Date' + }, + type: 'date' + }, + yaxis: { + autorange: true, + type: 'linear' + }, + + annotations: [ + { + x: '2017-01-31', + y: 0.9, + xref: 'x', + yref: 'paper', + text: 'largest movement', + font: {color: 'magenta'}, + showarrow: true, + xanchor: 'right', + ax: -20, + ay: 0 + } + ], + + shapes: [ + { + type: 'rect', + xref: 'x', + yref: 'paper', + x0: '2017-01-31', + y0: 0, + x1: '2017-02-01', + y1: 1, + fillcolor: '#d3d3d3', + opacity: 0.2, + line: { + width: 0 + } + } + ] +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/ohlc/ohlc-chart-rangeslider.html b/content/plotly_js/financial/ohlc/ohlc-chart-rangeslider.html new file mode 100644 index 00000000000..53b621207c7 --- /dev/null +++ b/content/plotly_js/financial/ohlc/ohlc-chart-rangeslider.html @@ -0,0 +1,47 @@ +--- +name: OHLC Chart without Rangeslider +language: plotly_js +suite: ohlc +order: 1.5 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var trace = { + x: unpack(rows, 'Date'), + close: unpack(rows, 'AAPL.Close'), + high: unpack(rows, 'AAPL.High'), + low: unpack(rows, 'AAPL.Low'), + open: unpack(rows, 'AAPL.Open'), + + // cutomise colors + increasing: {line: {color: 'black'}}, + decreasing: {line: {color: 'red'}}, + + type: 'ohlc', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace]; + +var layout = { + dragmode: 'zoom', + showlegend: false, + xaxis: { + rangeslider: { + visible: false + } + } +}; + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/financial/ohlc/ohlc-with-rangeselector.html b/content/plotly_js/financial/ohlc/ohlc-with-rangeselector.html new file mode 100644 index 00000000000..a8e35c40fb1 --- /dev/null +++ b/content/plotly_js/financial/ohlc/ohlc-with-rangeselector.html @@ -0,0 +1,71 @@ +--- +name: Add Rangeselector +language: plotly_js +suite: ohlc +order: 4 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var trace = { + x: unpack(rows, 'Date'), + close: unpack(rows, 'AAPL.Close'), + high: unpack(rows, 'AAPL.High'), + low: unpack(rows, 'AAPL.Low'), + open: unpack(rows, 'AAPL.Open'), + + // cutomise colors + increasing: {line: {color: 'black'}}, + decreasing: {line: {color: 'red'}}, + + type: 'ohlc', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace]; + +var layout = { + dragmode: 'zoom', + showlegend: false, + xaxis: { + autorange: true, + title: { + text: 'Date' + }, + rangeselector: { + x: 0, + y: 1.2, + xanchor: 'left', + font: {size:8}, + buttons: [{ + step: 'month', + stepmode: 'backward', + count: 1, + label: '1 month' + }, { + step: 'month', + stepmode: 'backward', + count: 6, + label: '6 months' + }, { + step: 'all', + label: 'All dates' + }] + } + }, + yaxis: { + autorange: true, + } +}; + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/financial/ohlc/ohlc_index.html b/content/plotly_js/financial/ohlc/ohlc_index.html new file mode 100644 index 00000000000..6bc9c6ecc4d --- /dev/null +++ b/content/plotly_js/financial/ohlc/ohlc_index.html @@ -0,0 +1,14 @@ +--- +description: How to graph D3.js-based OHLC charts in javascript. Examples of OHCL + charts. +display_as: financial +language: plotly_js +layout: base +name: OHLC Charts +order: 6 +permalink: javascript/ohlc-charts/ +thumbnail: thumbnail/ohlc.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","ohlc" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/financial/ohlc/simple-ohlc-chart.html b/content/plotly_js/financial/ohlc/simple-ohlc-chart.html new file mode 100644 index 00000000000..29a146ced54 --- /dev/null +++ b/content/plotly_js/financial/ohlc/simple-ohlc-chart.html @@ -0,0 +1,57 @@ +--- +name: Simple OHLC Chart +language: plotly_js +suite: ohlc +order: 1 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + + x: ['2017-01-17', '2017-01-18', '2017-01-19', '2017-01-20', '2017-01-23', '2017-01-24', '2017-01-25', '2017-01-26', '2017-01-27', '2017-01-30', '2017-01-31', '2017-02-01', '2017-02-02', '2017-02-03', '2017-02-06', '2017-02-07', '2017-02-08', '2017-02-09', '2017-02-10'], + + close: [120, 119.989998, 119.779999, 120, 120.080002, 119.970001, 121.879997, 121.940002, 121.949997, 121.629997, 121.349998, 128.75, 128.529999, 129.080002, 130.289993, 131.529999, 132.039993, 132.419998, 132.119995], + + decreasing: {line: {color: '#7F7F7F'}}, + + high: [120.239998, 120.5, 120.089996, 120.449997, 120.809998, 120.099998, 122.099998, 122.440002, 122.349998, 121.629997, 121.389999, 130.490005, 129.389999, 129.190002, 130.5, 132.089996, 132.220001, 132.449997, 132.940002], + + increasing: {line: {color: '#17BECF'}}, + + line: {color: 'rgba(31,119,180,1)'}, + + low: [118.220001, 119.709999, 119.370003, 119.730003, 119.769997, 119.5, 120.279999, 121.599998, 121.599998, 120.660004, 120.620003, 127.010002, 127.779999, 128.160004, 128.899994, 130.449997, 131.220001, 131.119995, 132.050003], + open: [118.339996, 120, 119.400002, 120.449997, 120, 119.550003, 120.419998, 121.669998, 122.139999, 120.93, 121.150002, 127.029999, 127.980003, 128.309998, 129.130005, 130.539993, 131.350006, 131.649994, 132.460007], + + type: 'ohlc', + xaxis: 'x', + yaxis: 'y' +}; + +var data = [trace1]; + +var layout = { + dragmode: 'zoom', + margin: { + r: 10, + t: 25, + b: 40, + l: 60 + }, + showlegend: false, + xaxis: { + autorange: true, + rangeslider: {range: ['2017-01-17 12:00', '2017-02-10 12:00']}, + title: { + text: 'Date' + }, + type: 'date' + }, + yaxis: { + autorange: true, + type: 'linear' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/financial/plotly_js-financial-index.html b/content/plotly_js/financial/plotly_js-financial-index.html new file mode 100644 index 00000000000..bc32bc079e6 --- /dev/null +++ b/content/plotly_js/financial/plotly_js-financial-index.html @@ -0,0 +1,27 @@ +--- +permalink: javascript/financial-charts/ +description: Plotly.js makes interactive, publication-quality graphs online. Examples of how to make financial charts. +name: Financial Charts +layout: langindex +language: plotly_js +display_as: financial +thumbnail: thumbnail/mixed.jpg +--- + + +
+
+ +
+ +
+

Plotly.js Financial Charts

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","financial" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/financial/time-series/basic-time-series.html b/content/plotly_js/financial/time-series/basic-time-series.html new file mode 100644 index 00000000000..5ee487d4c74 --- /dev/null +++ b/content/plotly_js/financial/time-series/basic-time-series.html @@ -0,0 +1,44 @@ +--- +name: Basic Time Series +language: plotly_js +suite: time-series +order: 2 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + + +var trace1 = { + type: "scatter", + mode: "lines", + name: 'AAPL High', + x: unpack(rows, 'Date'), + y: unpack(rows, 'AAPL.High'), + line: {color: '#17BECF'} +} + +var trace2 = { + type: "scatter", + mode: "lines", + name: 'AAPL Low', + x: unpack(rows, 'Date'), + y: unpack(rows, 'AAPL.Low'), + line: {color: '#7F7F7F'} +} + +var data = [trace1,trace2]; + +var layout = { + title: { + text: 'Date' + }, +}; + +Plotly.newPlot('myDiv', data, layout); +}) diff --git a/content/plotly_js/financial/time-series/date-axes.html b/content/plotly_js/financial/time-series/date-axes.html new file mode 100644 index 00000000000..e289bdcdd4a --- /dev/null +++ b/content/plotly_js/financial/time-series/date-axes.html @@ -0,0 +1,17 @@ +--- +name: Date Strings +language: plotly_js +suite: time-series +order: 1 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: ['2013-10-04 22:23:00', '2013-11-04 22:23:00', '2013-12-04 22:23:00'], + y: [1, 3, 6], + type: 'scatter' + } +]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/financial/time-series/time-series-range.html b/content/plotly_js/financial/time-series/time-series-range.html new file mode 100644 index 00000000000..38af14dd70a --- /dev/null +++ b/content/plotly_js/financial/time-series/time-series-range.html @@ -0,0 +1,51 @@ +--- +name: Manually Set Range +language: plotly_js +suite: time-series +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + + +var trace1 = { + type: "scatter", + mode: "lines", + x: unpack(rows, 'Date'), + y: unpack(rows, 'AAPL.High'), + line: {color: '#17BECF'} +} + +var trace2 = { + type: "scatter", + mode: "lines", + x: unpack(rows, 'Date'), + y: unpack(rows, 'AAPL.Low'), + line: {color: '#7F7F7F'} +} + +var data = [trace1,trace2]; + +var layout = { + title: { + text: 'Custom Range' + }, + xaxis: { + range: ['2016-07-01', '2016-12-31'], + type: 'date' + }, + yaxis: { + autorange: true, + range: [86.8700008333, 138.870004167], + type: 'linear' + } +}; + +Plotly.newPlot('myDiv', data, layout); +}) diff --git a/content/plotly_js/financial/time-series/time-series-rangeslider.html b/content/plotly_js/financial/time-series/time-series-rangeslider.html new file mode 100644 index 00000000000..114aaeeffa4 --- /dev/null +++ b/content/plotly_js/financial/time-series/time-series-rangeslider.html @@ -0,0 +1,68 @@ +--- +name: Time Series with Rangeslider +language: plotly_js +suite: time-series +order: 4 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + + +var trace1 = { + type: "scatter", + mode: "lines", + name: 'AAPL High', + x: unpack(rows, 'Date'), + y: unpack(rows, 'AAPL.High'), + line: {color: '#17BECF'} +} + +var trace2 = { + type: "scatter", + mode: "lines", + name: 'AAPL Low', + x: unpack(rows, 'Date'), + y: unpack(rows, 'AAPL.Low'), + line: {color: '#7F7F7F'} +} + +var data = [trace1,trace2]; + +var layout = { + title: {text: 'Time Series with Rangeslider'}, + xaxis: { + autorange: true, + range: ['2015-02-17', '2017-02-16'], + rangeselector: {buttons: [ + { + count: 1, + label: '1m', + step: 'month', + stepmode: 'backward' + }, + { + count: 6, + label: '6m', + step: 'month', + stepmode: 'backward' + }, + {step: 'all'} + ]}, + rangeslider: {range: ['2015-02-17', '2017-02-16']}, + type: 'date' + }, + yaxis: { + autorange: true, + range: [86.8700008333, 138.870004167], + type: 'linear' + } +}; + +Plotly.newPlot('myDiv', data, layout); +}) diff --git a/content/plotly_js/financial/time-series/time-series_plotly_js_index.html b/content/plotly_js/financial/time-series/time-series_plotly_js_index.html new file mode 100644 index 00000000000..8ca70e0fb1c --- /dev/null +++ b/content/plotly_js/financial/time-series/time-series_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to plot D3.js-based date and time in Plotly.js. An example of a time-series + plot. +display_as: financial +language: plotly_js +layout: base +name: Time Series +order: 5 +page_type: example_index +permalink: javascript/time-series/ +redirect_from: javascript-graphing-library/time-series/ +thumbnail: thumbnail/time-series.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","time-series" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/financial/waterfall/bar_plotly_js_index.html b/content/plotly_js/financial/waterfall/bar_plotly_js_index.html new file mode 100644 index 00000000000..eea090249bf --- /dev/null +++ b/content/plotly_js/financial/waterfall/bar_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a D3.js-based waterfall chart in javascript. +display_as: financial +language: plotly_js +layout: base +name: Waterfall Charts +order: 1 +page_type: example_index +permalink: javascript/waterfall-charts/ +thumbnail: thumbnail/waterfall-charts.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","waterfall" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/financial/waterfall/basic-bar.html b/content/plotly_js/financial/waterfall/basic-bar.html new file mode 100644 index 00000000000..8ea9029f493 --- /dev/null +++ b/content/plotly_js/financial/waterfall/basic-bar.html @@ -0,0 +1,67 @@ +--- +name: Basic Waterfall Chart +language: plotly_js +suite: waterfall +order: 1 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + name: "2018", + type: "waterfall", + orientation: "v", + measure: [ + "relative", + "relative", + "total", + "relative", + "relative", + "total" + ], + x: [ + "Sales", + "Consulting", + "Net revenue", + "Purchases", + "Other expenses", + "Profit before tax" + ], + textposition: "outside", + text: [ + "+60", + "+80", + "", + "-40", + "-20", + "Total" + ], + y: [ + 60, + 80, + 0, + -40, + -20, + 0 + ], + connector: { + line: { + color: "rgb(63, 63, 63)" + } + }, + } + ]; + layout = { + title: { + text: "Profit and loss statement 2018" + }, + xaxis: { + type: "category" + }, + yaxis: { + type: "linear" + }, + autosize: true, + showlegend: true + }; +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/waterfall/horizontal-waterfall-chart.html b/content/plotly_js/financial/waterfall/horizontal-waterfall-chart.html new file mode 100644 index 00000000000..94f6312f466 --- /dev/null +++ b/content/plotly_js/financial/waterfall/horizontal-waterfall-chart.html @@ -0,0 +1,93 @@ +--- +name: Horizontal Waterfall Chart +language: plotly_js +suite: waterfall +order: 3 +sitemap: false +arrangement: horizontal +--- + +var gd = document.getElementById('myDiv'); +var data = [ + { + name: "2018", + type: "waterfall", + orientation: "h", + measure: [ + "relative", + "relative", + "relative", + "relative", + "total", + "relative", + "relative", + "relative", + "relative", + "total", + "relative", + "relative", + "total", + "relative", + "total" + ], + y: [ + "Sales", + "Consulting", + "Maintenance", + "Other revenue", + "Net revenue", + "Purchases", + "Material expenses", + "Personnel expenses", + "Other expenses", + "Operating profit", + "Investment income", + "Financial income", + "Profit before tax", + "Income tax (15%)", + "Profit after tax" + ], + x: [ + 375, + 128, + 78, + 27, + null, + -327, + -12, + -78, + -12, + null, + 32, + 89, + null, + -45, + null + ], + connector: { + mode: "between", + line: { + width: 4, + color: "rgb(0, 0, 0)", + dash: 0 + } + } + } + ]; +var layout = {title: { + text: "Profit and loss statement 2018
waterfall chart displaying positive and negative" + }, + yaxis: { + type: "category", + autorange: "reversed" + }, + xaxis: { + type: "linear" + }, + margin: { l: 150 }, + showlegend: true + } +Plotly.newPlot('myDiv', data, layout); + + + diff --git a/content/plotly_js/financial/waterfall/multi_category-waterfall-charts.html b/content/plotly_js/financial/waterfall/multi_category-waterfall-charts.html new file mode 100644 index 00000000000..ff54cc4ba37 --- /dev/null +++ b/content/plotly_js/financial/waterfall/multi_category-waterfall-charts.html @@ -0,0 +1,42 @@ +--- +name: Multi Category Waterfall Chart +language: plotly_js +suite: waterfall +order: 2 +sitemap: false +arrangement: horizontal +--- +var gd = document.getElementById('myDiv'); +var data = [ + { + type: "waterfall", + x: [ + ["2016", "2017", "2017", "2017", "2017", "2018", "2018", "2018", "2018"], + ["initial", "q1", "q2", "q3", "total", "q1", "q2", "q3", "total" ] + ], + measure: ["absolute", "relative", "relative", "relative", "total", "relative", "relative", "relative", "total"], + y: [1, 2, 3, -1, null, 1, 2, -4, null], + base: 1000 + }, + { + type: "waterfall", + x: [ + ["2016", "2017", "2017", "2017", "2017", "2018", "2018", "2018", "2018"], + ["initial", "q1", "q2", "q3", "total", "q1", "q2", "q3", "total" ] + ], + measure: ["absolute", "relative", "relative", "relative", "total", "relative", "relative", "relative", "total"], + y: [1.1, 2.2, 3.3, -1.1, null, 1.1, 2.2, -4.4, null], + base: 1000 + } + ]; +var layout = { + waterfallgroupgap : 0.5, + xaxis: { + title: { + text: "MULTI-CATEGORY", + }, + tickfont: {size: 16}, + ticks: "outside" + } + } +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/financial/waterfall/style-waterfall.html b/content/plotly_js/financial/waterfall/style-waterfall.html new file mode 100644 index 00000000000..b40c89dba6f --- /dev/null +++ b/content/plotly_js/financial/waterfall/style-waterfall.html @@ -0,0 +1,34 @@ +--- +name: Style Waterfall Chart +language: plotly_js +suite: waterfall +order: 4 +sitemap: false +arrangement: horizontal +--- +var gd = document.getElementById('myDiv'); +var data = [ + { + type: "waterfall", + x: [ + ["2016", "2017", "2017", "2017", "2017", "2018", "2018", "2018", "2018"], + ["initial", "q1", "q2", "q3", "total", "q1", "q2", "q3", "total" ] + ], + measure: ["absolute", "relative", "relative", "relative", "total", "relative", "relative", "relative", "total"], + y: [10, 20, 30, -10, null, 10, 20, -40, null], + base: 300, + decreasing: { marker: { color: "Maroon" , line:{color : "red", width :2}}}, + increasing: { marker: { color: "Teal"} }, + totals: { marker: { color: "deep sky blue", line:{color:'blue',width:3}} } + }]; +var layout = {title: { + text: "Profit and loss statement" + }, + waterfallgap : 0.3, + xaxis: { + title: { text: ""}, + tickfont: {size: 15}, + ticks: "outside" + } + } +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-axes/3d_axes_fixed_ratio_axes.html b/content/plotly_js/fundamentals/3d-axes/3d_axes_fixed_ratio_axes.html new file mode 100644 index 00000000000..b68e8d2be9d --- /dev/null +++ b/content/plotly_js/fundamentals/3d-axes/3d_axes_fixed_ratio_axes.html @@ -0,0 +1,65 @@ +--- +name: Fixed Ratio Axes +language: plotly_js +suite: 3d-axes +order: 1.1 +sitemap: false +arrangement: horizontal +--- + +function getrandom(num , mul) + { + var value = [ ] + var i; + for(i=0;i<=num;i++) + { + rand = Math.random() * mul; + value.push(rand); + } + return value; + } + +var i; +traces = []; +names = ['cube', 'data', 'auto', 'manual']; +for (i=1; i<5; i++){ + traces.push({ + x: getrandom(20, 4), + y: getrandom(20, 3), + z: getrandom(20, 5), + opacity:0.5, + mode: "markers", + type: "mesh3d", + scene: "scene" + i, + name: names[i-1] + } + ) +} + +var layout = { + scene:{ + aspectmode:'cube', + domain:{row:0, column:0} + }, + scene2:{ + aspectmode:'data', + domain:{row:1, column:0} + }, + scene3:{ + aspectmode:'auto', + domain:{row:0, column:1} + }, + scene4:{ + aspectmode:'manual', + aspectratio: {x:1, y:1, z:2}, + domain: {row:1, column:1} + }, + grid:{ + pattern: 'independent', + rows:2, + columns:2 + }, + +}; + +Plotly.newPlot('myDiv', traces, layout); diff --git a/content/plotly_js/fundamentals/3d-axes/3d_axes_plotly_js_index.html b/content/plotly_js/fundamentals/3d-axes/3d_axes_plotly_js_index.html new file mode 100644 index 00000000000..b7bb4d01627 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-axes/3d_axes_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to format axes for 3d charts. +display_as: file_settings +language: plotly_js +layout: base +name: 3D Axes +order: 12 +page_type: u-guide +permalink: javascript/3d-axes/ +redirect_from: javascript-graphing-library/3d-axes/ +thumbnail: thumbnail/theming-and-templates.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-axes" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-axes/3d_axes_range.html b/content/plotly_js/fundamentals/3d-axes/3d_axes_range.html new file mode 100644 index 00000000000..6b70e894d98 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-axes/3d_axes_range.html @@ -0,0 +1,65 @@ +--- +name: Range of Axes +language: plotly_js +suite: 3d-axes +order: 1 +sitemap: false +arrangement: horizontal +--- + +function getrandom(num , mul) + { + var value = [ ]; + for(i=0;i<=num;i++) + { + var rand = Math.random() * mul; + value.push(rand); + } + return value; + } + + +var data=[ + { + opacity:0.4, + type: 'scatter3d', + x: getrandom(50 , -75), + y: getrandom(50 , -75), + z: getrandom(50 , -75), + }, + { + opacity:0.5, + type: 'scatter3d', + x: getrandom(50 , -75), + y: getrandom(50 , 75), + z: getrandom(50 , 75), + }, + { + opacity:0.5, + type: 'scatter3d', + x: getrandom(50 , 100), + y: getrandom(50 , 100), + z: getrandom(50 , 100), + } +]; +var layout = { + scene:{ + aspectmode: "manual", + aspectratio: { + x: 1, y: 0.7, z: 1, + }, + xaxis: { + nticks: 9, + range: [-200, 100], + }, + yaxis: { + nticks: 7, + range: [-100, 100], + }, + zaxis: { + nticks: 10, + range: [-150, 100], + }}, +}; +Plotly.newPlot('myDiv', data, layout); + \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-axes/3d_format_ticks.html b/content/plotly_js/fundamentals/3d-axes/3d_format_ticks.html new file mode 100644 index 00000000000..77d58e9a186 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-axes/3d_format_ticks.html @@ -0,0 +1,52 @@ +--- +name: Ticks Formatting +language: plotly_js +suite: 3d-axes +order: 2 +sitemap: false +arrangement: horizontal +--- + +function getrandom(num , mul) + { + var value = [ ]; + for(i=0;i<=num;i++) + { + var rand = Math.random() * mul; + value.push(rand); + } + return value; + } + + +var data=[ + { + opacity:0.4, + type: 'scatter3d', + x: getrandom(50 , -75), + y: getrandom(50 , -75), + z: getrandom(50 , -75), + }, +]; +var layout = { + scene:{ + xaxis: { + ticktext:['H20','C02','O2'], + tickvals:[-30, -45, -65, -10] + }, + yaxis: { + nticks: 5, + tickfont: + { + color:'green', + family:'Old Standard TT, serif', + size: 14 + }, + ticksuffix:'$' + }, + zaxis: { + ticks: 'outside', + tick0: 0, + tickwidth: 4}}, +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/3d-axes/axes_background.html b/content/plotly_js/fundamentals/3d-axes/axes_background.html new file mode 100644 index 00000000000..f2116de2ac4 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-axes/axes_background.html @@ -0,0 +1,66 @@ +--- +name: Axes Background Color +language: plotly_js +suite: 3d-axes +order: 3 +sitemap: false +arrangement: horizontal +--- +function getrandom(num , mul) + { + var value = [ ]; + for(i=0;i<=num;i++) + { + var rand = Math.random() * mul; + value.push(rand); + } + return value; + } + +var data=[ + { + opacity:0.4,type: 'scatter3d', + x: getrandom(50 , 75), + y: getrandom(50 , 75), + z: getrandom(50 , 75), + mode:'markers' + }, + { + opacity: 0.5, + type: 'scatter3d', + x: getrandom(75 , 75), + y: getrandom(75 , 75), + z: getrandom(75 , 75), + mode:'markers' + }, + { + opacity: 0.5, + type: 'scatter3d', + x: getrandom(75 , 100), + y: getrandom(75 , 100), + z: getrandom(75 , 100), + mode:'markers' + } +]; +var layout = { + scene:{ + xaxis: { + backgroundcolor: "rgb(200, 200, 230)", + gridcolor: "rgb(255, 255, 255)", + showbackground: true, + zerolinecolor: "rgb(255, 255, 255)", + }, + yaxis: { + backgroundcolor: "rgb(230, 200,230)", + gridcolor: "rgb(255, 255, 255)", + showbackground: true, + zerolinecolor: "rgb(255, 255, 255)" + }, + zaxis: { + backgroundcolor: "rgb(230, 230,200)", + gridcolor: "rgb(255, 255, 255)", + showbackground: true, + zerolinecolor: "rgb(255, 255, 255)" + }} +}; +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-axes/camera.html b/content/plotly_js/fundamentals/3d-axes/camera.html new file mode 100644 index 00000000000..71d5262e391 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-axes/camera.html @@ -0,0 +1,143 @@ +--- +name: Camera Controls +language: plotly_js +suite: 3d-axes +order: 5 +sitemap: false +arrangement: horizontal +--- + +function getrandom(num , mul) + { + var value = [ ]; + for(i=0;i<=num;i++) + { + var rand = Math.random() * mul; + value.push(rand); + } + return value; + } +var data = [ + { + x: getrandom(20, 4), + y: getrandom(20, 3), + z: getrandom(20, 5), + opacity:0.5, + mode: "markers", + type: "scatter3d", + scene: "scene1", + name: "Lower the view point" + }, + { + x:getrandom(20, 4), + y:getrandom(20, 3), + z:getrandom(20, 5), + opacity:0.5, + mode: "markers", + type: "scatter3d", + scene: "scene2", + name: "x-z plane" + }, + { + x:getrandom(20, 4), + y:getrandom(20, 3), + z:getrandom(20, 5), + opacity:0.5, + mode: "markers", + type: "scatter3d", + scene: "scene3", + name: "y-z plane" + }, + { + x:getrandom(10, 4), + y:getrandom(10, 3), + z:getrandom(10, 5), + opacity:0.5, + mode: "markers", + type: "scatter3d", + scene: "scene4", + name: "View from above" + }, + { + x:getrandom(20, 4), + y:getrandom(20, 3), + z:getrandom(20, 5), + opacity:0.5, + mode: "markers", + type: "scatter3d", + scene: "scene5", + name: "Zooming in" + }, +]; +var layout = { + scene1: { + domain: { + x: [0.00, 0.33], + y: [0.5, 1] + }, + camera: { + center: { + x: 0, y: 0, z: 0 }, + eye: { + x: 2, y: 2, z: 0.1 }, + up: { + x: 0, y: 0, z: 1 } + },}, + + scene2: { + domain: { + x: [0.33, 0.66], + y: [0.5, 1.0] + }, + camera: { + center: { + x: 0, y: 0, z: 0}, + eye: { + x:0.1, y:2.5, z:0.1}, + up: { + x: 0, y: 0, z: 1} + },}, + + scene3: { + domain: { + x: [0.66, 0.99], + y: [0.5, 1] + }, + camera: { + center: { + x: 0, y: 0, z: 0}, + eye: { + x:2.5, y:0.1, z:0.1}, + up: { + x: 0, y: 0, z: 1} + },}, + + scene4: { + domain: { + x: [0.15, 0.5], + y: [-0.25, 0.4] + }, + camera: { + center: { + x: 0, y: 0, z: 0}, + eye: { + x:0.1, y:0.1, z:2.5}, + up: { + x: 0, y: 0, z: 1} + },}, + + scene5: { + domain: { + x: [0.62, 0.7], + y: [-0.2, 0.4] + }, + camera: { + center: { + x: 0, y: 0, z: 0}, + eye: { + x:0.1, y:0.1, z:1}, + up: { + x: 0, y: 0, z: 1} + },}, +}; +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-axes/title.html b/content/plotly_js/fundamentals/3d-axes/title.html new file mode 100644 index 00000000000..bf2ac988af9 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-axes/title.html @@ -0,0 +1,58 @@ +--- +name: Set Axes Title +language: plotly_js +suite: 3d-axes +order: 5 +sitemap: false +arrangement: horizontal +--- +function getrandom(num , mul) { + var value = [ ]; + for(i=0;i<=num;i++) + { + var rand = Math.random() * mul; + value.push(rand); + } + return value;} + +var trace1 = { + type:'mesh3d', + x: getrandom(1000,200), y: getrandom(1000,300), z: getrandom(1000,150), + color: 'lightblue',}; + +var trace2 = { + type:'mesh3d', + x: getrandom(1000,200), y: getrandom(1000,300), z: getrandom(1000,150), + color: 'pink'}; + +var layout = { + scene: { + xaxis: { + title: { + text: 'X AXIS TITLE' + } + }, + yaxis: { + title: { + text: 'Y AXIS TITLE' + } + }, + zaxis: { + title: { + text: 'Z AXIS TITLE' + } + } + }, + autosize: false, + width: 550, + height: 500, + margin: { + l: 0, + r: 0, + b: 50, + t: 50, + pad: 4 + }, +} + +Plotly.newPlot('myDiv', [trace1,trace2], layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-hover-options/3d_hover_options_plotly_js_index.html b/content/plotly_js/fundamentals/3d-hover-options/3d_hover_options_plotly_js_index.html new file mode 100644 index 00000000000..4ebc04080ee --- /dev/null +++ b/content/plotly_js/fundamentals/3d-hover-options/3d_hover_options_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to customize hover options for 3d charts. +display_as: file_settings +language: plotly_js +layout: base +name: 3D Hover Options +order: 13 +page_type: u-guide +permalink: javascript/3d-hover/ +thumbnail: thumbnail/subplots.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-hover" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-hover-options/3d_hover_spike_settings.html b/content/plotly_js/fundamentals/3d-hover-options/3d_hover_spike_settings.html new file mode 100644 index 00000000000..e96aeb49fdc --- /dev/null +++ b/content/plotly_js/fundamentals/3d-hover-options/3d_hover_spike_settings.html @@ -0,0 +1,54 @@ +--- +name: Customize Hover for Spikelines +language: plotly_js +suite: 3d-hover +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + By default, Plotly's 3D plots display lines called "spikelines" while hovering over a point. + These lines project from the hover point to each of the three axes' normal planes and + then extend from those projection data points to the planes' wall boundaries. +--- + +function getrandom(num , mul) + { + var value = [ ]; + for(i=0;i<=num;i++) + { + var rand = Math.random() * mul; + value.push(rand); + } + return value; + } + + +var data=[ + { + opacity:0.4, + type: 'scatter3d', + x: getrandom(50 , -75), + y: getrandom(50 , -75), + z: getrandom(50 , -75), + }, +]; +var layout = { + scene:{ + xaxis: { + spikecolor: '#1fe5bd', + spikesides: false, + spikethickness: 6 + }, + yaxis: { + spikecolor: '#1fe5bd', + spikesides: false, + spikethickness: 6 + }, + zaxis: { + spikecolor: '#1fe5bd', + spikethickness: 6 + } + }, +}; +Plotly.newPlot('myDiv', data, layout); + \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-hover-options/3d_hover_surface_contour.html b/content/plotly_js/fundamentals/3d-hover-options/3d_hover_surface_contour.html new file mode 100644 index 00000000000..f15a19f4cb7 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-hover-options/3d_hover_surface_contour.html @@ -0,0 +1,46 @@ +--- +name: Customize Hover for Surface Contours +language: plotly_js +suite: 3d-hover +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + In addition to spikelines, Plotly 3D Surface plots also display surface contours on hover by default. + These are customized by styling the [`contours`](https://plotly.com/javascript/reference/surface/#surface-contours) + attribute in the surface trace. +--- + +x = [10,20,30,40] +y = [0,1,2,3] +z = [ + [2,2,2,3], + [1,1,1,1], + [1,1,0,0], + [0,0,0,0] +]; + +var data=[ + { + opacity:0.9, + type: 'surface', + x:x, y:y, z:z, + contours: { + x: { + highlight: true, + highlightcolor: "#41a7b3" + }, + y: { highlight: false }, + z: { highlight: false} + } + }, +]; +var layout = { + scene:{ + xaxis: { showspikes: false }, + yaxis: { showspikes: false }, + zaxis: { showspikes: false } + }, +}; +Plotly.newPlot('myDiv', data, layout); + \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-surface-lighting/3d_surface_lighting_plotly_js_index.html b/content/plotly_js/fundamentals/3d-surface-lighting/3d_surface_lighting_plotly_js_index.html new file mode 100644 index 00000000000..22a841fd315 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-surface-lighting/3d_surface_lighting_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to customize lighting for 3D surface charts. +display_as: file_settings +language: plotly_js +layout: base +name: 3D Surface Lighting +order: 14 +page_type: u-guide +permalink: javascript/3d-surface-lighting/ +thumbnail: thumbnail/3d-surface.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-surface-lighting" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-surface-lighting/surface_ambient_lighting.html b/content/plotly_js/fundamentals/3d-surface-lighting/surface_ambient_lighting.html new file mode 100644 index 00000000000..11a5640904c --- /dev/null +++ b/content/plotly_js/fundamentals/3d-surface-lighting/surface_ambient_lighting.html @@ -0,0 +1,55 @@ +--- +name: Ambient Lighting +language: plotly_js +suite: 3d-surface-lighting +order: 1 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/michaelbabyn/plot_data/master/sin_saddle.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var z_data = [ ]; +for(i=0;i<100;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type: 'surface', + colorscale: 'Viridis', + lighting: {ambient: 0.9} + }, + { + z: z_data, + type: 'surface', + scene: 'scene2', + colorscale:'Viridis', + lighting: {ambient: 0.2} + } +]; + +var layout = { + title: { + text: 'Ambient Lighting' + }, + grid: { + rows: 1, + columns: 2, + pattern: 'independent', + }, + scene:{ + aspectmode:'cube', + domain:{row:0, column:0} + }, + scene2:{ + aspectmode:'cube', + domain:{row:0, column:1} + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/3d-surface-lighting/surface_diffuse_reflection.html b/content/plotly_js/fundamentals/3d-surface-lighting/surface_diffuse_reflection.html new file mode 100644 index 00000000000..99ba9023df8 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-surface-lighting/surface_diffuse_reflection.html @@ -0,0 +1,55 @@ +--- +name: Diffuse +language: plotly_js +suite: 3d-surface-lighting +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/michaelbabyn/plot_data/master/sin_saddle.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var z_data = [] +for(i=0;i<100;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type: 'surface', + colorscale:'Viridis', + lighting: {diffuse: 0.9} + }, + { + z: z_data, + type: 'surface', + scene: 'scene2', + colorscale:'Viridis', + lighting: {diffuse: 0.1} + } +]; + +var layout = { + title: { + text: 'Diffuse Reflection' + }, + grid: { + rows: 1, + columns: 2, + pattern: 'independent', + }, + scene:{ + aspectmode:'cube', + domain:{row:0, column:0} + }, + scene2:{ + aspectmode:'cube', + domain:{row:0, column:1} + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/3d-surface-lighting/surface_fresnel.html b/content/plotly_js/fundamentals/3d-surface-lighting/surface_fresnel.html new file mode 100644 index 00000000000..93f3aeb511c --- /dev/null +++ b/content/plotly_js/fundamentals/3d-surface-lighting/surface_fresnel.html @@ -0,0 +1,55 @@ +--- +name: Fresnel +language: plotly_js +suite: 3d-surface-lighting +order: 5 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/michaelbabyn/plot_data/master/sin_saddle.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var z_data = []; +for(i=0;i<100;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type: 'surface', + colorscale:'Viridis', + lighting: {fresnel: 0.1} + }, + { + z: z_data, + type: 'surface', + scene: 'scene2', + colorscale:'Viridis', + lighting: {fresnel: 5} + } +]; + +var layout = { + title: { + text: 'Fresnel' + }, + grid: { + rows: 1, + columns: 2, + pattern: 'independent', + }, + scene:{ + aspectmode:'cube', + domain:{row:0, column:0} + }, + scene2:{ + aspectmode:'cube', + domain:{row:0, column:1} + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/3d-surface-lighting/surface_reference.html b/content/plotly_js/fundamentals/3d-surface-lighting/surface_reference.html new file mode 100644 index 00000000000..68d3da19b36 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-surface-lighting/surface_reference.html @@ -0,0 +1,10 @@ +--- +name: Reference +language: plotly_js +suite: 3d-surface-lighting +order: 10 +sitemap: false +arrangement: horizontal +markdown_content: | + See [https://plotly.com/javascript/reference/surface/#surface-lighting](https://plotly.com/javascript/reference/surface/#surface-lighting) for more information! +--- \ No newline at end of file diff --git a/content/plotly_js/fundamentals/3d-surface-lighting/surface_roughness.html b/content/plotly_js/fundamentals/3d-surface-lighting/surface_roughness.html new file mode 100644 index 00000000000..62f4523e098 --- /dev/null +++ b/content/plotly_js/fundamentals/3d-surface-lighting/surface_roughness.html @@ -0,0 +1,55 @@ +--- +name: Roughness +language: plotly_js +suite: 3d-surface-lighting +order: 2 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/michaelbabyn/plot_data/master/sin_saddle.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var z_data = []; +for(i=0;i<100;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type: 'surface', + colorscale:'Viridis', + lighting: {roughness: 0.9} + }, + { + z: z_data, + type: 'surface', + scene: 'scene2', + colorscale:'Viridis', + lighting: {roughness: 0.2} + } +]; + +var layout = { + title: { + text: 'Roughness' + }, + grid: { + rows: 1, + columns: 2, + pattern: 'independent', + }, + scene:{ + aspectmode:'cube', + domain:{row:0, column:0} + }, + scene2:{ + aspectmode:'cube', + domain:{row:0, column:1} + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/3d-surface-lighting/surface_specular_reflection.html b/content/plotly_js/fundamentals/3d-surface-lighting/surface_specular_reflection.html new file mode 100644 index 00000000000..226e77e46ff --- /dev/null +++ b/content/plotly_js/fundamentals/3d-surface-lighting/surface_specular_reflection.html @@ -0,0 +1,55 @@ +--- +name: Specular +language: plotly_js +suite: 3d-surface-lighting +order: 4 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/michaelbabyn/plot_data/master/sin_saddle.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + +var z_data = []; +for(i=0;i<100;i++) +{ + z_data.push(unpack(rows,i)); +} + +var data = [{ + z: z_data, + type: 'surface', + colorscale:'Viridis', + lighting: {specular: 0.1} + }, + { + z: z_data, + type: 'surface', + scene: 'scene2', + colorscale:'Viridis', + lighting: {specular: 2} + } +]; + +var layout = { + title: { + text: 'Specular Reflection' + }, + grid: { + rows: 1, + columns: 2, + pattern: 'independent', + }, + scene:{ + aspectmode:'cube', + domain:{row:0, column:0} + }, + scene2:{ + aspectmode:'cube', + domain:{row:0, column:1} + }, +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/ajax-call/ajax_call_plotly_js_index.html b/content/plotly_js/fundamentals/ajax-call/ajax_call_plotly_js_index.html new file mode 100644 index 00000000000..946a1bb5215 --- /dev/null +++ b/content/plotly_js/fundamentals/ajax-call/ajax_call_plotly_js_index.html @@ -0,0 +1,13 @@ +--- +name: Read CSV Data from an Ajax Call +permalink: javascript/ajax-call/ +description: How to make Ajax calls in javascript for Plotlyjs. +layout: base +thumbnail: thumbnail/line-plots.jpg +language: plotly_js +page_type: example_index +display_as: tutorials +redirect_from: javascript-graphing-library/ajax-call/ +--- +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","ajax" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/fundamentals/ajax-call/plotting-csv-data-from-ajax.html b/content/plotly_js/fundamentals/ajax-call/plotting-csv-data-from-ajax.html new file mode 100644 index 00000000000..6d37a2e7393 --- /dev/null +++ b/content/plotly_js/fundamentals/ajax-call/plotting-csv-data-from-ajax.html @@ -0,0 +1,42 @@ +--- +name: Plotting CSV Data from Ajax Call +plot_url: https://codepen.io/plotly/embed/9a091a6dd0486ff8de95982bc23a3467/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: ajax +order: 1 +sitemap: false +arrangement: horizontal +--- +function makeplot() { + d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv", function(data){ processData(data) } ); + +}; + +function processData(allRows) { + + console.log(allRows); + var x = [], y = [], standard_deviation = []; + + for (var i=0; iFormatting Annotations
click on a point to plot an annotation'}, + xaxis: { + zeroline: false, + title: { + text: 'Value A' + } + }, + yaxis: { + zeroline: false, + title: { + text: 'Value B' + } + } + }; + +Plotly.newPlot('myDiv', data, layout); + +myPlot.on('plotly_click', + function(data){ + var point = data.points[0], + newAnnotation = { + x: point.xaxis.d2l(point.x), + y: point.yaxis.d2l(point.y), + arrowhead: 6, + ax: 0, + ay: -80, + bgcolor: 'rgba(255, 255, 255, 0.9)', + arrowcolor: point.fullData.marker.color, + font: {size:12}, + bordercolor: point.fullData.marker.color, + borderwidth: 3, + borderpad: 4, + text: 'Series Identification' +
+ 'Year '+(point.data.name) + '
' + + 'Point Identification
' + + 'Month '+ (months[point.pointNumber]) + + '
Point Values
' + + 'A '+(point.x).toPrecision(4) + + '
B '+(point.y).toPrecision(4) + + }, + divid = document.getElementById('myDiv'), + newIndex = (divid.layout.annotations || []).length; + console.log(point.pointNumber) + // delete instead if clicked twice + if(newIndex) { + var foundCopy = false; + divid.layout.annotations.forEach(function(ann, sameIndex) { + if(ann.text === newAnnotation.text ) { + Plotly.relayout('myDiv', 'annotations[' + sameIndex + ']', 'remove'); + foundCopy = true; + } + }); + if(foundCopy) return; + } + Plotly.relayout('myDiv', 'annotations[' + newIndex + ']', newAnnotation); + }) + .on('plotly_clickannotation', function(event, data) { + Plotly.relayout('myDiv', 'annotations[' + data.index + ']', 'remove'); + }); diff --git a/content/plotly_js/fundamentals/annotations/style-annotation.html b/content/plotly_js/fundamentals/annotations/style-annotation.html new file mode 100644 index 00000000000..4886d611f4e --- /dev/null +++ b/content/plotly_js/fundamentals/annotations/style-annotation.html @@ -0,0 +1,50 @@ +--- +name: Styling and Coloring Annotations +language: plotly_js +suite: annotations +order: 6 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 3, 2, 4, 3, 4, 6, 5], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 4, 5, 1, 2, 2, 3, 4, 2], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + showlegend: false, + annotations: [ + { + x: 2, + y: 5, + xref: 'x', + yref: 'y', + text: 'max=5', + showarrow: true, + font: { + family: 'Courier New, monospace', + size: 16, + color: '#ffffff' + }, + align: 'center', + arrowhead: 2, + arrowsize: 1, + arrowwidth: 2, + arrowcolor: '#636363', + ax: 20, + ay: -30, + bordercolor: '#c7c7c7', + borderwidth: 2, + borderpad: 4, + bgcolor: '#ff7f0e', + opacity: 0.8 + } + ] +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/annotations/subplot-annotations.html b/content/plotly_js/fundamentals/annotations/subplot-annotations.html new file mode 100644 index 00000000000..6e2e5495b26 --- /dev/null +++ b/content/plotly_js/fundamentals/annotations/subplot-annotations.html @@ -0,0 +1,59 @@ +--- +name: Subplot Annotations +language: plotly_js +suite: annotations +order: 4.5 +sitemap: false +arrangement: horizontal +--- + +var trace0 = { + x: [1, 2, 3], + y: [4, 5, 6], + type: 'scatter' +}; + +var trace1 = { + x: [20, 30, 40], + y: [50, 60, 70], + xaxis: 'x2', + yaxis: 'y2', + type: 'scatter' +}; + +var data = [trace0, trace1]; + +var layout = { + title: { + text: 'Subplot Annotations' + }, + xaxis: {domain: [0, 0.45]}, + yaxis2: {anchor: 'x2'}, + xaxis2: {domain: [0.55, 1]}, + annotations: [ + { + x: 2, + y: 5, + xref: 'x', + yref: 'y', + text: 'Annotation A', + showarrow: true, + arrowhead: 3, + ax: -30, + ay: -40 + }, + { + x: 30, + y: 60, + xref: 'x2', + yref: 'y2', + text: 'Annotation B', + showarrow: true, + arrowhead: 2, + ax: -25, + ay: -40 + } + ] +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/annotations/text-chart-basic.html b/content/plotly_js/fundamentals/annotations/text-chart-basic.html new file mode 100644 index 00000000000..e745093253c --- /dev/null +++ b/content/plotly_js/fundamentals/annotations/text-chart-basic.html @@ -0,0 +1,38 @@ +--- +name: Adding Text to Data in Line and Scatter Plots +language: plotly_js +suite: annotations +order: 1 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2], + y: [1, 1, 1], + mode: 'lines+markers+text', + name: 'Lines, Markers and Text', + text: ['Text A', 'Text B', 'Text C'], + textposition: 'top', + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2], + y: [2, 2, 2], + mode: 'markers+text', + name: 'Markers and Text', + text: ['Text D', 'Text E', 'Text F'], + textposition: 'bottom', + type: 'scatter' +}; +var trace3 = { + x: [0, 1, 2], + y: [3, 3, 3], + mode: 'lines+text', + name: 'Lines and Text', + text: ['Text G', 'Text H', 'Text I'], + textposition: 'bottom', + type: 'scatter' +}; +var data = [trace1, trace2, trace3]; +var layout = {showlegend: false}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/annotations/text-chart-styling.html b/content/plotly_js/fundamentals/annotations/text-chart-styling.html new file mode 100644 index 00000000000..e26632bf1ed --- /dev/null +++ b/content/plotly_js/fundamentals/annotations/text-chart-styling.html @@ -0,0 +1,39 @@ +--- +name: Custom Text Color and Styling +language: plotly_js +suite: annotations +order: 5 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2], + y: [1, 1, 1], + mode: 'lines+markers+text', + name: 'Lines, Markers and Text', + text: ['Text A', 'Text B', 'Text C'], + textposition: 'top right', + textfont: { + family: 'sans serif', + size: 18, + color: '#1f77b4' + }, + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2], + y: [2, 2, 2], + mode: 'lines+markers+text', + name: 'Lines and Text', + text: ['Text G', 'Text H', 'Text I'], + textposition: 'bottom', + textfont: { + family: 'sans serif', + size: 18, + color: '#ff7f0e' + }, + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = {showlegend: false}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/annotations/webgl-text-and-annotations.html b/content/plotly_js/fundamentals/annotations/webgl-text-and-annotations.html new file mode 100644 index 00000000000..83b65281ef8 --- /dev/null +++ b/content/plotly_js/fundamentals/annotations/webgl-text-and-annotations.html @@ -0,0 +1,77 @@ +--- +name: WebGL Text and Annotations +language: plotly_js +suite: annotations +order: 8 +sitemap: false +arrangement: horizontal +--- + +var n = 250; +var t = 12; +var x = []; +var y = []; +var z = []; +var text = []; +var arr = ["A","T","G", "C"]; + +for (var j = 0; j < t; j++){ + ztemp = []; + for (var i = 0; i < n; i++) { + x.push(i); + y.push(j); + ztemp.push(Math.floor(Math.random() * 10)); + text.push(arr[Math.floor(Math.random() * 4)]) + } + z.push(ztemp) +} + +var steps = []; +for (var e = 0; e < n-30; e++){ + steps.push({ + label: e, + value: e, + method: 'relayout', + args: ['xaxis', {range: [-0.5 + e, 30.5 + e]}] + }) +} + +data1 = { + x: x, + y: y, + mode: "text", + text: text, + type: "scattergl", + textfont: { + size: 20 + } + } + +data2 = { + z: z, + type: "heatmap" + } + +sliders = [{ + active: 0, + steps: steps + }] + +layout = { + sliders: sliders, + xaxis: { + range: [-0.5, 30.5], + showline: false, + zeroline: false, + showgrid: false + }, + yaxis: { + showline: false, + zeroline: false, + showgrid: false + } + } + +data = [data1, data2] +Plotly.newPlot('myDiv', {data:data, + layout:layout}); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/axes/aspectratio.html b/content/plotly_js/fundamentals/axes/aspectratio.html new file mode 100644 index 00000000000..72333aebd70 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/aspectratio.html @@ -0,0 +1,91 @@ +--- +name: Fixed-Ratio Axes +language: plotly_js +suite: axes +order: 9 +sitemap: false +arrangement: horizontal +--- + +var trace0 = { + x: [0,1,1,0,0,1,1,2,2,3,3,2,2,3], + y: [0,0,1,1,3,3,2,2,3,3,1,1,0,0] +} + +var trace1 = { + x: [0,1,2,3], + y: [1,2,4,8], + yaxis:"y2" +} + +var trace2 = { + x: [1,10,100,10,1], + y: [0,1,2,3,4], + xaxis: "x2", + yaxis:"y3", +} + +var trace3 = { + x: [1,100,30,80,1], + y: [1,1.5,2,2.5,3], + xaxis:"x2", + yaxis:"y4" +} + +var data = [trace0,trace1,trace2,trace3] + +var layout = { + width: 800, + height: 500, + title: { + text: "fixed-ratio axes" + }, + xaxis: { + nticks: 10, + domain: [0, 0.45], + title: { + text: "shared X axis" + } + }, + yaxis: { + scaleanchor: "x", + domain: [0, 0.45], + title: { + text: "1:1" + } + }, + yaxis2: { + scaleanchor: "x", + scaleratio: 0.2, + domain: [0.55, 1], + title: { + text: "1:5" + } + }, + xaxis2: { + type: "log", + domain: [0.55, 1], + anchor: "y3", + title: { + text: "unconstrained log X" + } + }, + yaxis3: { + domain: [0, 0.45], + anchor: "x2", + title: { + text: "Scale matches ->" + } + }, + yaxis4: { + scaleanchor: "y3", + domain: [0.55, 1], + anchor: "x2", + title: { + text: "Scale matches <-" + } + }, + showlegend: false +} + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/fundamentals/axes/axes-booleans.html b/content/plotly_js/fundamentals/axes/axes-booleans.html new file mode 100644 index 00000000000..2f6aa16cdf0 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-booleans.html @@ -0,0 +1,40 @@ +--- +name: Toggling Axes Lines, Ticks, Labels, and Autorange +language: plotly_js +suite: axes +order: 1 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [8, 7, 6, 5, 4, 3, 2, 1, 0], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + xaxis: { + autorange: true, + showgrid: false, + zeroline: false, + showline: false, + autotick: true, + ticks: '', + showticklabels: false + }, + yaxis: { + autorange: true, + showgrid: false, + zeroline: false, + showline: false, + autotick: true, + ticks: '', + showticklabels: false + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-categories.html b/content/plotly_js/fundamentals/axes/axes-categories.html new file mode 100644 index 00000000000..1e6f1c56bcc --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-categories.html @@ -0,0 +1,36 @@ +--- +name: Categorical Axes +language: plotly_js +suite: axes +order: 7 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: ['A12', 'BC2', 109, '12F', 215, 304], + y: [1, 6, 3, 5, 1, 4], + mode: 'markers', + type: 'bar', + name: 'Team A', + text: ['Apples', 'Pears', 'Peaches', 'Bananas', 'Pineapples', 'Cherries'], +}; + +var data = [ trace1 ]; + +var layout = { + xaxis: { + type: 'category', + title: { + text: 'Product Code' + } + }, + yaxis: { + range: [0, 7], + title: { + text: 'Number of Items in Stock' + } + }, + title: {text: 'Inventory'} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-dates.html b/content/plotly_js/fundamentals/axes/axes-dates.html new file mode 100644 index 00000000000..56a08016e72 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-dates.html @@ -0,0 +1,36 @@ +--- +name: Using Dates on the X-Axis +language: plotly_js +suite: axes +order: 8 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: ['2000-01-01', '2000-01-02', '2000-01-03', '2000-01-04', '2000-01-05', '2000-01-06', '2000-01-07', '2000-01-08', '2000-01-09', '2000-01-10', '2000-01-11', '2000-01-12', '2000-01-13', '2000-01-14', '2000-01-15', '2000-01-16', '2000-01-17', '2000-01-18', '2000-01-19', '2000-01-20', '2000-01-21', '2000-01-22', '2000-01-23', '2000-01-24', '2000-01-25', '2000-01-26', '2000-01-27', '2000-01-28', '2000-01-29', '2000-01-30', '2000-01-31'], + y: [4.3, 8.2, 4.1, 5.6, -3, -0.2, 0.3, 0.4, 4.1, 5, 4.6, -0.2, -8.5, -9.1, -2.7, -2.7, -17, -11.3, -5.5, -6.5, -16.9, -12, -6.1, -6.6, -7.9, -10.8, -14.8, -11, -4.4, -1.3, -1.1], + mode: 'lines', + type: 'scatter', + name: '2000' +}; + +var data = [ trace1 ]; + +var layout = { + xaxis: { + type: 'date', + title: { + text: 'January Weather' + } + }, + yaxis: { + title: { + text: 'Daily Mean Temperature' + } + }, + title: { + text: '2000 Toronto January Weather' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-label-aliases.html b/content/plotly_js/fundamentals/axes/axes-label-aliases.html new file mode 100644 index 00000000000..1487550d7ee --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-label-aliases.html @@ -0,0 +1,29 @@ +--- +name: Specifying Label Aliases +language: plotly_js +suite: axes +order: 10 +sitemap: false +arrangement: horizontal +markdown_content: | + This example uses `labelalias` to update the text displayed for the x-axis values. +--- +var trace1 = { + x: ['UK', 'US', 'Germany', 'France'], + y: [8, 3, 10, 3], + type: 'bar', +}; + +var data = [trace1]; + +var layout = { +xaxis: { + labelalias: { + UK: '🇬🇧 United Kingdom', + US: '🇺🇸 United States', + Germany: '🇩🇪 Germany', + France: '🇫🇷 France'} + }, +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-labels.html b/content/plotly_js/fundamentals/axes/axes-labels.html new file mode 100644 index 00000000000..e3ba4cc0b4d --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-labels.html @@ -0,0 +1,75 @@ +--- +name: Set and Style Axes Title Labels and Ticks +language: plotly_js +suite: axes +order: 0 +sitemap: false +arrangement: horizontal +--- + + + + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); +} + + var x = unpack(rows, 'Date') + var y = unpack(rows, 'AAPL.Volume') + + var trace = { + type: "scatter", + mode: "lines", + name: 'AAPL Volume', + x: x, + y: y, + line: {color: 'grey'} + } + + var data = [trace]; + +var layout = { + title: {text: 'Volume of Apple Shares Traded'}, + xaxis: { + title: { + text: 'AXIS TITLE', + font: { + family: 'Arial, sans-serif', + size: 18, + color: 'lightgrey' + } + }, + showticklabels: true, + tickangle: 'auto', + tickfont: { + family: 'Old Standard TT, serif', + size: 14, + color: 'black' + }, + exponentformat: 'e', + showexponent: 'all' + }, + yaxis: { + title: { + text: 'AXIS TITLE', + font: { + family: 'Arial, sans-serif', + size: 18, + color: 'lightgrey' + } + }, + showticklabels: true, + tickangle: 45, + tickfont: { + family: 'Old Standard TT, serif', + size: 14, + color: 'black' + }, + exponentformat: 'e', + showexponent: 'all' + } +}; + +Plotly.newPlot('myDiv', data, layout); +}) diff --git a/content/plotly_js/fundamentals/axes/axes-lines.html b/content/plotly_js/fundamentals/axes/axes-lines.html new file mode 100644 index 00000000000..be57d7421c8 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-lines.html @@ -0,0 +1,46 @@ +--- +name: Styling and Coloring Axes and the Zero-Line +language: plotly_js +suite: axes +order: 0 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [8, 7, 6, 5, 4, 3, 2, 1, 0], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + xaxis: { + showgrid: true, + zeroline: true, + showline: true, + mirror: 'ticks', + gridcolor: '#bdbdbd', + gridwidth: 2, + zerolinecolor: '#969696', + zerolinewidth: 4, + linecolor: '#636363', + linewidth: 6 + }, + yaxis: { + showgrid: true, + zeroline: true, + showline: true, + mirror: 'ticks', + gridcolor: '#bdbdbd', + gridwidth: 2, + zerolinecolor: '#969696', + zerolinewidth: 4, + linecolor: '#636363', + linewidth: 6 + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-multi-categories.html b/content/plotly_js/fundamentals/axes/axes-multi-categories.html new file mode 100644 index 00000000000..d894d728219 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-multi-categories.html @@ -0,0 +1,42 @@ +--- +name: Multi-Category Axes +language: plotly_js +suite: axes +order: 7.4 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [ + ['SF Zoo','SF Zoo','SF Zoo'], + ['giraffes', 'orangutans', 'monkeys'] + ], + y: [20, 14, 23], + name: 'SF Zoo', + type: 'bar' +}; + +var trace2 = { + x: [ + ['LA Zoo','LA Zoo','LA Zoo'], + ['giraffes', 'orangutans', 'monkeys'] + ], + y: [12, 18, 29], + name: 'LA Zoo', + type: 'bar' +}; + +var data = [trace1, trace2]; +var layout = { + showlegend: false, + xaxis: { + tickson: "boundaries", + ticklen: 15, + showdividers: true, + dividercolor: 'grey', + dividerwidth: 2 + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-range-manual.html b/content/plotly_js/fundamentals/axes/axes-range-manual.html new file mode 100644 index 00000000000..0b13c60c393 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-range-manual.html @@ -0,0 +1,24 @@ +--- +name: Setting the Range of Axes Manually +language: plotly_js +suite: axes +order: 1 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [8, 7, 6, 5, 4, 3, 2, 1, 0], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + xaxis: {range: [2, 5]}, + yaxis: {range: [2, 5]} +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-range-mode.html b/content/plotly_js/fundamentals/axes/axes-range-mode.html new file mode 100644 index 00000000000..186a85a1845 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-range-mode.html @@ -0,0 +1,27 @@ +--- +name: nonnegative, tozero, and normal Rangemode +language: plotly_js +suite: axes +order: 2 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [2, 4, 6], + y: [-3, 0, 3], + type: 'scatter' + } +]; +var layout = { + showlegend: false, + xaxis: { + rangemode: 'tozero', + autorange: true + }, + yaxis: { + rangemode: 'nonnegative', + autorange: true + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-range-type.html b/content/plotly_js/fundamentals/axes/axes-range-type.html new file mode 100644 index 00000000000..0a8c782b78b --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-range-type.html @@ -0,0 +1,30 @@ +--- +name: Logarithmic Axes +language: plotly_js +suite: axes +order: 3 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [8, 7, 6, 5, 4, 3, 2, 1, 0], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + xaxis: { + type: 'log', + autorange: true + }, + yaxis: { + type: 'log', + autorange: true + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-reversed-with-min-max.html b/content/plotly_js/fundamentals/axes/axes-reversed-with-min-max.html new file mode 100644 index 00000000000..73601c47bf2 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-reversed-with-min-max.html @@ -0,0 +1,25 @@ +--- +name: Reversed Axes with Range ( Min/Max ) Specified +language: plotly_js +suite: axes +order: 5 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + x: [0.0, 0.1, 0.2, 0.3, 0.4, 0.51, 0.61, 0.71, 0.81, 0.91, 1.01, 1.11, 1.21, 1.31, 1.41, 1.52, 1.62, 1.72, 1.82, 1.92, 2.02, 2.12, 2.22, 2.32, 2.42, 2.53, 2.63, 2.73, 2.83, 2.93, 3.03, 3.13, 3.23, 3.33, 3.43, 3.54, 3.64, 3.74, 3.84, 3.94, 4.04, 4.14, 4.24, 4.34, 4.44, 4.55, 4.65, 4.75, 4.85, 4.95, 5.05, 5.15, 5.25, 5.35, 5.45, 5.56, 5.66, 5.76, 5.86, 5.96, 6.06, 6.16, 6.26, 6.36, 6.46, 6.57, 6.67, 6.77, 6.87, 6.97, 7.07, 7.17, 7.27, 7.37, 7.47, 7.58, 7.68, 7.78, 7.88, 7.98, 8.08, 8.18, 8.28, 8.38, 8.48, 8.59, 8.69, 8.79, 8.89, 8.99, 9.09, 9.19, 9.29, 9.39, 9.49, 9.6, 9.7, 9.8, 9.9, 10.0], + y: [63, 65, 78, 92, 12, 50, 17, 31, 1, 25, 76, 66, 83, 38, 95, 23, 20, 88, 31, 26, 39, 74, 11, 84, 7, 13, 30, 85, 80, 47, 12, 89, 12, 35, 99, 78, 77, 56, 26, 13, 96, 55, 19, 88, 31, 1, 42, 39, 99, 62, 68, 61, 45, 44, 10, 25, 89, 82, 28, 2, 24, 1, 32, 16, 29, 40, 55, 75, 20, 41, 67, 33, 92, 14, 16, 22, 86, 55, 37, 42, 42, 85, 60, 11, 54, 3, 34, 29, 59, 28, 25, 67, 90, 10, 29, 16, 51, 17, 2, 34], + mode: "markers" + } +]; +var layout = { + title: { + text: "Reversed Axis with Min/Max" + }, + xaxis: { + range: [10, 0] + } +}; +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/axes/axes-reversed.html b/content/plotly_js/fundamentals/axes/axes-reversed.html new file mode 100644 index 00000000000..c1925f99037 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-reversed.html @@ -0,0 +1,17 @@ +--- +name: Reversed Axes +language: plotly_js +suite: axes +order: 4 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [1, 2], + y: [1, 2], + type: 'scatter' + } +]; +var layout = {xaxis: {autorange: 'reversed'}}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes-ticks.html b/content/plotly_js/fundamentals/axes/axes-ticks.html new file mode 100644 index 00000000000..3a0241c8ab7 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes-ticks.html @@ -0,0 +1,40 @@ +--- +name: Tick Placement, Color, and Style +language: plotly_js +suite: axes +order: 0 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [8, 7, 6, 5, 4, 3, 2, 1, 0], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + xaxis: { + tickmode: 'linear', + ticks: 'outside', + tick0: 0, + dtick: 0.25, + ticklen: 8, + tickwidth: 4, + tickcolor: '#000' + }, + yaxis: { + tickmode: 'linear', + ticks: 'outside', + tick0: 0, + dtick: 0.25, + ticklen: 8, + tickwidth: 4, + tickcolor: '#000' + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/axes/axes_plotly_js_index.html b/content/plotly_js/fundamentals/axes/axes_plotly_js_index.html new file mode 100644 index 00000000000..2b2c96adb86 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/axes_plotly_js_index.html @@ -0,0 +1,17 @@ +--- +description: How to adjust axes properties in D3.js-based javascript charts. Seven + examples of linear and logarithmic axes, axes titles, and styling and coloring axes + and grid lines. +display_as: file_settings +language: plotly_js +layout: base +name: Axes +order: 15 +page_type: u-guide +permalink: javascript/axes/ +redirect_from: javascript-graphing-library/axes/ +thumbnail: thumbnail/axes.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","axes" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/axes/b64-arrays.html b/content/plotly_js/fundamentals/axes/b64-arrays.html new file mode 100644 index 00000000000..2357720a2d1 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/b64-arrays.html @@ -0,0 +1,34 @@ +--- +name: Use Base64-Encoded Typed Arrays +language: plotly_js +suite: axes +order: 11 +sitemap: false +arrangement: horizontal +markdown_content: | + Plotly.js 2.28.0 and later supports using base64-encoded typed arrays. To use a base64-encoded typed array, pass an object with the keys `bdata` (a base64-encoded string or the ArrayBuffer of an integer or float typed array) and `dtype` (the data type of the array, where the supported types are `float64`, `float32`, `int32`, `uint32`, `int16`, `uint16`, `int8`, `uint8`, and `uint8c`). You can also specify `shape` for multidimensional arrays. For example, `'4,10'` would be a 2D array with 4 rows and 10 columns. +--- +var x = 'VVVVVVVV1b8AAAAAAAAAAFVVVVVVVdU/' +var y = 'q6qqPquqqr4=' +var z = 'AABkAMgALAGQAfQB' + +var trace1 = { + x: { + bdata: x, + dtype: 'f8' + }, + y: { + bdata: y, + dtype: 'f4' + }, + z: { + bdata: z, + dtype: 'u2', + shape: '2,3' + }, + type: 'surface' +}; + +var data = [trace1]; + +Plotly.newPlot('myDiv', data); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/axes/enumerated-ticks-with-tickvals-and-ticktext.html b/content/plotly_js/fundamentals/axes/enumerated-ticks-with-tickvals-and-ticktext.html new file mode 100644 index 00000000000..32020def0e2 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/enumerated-ticks-with-tickvals-and-ticktext.html @@ -0,0 +1,38 @@ +--- +name: Enumerated Ticks with Tickvals and Ticktext +language: plotly_js +suite: axes +order: 2 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/stockdata.csv', function(err, rows){ +function unpack(rows, key) { + return rows.map(function(row) + { return row[key]; });} + +var trace1 = { + x:unpack(rows, 'Date'), + y: unpack(rows, 'IBM'), + mode: 'markers', + marker: { + size: 7, + line: { + width: 0.5}, + opacity: 0.8}, + type: 'scatter' +}; + +var layout = { + title: { + text: 'IBM Stock Data: Jan 2007 - Mar 2016' + }, + xaxis: { + tickvals: ['2007-01-01', '2007-09-01', '2008-01-01', '2008-09-01', '2009-01-01', '2010-01-01', '2011-01-01', '2011-02-14', '2012-01-01', '2013-01-01', '2014-01-01', '2015-01-01', '2016-01-01'], + ticktext: ['2007', 'Financial Crisis Starts', '2008', 'Financial Crisis Ends', '2009', '2010', '2011', 'IBM wins Jeopardy!', '2012', '2013', '2014', '2015', '2016'] + } +}; + +var data = [trace1]; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/axes/title_standoff.html b/content/plotly_js/fundamentals/axes/title_standoff.html new file mode 100644 index 00000000000..7670557034f --- /dev/null +++ b/content/plotly_js/fundamentals/axes/title_standoff.html @@ -0,0 +1,36 @@ +--- +name: Set Axis Title Position +language: plotly_js +suite: axes +order: 3.5 +sitemap: false +arrangement: horizontal +markdown_content: | + This example sets `standoff` attribute to cartesian axes to determine the distance between the tick labels and the axis title. + Note that the axis title position is always constrained within the margins, so the actual standoff distance is always less than the set or default value. + By setting standoff and turning [automargin](https://plotly.com/javascript/setting-graph-size/#automatically-adjust-margins) on, plotly.js will push the margins to fit the axis title at given standoff distance. +--- +var data = [{ + mode: "lines+markers", + x:["December", "January", "February"], + y:[4,1,3] + }] + + var layout = { + margin: {t:0,r:0,b:0,l:20}, + xaxis: { + automargin: true, + tickangle: 90, + title: { + text: "Month", + standoff: 20 + }}, + yaxis: { + automargin: true, + tickangle: 90, + title: { + text: "Temperature", + standoff: 40 + }}} + +Plotly.newPlot('myDiv', data, layout) \ No newline at end of file diff --git a/content/plotly_js/fundamentals/axes/zeroline.html b/content/plotly_js/fundamentals/axes/zeroline.html new file mode 100644 index 00000000000..3c7d8a25072 --- /dev/null +++ b/content/plotly_js/fundamentals/axes/zeroline.html @@ -0,0 +1,30 @@ +--- +name: Zero Line Layer +language: plotly_js +suite: axes +order: 12 +sitemap: false +arrangement: horizontal +markdown_content: | + *New in 3.1* + + By default, zero lines are displayed below traces. Set `zerolinelayer="above traces"` on an axis to display its zero line above traces. +--- +var trace1 = { + x: ['A', 'B', 'C', 'D', 'A'], + y: [2, 0, 4, -3, 2], + fill: 'toself', + mode: 'none', + fillcolor: 'lightpink', + type: 'scatter' +}; + +var data = [trace1]; + +var layout = { + yaxis: { + zerolinelayer: "above traces" // Change to "below traces" to see the difference + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/colorscales/Blackbody-heatmap.html b/content/plotly_js/fundamentals/colorscales/Blackbody-heatmap.html new file mode 100644 index 00000000000..793cf150233 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Blackbody-heatmap.html @@ -0,0 +1,22 @@ +--- +name: Blackbody Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Blackbody', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'Blackbody' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/Bluered-heatmap.html b/content/plotly_js/fundamentals/colorscales/Bluered-heatmap.html new file mode 100644 index 00000000000..e754a1eca40 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Bluered-heatmap.html @@ -0,0 +1,16 @@ +--- +name: Bluered Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Bluered', + type: 'heatmap' +}]; +Plotly.newPlot('myDiv', data); + }); diff --git a/content/plotly_js/fundamentals/colorscales/Earth-heatmap.html b/content/plotly_js/fundamentals/colorscales/Earth-heatmap.html new file mode 100644 index 00000000000..424fd581878 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Earth-heatmap.html @@ -0,0 +1,17 @@ +--- +name: Earth Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- + +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Earth', + type: 'heatmap' +}]; +Plotly.newPlot('myDiv', data); + }); diff --git a/content/plotly_js/fundamentals/colorscales/Electric-heatmap.html b/content/plotly_js/fundamentals/colorscales/Electric-heatmap.html new file mode 100644 index 00000000000..5a316c6ae31 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Electric-heatmap.html @@ -0,0 +1,16 @@ +--- +name: Electric Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Electric', + type: 'heatmap' +}]; +Plotly.newPlot('myDiv', data); + }); diff --git a/content/plotly_js/fundamentals/colorscales/Greens-heatmap.html b/content/plotly_js/fundamentals/colorscales/Greens-heatmap.html new file mode 100644 index 00000000000..b5ff8f2f913 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Greens-heatmap.html @@ -0,0 +1,22 @@ +--- +name: Greens Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Greens', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'Greens' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/Greys-heatmap.html b/content/plotly_js/fundamentals/colorscales/Greys-heatmap.html new file mode 100644 index 00000000000..4470c4bc2d6 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Greys-heatmap.html @@ -0,0 +1,22 @@ +--- +name: Greys Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Greys', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'Greys' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/Hot-heatmap.html b/content/plotly_js/fundamentals/colorscales/Hot-heatmap.html new file mode 100644 index 00000000000..671a98ee711 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Hot-heatmap.html @@ -0,0 +1,17 @@ +--- +name: Hot Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- + +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Hot', + type: 'heatmap' +}]; +Plotly.newPlot('myDiv', data); + }); diff --git a/content/plotly_js/fundamentals/colorscales/Jet-heatmap.html b/content/plotly_js/fundamentals/colorscales/Jet-heatmap.html new file mode 100644 index 00000000000..f5cf906376a --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Jet-heatmap.html @@ -0,0 +1,23 @@ +--- +name: Jet Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- + +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Jet', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'Jet' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/Picnic-heatmap.html b/content/plotly_js/fundamentals/colorscales/Picnic-heatmap.html new file mode 100644 index 00000000000..e4721eafc31 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Picnic-heatmap.html @@ -0,0 +1,22 @@ +--- +name: Picnic Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Picnic', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'Picnic' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/Portland-heatmap.html b/content/plotly_js/fundamentals/colorscales/Portland-heatmap.html new file mode 100644 index 00000000000..f402d7a600a --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/Portland-heatmap.html @@ -0,0 +1,23 @@ +--- +name: Portland Heatmap +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- + +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'Portland', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'Portland' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/RdBu-heatmap.html b/content/plotly_js/fundamentals/colorscales/RdBu-heatmap.html new file mode 100644 index 00000000000..6fd7583f0a2 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/RdBu-heatmap.html @@ -0,0 +1,23 @@ +--- +name: RdBu Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- + +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'RdBu', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'RdBu' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/YIGnBu-heatmap.html b/content/plotly_js/fundamentals/colorscales/YIGnBu-heatmap.html new file mode 100644 index 00000000000..7f720e6e1ab --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/YIGnBu-heatmap.html @@ -0,0 +1,22 @@ +--- +name: YlGnBu Colorscale +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'YlGnBu', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'YlGnBu' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/YIOrRd-heatmap.html b/content/plotly_js/fundamentals/colorscales/YIOrRd-heatmap.html new file mode 100644 index 00000000000..ba580ee85c9 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/YIOrRd-heatmap.html @@ -0,0 +1,23 @@ +--- +name: YlOrRd Heatmap +language: plotly_js +suite: colorscales +order: 16 +sitemap: false +arrangement: horizontal +--- + +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: 'YlOrRd', + type: 'heatmap' + } +]; +var layout = { + title: { + text: 'YlOrRd' + } +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/fundamentals/colorscales/colorscale-for-contour-plot.html b/content/plotly_js/fundamentals/colorscales/colorscale-for-contour-plot.html new file mode 100644 index 00000000000..7dce3955707 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/colorscale-for-contour-plot.html @@ -0,0 +1,27 @@ +--- +name: Colorscale for Contour Plot +language: plotly_js +suite: colorscales +order: 20 +sitemap: false +arrangement: horizontal +--- + +var data = [ { + 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]], + type: 'contour', + colorscale: 'Jet' +} +]; + +var layout = { + title: { + text: 'Colorscale for Contour Plot' + } +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/colorscales/colorscales_new_plotlyjs_index.html b/content/plotly_js/fundamentals/colorscales/colorscales_new_plotlyjs_index.html new file mode 100644 index 00000000000..8d026dfe310 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/colorscales_new_plotlyjs_index.html @@ -0,0 +1,16 @@ +--- +description: How to set colorscales and heatmap colorscales in D3.js-based JavaScript + charts in Plotly.js. Divergent, sequential, and qualitative colorscales. +display_as: file_settings +language: plotly_js +layout: base +name: Colorscales +order: 6 +page_type: u-guide +permalink: javascript/colorscales/ +redirect_from: javascript-graphing-library/heatmap-and-contour-colorscales/ +thumbnail: thumbnail/heatmap_colorscale.jpg +--- + +{% assign examples = site.posts | where:'language','plotly_js' | where:'suite','colorscales' | sort: 'order' %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/colorscales/custom-colorscale-for-contour-plot.html b/content/plotly_js/fundamentals/colorscales/custom-colorscale-for-contour-plot.html new file mode 100644 index 00000000000..ade05d99c7c --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/custom-colorscale-for-contour-plot.html @@ -0,0 +1,26 @@ +--- +name: Custom Colorscale for Contour Plot +language: plotly_js +suite: colorscales +order: 21 +sitemap: false +arrangement: horizontal +--- +var data = [ { + 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]], + type: 'contour', + colorscale: [[0, 'rgb(166,206,227)'], [0.25, 'rgb(31,120,180)'], [0.45, 'rgb(178,223,138)'], [0.65, 'rgb(51,160,44)'], [0.85, 'rgb(251,154,153)'], [1, 'rgb(227,26,28)']] +} +]; + +var layout = { + title: { + text: 'Custom Contour Plot Colorscale' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/colorscales/custom-colorscale.html b/content/plotly_js/fundamentals/colorscales/custom-colorscale.html new file mode 100644 index 00000000000..ef7920aa280 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/custom-colorscale.html @@ -0,0 +1,27 @@ +--- +name: Custom Colorscale +language: plotly_js +suite: colorscales +order: 3 +sitemap: false +arrangement: horizontal +--- +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) { +var data = [{ + z: figure.z, + colorscale: [ + ['0.0', 'rgb(165,0,38)'], + ['0.111111111111', 'rgb(215,48,39)'], + ['0.222222222222', 'rgb(244,109,67)'], + ['0.333333333333', 'rgb(253,174,97)'], + ['0.444444444444', 'rgb(254,224,144)'], + ['0.555555555556', 'rgb(224,243,248)'], + ['0.666666666667', 'rgb(171,217,233)'], + ['0.777777777778', 'rgb(116,173,209)'], + ['0.888888888889', 'rgb(69,117,180)'], + ['1.0', 'rgb(49,54,149)'] + ], + type: 'heatmap' +}]; +Plotly.newPlot('myDiv', data); + }); diff --git a/content/plotly_js/fundamentals/colorscales/discretized-heatmap-colorscale.html b/content/plotly_js/fundamentals/colorscales/discretized-heatmap-colorscale.html new file mode 100644 index 00000000000..183fcfc4577 --- /dev/null +++ b/content/plotly_js/fundamentals/colorscales/discretized-heatmap-colorscale.html @@ -0,0 +1,68 @@ +--- +name: Custom Discretized Heatmap Colorscale +language: plotly_js +suite: colorscales +order: 22 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + z: [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], + colorscale: [ + +// Let first 10% (0.1) of the values have color rgb(0, 0, 0) + + [0, 'rgb(0, 0, 0)'], + [0.1, 'rgb(0, 0, 0)'], + +// Let values between 10-20% of the min and max of z +// have color rgb(20, 20, 20) + + [0.1, 'rgb(20, 20, 20)'], + [0.2, 'rgb(20, 20, 20)'], + +// Values between 20-30% of the min and max of z +//have color rgb(40, 40, 40) + + [0.2, 'rgb(40, 40, 40)'], + [0.3, 'rgb(40, 40, 40)'], + + [0.3, 'rgb(60, 60, 60)'], + [0.4, 'rgb(60, 60, 60)'], + + [0.4, 'rgb(80, 80, 80)'], + [0.5, 'rgb(80, 80, 80)'], + + [0.5, 'rgb(100, 100, 100)'], + [0.6, 'rgb(100, 100, 100)'], + + [0.6, 'rgb(120, 120, 120)'], + [0.7, 'rgb(120, 120, 120)'], + + [0.7, 'rgb(140, 140, 140)'], + [0.8, 'rgb(140, 140, 140)'], + + [0.8, 'rgb(160, 160, 160)'], + [0.9, 'rgb(160, 160, 160)'], + + [0.9, 'rgb(180, 180, 180)'], + [1.0, 'rgb(180, 180, 180)'] + ], + type: 'heatmap', + colorbar:{ + tickmode: 'linear', + tick0: 0, + dtick: 1 + } + } +]; + +var layout = { + title: { + text: 'CUSTOM DISCRETIZED HEATMAP COLORSCALE' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/colorway/colorway.html b/content/plotly_js/fundamentals/colorway/colorway.html new file mode 100644 index 00000000000..506f5b94e80 --- /dev/null +++ b/content/plotly_js/fundamentals/colorway/colorway.html @@ -0,0 +1,34 @@ +--- +name: Set Default Trace Colors with colorway +language: plotly_js +suite: colorway +order: 1 +sitemap: false +arrangement: horizontal +--- +function linspace(a,b,n) { + return d3.range(n).map(function(i){return a+i*(b-a)/(n-1);}); +} + +const parabolaGen = (a, b) => + x => x*x*a + b; + +var as = linspace(1, 3, 7); +var bs = linspace(2, 14, 7); +var x = linspace(-1, 3, 50); +var data = []; + +for (i=0; i< as.length; i++ ){ + data.push({ + type: "scatter", + mode: "lines", + x: x, + y: x.map(parabolaGen(as[i],bs[i])) + }) +} + +var layout = { + colorway : ['#f3cec9', '#e7a4b6', '#cd7eaf', '#a262a9', '#6f4d96', '#3d3b72', '#182844'] +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/colorway/colorway_plotlyjs_index.html b/content/plotly_js/fundamentals/colorway/colorway_plotlyjs_index.html new file mode 100644 index 00000000000..f2fe2bceffb --- /dev/null +++ b/content/plotly_js/fundamentals/colorway/colorway_plotlyjs_index.html @@ -0,0 +1,14 @@ +--- +description: How to use colorway to set default trace colors in JavaScript with Plotly. +display_as: file_settings +language: plotly_js +layout: base +name: Colorway +order: 7 +page_type: u-guide +permalink: javascript/colorway/ +thumbnail: thumbnail/colorway.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","colorway" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/config-options/add-button-to-modebar.html b/content/plotly_js/fundamentals/config-options/add-button-to-modebar.html new file mode 100644 index 00000000000..9edc5c1e449 --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/add-button-to-modebar.html @@ -0,0 +1,48 @@ +--- +name: Add Buttons to ModeBar +language: plotly_js +suite: configuration +order: 5.7 +sitemap: false +arrangement: horizontal +markdown_content: | + The following example shows how to add a button to your modebar, either by using one of the [Plotly icons](https://github.com/plotly/plotly.js/blob/master/src/fonts/ploticon.js) or an [arbitrary icon](https://fontawesome.com/icons?d=gallery&m=free) with a custom behaviour. +--- +var icon1 = { + 'width': 500, + 'height': 600, + 'path': 'M224 512c35.32 0 63.97-28.65 63.97-64H160.03c0 35.35 28.65 64 63.97 64zm215.39-149.71c-19.32-20.76-55.47-51.99-55.47-154.29 0-77.7-54.48-139.9-127.94-155.16V32c0-17.67-14.32-32-31.98-32s-31.98 14.33-31.98 32v20.84C118.56 68.1 64.08 130.3 64.08 208c0 102.3-36.15 133.53-55.47 154.29-6 6.45-8.66 14.16-8.61 21.71.11 16.4 12.98 32 32.1 32h383.8c19.12 0 32-15.6 32.1-32 .05-7.55-2.61-15.27-8.61-21.71z' +} + +var colors = ['green', 'red', 'blue'] +var data = [{ + mode: 'lines', + y: [2, 1, 2], + line: {color: colors[0], width: 3, shape: 'spline'} +}] + +var layout = { + title: { + text: 'add mode bar button with custom icon' + } +} + +var config = { + displayModeBar: true, + modeBarButtonsToAdd: [ + { + name: 'color toggler', + icon: icon1, + click: function(gd) { + var newColor = colors[Math.floor(3 * Math.random())] + Plotly.restyle(gd, 'line.color', newColor) + }}, + { + name: 'button1', + icon: Plotly.Icons.pencil, + direction: 'up', + click: function(gd) {alert('button1') + }}], + modeBarButtonsToRemove: ['pan2d','select2d','lasso2d','resetScale2d','zoomOut2d']} + +Plotly.newPlot('myDiv', data, layout, config) \ No newline at end of file diff --git a/content/plotly_js/fundamentals/config-options/button-disable-axis.html b/content/plotly_js/fundamentals/config-options/button-disable-axis.html new file mode 100644 index 00000000000..185c2fae7ab --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/button-disable-axis.html @@ -0,0 +1,34 @@ +--- +name: Disabling Buttons for Specific Axes +language: plotly_js +suite: configuration +order: 5.8 +sitemap: false +arrangement: horizontal +markdown_content: | + *New in 3.1* + + Disabling the zoom in, zoom out, and autoscale buttons for specific axes is supported on cartesian axes using the `modebardisable` attribute. In the following example, the zoom in and zoom out buttons are disabled on the `xaxis`, meaning these buttons only zoom in and out on the `yaxis`. Disable the autoscale button using `modebardisable='autoscale'`. You can also disable both autoscaling and zoom buttons using `modebardisable='zoominout+autoscale'`. +--- +var data = [{ + type: "scatter", + mode: "lines+markers", + x: ["2023-01-01", "2023-02-01", "2023-03-01", "2023-04-01", "2023-05-01", "2023-06-01"], + y: [150, 160, 155, 170, 165, 180], + name: "Google Stock Price" +}]; + +var layout = { + title: "Google Stock Price Over Time with Mode Bar Disabled", + xaxis: { + title: "Date", + type: "date", + // Try zooming in or out using the modebar buttons. These only apply to the yaxis in this example. + modebardisable: "zoominout" + }, + yaxis: { + title: "Stock Price (USD)" + } +}; + +Plotly.newPlot("myDiv", data, layout); diff --git a/content/plotly_js/fundamentals/config-options/config-locale.html b/content/plotly_js/fundamentals/config-options/config-locale.html new file mode 100644 index 00000000000..d6eb1ace4dd --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-locale.html @@ -0,0 +1,40 @@ +--- +name: Change the Default Locale +language: plotly_js +suite: configuration +order: 7.5 +sitemap: false +arrangement: horizontal +markdown_content: | + Load and register a non-default locale by adding `` + to your HTML after the plotly.js tag and then reference the locale in the `config`. For Example, the codepen example below has + `` in its HTML. For more information and a list of available locales, see + [https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization](https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization) +--- +var trace1 = { + type: "scatter", + mode: "lines", + x: ['2018-01-01', '2018-08-31'], + y: [10, 5], + line: {color: '#17BECF'} +}; + +var trace2 = { + type: "scatter", + mode: "lines", + x: ['2018-01-01', '2018-08-31'], + y: [3,7], + line: {color: '#7F7F7F'} +}; + +var data = [trace1,trace2]; + +var layout = { + title: { + text: 'Custom Locale' + } +}; + +var config = {locale: 'fr'}; + +Plotly.newPlot('myDiv', data, layout, config); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/config-options/config-opt-displaylogo.html b/content/plotly_js/fundamentals/config-options/config-opt-displaylogo.html new file mode 100644 index 00000000000..c725877df12 --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-opt-displaylogo.html @@ -0,0 +1,25 @@ +--- +name: Hide the Plotly Logo on the Modebar +language: plotly_js +suite: configuration +order: 8 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x:['trees', 'flowers', 'hedges'], + y: [90, 130, 40], + type: 'bar' +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Hide the Plotly Logo on the Modebar' + }, + showlegend: false +}; + +Plotly.newPlot('myDiv', data, layout, {displaylogo: false}); diff --git a/content/plotly_js/fundamentals/config-options/config-opt-hide-modebar.html b/content/plotly_js/fundamentals/config-options/config-opt-hide-modebar.html new file mode 100644 index 00000000000..5fdc97667e2 --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-opt-hide-modebar.html @@ -0,0 +1,36 @@ +--- +name: Never Display The Modebar +language: plotly_js +suite: configuration +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + When users hover over a figure generated with `plotly.js`, a `modebar` appears in the top-right of the figure. This presents users with several options for interacting with the figure. + + By default, the `modebar` is only visible while the user is hovering over the chart. If you would like the `modebar` to never be visible, then set the `displayModeBar` attribute in the `config` of your figure to `false`. +--- +var trace1 = { + x:['Zebras', 'Lions', 'Pelicans'], + y: [90, 40, 60], + type: 'bar', + name: 'New York Zoo' +}; + +var trace2 = { + x:['Zebras', 'Lions', 'Pelicans'], + y: [10, 80, 45], + type: 'bar', + name: 'San Francisco Zoo' +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'Hide the Modebar' + }, + showlegend: true +}; + +Plotly.newPlot('myDiv', data, layout, {displayModeBar: false}); diff --git a/content/plotly_js/fundamentals/config-options/config-opt-link-text.html b/content/plotly_js/fundamentals/config-options/config-opt-link-text.html new file mode 100644 index 00000000000..e3f409e76c5 --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-opt-link-text.html @@ -0,0 +1,27 @@ +--- +name: Customize The `Edit Chart` Link Text +language: plotly_js +suite: configuration +order: 7 +sitemap: false +arrangement: horizontal +--- +var data = [{ + z: [[0, 1, 2, 3, 4, 5, 6], + [1, 9, 4, 7, 5, 2, 4], + [2, 4, 2, 1, 6, 9, 3]], + type: 'heatmap'}] + +var layout = { + title: { + text: 'Customize The Edit Chart Link Text' + } +}; + +var config = { + showLink: true, + plotlyServerURL: "https://chart-studio.plotly.com", + linkText: 'This text is custom!' +}; + +Plotly.newPlot('myDiv', data, layout, config) diff --git a/content/plotly_js/fundamentals/config-options/config-opt-responsive.html b/content/plotly_js/fundamentals/config-options/config-opt-responsive.html new file mode 100644 index 00000000000..a5df6f726ee --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-opt-responsive.html @@ -0,0 +1,30 @@ +--- +name: Making a Responsive Chart +language: plotly_js +suite: configuration +order: 10 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + type: 'bar', + x: [1, 2, 3, 4], + y: [5, 10, 2, 8], + marker: { + color: '#C8A2C8', + line: { + width: 2.5 + } + } +}; + +var data = [ trace1 ]; + +var layout = { + title: { + text: 'Responsive to window size!' + }, + font: {size: 18} +}; + +Plotly.newPlot('myDiv', data, layout, {responsive: true}); diff --git a/content/plotly_js/fundamentals/config-options/config-opt-scrollzoom.html b/content/plotly_js/fundamentals/config-options/config-opt-scrollzoom.html new file mode 100644 index 00000000000..6833d22484a --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-opt-scrollzoom.html @@ -0,0 +1,26 @@ +--- +name: Scroll and Zoom +language: plotly_js +suite: configuration +order: 1 +sitemap: false +arrangement: horizontal +--- +// mousewheel or two-finger scroll zooms the plot + +var trace1 = { + x:['2020-10-04', '2021-11-04', '2023-12-04'], + y: [90, 40, 60], + type: 'scatter' +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Scroll and Zoom' + }, + showlegend: false +}; + +Plotly.newPlot('myDiv', data, layout, {scrollZoom: true}); diff --git a/content/plotly_js/fundamentals/config-options/config-opt-showlink.html b/content/plotly_js/fundamentals/config-options/config-opt-showlink.html new file mode 100644 index 00000000000..b75ab5859c4 --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-opt-showlink.html @@ -0,0 +1,32 @@ +--- +name: Display the `Edit Chart` Link +language: plotly_js +suite: configuration +order: 6 +sitemap: false +arrangement: horizontal +markdown_content: | + Note: showLink now defaults to false. +--- + +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6], + y: [1, 9, 4, 7, 5, 2, 4], + mode: 'lines+markers', + type: 'scatter' +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Display the Edit Chart Link' + } +}; + +var config = { + showLink: true, + plotlyServerURL: "https://chart-studio.plotly.com" +}; + +Plotly.newPlot('myDiv', data, layout, config); diff --git a/content/plotly_js/fundamentals/config-options/config-opt-static-plot.html b/content/plotly_js/fundamentals/config-options/config-opt-static-plot.html new file mode 100644 index 00000000000..b47fe67fdab --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-opt-static-plot.html @@ -0,0 +1,27 @@ +--- +name: Making a Static Chart +language: plotly_js +suite: configuration +order: 3 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6], + y: [1, 9, 4, 7, 5, 2, 4], + mode: 'markers', + marker: { + size: [20, 40, 25, 10, 60, 90, 30], + } +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Create a Static Chart' + }, + showlegend: false +}; + +Plotly.newPlot('myDiv', data, layout, {staticPlot: true}); diff --git a/content/plotly_js/fundamentals/config-options/config-opt-toImageButtonOptions.html b/content/plotly_js/fundamentals/config-options/config-opt-toImageButtonOptions.html new file mode 100644 index 00000000000..688279133e9 --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-opt-toImageButtonOptions.html @@ -0,0 +1,37 @@ +--- +name: Customize Download Plot Options +language: plotly_js +suite: configuration +order: 3.1 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6], + y: [1, 9, 4, 7, 5, 2, 4], + mode: 'markers', + marker: { + size: [20, 40, 25, 10, 60, 90, 30], + } +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Download Chart as SVG instead of PNG' + }, + showlegend: false +}; + +var config = { + toImageButtonOptions: { + format: 'svg', // one of png, svg, jpeg, webp + filename: 'custom_image', + height: 500, + width: 700, + scale: 1 // Multiply title/legend/axis/canvas sizes by this factor + } +}; + +Plotly.newPlot('myDiv', data, layout, config); diff --git a/content/plotly_js/fundamentals/config-options/config-showSendToCloud.html b/content/plotly_js/fundamentals/config-options/config-showSendToCloud.html new file mode 100644 index 00000000000..0a906c6263d --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config-showSendToCloud.html @@ -0,0 +1,26 @@ +--- +name: Display Edit in Chart Studio Modebar Button +language: plotly_js +suite: configuration +order: 7.1 +sitemap: false +arrangement: horizontal +--- +var data = [{ + values: [19, 26, 55], + labels: ['Residential', 'Non-Residential', 'Utility'], + type: 'pie' +}]; + +var layout = { + title: { + text: 'Show Edit in Chart Studio Modebar Button' + } +}; + +var config = { + showEditInChartStudio: true, + plotlyServerURL: "https://chart-studio.plotly.com" +}; + +Plotly.newPlot('myDiv', data, layout, config); diff --git a/content/plotly_js/fundamentals/config-options/config_options_index.html b/content/plotly_js/fundamentals/config-options/config_options_index.html new file mode 100644 index 00000000000..ecd0697852c --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/config_options_index.html @@ -0,0 +1,26 @@ +--- +description: How to set the configuration options for figures in JavaScript. +display_as: file_settings +language: plotly_js +layout: base +name: Configuration Options +order: 1 +page_type: example_index +permalink: javascript/configuration-options/ +thumbnail: thumbnail/modebar-icons.png +--- + + + +The plotly.js config argument sets properties like the mode bar buttons and the interactivity in the chart. +It's the last argument in Plotly.newPlot calls. +
+ +View the full list of configuration options in the + +plotly.js source code on GitHub +. +
+ +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","configuration" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/config-options/display-modebar.html b/content/plotly_js/fundamentals/config-options/display-modebar.html new file mode 100644 index 00000000000..b4371353635 --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/display-modebar.html @@ -0,0 +1,26 @@ +--- +name: Force The Modebar to Always Be Visible +language: plotly_js +suite: configuration +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + When users hover over a figure generated with `plotly.js`, a `modebar` appears in the top-right of the figure. This presents users with several options for interacting with the figure. + + By default, the `modebar` is only visible while the user is hovering over the chart. If you would like the `modebar` to always be visible regardless of whether or not the user is currently hovering over the figure, set the `displayModeBar` attribute in the `config` of your figure to `true`. +--- +var data = [{ + y:['Marc', 'Henrietta', 'Jean', 'Claude', 'Jeffrey', 'Jonathan', 'Jennifer', 'Zacharias'], + x: [90, 40, 60, 80, 75, 92, 87, 73], + type: 'bar', + orientation: 'h'}] + +var layout = { + title: { + text: 'Always Display the Modebar' + }, + showlegend: false +} + +Plotly.newPlot('myDiv', data, layout, {displayModeBar: true}) diff --git a/content/plotly_js/fundamentals/config-options/double-click-delay.html b/content/plotly_js/fundamentals/config-options/double-click-delay.html new file mode 100644 index 00000000000..29c457dae4c --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/double-click-delay.html @@ -0,0 +1,22 @@ +--- +name: Double Click Delay +language: plotly_js +suite: configuration +order: 11 +sitemap: false +arrangement: horizontal +markdown_content: | + Sets the maximum delay between two consecutive clicks to be interpreted as a double-click in ms. This is the time interval between first mousedown, and' second mouseup. The default timing is 300 ms (less than half a second). + This setting propagates to all on-subplot double clicks, (except for geo, map, and mapbox). +--- +var data = [{ + type: "bar", + y: [3, 5, 3, 2], + x: ["2019-09-02", "2019-10-10", "2019-11-12", "2019-12-22"] +}]; + +var layout = {xaxis: {type: 'date'}}; + +var config = {doubleClickDelay: 1000} + +Plotly.newPlot("myDiv", data, layout, config) diff --git a/content/plotly_js/fundamentals/config-options/edit_mode.html b/content/plotly_js/fundamentals/config-options/edit_mode.html new file mode 100644 index 00000000000..c8d26d366ae --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/edit_mode.html @@ -0,0 +1,32 @@ +--- +name: Editable Mode +language: plotly_js +suite: configuration +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + In editable mode, users can edit the chart title, axis labels and trace names in the legend. +--- +var trace1 = { + x: [0, 1, 2, 3, 4], + y: [1, 5, 3, 7, 5], + mode: 'lines+markers', + type: 'scatter' +}; + +var trace2 = { + x: [1, 2, 3, 4, 5], + y: [4, 0, 4, 6, 8], + mode: 'lines+markers', + type: 'scatter' +}; + +var data = [trace1, trace2]; +var layout = { + title: { + text: 'Click Here
to Edit Chart Title' + } +}; + +Plotly.newPlot('myDiv', data, layout, {editable: true}); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/config-options/remove-modebarButtons.html b/content/plotly_js/fundamentals/config-options/remove-modebarButtons.html new file mode 100644 index 00000000000..75190eedb0f --- /dev/null +++ b/content/plotly_js/fundamentals/config-options/remove-modebarButtons.html @@ -0,0 +1,30 @@ +--- +name: Remove ModeBar Buttons +language: plotly_js +suite: configuration +order: 5.5 +sitemap: false +arrangement: horizontal +markdown_content: | + To delete buttons from the modebar, pass an array of strings containing the names of the buttons you want to remove to the `modeBarButtonsToRemove` attribute in the figure's configuration object. Note that different chart types have different default modebars. The following is a list of all the modebar buttons and the chart types they are associated with: + +--- +var data = [{ + x:['trees', 'flowers', 'hedges'], + y: [90, 130, 40], + type: 'bar'}] + +var layout = { + title: { + text: 'Remove Modebar Buttons' + }, + showlegend: false +} + +Plotly.newPlot('myDiv', data, layout, {modeBarButtonsToRemove: ['toImage']}) \ No newline at end of file diff --git a/content/plotly_js/fundamentals/eula/eula.html b/content/plotly_js/fundamentals/eula/eula.html new file mode 100644 index 00000000000..ba7def0d395 --- /dev/null +++ b/content/plotly_js/fundamentals/eula/eula.html @@ -0,0 +1,45 @@ +--- +name: Plotly.js +permalink: javascript/eula/ +description: End User License Agreement for Plotly.js and other Plotly products +layout: langindex +language: plotly_js +sitemap: false +redirect_from: javascript-graphing-library/eula/ +--- +

Plotly EULA

+
+ +

+ Please read the full Plotly.js End User License Agreement before using, downloading, or purchasing the software. +

+ +
Free use of  "Basic Charts"
+
    +
  • The Plotly.js Basic Charts module is free for unlimited use if all links and references to Plotly remain visible and unmodified.
  • +
  • All Restricted and Permitted Uses below and the full EULA apply.
  • +
+ +
Permitted Uses
+
    +
  • Plotly.js can be used with an unlimited number of SaaS projects, web applications, intranets, and websites.
  • +
  • Each person who directly or indirectly creates an application or user interface containing Plotly.js is considered a developer.
  • +
  • Source editing is allowed
  • +
+ +
Restricted Uses
+
    +
  • Plotly.js distribution with your desktop software or hardware requires an OEM license. Please contact sales@plot.ly
  • +
  • Plotly.js use with IPython notebook, RStudio, MATLAB, or another desktop analytics IDE requires a Plotly Desktop license.
  • +
  • Plotly.js integration with Spotfire, Cognos, Qlikview, or Tableau products requires an additional support plan and license for viewers. Please contact sales@plot.ly
  • +
+
+ +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","Plotly.js" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} + + diff --git a/content/plotly_js/fundamentals/font/font_plotly_js_index.html b/content/plotly_js/fundamentals/font/font_plotly_js_index.html new file mode 100644 index 00000000000..f617762096a --- /dev/null +++ b/content/plotly_js/fundamentals/font/font_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to edit and style the font of D3.js-based graphs in javascript. +display_as: file_settings +layout: base +name: Text and Font Styling +order: 8 +page_type: u-guide +permalink: javascript/font/ +redirect_from: javascript-graphing-library/font/ +thumbnail: thumbnail/hover-text.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","font" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/font/global-font.html b/content/plotly_js/fundamentals/font/global-font.html new file mode 100644 index 00000000000..57233991e50 --- /dev/null +++ b/content/plotly_js/fundamentals/font/global-font.html @@ -0,0 +1,26 @@ +--- +name: Global Font Properties +language: plotly_js +suite: font +order: 0 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + type: 'scatter' + } +]; +var layout = { + title: { + text: 'Global Font' + }, + font: { + family: 'Courier New, monospace', + size: 18, + color: '#7f7f7f' + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/horizontal-legend/horizontal_legend.html b/content/plotly_js/fundamentals/horizontal-legend/horizontal_legend.html new file mode 100644 index 00000000000..fa5a3deeeb2 --- /dev/null +++ b/content/plotly_js/fundamentals/horizontal-legend/horizontal_legend.html @@ -0,0 +1,34 @@ +--- +name: Basic Example +arrangement: horizontal +language: plotly_js +suite: horizontal_legend +order: 1 +sitemap: false +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 3, 6, 4, 5, 2, 3, 5, 4], + type: 'scatter', + name:'Plot 1' + }; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 4, 7, 8, 3, 6, 3, 3, 4], + type: 'scatter', + name:'Plot 2' + }; +var trace3 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 5, 3, 10, 5.33, 2.24, 4.4, 5.1, 7.2], + type: 'scatter', + name:'Plot 3' + }; + +var data = [trace1, trace2, trace3]; +var layout = { + showlegend: true, + legend: {"orientation": "h"} + }; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/horizontal-legend/horizontal_legend_js_index.html b/content/plotly_js/fundamentals/horizontal-legend/horizontal_legend_js_index.html new file mode 100644 index 00000000000..3cfb8760c76 --- /dev/null +++ b/content/plotly_js/fundamentals/horizontal-legend/horizontal_legend_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make a D3.js-based horizontal legend plot in JavaScript. +display_as: file_settings +language: plotly_js +layout: base +name: Horizontal Legends +order: 16 +page_type: u-guide +permalink: javascript/horizontal-legend/ +redirect_from: javascript-graphing-library/horizontal-legends/ +thumbnail: thumbnail/images.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","horizontal_legend" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/hover/hover-chart-basic.html b/content/plotly_js/fundamentals/hover/hover-chart-basic.html new file mode 100644 index 00000000000..a54adfc7fc1 --- /dev/null +++ b/content/plotly_js/fundamentals/hover/hover-chart-basic.html @@ -0,0 +1,24 @@ +--- +name: Adding Hover Text to Data in Line and Scatter Plots +language: plotly_js +suite: hover +order: 1 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [0, .5, 1, 1.5, 2], + y: [1, 3, 2, 4, 2], + mode: 'markers', + marker: {size:16}, + text: ['Text A', 'Text B', 'Text C', 'Text D', 'Text E'], + type: 'scatter' + } +]; +var layout = { + title: { + text: 'Hover over the points to see the text' + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/hover/hover_plotly_js_index.html b/content/plotly_js/fundamentals/hover/hover_plotly_js_index.html new file mode 100644 index 00000000000..6cf94337c4d --- /dev/null +++ b/content/plotly_js/fundamentals/hover/hover_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to add hover text and format hover values in D3.js-based javascript + charts. +display_as: file_settings +language: plotly_js +layout: base +name: Hover Text and Formatting +order: 17 +page_type: u-guide +permalink: javascript/hover-text-and-formatting/ +redirect_from: javascript-graphing-library/hover-text-and-formatting/ +thumbnail: thumbnail/hover-text.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","hover" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/hover/rounding-hover-values.html b/content/plotly_js/fundamentals/hover/rounding-hover-values.html new file mode 100644 index 00000000000..a7509525598 --- /dev/null +++ b/content/plotly_js/fundamentals/hover/rounding-hover-values.html @@ -0,0 +1,44 @@ +--- +name: Rounding X and Y Hover Values +language: plotly_js +suite: hover +order: 2 +sitemap: false +arrangement: horizontal +--- +// Round x and y hover values by setting hoverformat in layout.xaxis and/or layout.yaxis +// using D3 number formatting ( https://github.com/mbostock/d3/wiki/Formatting ) + +var N = 40, + x = d3.range(N).map( d3.random.normal() ), + y1 = d3.range(N).map( d3.random.normal() ), + y2 = d3.range(N).map( d3.random.normal() ), + data = [{ x:x, y:y1, type:'scatter', mode:'markers', + marker:{color:'rgba(200, 50, 100, .7)', size:16}, + hoverinfo:"x+y" + }, + { x:x, y:y2, type:'scatter', mode:'markers', + marker:{color:'rgba(10, 180, 180, .8)', size:16}, + hoverinfo:"x+y"}]; + layout = { + hovermode: 'closest', + title: { + text: 'Formatting X & Y Hover Values' + }, + xaxis: { + zeroline: false, + hoverformat: '.2f', + title: { + text: 'Rounded: 2 values after the decimal point on hover' + } + }, + yaxis: { + zeroline: false, + hoverformat: '.2r', + title: { + text: 'Rounded: 2 significant values on hover' + } + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/hover/unified-hover-template.html b/content/plotly_js/fundamentals/hover/unified-hover-template.html new file mode 100644 index 00000000000..5b032f5e1e8 --- /dev/null +++ b/content/plotly_js/fundamentals/hover/unified-hover-template.html @@ -0,0 +1,47 @@ +--- +name: Custom Unified Hover Title +language: plotly_js +suite: hover +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + *New in 3.1* + + Customize the title shown in unified hovermode by specifying `unifiedhovertitle.text`. The unified hover title is a template string that supports using variables from the data. Numbers are formatted using d3-format's syntax `%{variable:d3-format}`, for example `"Price: %{y:$.2f}"`. Dates are formatted using d3-time-format's syntax `%{variable|d3-time-format}`, for example `"Day: %{x|%A}"`. +--- +var data = [ + { + x: ['2020-01-01', '2020-02-01', '2020-03-01', '2020-04-01'], + y: [150.25, 165.50, 142.75, 178.90], + mode: 'lines+markers', + name: 'Stock A', + type: 'scatter' + }, + { + x: ['2020-01-01', '2020-02-01', '2020-03-01', '2020-04-01'], + y: [85.30, 92.15, 88.45, 95.20], + mode: 'lines+markers', + name: 'Stock B', + type: 'scatter' + } +]; + +var layout = { + title: { + text: "Stock Prices with Custom Unified Hover Title" + }, + hovermode: 'x unified', + xaxis: { + title: 'Date', + unifiedhovertitle: { + text: '%{x|%A, %B %d, %Y}' + } + }, + yaxis: { + title: 'Price (USD)', + tickprefix: '$' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/hover/unified-hover.html b/content/plotly_js/fundamentals/hover/unified-hover.html new file mode 100644 index 00000000000..15d90721268 --- /dev/null +++ b/content/plotly_js/fundamentals/hover/unified-hover.html @@ -0,0 +1,43 @@ +--- +name: Unified Hover Mode +language: plotly_js +suite: hover +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + If "x unified" (or "y unified"), a single hoverlabel will appear for multiple points at the closest x- (or y-) coordinate within the `hoverdistance` with the caveat that no more than one hoverlabel will appear per trace. +--- +var data = [ + { + x: ['2020-01-01', '2020-02-01', '2020-03-01', '2020-04-01'], + y: [10, 15, 12, 18], + mode: 'markers+lines', + name: 'Series A', + hovertemplate: null, + type: 'scatter' + }, + { + x: ['2020-01-01', '2020-02-01', '2020-03-01', '2020-04-01'], + y: [8, 12, 16, 14], + mode: 'markers+lines', + name: 'Series B', + hovertemplate: null, + type: 'scatter' + } +]; + +var layout = { + title: { + text: "layout.hovermode='x unified'" + }, + hovermode: 'x unified', + xaxis: { + title: 'Date' + }, + yaxis: { + title: 'Value' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/images/images_plotly_js_index.html b/content/plotly_js/fundamentals/images/images_plotly_js_index.html new file mode 100644 index 00000000000..b4338646f5b --- /dev/null +++ b/content/plotly_js/fundamentals/images/images_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to add images to charts as background images or logos. +display_as: file_settings +language: plotly_js +layout: base +name: Images +order: 9 +page_type: u-guide +permalink: javascript/images/ +redirect_from: javascript-graphing-library/images/ +thumbnail: thumbnail/images.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","images" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/images/logo.html b/content/plotly_js/fundamentals/images/logo.html new file mode 100644 index 00000000000..5bf0d8737ca --- /dev/null +++ b/content/plotly_js/fundamentals/images/logo.html @@ -0,0 +1,88 @@ +--- +name: Add a Logo +language: plotly_js +suite: images +order: 1 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + x: ["-35.3", "-15.9", "-15.8", "-15.6", "-11.1", "-9.6", "-9.2", "-3.5", "-1.9", "-0.9", "1.0", "1.4", "1.7", "2.0", "2.8", "6.2", "8.1", "8.5", "8.5", "8.6", "11.4", "12.5", "13.3", "13.7", "14.4", "17.5", "17.7", "18.9", "25.1", "28.9", "41.4"], + y: ["Designers, musicians, artists, etc.", "Secretaries and administrative assistants", "Waiters and servers", "Archivists, curators, and librarians", "Sales and related", "Childcare workers, home car workers, etc.", "Food preparation occupations", "Janitors, maids, etc.", "Healthcare technicians, assistants. and aides", "Counselors, social and religious workers", "Physical, life and social scientists", "Construction", "Factory assembly workers", "Machinists, repairmen, etc.", "Media and communications workers", "Teachers", "Mechanics, repairmen, etc.", "Financial analysts and advisers", "Farming, fishing and forestry workers", "Truck drivers, heavy equipment operator, etc.", "Accountants and auditors", "Human resources, management analysts, etc.", "Managers", "Lawyers and judges", "Engineers, architects and surveyors", "Nurses", "Legal support workers", "Computer programmers and system admin.", "Police officers and firefighters", "Chief executives", "Doctors, dentists and surgeons"], + marker: { + color: "rgb(253, 240, 54)", + line: { + color: "rgb(0, 0, 0)", + width: 2 + } + }, + name: "y", + orientation: "h", + type: "bar", + } +]; +var layout = { + autosize: false, + bargap: 0.15, + bargroupgap: 0.1, + barmode: "stack", + height: 800, + hovermode: "x", + images: [ + { + x: 1, + y: 1.05, + sizex: 0.2, + sizey: 0.2, + source: "https://raw.githubusercontent.com/cldougl/plot_images/add_r_img/vox.png", + xanchor: "right", + xref: "paper", + yanchor: "bottom", + yref: "paper" + } + ], + margin: { + r: 20, + t: 125, + b: 75, + l: 300 + }, + title: { + text: "Moving Up, Moving Down
Percentile change in income between childhood and adulthood" + }, + width: 700, + xaxis: { + tickmode: "linear", + dtick: 10, + gridcolor: "rgba(102, 102, 102, 0.4)", + linecolor: "#000", + linewidth: 1, + mirror: true, + nticks: 0, + showticklabels: true, + tick0: 0, + tickwidth: 1, + title: { + text: "Change in percentile" + }, + }, + yaxis: { + anchor: "x", + tickmode: "linear", + gridcolor: "rgba(102, 102, 102, 0.4)", + gridwidth: 1, + linecolor: "#000", + linewidth: 1, + mirror: true, + showgrid: false, + showline: true, + showticklabels: true, + tick0: 0, + type: "category", + zeroline: false + } +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/images/multiple_images_example.html b/content/plotly_js/fundamentals/images/multiple_images_example.html new file mode 100644 index 00000000000..1b4ccfee5ad --- /dev/null +++ b/content/plotly_js/fundamentals/images/multiple_images_example.html @@ -0,0 +1,62 @@ +--- +name: Add Multiple Images +language: plotly_js +suite: images +order: 2 +sitemap: false +arrangement: horizontal +--- + +Plotly.newPlot('myDiv', [{ + x: [1, 2, 3], + y: [1, 2, 3] +}], { + images: [ + { + "source": "https://images.plot.ly/language-icons/api-home/python-logo.png", + "xref": "paper", + "yref": "paper", + "x": 0, + "y": 1, + "sizex": 0.2, + "sizey": 0.2, + "xanchor": "right", + "yanchor": "bottom" + }, + { + "source": "https://images.plot.ly/language-icons/api-home/js-logo.png", + "xref": "x", + "yref": "y", + "x": 1.5, + "y": 2, + "sizex": 1, + "sizey": 1, + "xanchor": "right", + "yanchor": "bottom" + }, + { + "source": "https://images.plot.ly/language-icons/api-home/r-logo.png", + "xref": "x", + "yref": "y", + "x": 1, + "y": 3, + "sizex": 2, + "sizey": 2, + "sizing": "stretch", + "opacity": 0.4, + "layer": "below" + }, + { + "source": "https://images.plot.ly/language-icons/api-home/matlab-logo.png", + "xref": "x", + "yref": "paper", + "x": 3, + "y": 0, + "sizex": 0.5, + "sizey": 1, + "opacity": 1, + "xanchor": "right", + "yanchor": "middle" + }, + ] +}) \ No newline at end of file diff --git a/content/plotly_js/fundamentals/labels/automargin.html b/content/plotly_js/fundamentals/labels/automargin.html new file mode 100644 index 00000000000..5bb80188010 --- /dev/null +++ b/content/plotly_js/fundamentals/labels/automargin.html @@ -0,0 +1,63 @@ +--- +name: Setting Title Automargin +language: plotly_js +suite: labels +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + Set `automargin` to `true` to allow the title to push the figure margins. + With `yref` set to `paper`, `automargin` expands the margins to make the title visible, + but doesn't push outside the container. With `yref` set to `container`, `automargin` + expands the margins, but doesn't overlap with the plot area, tick labels, and axis titles. +--- + +var trace1 = { + x: [1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007], + y: [69.39, + 70.26, + 71.24, + 71.52, + 71.89, + 72.22, + 73.84, + 74.32, + 76.33, + 77.55, + 79.11, + 80.204 + ], + type: 'scatter' +}; +var trace2 = { + x: [1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007], + y: [69.12, + 70.33, + 70.93, + 71.1, + 71.93, + 73.49, + 74.74, + 76.32, + 77.56, + 78.83, + 80.37, + 81.235 + ], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + title: { + text: 'Population', + font: { + family: 'Courier New, monospace', + size: 70 + }, + yref: 'paper', + automargin: true, + }, + showlegend: false +}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/labels/labels_plotly_js_index.html b/content/plotly_js/fundamentals/labels/labels_plotly_js_index.html new file mode 100644 index 00000000000..3d15b1610db --- /dev/null +++ b/content/plotly_js/fundamentals/labels/labels_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to set the title, legend-entries, and axis-titles in javascript D3.js-based + charts. +display_as: file_settings +language: plotly_js +layout: base +name: Setting the Title, Legend Entries, and Axis Titles +order: 18 +page_type: u-guide +permalink: javascript/figure-labels/ +redirect_from: javascript-graphing-library/figure-labels/ +thumbnail: thumbnail/figure-labels.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","labels" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/labels/styling-names.html b/content/plotly_js/fundamentals/labels/styling-names.html new file mode 100644 index 00000000000..0085f3c7f52 --- /dev/null +++ b/content/plotly_js/fundamentals/labels/styling-names.html @@ -0,0 +1,54 @@ +--- +name: Styling Names +language: plotly_js +suite: labels +order: 0 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + name: 'Name of Trace 1', + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [1, 0, 3, 2, 5, 4, 7, 6, 8], + name: 'Name of Trace 2', + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + title: { + text:'Plot Title', + font: { + family: 'Courier New, monospace', + size: 24 + }, + xref: 'paper', + x: 0.05, + }, + xaxis: { + title: { + text: 'x Axis', + font: { + family: 'Courier New, monospace', + size: 18, + color: '#7f7f7f' + } + }, + }, + yaxis: { + title: { + text: 'y Axis', + font: { + family: 'Courier New, monospace', + size: 18, + color: '#7f7f7f' + } + } + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/latex/latex.html b/content/plotly_js/fundamentals/latex/latex.html new file mode 100644 index 00000000000..569c1754e4c --- /dev/null +++ b/content/plotly_js/fundamentals/latex/latex.html @@ -0,0 +1,35 @@ +--- +name: LaTeX Typesetting +arrangement: horizontal +language: plotly_js +suite: latex +order: 0 +sitemap: false +--- +// remember to load MathJax.js?config=TeX-MML-AM_CHTML +var trace1 = { + x: [1, 2, 3, 4], + y: [1, 4, 9, 16], + name: '$\\alpha_{1c} = 352 \\pm 11 \\text{ km s}^{-1}$', + type: 'scatter' +}; +var trace2 = { + x: [1, 2, 3, 4], + y: [0.5, 2, 4.5, 8], + name: '$\\beta_{1c} = 25 \\pm 11 \\text{ km s}^{-1}$', + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + xaxis: { + title: { + text: '$\\sqrt{(n_\\text{c}(t|{T_\\text{early}}))}$' + } + }, + yaxis: { + title: { + text: '$d, r \\text{ (solar radius)}$' + } + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/latex/latex_plotly_js_index.html b/content/plotly_js/fundamentals/latex/latex_plotly_js_index.html new file mode 100644 index 00000000000..d4f33c035ef --- /dev/null +++ b/content/plotly_js/fundamentals/latex/latex_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to add LaTeX to javascript D3.js-based graphs. +display_as: file_settings +language: plotly_js +layout: base +name: LaTeX +order: 10 +page_type: u-guide +permalink: javascript/LaTeX/ +redirect_from: javascript-graphing-library/LaTeX/ +thumbnail: thumbnail/venn.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","latex" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/layout-template/adding-named-items.html b/content/plotly_js/fundamentals/layout-template/adding-named-items.html new file mode 100644 index 00000000000..cfb1e952b0d --- /dev/null +++ b/content/plotly_js/fundamentals/layout-template/adding-named-items.html @@ -0,0 +1,66 @@ +--- +name: Add Named Container Array Items +language: plotly_js +suite: layout_template +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + Container array items in a template with a `name` attribute will be added to any plot using that template. + We can use this feature to create a template that adds watermarks to our chart by including named image items in `images`. + The example below also shows how to make one of these images invisible using the `templateitemname` attribute + if you don't want it to display for this specific chart. +--- +var baseLayout = { + title: { + text: 'Watermark Template' + }, + // items with a `name` attribute in template.images will be added to any + // plot using this template + images: [{ + name: 'watermark_1', + source: "https://raw.githubusercontent.com/michaelbabyn/plot_data/master/benzene.png", + xref: "paper", + yref: "paper", + x: 0.40, + y: 0.9, + sizex: 0.7, + sizey: 0.7, + opacity: 0.1, + layer: "below" + }, + { + name: 'watermark_2', + source: "https://raw.githubusercontent.com/michaelbabyn/plot_data/master/naphthalene.png", + xref: "paper", + yref: "paper", + x: .75, + y: 0.3, + sizex: 0.25, + sizey: 0.25, + sizing: "stretch", + opacity: 0.2, + layer: "below" + }], + showlegend: false +}; + +var template = {data: {}, layout: baseLayout}; + +var data = [{ + x: [0, 1, 2, 3, 4, 5], + y: [2, 4, 3, 0, 5, 6], +}]; + +var layoutUsingTemplate = { + template: template, + images: [ + { + // set the second watermark in the template to be invisible + templateitemname: 'watermark_2', + visible: false + } + ] +}; + +Plotly.newPlot("myDiv", data, layoutUsingTemplate); diff --git a/content/plotly_js/fundamentals/layout-template/default-container.html b/content/plotly_js/fundamentals/layout-template/default-container.html new file mode 100644 index 00000000000..4d031fc884d --- /dev/null +++ b/content/plotly_js/fundamentals/layout-template/default-container.html @@ -0,0 +1,65 @@ +--- +name: Creating Default Item Values +language: plotly_js +suite: layout_template +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + Add an attribute called `annotationdefaults` to your template to set a default annotation object. Each + item in the plot using the template without a `templateitemname` attribute will have the default applied + to it. `annotationdefaults` can be manually added to a template or, if makeTemplate is used, the first un-named + item in annotations will be used as the default. + + Note, this behaviour works for all container array objects. E.g for `images`, you would create `imagedefaults` in + your layout containing the default image item. +--- +var x = [0, 1, 2, 3, 4, 5]; +var y = [2, 4, 3, 0, 5, 6]; + +var baseData = [{ + mode: 'lines', + error_y: {visible: true, width: 0}, + line: {color: 'teal'} +}]; + +var baseLayout = { + + // Plotly.makeTemplate will use the first annotation without a `name` attribute + // in the annotations array as the annotationdefaults for the template. + annotations: [ + { + text: 'DEFAULT ANNOTATION', + x: 0.1, + y: 1.1, + yref: 'paper', xref: 'paper', + showarrow: false, + font: {color:'teal', size: 14} + } + ], + showlegend: false +}; + +// use Plotly.makeTemplate to generate the template object +var template = Plotly.makeTemplate({data: baseData, layout: baseLayout}); + +var data = [{ + x: x, + y: y +}]; + +var annotations = [ + {}, // An empty annotation object will copy annotationdefaults + { + text: 'Third point', + x: x[2], + y: y[2], + showarrow: true, + yref: 'y', xref: 'x', + font: {size: 20} // since there is no font.color attribute for this object, + // it will use the annotationdefaults' color + } +]; +var layoutWithTemplate = {template: template, annotations: annotations}; + +Plotly.newPlot("myDiv", data, layoutWithTemplate); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/layout-template/labels_plotly_js_index.html b/content/plotly_js/fundamentals/layout-template/labels_plotly_js_index.html new file mode 100644 index 00000000000..21ec61837d7 --- /dev/null +++ b/content/plotly_js/fundamentals/layout-template/labels_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: Plotly's template attribute and how to use it with Container arrays. +display_as: file_settings +language: plotly_js +layout: base +name: Layout Template Examples +order: 19 +page_type: u-guide +permalink: javascript/layout-template/ +thumbnail: thumbnail/plotly-express.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","layout_template" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/layout-template/matching-named-items.html b/content/plotly_js/fundamentals/layout-template/matching-named-items.html new file mode 100644 index 00000000000..af04a1b0c8c --- /dev/null +++ b/content/plotly_js/fundamentals/layout-template/matching-named-items.html @@ -0,0 +1,66 @@ +--- +name: Matching Named Template Container Items +language: plotly_js +suite: layout_template +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + A container item in your new plot with the attribute `templateitemname` matching one of the named + container items in the template will inherit attributes from item with the corresponding name. + If an item in the plot using the template has the `templateitemname` attribute but there is no + corresponding template container item by the same name, it will be marked as invisible in your new plot. +--- +var x = [0, 1, 2, 3, 4, 5]; +var y = [2, 4, 3, 0, 5, 6]; + +var baseData = [{ + mode: 'lines', + error_y: {visible: true, width: 0}, + line: {color: 'teal'} +}]; + +var baseLayout = { + title: { + text: 'Template Title' + }, + annotations: [{ + text: 'First point', + name:'first', + yref: 'y', xref: 'x', + ay: 40, ax: 30, + font: {size: 16} + }], + showlegend: false +}; + +// use Plotly.makeTemplate to generate the template object +var template = Plotly.makeTemplate({data: baseData, layout: baseLayout}); + +var data = [{ + x: x, + y: y, +}]; + +var annotations = [ + + // plotly will look for an annotation with `name` matching `templateitemname` + // and use insert that annotation into the new plot. + { + templateitemname:'first', + x: x[0], + y: y[0], + }, + { + templateitemname: 'fourth', //since there is no template item with this name, + //this annotation will be set to invisible. + text: 'Fourth point', + x: x[3], + y: y[3], + showarrow: true, + yref: 'y', xref: 'x', + } + ]; +var layoutWithTemplate = {template: template, annotations: annotations}; + +Plotly.newPlot("myDiv", data, layoutWithTemplate); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/layout-template/template-attribute.html b/content/plotly_js/fundamentals/layout-template/template-attribute.html new file mode 100644 index 00000000000..df5d51321eb --- /dev/null +++ b/content/plotly_js/fundamentals/layout-template/template-attribute.html @@ -0,0 +1,16 @@ +--- +name: The Layout Template Attribute +language: plotly_js +suite: layout_template +order: 0 +sitemap: false +arrangement: horizontal +markdown_content: | + The `template` attribute of `layout` allows a Plotly chart to take it's style and formatting from a `template` + object. `template`s can be generated using [Plotly.makeTemplate](https://plotly.com/javascript/plotlyjs-function-reference/#plotlymaketemplate) + or manually. `annotaions`, `updatemenus`, `images`, `shapes` and other container array objects in the Plotly `layout` + are specially handled by the template machinery to provide more flexibility when using these container arrays + in plots derived from these templates. + + For more information see [https://plotly.com/javascript/reference/layout/#layout-template](https://plotly.com/javascript/reference/layout/#layout-template). +--- diff --git a/content/plotly_js/fundamentals/legends/grouped-legend.html b/content/plotly_js/fundamentals/legends/grouped-legend.html new file mode 100644 index 00000000000..2ba1e3562c3 --- /dev/null +++ b/content/plotly_js/fundamentals/legends/grouped-legend.html @@ -0,0 +1,52 @@ +--- +name: Grouped Legend +language: plotly_js +suite: legends +order: 10 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3], + y: [2, 1, 3], + legendgroup: 'group', + marker: {color: 'rgb(164, 194, 244)'}, + mode: 'markers', + name: 'first legend group', + type: 'scatter' +}; + +var trace2 = { + x: [1, 2, 3], + y: [2, 2, 2], + legendgroup: 'group', + line: {color: 'rgb(164, 194, 244)'}, + mode: 'lines', + name: 'first legend group - average', + type: 'scatter' +}; + +var trace3 = { + x: [1, 2, 3], + y: [4, 9, 2], + legendgroup: 'group2', + marker: {color: 'rgb(142, 124, 195)'}, + mode: 'markers', + name: 'second legend group', + type: 'scatter' +}; + +var trace4 = { + x: [1, 2, 3], + y: [5, 5, 5], + legendgroup: 'group2', + line: {color: 'rgb(142, 124, 195)'}, + mode: 'lines', + name: 'second legend group - average', + type: 'scatter' +}; + +data = [trace1, trace2, trace3, trace4]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/fundamentals/legends/legend-inside.html b/content/plotly_js/fundamentals/legends/legend-inside.html new file mode 100644 index 00000000000..962e4559627 --- /dev/null +++ b/content/plotly_js/fundamentals/legends/legend-inside.html @@ -0,0 +1,28 @@ +--- +name: Positioning the Legend Inside the Plot +language: plotly_js +suite: legends +order: 5 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 3, 6, 4, 5, 2, 3, 5, 4], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 4, 7, 8, 3, 6, 3, 3, 4], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + showlegend: true, + legend: { + x: 1, + xanchor: 'right', + y: 1 + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/legends/legend-labels.html b/content/plotly_js/fundamentals/legends/legend-labels.html new file mode 100644 index 00000000000..1fa4bbfa522 --- /dev/null +++ b/content/plotly_js/fundamentals/legends/legend-labels.html @@ -0,0 +1,22 @@ +--- +name: Legend Names +language: plotly_js +suite: legends +order: 4 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 3, 6, 4, 5, 2, 3, 5, 4], + name: 'Blue Trace', + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 4, 7, 8, 3, 6, 3, 3, 4], + name: 'Orange Trace', + type: 'scatter' +}; +var data = [trace1, trace2]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/fundamentals/legends/legend-orientation.html b/content/plotly_js/fundamentals/legends/legend-orientation.html new file mode 100644 index 00000000000..cf2889c896b --- /dev/null +++ b/content/plotly_js/fundamentals/legends/legend-orientation.html @@ -0,0 +1,23 @@ +--- +name: Changing the orientation of Legend +language: plotly_js +suite: legends +order: 8 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 3, 6, 4, 5, 2, 3, 5, 4], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 4, 7, 8, 3, 6, 3, 3, 4], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = {showlegend: true, + legend: {"orientation": "h"}}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/legends/legend-outside.html b/content/plotly_js/fundamentals/legends/legend-outside.html new file mode 100644 index 00000000000..88f4259f1b4 --- /dev/null +++ b/content/plotly_js/fundamentals/legends/legend-outside.html @@ -0,0 +1,27 @@ +--- +name: Positioning the Legend Outside the Plot +language: plotly_js +suite: legends +order: 6 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 3, 6, 4, 5, 2, 3, 5, 4], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 4, 7, 8, 3, 6, 3, 3, 4], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = { + showlegend: true, + legend: { + x: 1, + y: 0.5 + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/legends/legend-style.html b/content/plotly_js/fundamentals/legends/legend-style.html new file mode 100644 index 00000000000..88d6fc6e2df --- /dev/null +++ b/content/plotly_js/fundamentals/legends/legend-style.html @@ -0,0 +1,33 @@ +--- +name: Styling and Coloring the Legend +language: plotly_js +suite: legends +order: 7 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 3, 6, 4, 5, 2, 3, 5, 4], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 4, 7, 8, 3, 6, 3, 3, 4], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = {legend: { + x: 0, + y: 1, + traceorder: 'normal', + font: { + family: 'sans-serif', + size: 12, + color: '#000' + }, + bgcolor: '#E2E2E2', + bordercolor: '#FFFFFF', + borderwidth: 2 + }}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/legends/legend-visibility.html b/content/plotly_js/fundamentals/legends/legend-visibility.html new file mode 100644 index 00000000000..4856f0f56ef --- /dev/null +++ b/content/plotly_js/fundamentals/legends/legend-visibility.html @@ -0,0 +1,21 @@ +--- +name: Hiding the Legend +language: plotly_js +suite: legends +order: 2 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 3, 6, 4, 5, 2, 3, 5, 4], + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 4, 7, 8, 3, 6, 3, 3, 4], + type: 'scatter' +}; +var data = [trace1, trace2]; +var layout = {showlegend: false}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/legends/legends_plotly_js_index.html b/content/plotly_js/fundamentals/legends/legends_plotly_js_index.html new file mode 100644 index 00000000000..e897633f1f9 --- /dev/null +++ b/content/plotly_js/fundamentals/legends/legends_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to modify the legend in D3.js-based javascript graphs. Seven examples + of how to move, color, and hide the legend. +display_as: file_settings +language: plotly_js +layout: base +name: Legends +order: 20 +page_type: u-guide +permalink: javascript/legend/ +redirect_from: javascript-graphing-library/legend/ +thumbnail: thumbnail/legends.gif +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","legends" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/legends/show-legend.html b/content/plotly_js/fundamentals/legends/show-legend.html new file mode 100644 index 00000000000..f008f7e4abe --- /dev/null +++ b/content/plotly_js/fundamentals/legends/show-legend.html @@ -0,0 +1,24 @@ +--- +name: Hiding Legend Entries +language: plotly_js +suite: legends +order: 9 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2], + y: [1, 2, 3], + name: 'First Trace', + showlegend: false, + type: 'scatter' +}; +var trace2 = { + x: [0, 1, 2, 3], + y: [8, 4, 2, 0], + name: 'Second Trace', + showlegend: true, + type: 'scatter' +}; +var data = [trace1, trace2]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/fundamentals/legends/subplot-grouped-legend.html b/content/plotly_js/fundamentals/legends/subplot-grouped-legend.html new file mode 100644 index 00000000000..70951d11189 --- /dev/null +++ b/content/plotly_js/fundamentals/legends/subplot-grouped-legend.html @@ -0,0 +1,135 @@ +--- +name: Subplot Grouped Legend +language: plotly_js +suite: legends +order: 11 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: ['a'], + y: [2], + legendgroup: 'a', + marker: { + color: 'rgba(102,194,165,1)', + line: {color: 'transparent'} + }, + name: 'a', + type: 'bar', + xaxis: 'x', + yaxis: 'y' +}; + +var trace2 = { + x: ['b'], + y: [3], + legendgroup: 'b', + marker: { + color: 'rgba(252,141,98,1)', + line: {color: 'transparent'} + }, + name: 'b', + type: 'bar', + xaxis: 'x', + yaxis: 'y' +}; + +var trace3 = { + x: ['c'], + y: [2], + legendgroup: 'c', + marker: { + color: 'rgba(141,160,203,1)', + line: {color: 'transparent'} + }, + name: 'c', + type: 'bar', + xaxis: 'x', + yaxis: 'y' +}; + +var trace4 = { + x: ['a'], + y: [4], + legendgroup: 'a', + marker: { + color: 'rgba(102,194,165,1)', + line: {color: 'transparent'} + }, + name: 'a', + showlegend: false, + type: 'bar', + xaxis: 'x2', + yaxis: 'y2' +}; + +var trace5 = { + x: ['b'], + y: [2], + legendgroup: 'b', + marker: { + color: 'rgba(252,141,98,1)', + line: {color: 'transparent'} + }, + name: 'b', + showlegend: false, + type: 'bar', + xaxis: 'x2', + yaxis: 'y2' +}; + +var trace6 = { + x: ['c'], + y: [4], + legendgroup: 'c', + marker: { + color: 'rgba(141,160,203,1)', + line: {color: 'transparent'} + }, + name: 'c', + showlegend: false, + type: 'bar', + xaxis: 'x2', + yaxis: 'y2' +}; + +var data = [trace1, trace2, trace3, trace4, trace5, trace6]; + +var layout = { + hovermode: 'closest', + margin: { + r: 10, + t: 25, + b: 40, + l: 60 + }, + showlegend: true, + xaxis: { + anchor: 'y', + categoryorder: 'array', + domain: [0, 1], + type: 'category', + showgrid: false, + showticklabels: false + }, + xaxis2: { + anchor: 'y2', + categoryorder: 'array', + domain: [0, 1], + type: 'category', + showgrid: false + }, + yaxis: { + anchor: 'x', + domain: [0.52, 1], + showgrid: false + }, + yaxis2: { + anchor: 'x2', + domain: [0, 0.48], + showgrid: false + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/marker-style/color-opacity.html b/content/plotly_js/fundamentals/marker-style/color-opacity.html new file mode 100644 index 00000000000..c971ad39e06 --- /dev/null +++ b/content/plotly_js/fundamentals/marker-style/color-opacity.html @@ -0,0 +1,45 @@ +--- +name: Color Opacity +language: plotly_js +suite: marker-style +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + To maximise visibility of each point, set the color opacity by using alpha: `marker:{color: 'rgba(0,0,0,0.5)'}`. Here, the marker line will remain opaque. +--- + +var x = Array.from({length: 500}, () => Math.random()*(6-3)+3); +var y = Array.from({length: 500}, () => Math.random()*(6-3)+3); + +var data = [{ + x: x, + y: y, + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgba(17, 157, 255,0.5)', + size: 20, + line: { + color: 'rgb(231, 99, 250)', + width: 2 + } + }, + showlegend: false + }, { + x: [2,2], + y: [4.25,4.75], + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgba(17, 157, 255,0.5)', + size: 60, + line: { + color: 'rgb(231, 99, 250)', + width: 6 + } + }, + showlegend: false +}] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/fundamentals/marker-style/marker-border.html b/content/plotly_js/fundamentals/marker-style/marker-border.html new file mode 100644 index 00000000000..b20eff4e06c --- /dev/null +++ b/content/plotly_js/fundamentals/marker-style/marker-border.html @@ -0,0 +1,45 @@ +--- +name: Add Marker Border +language: plotly_js +suite: marker-style +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + In order to make markers distinct, you can add a border to the markers. This can be achieved by adding the line dict to the marker dict. For example, `marker:{..., line: {...}}`. +--- + +var x = Array.from({length: 500}, () => Math.random()*(6-3)+3); +var y = Array.from({length: 500}, () => Math.random()*(6-3)+3); + +var data = [{ + x: x, + y: y, + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgb(17, 157, 255)', + size: 20, + line: { + color: 'rgb(231, 99, 250)', + width: 2 + } + }, + showlegend: false + }, { + x: [2], + y: [4.5], + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgb(17, 157, 255)', + size: 60, + line: { + color: 'rgb(231, 99, 250)', + width: 6 + } + }, + showlegend: false +}] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/fundamentals/marker-style/marker-opacity.html b/content/plotly_js/fundamentals/marker-style/marker-opacity.html new file mode 100644 index 00000000000..5258ff4f61a --- /dev/null +++ b/content/plotly_js/fundamentals/marker-style/marker-opacity.html @@ -0,0 +1,47 @@ +--- +name: Marker Opacity +language: plotly_js +suite: marker-style +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + To maximise visibility of density, it is recommended to set the opacity inside the marker `marker:{opacity:0.5}`. If multiple traces exist with high density, consider using marker opacity in conjunction with trace opacity. +--- + +var x = Array.from({length: 500}, () => Math.random()*(6-3)+3); +var y = Array.from({length: 500}, () => Math.random()*(6-3)+3); + +var data = [{ + x: x, + y: y, + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgb(17, 157, 255)', + opacity: 0.5, + size: 20, + line: { + color: 'rgb(231, 99, 250)', + width: 2 + } + }, + showlegend: false + }, { + x: [2,2], + y: [4.25,4.75], + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgb(17, 157, 255)', + opacity: 0.5, + size: 60, + line: { + color: 'rgb(231, 99, 250)', + width: 6 + } + }, + showlegend: false +}] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/fundamentals/marker-style/marker-opaque.html b/content/plotly_js/fundamentals/marker-style/marker-opaque.html new file mode 100644 index 00000000000..261547bfb94 --- /dev/null +++ b/content/plotly_js/fundamentals/marker-style/marker-opaque.html @@ -0,0 +1,45 @@ +--- +name: Fully Opaque +language: plotly_js +suite: marker-style +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + Fully opaque, the default setting, is useful for non-overlapping markers. When many points overlap it can be hard to observe density. +--- + +var x = Array.from({length: 500}, () => Math.random()*(6-3)+3); +var y = Array.from({length: 500}, () => Math.random()*(6-3)+3); + +var data = [{ + x: x, + y: y, + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgb(17, 157, 255)', + size: 20, + line: { + color: 'rgb(231, 99, 250)', + width: 2 + } + }, + showlegend: false + }, { + x: [2,2], + y: [4.25,4.75], + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgb(17, 157, 255)', + size: 60, + line: { + color: 'rgb(231, 99, 250)', + width: 6 + } + }, + showlegend: false +}] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/fundamentals/marker-style/marker-style-plotly-js.html b/content/plotly_js/fundamentals/marker-style/marker-style-plotly-js.html new file mode 100644 index 00000000000..beea5f99147 --- /dev/null +++ b/content/plotly_js/fundamentals/marker-style/marker-style-plotly-js.html @@ -0,0 +1,14 @@ +--- +description: How to style markers in JavaScript. +display_as: file_settings +language: plotly_js +layout: base +name: Styling Markers +order: 11 +page_type: u-guide +permalink: javascript/marker-style/ +thumbnail: thumbnail/marker-style.gif +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","marker-style" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/marker-style/trace-opacity.html b/content/plotly_js/fundamentals/marker-style/trace-opacity.html new file mode 100644 index 00000000000..6207d5e112c --- /dev/null +++ b/content/plotly_js/fundamentals/marker-style/trace-opacity.html @@ -0,0 +1,63 @@ +--- +name: Trace Opacity +language: plotly_js +suite: marker-style +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + Setting opacity outside the marker will set the opacity of the trace. Thus, it will allow greater visbility of additional traces but like fully opaque it is hard to distinguish density. +--- + +var x = Array.from({length: 500}, () => Math.random()*(6-3)+3); +var y = Array.from({length: 500}, () => Math.random()*(4.5-3)+3); +var x2 = Array.from({length: 500}, () => Math.random()*(6-3)+3); +var y2 = Array.from({length: 500}, () => Math.random()*(6-4.5)+4.5); + +var data = [{ + x: x, + y: y, + type: 'scatter', + mode: 'markers', + opacity: 0.5, + marker: { + color: 'rgb(17, 157, 255)', + size: 20, + line: { + color: 'rgb(231, 99, 250)', + width: 2 + } + }, + name: 'Opacity 0.5' + }, { + x: x2, + y: y2, + type: 'scatter', + mode: 'markers', + marker: { + color: 'rgb(17, 157, 255)', + size: 20, + line: { + color: 'rgb(231, 99, 250)', + width: 2 + } + }, + name: 'Opacity 1.0' + }, { + x: [2,2], + y: [4.25,4.75], + type: 'scatter', + mode: 'markers', + opacity: 0.5, + marker: { + color: 'rgb(17, 157, 255)', + size: 60, + line: { + color: 'rgb(231, 99, 250)', + width: 6 + } + }, + showlegend: false +}] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/fundamentals/plotly-js-3-changes/plotly-js-3-changes.md b/content/plotly_js/fundamentals/plotly-js-3-changes/plotly-js-3-changes.md new file mode 100644 index 00000000000..7beac7958c9 --- /dev/null +++ b/content/plotly_js/fundamentals/plotly-js-3-changes/plotly-js-3-changes.md @@ -0,0 +1,362 @@ +--- +description: Learn about the changes in Plotly.js version 3. +display_as: file_settings +language: plotly_js +layout: base +name: Version 3 Changes +order: 27 +page_type: u-guide +permalink: javascript/version-3-changes/ +redirect_from: javascript/pointcloud/ +sitemap: false +thumbnail: thumbnail/pointcloud.jpg +--- +This page outlines the changes in Plotly.js version 3 and cases where you may need to update your charts. + +## Removed Features + +Plotly.js 3 removes the following features that were deprecated in previous versions. + +### `annotation.ref` Attribute + +`annotation.ref` has been removed. Use `annotation.xref` and `annotation.yref` instead. + +Here's an example using `annotation.ref`, followed by teh same example rewritte to use `annotation.xref` and `annotation.yref`: + +```js +... +var layout = { + title: "Try panning or zooming!", + annotations: [{ + text: "Absolutely-positioned annotation", + ref: "paper", + x: 0.3, + y: 0.3, + showarrow: false + }] +}; +... +``` + +```js +... +var layout = { + title: "Try panning or zooming!", + annotations: [{ + text: "Absolutely-positioned annotation", + xref: "paper", + yref: "paper", + x: 0.3, + y: 0.3, + showarrow: false + }] +}; +... +``` + +### `autotick` Attribute + +The `autotick` attribute has been removed. Use `tickmode: 'auto'` instead of `autotick: true` and `tickmode: 'linear'` instead of `autotick: false`. + +### `bardir` Attribute on Bar Charts + +The `bardir` attribute for setting the bar direction on bar charts has been removed. Use `orientation` instead. + +Here's an example using `bardir` to make the bars horizontal, followed by the same example rewritten to use `orientation`: + +```js +var data = [{ + type: 'bar', + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + bardir: 'h', +}]; + +var layout = { + title: 'Bar Chart with Horizontal Bars', + xaxis: { + title: 'X Axis' + }, + yaxis: { + title: 'Y Axis' + } +}; + + +Plotly.newPlot('bar-chart', data, layout); +``` + +```js +var data = [{ + type: 'bar', + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + orientation: 'h', +}]; + +var layout = { + title: 'Bar Chart with Horizontal Bars', + xaxis: { + title: 'X Axis' + }, + yaxis: { + title: 'Y Axis' + } +}; + + +Plotly.newPlot('bar-chart', data, layout); +``` + +### `layout.scene.cameraposition` Attribute for 3D Plots + +The `layout.scene.cameraposition` attribute on 3D plots has been removed. Use `layout.scene.camera` instead. + +If you are using `cameraposition`, you'll need to update it for it work with the `camera` attribute. Here's an example of converting a `cameraposition` to `camera`. This example uses [gl-mat4](https://www.npmjs.com/package/gl-mat4#fromquatoutmat4-qquat4). + +```js +var m4FromQuat = require('gl-mat4/fromQuat'); + +// Original cameraposition +var cameraposition = ; + +var rotation = cameraposition[0]; +var center = cameraposition[1]; +var radius = cameraposition[2]; +var mat = m4FromQuat([], rotation); +var eye = []; + +for(j = 0; j < 3; ++j) { + eye[j] = center[j] + radius * mat[2 + 4 * j]; +} + +// New camera +var camera = { + eye: {x: eye[0], y: eye[1], z: eye[2]}, + center: {x: center[0], y: center[1], z: center[2]}, + up: {x: 0, y: 0, z: 1} +}; +``` + +### `heatmapgl` Trace + +`heatmapgl` has been removed. Use `heatmap` instead. + +``` +var data = [ + { + z: [[1, 20, 30], [20, 1, 60], [30, 60, 1]], + type: 'heatmapgl' + } +]; + +Plotly.newPlot('myDiv', data); +``` + +``` +var data = [ + { + z: [[1, 20, 30], [20, 1, 60], [30, 60, 1]], + type: 'heatmap' + } +]; + +Plotly.newPlot('myDiv', data); +``` + +### `opacity` Attribute on Error Bars + +The `opacity` attribute on error bars has been removed. Use the alpha channel of the `color` attribute instead. + +Here's an example that was previously in the Plotly.js docs, and which uses `opacity`, followed by the same example rewritten to use the alpha channel on a `rgba` color value. + +``` + error_y: { + type: 'constant', + value: 0.1, + color: '#85144B', + thickness: 1.5, + width: 3, + opacity: 0.5 + } + +``` + +``` + error_y: { + type: 'constant', + value: 0.1, + color: 'rgba(133, 20, 75, 0.5)', + thickness: 1.5, + width: 3, + } + +``` + +### jQuery Events + +Support for using jQuery events has been removed. Use [Plotly.js events](/javascript/plotlyjs-events/) instead. + +### `pointcloud` Trace + +`pointcloud` has been removed. Use `scattergl` instead. + +Here's an example that was previously in the Plotly.js docs and which uses `pointcloud`, followed by the same example rewritten to use `scattergl`: + +```js +var myPlot = document.getElementById('myDiv'); + +var xy = new Float32Array([1,2,3,4,5,6,0,4]); + + +data = [{ xy: xy, type: 'pointcloud' }]; + +layout = { }; + + +Plotly.newPlot('myDiv', data, layout); +``` + +```js +var myPlot = document.getElementById('myDiv'); + +var xy = new Float32Array([1,2,3,4,5,6,0,4]); + +var x = []; +var y = []; +for (var i = 0; i < xy.length; i += 2) { + x.push(xy[i]); + y.push(xy[i + 1]); +} + +var data = [{ + x: x, + y: y, + mode: 'markers', + type: 'scattergl', + marker: { + size: 10, + color: 'blue', + opacity: 0.8 + } +}]; +var layout = { + title: 'Point Cloud', + xaxis: { title: 'X Axis' }, + yaxis: { title: 'Y Axis' } +}; + +Plotly.newPlot('myDiv', data, layout); +``` + +### `plot3dPixelRatio` for WebGL Image Export + +The `plot3dPixelRatio` option on `config` for setting the pixel ration during WebGL image export has been removed. Use `plotGlPixelRatio` instead. + + +## `title` Attribute as a String + +The `title` attribute can no longer be set as a string. Use `title.text` instead. Here's an example of how to set the title using `title.text`: + +```js +var data = [ + { + x: [1, 2, 3, 4, 5], + y: [1, 2, 4, 8, 16] + } +]; + +var layout = { + title: { text: "My chart title" }, + xaxis: { + title: { + text: "x-axis title" + } + }, + yaxis: { title: { text: "y-axis title" } } +}; + +Plotly.newPlot("myDiv", data, layout); +``` + +### `titlefont`,`titleposition`, `titleside`, and `titleoffset` Attributes + +The `titlefont`,`titleposition`, `titleside`, and `titleoffset` attributes are removed. Replace them with `title.font`, `title.position`, `title.side`, and `title.offset`. + +Here's an example that uses `titlefont`, followed by the same example rewritten to use `title.font`: + +```js +var data = [{ + type: 'bar', + x: ['A', 'B', 'C', 'D'], + y: [10, 15, 13, 17] +}]; + +var layout = { + title: { + text: 'Chart Title', + }, + titlefont: { + size: 40 + } +}; + +Plotly.newPlot('chart', data, layout); +``` + +```js +var data = [{ + type: 'bar', + x: ['A', 'B', 'C', 'D'], + y: [10, 15, 13, 17] +}]; + +var layout = { + title: { + text: 'Chart Title', + font: { + size: 40 + } + }, +}; + +Plotly.newPlot('chart', data, layout); +``` + +### Transforms + +Transforms have been removed. + +### `zauto`, `zmin`, and `zmax` from Surface Trace + +The `zauto`, `zmin`, and `zmax` attributes have been removed on surface traces. Use `cauto`, `cmin`, and `cmax` instead. + +```JavaScript +var data = [{ + z: [ + [1, 20, 30, 50], + [20, 1, 60, 80], + [30, 60, 1, 100], + [50, 80, 100, 1] + ], + type: 'surface', + zauto: false, + zmin: 0, + zmax: 100 +}]; +``` + +```JavaScript +var data = [{ + z: [ + [1, 20, 30, 50], + [20, 1, 60, 80], + [30, 60, 1, 100], + [50, 80, 100, 1] + ], + type: 'surface', + cauto: false, + cmin: 0, + cmax: 100 +}]; +``` diff --git a/content/plotly_js/fundamentals/plotly_js-fundamentals-index.html b/content/plotly_js/fundamentals/plotly_js-fundamentals-index.html new file mode 100644 index 00000000000..ebb89a6aa6d --- /dev/null +++ b/content/plotly_js/fundamentals/plotly_js-fundamentals-index.html @@ -0,0 +1,28 @@ +--- +permalink: javascript/plotly-fundamentals/ +redirect_from: javascript/modularizing-monolithic-javascript-projects/ +description: Plotly.js makes interactive, publication-quality graphs online. Tutorials and tips about fundamental features of Plotly JS +name: Fundamentals +layout: langindex +display_as: file_settings +language: plotly_js +thumbnail: thumbnail/mixed.jpg +--- + + +
+
+ +
+ +
+

Plotly.js Fundamentals

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","file_settings" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/fundamentals/react/advanced.html b/content/plotly_js/fundamentals/react/advanced.html new file mode 100644 index 00000000000..14c417125a3 --- /dev/null +++ b/content/plotly_js/fundamentals/react/advanced.html @@ -0,0 +1,11 @@ +--- +name: Advanced Usage +language: plotly_js +suite: react +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + For information on more advanced usage patterns such as [State Management](https://github.com/plotly/react-plotly.js#state-management) or [Customizing the plotly.js bundle](https://github.com/plotly/react-plotly.js#customizing-the-plotlyjs-bundle) please see the [ReadMe for react-plotly.js](https://github.com/plotly/react-plotly.js/blob/master/README.md). + +--- diff --git a/content/plotly_js/fundamentals/react/api.html b/content/plotly_js/fundamentals/react/api.html new file mode 100644 index 00000000000..b0af54f0fb1 --- /dev/null +++ b/content/plotly_js/fundamentals/react/api.html @@ -0,0 +1,11 @@ +--- +name: Props and Events +language: plotly_js +suite: react +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + More information about [Props](https://github.com/plotly/react-plotly.js/#basic-props) and [Event Handlers](https://github.com/plotly/react-plotly.js/#event-handler-props) can be found in the [ReadMe for react-plotly.js](https://github.com/plotly/react-plotly.js/blob/master/README.md). + +--- diff --git a/content/plotly_js/fundamentals/react/installation.html b/content/plotly_js/fundamentals/react/installation.html new file mode 100644 index 00000000000..81fa7618173 --- /dev/null +++ b/content/plotly_js/fundamentals/react/installation.html @@ -0,0 +1,10 @@ +--- +name: Installation +language: plotly_js +suite: react +order: 2 +sitemap: false +arrangement: horizontal +--- + +$ npm install react-plotly.js plotly.js diff --git a/content/plotly_js/fundamentals/react/introduction.html b/content/plotly_js/fundamentals/react/introduction.html new file mode 100644 index 00000000000..9a9c46852a3 --- /dev/null +++ b/content/plotly_js/fundamentals/react/introduction.html @@ -0,0 +1,10 @@ +--- +name: Introduction +language: plotly_js +suite: react +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + Use [react-plotly.js](https://github.com/plotly/react-plotly.js) to embed D3 charts in your [React](https://reactjs.org/)-powered web application. This React component takes the chart type, data, and styling as [Plotly JSON](https://help.plot.ly/json-chart-schema/) in its data and layout props, then draws the chart using Plotly.js. See below about how to get started with react-plotly.js. +--- diff --git a/content/plotly_js/fundamentals/react/plotly-js-chart-and-attributes.html b/content/plotly_js/fundamentals/react/plotly-js-chart-and-attributes.html new file mode 100644 index 00000000000..6d2a144b3ca --- /dev/null +++ b/content/plotly_js/fundamentals/react/plotly-js-chart-and-attributes.html @@ -0,0 +1,10 @@ +--- +name: Plotly.js Chart Types and Attributes +language: plotly_js +suite: react +order: 6 +sitemap: false +arrangement: horizontal +markdown_content: | + Click here for more information about [Plotly Chart Types](https://plotly.com/javascript/) and [Attributes](https://plotly.com/javascript/reference/). +--- diff --git a/content/plotly_js/fundamentals/react/quick_start.html b/content/plotly_js/fundamentals/react/quick_start.html new file mode 100644 index 00000000000..37301c390d1 --- /dev/null +++ b/content/plotly_js/fundamentals/react/quick_start.html @@ -0,0 +1,34 @@ +--- +name: Quick Start +language: plotly_js +suite: react +plot_url: https://codepen.io/rsreusser/embed/qPgwwJ?height=550&default-tab=result +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + The easiest way to use this component is to import and pass data to a plot component: +--- + +import React from 'react'; +import Plot from 'react-plotly.js'; + +class App extends React.Component { + render() { + return ( + + ); + } +} diff --git a/content/plotly_js/fundamentals/react/react-plotlyjs-index.html b/content/plotly_js/fundamentals/react/react-plotlyjs-index.html new file mode 100644 index 00000000000..4a091dd7b62 --- /dev/null +++ b/content/plotly_js/fundamentals/react/react-plotlyjs-index.html @@ -0,0 +1,14 @@ +--- +description: How to use the Plotly.js React component. +display_as: file_settings +language: plotly_js +layout: base +name: React Plotly.js +order: 4 +page_type: example_index +permalink: javascript/react/ +thumbnail: thumbnail/react.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","react" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/responsive-fluid-layout/responsive-charts.html b/content/plotly_js/fundamentals/responsive-fluid-layout/responsive-charts.html new file mode 100644 index 00000000000..b6d53dd2712 --- /dev/null +++ b/content/plotly_js/fundamentals/responsive-fluid-layout/responsive-charts.html @@ -0,0 +1,34 @@ +--- +name: Responsive Plots +language: plotly_js +suite: responsive-fluid-layout +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + If you set the `responsive` attribute equal to `true` (using the `config` object), then your figures will be automatically resized when the browser window size changes. This is an especially useful feature for charts which are going to viewed on mobile devices! +--- +var trace1 = { + type: 'bar', + x: [1, 2, 3, 4], + y: [5, 10, 2, 8], + marker: { + color: '#C8A2C8', + line: { + width: 2.5 + } + } +}; + +var data = [ trace1 ]; + +var layout = { + title: { + text: 'Responsive to window\'s size!' + }, + font: {size: 18} +}; + +var config = {responsive: true} + +Plotly.newPlot('myDiv', data, layout, config ); diff --git a/content/plotly_js/fundamentals/responsive-fluid-layout/responsive-fluid-layout_plotly_js_index.html b/content/plotly_js/fundamentals/responsive-fluid-layout/responsive-fluid-layout_plotly_js_index.html new file mode 100644 index 00000000000..8e5bb95366b --- /dev/null +++ b/content/plotly_js/fundamentals/responsive-fluid-layout/responsive-fluid-layout_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to create figures with responsive/fluid layouts in JavaScript. +display_as: file_settings +language: plotly_js +layout: base +name: Responsive / Fluid Layouts +order: 2 +page_type: example_index +permalink: javascript/responsive-fluid-layout/ +redirect_from: javascript-graphing-library/responsive-fluid-layout/ +thumbnail: thumbnail/fluid-layout.gif +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","responsive-fluid-layout" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/shapes/basic-arbitrary-svg-paths.html b/content/plotly_js/fundamentals/shapes/basic-arbitrary-svg-paths.html new file mode 100644 index 00000000000..8831569e697 --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/basic-arbitrary-svg-paths.html @@ -0,0 +1,79 @@ +--- +name: Basic Arbitrary SVG Paths +language: plotly_js +suite: shape +order: 7 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [2, 1, 8, 8], + y: [0.25, 9, 2, 6], + text: ['filled triangle', 'filled Polygon', 'Quadratic Bezier Curves', 'Cubic Bezier Curves'], + mode: 'text' +}; + +var layout = { + title: { + text: 'Basic Arbitrary SVG Paths' + }, + xaxis: { + range: [0, 9], + zeroline: false + }, + yaxis: { + range: [0, 11], + showgrid: false + }, + width: 500, + height: 500, + shapes: [ + + //Quadratic Bezier Curves + + { + type: 'path', + path: 'M 4,4 Q 6,0 8,4', + line: { + color: 'rgb(93, 164, 214)' + } + }, + + //Cubic Bezier Curves + + { + type: 'path', + path: 'M 1,4 C 2,8 6,4 8,8', + line: { + color: 'rgb(207, 114, 255)' + } + }, + + //Filled Triangle + + { + type: 'path', + path: 'M 1 1 L 1 3 L 4 1 Z', + fillcolor: 'rgba(44, 160, 101, 0.5)', + line: { + color: 'rgb(44, 160, 101)' + } + }, + + //Filled Polygon + + { + type: 'path', + path: ' M 3,7 L2,8 L2,9 L3,10, L4,10 L5,9 L5,8 L4,7 Z', + fillcolor: 'rgba(255, 140, 184, 0.5)', + line: { + color: 'rgb(255, 140, 184)' + } + } + ] +}; + +var data = [trace1]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/circle.html b/content/plotly_js/fundamentals/shapes/circle.html new file mode 100644 index 00000000000..929abdbc92c --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/circle.html @@ -0,0 +1,67 @@ +--- +name: Circle +language: plotly_js +suite: shape +order: 4 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1.5, 3.5], + y: [0.75, 2.5], + text: ['Unfilled Circle', 'Filled Circle'], + mode: 'text' +}; + +var layout = { + title: { + text: 'Circles' + }, + xaxis: { + range: [0, 4.5], + zeroline: false + }, + yaxis: { + range: [0, 4.5] + }, + width: 500, + height: 500, + shapes: [ + + // Unfilled Circle + + { + type: 'circle', + xref: 'x', + yref: 'y', + x0: 1, + y0: 1, + x1: 3, + y1: 3, + line: { + color: 'rgba(50, 171, 96, 1)' + } + }, + + // Filled Circle + + { + type: 'circle', + xref: 'x', + yref: 'y', + fillcolor: 'rgba(50, 171, 96, 0.7)', + x0: 3, + y0: 3, + x1: 4, + y1: 4, + line: { + color: 'rgba(50, 171, 96, 1)' + } + } + ] +}; + +var data = [trace1]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/labels-on-shapes.html b/content/plotly_js/fundamentals/shapes/labels-on-shapes.html new file mode 100644 index 00000000000..7fa65086c34 --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/labels-on-shapes.html @@ -0,0 +1,91 @@ +--- +name: Adding Labels to Shapes +language: plotly_js +suite: shape +order: 11 +sitemap: false +arrangement: horizontal +markdown_content: | + This example adds a `label` to a rectangle and a line on the graph, + sets a `font` `size` and `color` on the rectangle, and positions its label + 'top center' using `textposition`. On the line, we specify a `yanchor` of "top" + to anchor the top of the label to its `textposition`. + You can also draw new shapes on the graph and each new shape automatically + gets a text label. +--- +var data = [ + { + 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: [ + 14, 17, 8, 4, 7, 10, 12, 14, 12, 11, 10, 9, 18, 14, 14, 16, 13, 8, 8, + 7, 7, 3, 9, 9, 4, 13, 9, 6, + ], + mode: 'line', + }, +]; + +var layout = { + title: {text: 'Product price changes and revenue growth'}, + xaxis: { title: {text: 'Date' }}, + yaxis: { title: {text: 'Revenue Growth' }}, + dragmode: 'drawline', + + shapes: [ + { + type: 'rect', + xref: 'x', + yref: 'paper', + x0: '2015-02-02', + y0: 0, + x1: '2015-02-08', + y1: 1, + fillcolor: '#d3d3d3', + opacity: 0.2, + editable: true, + line: { + width: 0, + }, + label: { + text: 'Price drop', + font: { size: 10, color: 'green' }, + textposition: 'top center', + }, + }, + { + type: 'line', + x0: '2015-02-01', + y0: 8, + x1: '2015-02-28', + y1: 8, + fillcolor: '#d3d3d3', + opacity: 0.2, + editable: true, + label: { + text: 'January average', + yanchor: 'top', + }, + }, + ], + newshape: { label: { text: 'New shape text' } }, + height: 500, + width: 500, +}; + +var config = { 'modeBarButtonsToAdd': [ + 'drawline', + 'drawopenpath', + 'drawclosedpath', + 'drawcircle', + 'drawrect', + 'eraseshape' + ] +}; + +Plotly.newPlot('myDiv', data, layout, config); diff --git a/content/plotly_js/fundamentals/shapes/lines-positioned-realative-to-plot-and-to-axis.html b/content/plotly_js/fundamentals/shapes/lines-positioned-realative-to-plot-and-to-axis.html new file mode 100644 index 00000000000..de3ed24d10a --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/lines-positioned-realative-to-plot-and-to-axis.html @@ -0,0 +1,67 @@ +--- +name: Lines Positioned Relative to the Plot and to the Axis +language: plotly_js +suite: shape +order: 6 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [2, 6], + y: [1, 1], + text: ['Line positioned relative to the plot', 'Line positioned relative to the axes'], + mode: 'text' +}; + +var layout = { + title: { + text: 'Lines Positioned Relative to the Plot & to the Axes' + }, + xaxis: { + range: [0, 8] + }, + yaxis: { + range: [0, 2] + }, + width: 500, + height: 500, + shapes: [ + + //Line reference to the axes + + { + type: 'line', + xref: 'x', + yref: 'y', + x0: 4, + y0: 0, + x1: 8, + y1: 1, + line: { + color: 'rgb(55, 128, 191)', + width: 3 + } + }, + + //Line reference to the plot + + { + type: 'line', + xref: 'paper', + yref: 'paper', + x0: 0, + y0: 0, + x1: 0.5, + y1: 0.5, + line: { + color: 'rgb(50, 171, 96)', + width: 3 + } + } + ] +}; + +var data = [trace1]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/lines-positioned-relative-to-axis.html b/content/plotly_js/fundamentals/shapes/lines-positioned-relative-to-axis.html new file mode 100644 index 00000000000..5512270f352 --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/lines-positioned-relative-to-axis.html @@ -0,0 +1,79 @@ +--- +name: Vertical and Horizontal Lines Positioned Relative to the Axes +language: plotly_js +suite: shape +order: 3 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [2, 3.5, 6], + y: [1, 1.5, 1], + text: ['Vertical Line', 'Horizontal Dashed Line', 'Diagonal dotted Line'], + mode: 'text' +}; + +var layout = { + title: { + text: 'Vertical and Horizontal Lines Positioned Relative to the Axes' + }, + xaxis: { + range: [0, 7] + }, + yaxis: { + range: [0, 2.5] + }, + width: 500, + height: 500, + shapes: [ + + //line vertical + + { + type: 'line', + x0: 1, + y0: 0, + x1: 1, + y1: 2, + line: { + color: 'rgb(55, 128, 191)', + width: 3 + } + }, + + //Line Horizontal + + { + type: 'line', + x0: 2, + y0: 2, + x1: 5, + y1: 2, + line: { + color: 'rgb(50, 171, 96)', + width: 4, + dash: 'dashdot' + } + }, + + //Line Diagonal + + { + type: 'line', + x0: 4, + y0: 0, + x1: 6, + y1: 2, + line: { + color: 'rgb(128, 0, 128)', + width: 4, + dash: 'dot' + } + } + ] +}; + +var data = [trace1]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/rectangle-positioned-relative-to-axis.html b/content/plotly_js/fundamentals/shapes/rectangle-positioned-relative-to-axis.html new file mode 100644 index 00000000000..ffd2be993c2 --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/rectangle-positioned-relative-to-axis.html @@ -0,0 +1,64 @@ +--- +name: Rectangle Positioned Relative to the Axes +language: plotly_js +suite: shape +order: 5 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1.5, 4.5], + y: [0.75, 0.75], + text: ['Unfilled Rectangle', 'Filled Rectangle'], + mode: 'text' +}; + +var layout = { + title: { + text: 'Rectangle Positioned Relative to the Axes' + }, + xaxis: { + range: [0, 7], + showgrid: false + }, + yaxis: { + range: [0, 3.5] + }, + width: 500, + height: 500, + shapes: [ + + //Unfilled Rectangle + + { + type: 'rect', + x0: 1, + y0: 1, + x1: 2, + y1: 3, + line: { + color: 'rgba(128, 0, 128, 1)' + } + }, + + //Filled Rectangle + + { + type: 'rect', + x0: 3, + y0: 1, + x1: 6, + y1: 2, + line: { + color: 'rgba(128, 0, 128, 1)', + width: 2 + }, + fillcolor: 'rgba(128, 0, 128, 0.7)' + } + ] +}; + +var data = [trace1]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/rectangles-positioned-relative-to-plot-and-axes.html b/content/plotly_js/fundamentals/shapes/rectangles-positioned-relative-to-plot-and-axes.html new file mode 100644 index 00000000000..17d2593f3a5 --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/rectangles-positioned-relative-to-plot-and-axes.html @@ -0,0 +1,70 @@ +--- +name: Rectangle Positioned Relative to the Plot and to the Axes +language: plotly_js +suite: shape +order: 5 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1.5, 3], + y: [2.5, 2.5], + text: ['Rectangle reference to the plot', 'Rectangle reference to the axes'], + mode: 'text' +}; + +var layout = { + title: { + text: 'Rectangles Positioned Relative to the Plot and to the Axes' + }, + xaxis: { + range: [0, 4], + showgrid: false + }, + yaxis: { + range: [0, 4] + }, + width: 800, + height: 600, + shapes: [ + + //Rectangle reference to the axes + + { + type: 'rect', + xref: 'x', + yref: 'y', + x0: 2.5, + y0: 0, + x1: 3.5, + y1: 2, + line: { + color: 'rgb(55, 128, 191)', + width: 3 + }, + fillcolor: 'rgba(55, 128, 191, 0.6)' + }, + + //Rectangle reference to the Plot + + { + type: 'rect', + xref: 'paper', + yref: 'paper', + x0: 0.25, + y0: 0, + x1: 0.5, + y1: 0.5, + line: { + color: 'rgb(50, 171, 96)', + width: 3 + }, + fillcolor: 'rgba(50, 171, 96, 0.6)' + } + ] +}; + +var data = [trace1]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/shape-clusters.html b/content/plotly_js/fundamentals/shapes/shape-clusters.html new file mode 100644 index 00000000000..d7a56512de3 --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/shape-clusters.html @@ -0,0 +1,118 @@ +--- +name: Highlighting Clusters of Scatter Points with Circle Shapes +language: plotly_js +suite: shape +order: 1 +sitemap: false +arrangement: horizontal +--- + +function normal_array( mean, stddev, size ){ + var arr = new Array(size), i; + // from http://bl.ocks.org/nrabinowitz/2034281 + var generator = (function() { + return d3.random.normal(mean, stddev); + }()); + + for( i=0; i< arr.length; i++ ){ + arr[i] = generator(); + } + return arr; +} + +var x0 = normal_array(2, 0.45, 300); +var y0 = normal_array(2, 0.45, 300); + +var x1 = normal_array(6, 0.4, 200); +var y1 = normal_array(6, 0.4, 200) + +var x2 = normal_array(4, 0.3, 200); +var y2 = normal_array(4, 0.3, 200); + +console.log(x0); + +var data = [ + { + x: x0, + y: y0, + mode: 'markers' + }, { + x: x1, + y: y1, + mode: 'markers' + }, { + x: x2, + y: y2, + mode: 'markers' + }, { + x: x1, + y: y0, + mode: 'markers' + } +]; + +var layout = { + shapes: [ + { + type: 'circle', + xref: 'x', + yref: 'y', + x0: d3.min(x0), + y0: d3.min(y0), + x1: d3.max(x0), + y1: d3.max(y0), + opacity: 0.2, + fillcolor: 'blue', + line: { + color: 'blue' + } + }, + { + type: 'circle', + xref: 'x', + yref: 'y', + x0: d3.min(x1), + y0: d3.min(y1), + x1: d3.max(x1), + y1: d3.max(y1), + opacity: 0.2, + fillcolor: 'orange', + line: { + color: 'orange' + } + }, + { + type: 'circle', + xref: 'x', + yref: 'y', + x0: d3.min(x2), + y0: d3.min(y2), + x1: d3.max(x2), + y1: d3.max(y2), + opacity: 0.2, + fillcolor: 'green', + line: { + color: 'green' + } + }, + { + type: 'circle', + xref: 'x', + yref: 'y', + x0: d3.min(x1), + y0: d3.min(y0), + x1: d3.max(x1), + y1: d3.max(y0), + opacity: 0.2, + fillcolor: 'red', + line: { + color: 'red' + } + } + ], + height: 400, + width: 480, + showlegend: false +} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/shape-timestamp-highlight.html b/content/plotly_js/fundamentals/shapes/shape-timestamp-highlight.html new file mode 100644 index 00000000000..803aa01745c --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/shape-timestamp-highlight.html @@ -0,0 +1,68 @@ +--- +name: Highlighting Time Series Regions with Rectangle Shapes +language: plotly_js +suite: shape +order: 0 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + 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: [-14, -17, -8, -4, -7, -10, -12, -14, -12, -7, -11, -7, -18, -14, -14, + -16, -13, -7, -8, -14, -8, -3, -9, -9, -4, -13, -9, -6], + mode: 'line', + name: 'temperature' + } +]; + +var layout = { + + // to highlight the timestamp we use shapes and create a rectangular + + shapes: [ + // 1st highlight during Feb 4 - Feb 6 + { + type: 'rect', + // x-reference is assigned to the x-values + xref: 'x', + // y-reference is assigned to the plot paper [0,1] + yref: 'paper', + x0: '2015-02-04', + y0: 0, + x1: '2015-02-06', + y1: 1, + fillcolor: '#d3d3d3', + opacity: 0.2, + line: { + width: 0 + } + }, + + // 2nd highlight during Feb 20 - Feb 23 + + { + type: 'rect', + xref: 'x', + yref: 'paper', + x0: '2015-02-20', + y0: 0, + x1: '2015-02-22', + y1: 1, + fillcolor: '#d3d3d3', + opacity: 0.2, + line: { + width: 0 + } + } + ], + height: 500, + width: 500 +} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/shape_plotlyjs_index.html b/content/plotly_js/fundamentals/shapes/shape_plotlyjs_index.html new file mode 100644 index 00000000000..1e6c63f476f --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/shape_plotlyjs_index.html @@ -0,0 +1,16 @@ +--- +description: How to make arbitrary D3.js-based SVG shapes in JavaScript. Examples + of lines, circle, rectangle, and path. +display_as: file_settings +language: plotly_js +layout: base +name: Shapes +order: 23 +page_type: u-guide +permalink: javascript/shapes/ +redirect_from: javascript-graphing-library/shapes/ +thumbnail: thumbnail/shape.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","shape" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/shapes/tangent-lines-with-shapes.html b/content/plotly_js/fundamentals/shapes/tangent-lines-with-shapes.html new file mode 100644 index 00000000000..83610a946b5 --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/tangent-lines-with-shapes.html @@ -0,0 +1,72 @@ +--- +name: Creating Tangent Lines with Shapes +language: plotly_js +suite: shape +order: 10 +sitemap: false +arrangement: horizontal +--- +function linspace(a,b,n) { + return d3.range(n).map(function(i){return a+i*(b-a)/(n-1);}); +} + +var xValues = linspace(1, 3, 200); + +var yValues = []; + +for ( var i = 0 ; i < xValues.length ; i++ ) { + var result = xValues[i] * Math.sin(Math.pow(xValues[i], 2)) + 1; + yValues.push(result); +}; + +var trace1 = { + x: xValues, + y: yValues, + type: 'scatter' +}; + +var data = [trace1]; + +var layout = { + title: { + text: 'Rectangles Positioned Relative to the Plot and to the Axes' + }, + shapes: [{ + type: 'line', + x0: 1, + y0: 2.30756, + x1: 1.75, + y1: 2.30756, + opacity: 0.7, + line: { + color: 'red', + width: 2.5 + } + }, { + type: 'line', + x0: 2.5, + y0: 3.80796, + x1: 3.05, + y1: 3.80796, + opacity: 0.7, + line: { + color: 'red', + width: 2.5 + } + }, { + type: 'line', + x0: 1.90, + y0: -1.1827, + x1: 2.50, + y1: -1.1827, + opacity: 0.7, + line: { + color: 'red', + width: 2.5 + } + }], + height: 500, + width: 500 +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/shapes/venn-diagram-with-circle-shapes.html b/content/plotly_js/fundamentals/shapes/venn-diagram-with-circle-shapes.html new file mode 100644 index 00000000000..6cbfa0670bf --- /dev/null +++ b/content/plotly_js/fundamentals/shapes/venn-diagram-with-circle-shapes.html @@ -0,0 +1,77 @@ +--- +name: Venn Diagram with Circle Shapes +language: plotly_js +suite: shape +order: 9 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 1.75, 2.5], + y: [1, 1, 1], + type: 'scatter', + mode: 'text', + text: ['A', 'A+B', 'B'], + textfont: { + color: 'black', + size: 18, + family: 'Arial' + } +}; + +var layout = { + title: { + text: 'Venn Diagram with Circle Shapes' + }, + xaxis: { + showticklabels: false, + tickmode: 'linear', + showgrid: false, + zeroline: false + }, + yaxis: { + showticklabels: false, + tickmode: 'linear', + showgrid: false, + zeroline: false + }, + shapes: [{ + opacity: 0.3, + xref: 'x', + yref: 'y', + fillcolor: 'blue', + x0: 0, + y0: 0, + x1: 2, + y1: 2, + type: 'circle', + line: { + color: 'blue' + } + }, { + opacity: 0.3, + xref: 'x', + yref: 'y', + fillcolor: 'gray', + x0: 1.5, + y0: 0, + x1: 3.5, + y1: 2, + type: 'circle', + line: { + color: 'gray' + } + }], + margin: { + l: 20, + r: 20, + b: 100 + }, + height: 500, + width: 500 +}; + +var data = [trace1]; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/sizing/automargin.html b/content/plotly_js/fundamentals/sizing/automargin.html new file mode 100644 index 00000000000..bdc997ece57 --- /dev/null +++ b/content/plotly_js/fundamentals/sizing/automargin.html @@ -0,0 +1,35 @@ +--- +name: Automatically Adjust Margins +language: plotly_js +suite: sizing +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + Set `automargin=true` ([reference](https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-automargin)) and Plotly will automatically increase the margin size to prevent ticklabels from being cut off or overlapping with axis titles. +--- +var data = [ + { + x: ['Apples', 'Oranges', 'Watermelon', 'Pears'], + y: [3, 2, 1, 4], + type: 'bar' + } +]; +var layout = { + autosize: false, + width: 500, + height: 500, + yaxis: { + title: { + text: 'Y-axis Title', + font: { size: 30 } + }, + ticktext: ['long label','Very long label','3','label'], + tickvals: [1, 2, 3, 4], + tickmode: 'array', + automargin: true, + }, + paper_bgcolor: '#7f7f7f', + plot_bgcolor: '#c7c7c7' +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/sizing/size-margins.html b/content/plotly_js/fundamentals/sizing/size-margins.html new file mode 100644 index 00000000000..a4fe3a92e19 --- /dev/null +++ b/content/plotly_js/fundamentals/sizing/size-margins.html @@ -0,0 +1,30 @@ +--- +name: Adjusting Height, Width, and Margins +language: plotly_js +suite: sizing +order: 0 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + type: 'scatter' + } +]; +var layout = { + autosize: false, + width: 500, + height: 500, + margin: { + l: 50, + r: 50, + b: 100, + t: 100, + pad: 4 + }, + paper_bgcolor: '#7f7f7f', + plot_bgcolor: '#c7c7c7' +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/sizing/sizing_plotly_js_index.html b/content/plotly_js/fundamentals/sizing/sizing_plotly_js_index.html new file mode 100644 index 00000000000..08130cb59b5 --- /dev/null +++ b/content/plotly_js/fundamentals/sizing/sizing_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to change the size of D3.js-based graphs in javascript. +display_as: file_settings +language: plotly_js +layout: base +name: Setting Graph Size +order: 21 +page_type: u-guide +permalink: javascript/setting-graph-size/ +redirect_from: javascript-graphing-library/setting-graph-size/ +thumbnail: thumbnail/multiple-axes.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","sizing" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/static-image-export/static-image.md b/content/plotly_js/fundamentals/static-image-export/static-image.md new file mode 100644 index 00000000000..94282aaadf8 --- /dev/null +++ b/content/plotly_js/fundamentals/static-image-export/static-image.md @@ -0,0 +1,71 @@ +--- +description: How to export graphs as static images in JavaScript. The Plotly JavaScript + graphing library supports `.jpg`, `.png`, and `.svg` as formats for static image + export. +display_as: file_settings +language: plotly_js +layout: base +name: Static Image Export +order: 25 +page_type: u-guide +permalink: javascript/static-image-export/ +sitemap: false +thumbnail: thumbnail/png-export.png +--- + +You can save graphs created with `plotly.js` to static images and view them in your browser. Consider the following example: + + var img_jpg= d3.select('#jpg-export'); + + // Plotting the Graph + + var trace={x:[3,9,8,10,4,6,5],y:[5,7,6,7,8,9,8],type:"scatter"}; + var trace1={x:[3,4,1,6,8,9,5],y:[4,2,5,2,1,7,3],type:"scatter"}; + var data = [trace,trace1]; + var layout = {title : "Simple JavaScript Graph"}; + Plotly.newPlot( + 'plotly_div', + data, + layout) + + // static image in jpg format + + .then( + function(gd) + { + Plotly.toImage(gd,{height:300,width:300}) + .then( + function(url) + { + img_jpg.attr("src", url); + } + ) + }); +To view this image in your page include following HTML tag: + + + +Height and width of the image can be adjusted by specifying the same in `toImage` call: + + Plotly.toImage( + gd,{ + format:'jpeg', + height:desired_height, + width:desired_width, + }); + +You can also save the image using different formats. + +# Formats Supported + +The common image formats: 'PNG', 'JPG/JPEG' are supported. In addition, formats like 'EPS', 'SVG' and 'PDF' are also available for user with a Personal or Professional subscription. You can get more details on our [pricing page] (https://plotly.com/products/cloud/) + +**Note:** It is important to note that any figures containing WebGL traces (i.e. of type scattergl, heatmapgl, contourgl, scatter3d, surface, mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that are exported in a vector format like SVG, EPS or PDF will include encapsulated rasters instead of vectors for some parts of the image. + +## Saving as PNG ## + img_png.attr("src", url); + Plotly.toImage(gd,{format:'png',height:400,width:400}); + +## Saving as SVG ## + img_svg.attr("src", url); + Plotly.toImage(gd,{format:'svg',height:800,width:800}); diff --git a/content/plotly_js/fundamentals/texttemplate/add_text_template.html b/content/plotly_js/fundamentals/texttemplate/add_text_template.html new file mode 100644 index 00000000000..867cda63d28 --- /dev/null +++ b/content/plotly_js/fundamentals/texttemplate/add_text_template.html @@ -0,0 +1,19 @@ +--- +name: Add Text Template in Pie Chart +language: plotly_js +suite: texttemplate +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + To show an arbitrary text in your chart you can use [texttemplate](https://plotly.com/javascript/reference/pie/#pie-texttemplate), which is a template string used for rendering the information, and will override [textinfo](https://plotly.com/javascript/reference/treemap/#treemap-textinfo). +--- +var data = [{ + type: "pie", + values: [2, 5, 3, 2.5], + labels: ["R", "Python", "Java Script", "Matlab"], + texttemplate: "%{label}: %{value} (%{percent})", + textposition: "inside" +}]; + +Plotly.newPlot("myDiv", data) diff --git a/content/plotly_js/fundamentals/texttemplate/customize_text_template.html b/content/plotly_js/fundamentals/texttemplate/customize_text_template.html new file mode 100644 index 00000000000..a085ac6b1a3 --- /dev/null +++ b/content/plotly_js/fundamentals/texttemplate/customize_text_template.html @@ -0,0 +1,23 @@ +--- +name: Customize Text Template +language: plotly_js +suite: texttemplate +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + The following example uses [textfont](https://plotly.com/javascript/reference/scatterternary/#scatterternary-textfont) to customize the added text. +--- +var data = [{ + type: "scatterternary", + a: [3, 2, 5], + b: [2, 5, 2], + c: [5, 2, 2], + mode: "markers+text", + text: ["A", "B", "C"], + texttemplate: "%{text}
(%{a:.2f}, %{b:.2f}, %{c:.2f})", + textposition: "bottom center", + textfont:{'family': "Times", 'size': [18, 21, 20], 'color': ["IndianRed", "MediumPurple", "DarkOrange"]} +}]; + +Plotly.newPlot("myDiv", data) diff --git a/content/plotly_js/fundamentals/texttemplate/date-in-text-template.html b/content/plotly_js/fundamentals/texttemplate/date-in-text-template.html new file mode 100644 index 00000000000..da531782f3a --- /dev/null +++ b/content/plotly_js/fundamentals/texttemplate/date-in-text-template.html @@ -0,0 +1,31 @@ +--- +name: Set Date in Text Template +language: plotly_js +suite: texttemplate +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + + The following example displays how to show date by setting [axis.type](https://plotly.com/javascript/reference/layout/yaxis/#layout-yaxis-type) in [funnel charts](https://plotly.com/javascript/funnel-charts/). +--- +var data = [{ + type: 'funnel', + name: 'Montreal', + orientation: "h", + y: ["2018-01-01", "2018-07-01", "2019-01-01", "2020-01-01"], + x: [100, 60, 40, 20], + textposition: "inside", + texttemplate: "%{label}" +},{ + type: "funnel", + name: 'Vancouver', + orientation: "h", + y: ["2018-01-01", "2018-07-01", "2019-01-01", "2020-01-01"], + x: [90, 70, 50, 10], + textposition: "inside", + textinfo: "label"}] + +var layout = {yaxis: {type: 'date'}} + +Plotly.newPlot("myDiv", data, layout) diff --git a/content/plotly_js/fundamentals/texttemplate/texttemplate_plotly_js_index.html b/content/plotly_js/fundamentals/texttemplate/texttemplate_plotly_js_index.html new file mode 100644 index 00000000000..9b16a1b2580 --- /dev/null +++ b/content/plotly_js/fundamentals/texttemplate/texttemplate_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to use D3.js-based text template in Plotly.js. +display_as: file_settings +has_thumbnail: true +language: plotly_js +layout: base +name: Text Template +order: 24 +page_type: u-guide +permalink: javascript/texttemplate/ +thumbnail: thumbnail/texttemplate.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","texttemplate" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/tick-format/array-tickmode.html b/content/plotly_js/fundamentals/tick-format/array-tickmode.html new file mode 100644 index 00000000000..2f5211293be --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/array-tickmode.html @@ -0,0 +1,25 @@ +--- +name: Tickmode - Array +language: plotly_js +suite: tick-formatting +order: 1.5 +sitemap: false +arrangement: horizontal +--- + +var x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; +var y = [28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9]; +var data = [{ + x: x, + y: y, + type: 'scatter' +}]; +var layout = { + xaxis: { + tickmode: "array", // If "array", the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. + tickvals: [1, 3, 5, 7, 9, 11], + ticktext: ['One', 'Three', 'Five', 'Seven', 'Nine', 'Eleven'] + } +} + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/tick-format/how-to-tick-format-layout.html b/content/plotly_js/fundamentals/tick-format/how-to-tick-format-layout.html new file mode 100644 index 00000000000..4c4254926bb --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/how-to-tick-format-layout.html @@ -0,0 +1,58 @@ +--- +name: Layout Attributes with respect to Formatting Ticks +language: plotly_js +suite: tick-formatting +sitemap: false +arrangement: horizontal +order: 0 +--- + + + +{ + xaxis: { + /* show/hide tick labels (defaults to true) */ + showticklabels: boolean, + /* Set the tick mode for the axis "auto" or "linear" or "array" */ + tickmode: 'auto', + + /* Set the placement of the first tick*/ + tick0: '', + /* Set the step in-between ticks*/ + dtick: '', + /* Specifies the maximum number of ticks */ + nticks: 0, + + /* Set the values at which ticks on this axis appear */ + tickvals: [ /* */ ], + /* Set the text displayed at the ticks position via tickvals */ + ticktext: [ /* */ ], + /* Set the source reference for tickvals */ + tickvalssrc: '', + /* Set the source reference for ticktext */ + tickvtextsrc: '', + + /* Set the tick label formatting rule using d3 formatting mini-languages */ + tickformat: '', + /* Set the tickformat per zoom level */ + tickformatstops: { + enabled: true, + /* Set the range of the dtick values which describe the zoom level, it is possible to omit "min" or "max" value by passing "null" */ + dtickrange: ["min", "max"], + /* dtickformat for described zoom level, the same as "tickformat" */ + value: string, + }, + + /* Set the ticks to display with a prefix: "all" or "first" or "last" or "none" */ + showtickprefix: 'all', + tickprefix: string, + + /* Set the ticks to display with a suffix: "all" or "first" or "last" or "none" */ + showticksuffix: 'all', + ticksuffix: string, + + /* Determines a formatting rule for the tick exponents: "none" or "e" or "E" or "power" or "SI" or "B" */ + exponentformat: 'B', + } + /* similarly for yaxis */ +} diff --git a/content/plotly_js/fundamentals/tick-format/how-to-tick-format_index.html b/content/plotly_js/fundamentals/tick-format/how-to-tick-format_index.html new file mode 100644 index 00000000000..2b43f4a7be0 --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/how-to-tick-format_index.html @@ -0,0 +1,15 @@ +--- +arrangement: horizontal +description: How to format axes ticks in D3.js-based JavaScript charts. +display_as: file_settings +language: plotly_js +layout: base +name: Formatting Ticks +order: 22 +page_type: u-guide +permalink: javascript/tick-formatting/ +thumbnail: thumbnail/hover.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","tick-formatting" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/tick-format/include-fr-locale.html b/content/plotly_js/fundamentals/tick-format/include-fr-locale.html new file mode 100644 index 00000000000..e4f770e8b49 --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/include-fr-locale.html @@ -0,0 +1,25 @@ +--- +name: Include Locale Config +language: plotly_js +suite: tick-formatting +order: 4.0 +sitemap: false +arrangement: horizontal +--- + +var x = ['2013-02-04', '2013-04-05', '2013-06-06', '2013-08-07', '2013-10-02']; +var y = [1, 4, 3, 6, 2]; +var data = [{ + x: x, + y: y, + type: 'scatter' +}]; +var layout = { + xaxis: { + tickformat: '%a %e %b \n %Y' + } +} + +Plotly.newPlot('myDiv', data, layout, { + locale: 'fr' // For more info, see: https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization and https://github.com/plotly/plotly.js/tree/master/dist +}); diff --git a/content/plotly_js/fundamentals/tick-format/linear(date)-tickmode.html b/content/plotly_js/fundamentals/tick-format/linear(date)-tickmode.html new file mode 100644 index 00000000000..fbc527bbe2f --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/linear(date)-tickmode.html @@ -0,0 +1,25 @@ +--- +name: Tickmode - Linear (Date) +language: plotly_js +suite: tick-formatting +order: 1 +sitemap: false +arrangement: horizontal +--- + +var x = ['2000-01', '2000-02', '2000-03', '2000-04', '2000-05', '2000-06', '2000-07', '2000-08', '2000-09', '2000-10', '2000-11', '2000-12', '2001-01']; +var y = [-36.5, -26.6, -43.6, -52.3, -71.5, -81.4, -80.5, -82.2, -76, -67.3, -46.1, -35, -40]; +var data = [{ + x: x, + y: y, + type: 'scatter' +}]; +var layout = { + xaxis: { + tickmode: "linear", // If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` + tick0: '1999-12-15', + dtick: 30 * 24 * 60 * 60 * 1000 // milliseconds + } +} + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/tick-format/linear-tickmode.html b/content/plotly_js/fundamentals/tick-format/linear-tickmode.html new file mode 100644 index 00000000000..2d06b7f8a0f --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/linear-tickmode.html @@ -0,0 +1,25 @@ +--- +name: Tickmode - Linear +language: plotly_js +suite: tick-formatting +order: 0.5 +sitemap: false +arrangement: horizontal +--- + +var x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; +var y = [28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9]; +var data = [{ + x: x, + y: y, + type: 'scatter' +}]; +var layout = { + xaxis: { + tickmode: "linear", // If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` + tick0: 0.5, + dtick: 0.75 + } +} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/fundamentals/tick-format/tickformatstops.html b/content/plotly_js/fundamentals/tick-format/tickformatstops.html new file mode 100644 index 00000000000..834967f68cd --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/tickformatstops.html @@ -0,0 +1,57 @@ +--- +name: Tickformatstops to customize for different zoom levels +language: plotly_js +suite: tick-formatting +order: 2.75 +sitemap: false +arrangement: horizontal +--- + +var gd = document.getElementById('myDiv'); +var x = ["2005-01", "2005-02", "2005-03", "2005-04", "2005-05", "2005-06", "2005-07"]; +var y = [-20, 10, -5, 0, 5, -10, 20]; +var data = [{ + x: x, + y: y, + type: 'scatter' +}]; +var layout = { + xaxis: { + tickformatstops: [{ + "dtickrange": [null, 1000], + "value": "%H:%M:%S.%L ms" + }, + { + "dtickrange": [1000, 60000], + "value": "%H:%M:%S s" + }, + { + "dtickrange": [60000, 3600000], + "value": "%H:%M m" + }, + { + "dtickrange": [3600000, 86400000], + "value": "%H:%M h" + }, + { + "dtickrange": [86400000, 604800000], + "value": "%e. %b d" + }, + { + "dtickrange": [604800000, "M1"], + "value": "%e. %b w" + }, + { + "dtickrange": ["M1", "M12"], + "value": "%b '%y M" + }, + { + "dtickrange": ["M12", null], + "value": "%Y Y" + } + ] + } +}; + +Plotly.newPlot("myDiv", data, layout); + diff --git a/content/plotly_js/fundamentals/tick-format/using-exponentformat.html b/content/plotly_js/fundamentals/tick-format/using-exponentformat.html new file mode 100644 index 00000000000..da475cbf87f --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/using-exponentformat.html @@ -0,0 +1,24 @@ +--- +name: Using Exponentformat +language: plotly_js +suite: tick-formatting +order: 3.0 +sitemap: false +arrangement: horizontal +--- + +var x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; +var y = [68000, 52000, 60000, 20000, 95000, 40000, 60000, 79000, 74000, 42000, 20000, 90000]; +var data = [{ + x: x, + y: y, + type: 'scatter' +}]; +var layout = { + yaxis: { + showexponent: 'all', + exponentformat: 'e' + } +} + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/tick-format/using-tickformat(date).html b/content/plotly_js/fundamentals/tick-format/using-tickformat(date).html new file mode 100644 index 00000000000..f726a4e9fce --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/using-tickformat(date).html @@ -0,0 +1,53 @@ +--- +name: Using Tickformat (Date) +language: plotly_js +suite: tick-formatting +order: 2.5 +sitemap: false +arrangement: horizontal +--- + + + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function (err, rows) { + + function unpack(rows, key) { + return rows.map(function (row) { + return row[key]; + }); + } + + + var trace1 = { + type: "scatter", + mode: "lines", + name: 'AAPL High', + x: unpack(rows, 'Date'), + y: unpack(rows, 'AAPL.High'), + line: { + color: '#17BECF' + } + } + + var trace2 = { + type: "scatter", + mode: "lines", + name: 'AAPL Low', + x: unpack(rows, 'Date'), + y: unpack(rows, 'AAPL.Low'), + line: { + color: '#7F7F7F' + } + } + + var data = [trace1, trace2]; + + var layout = { + title: {text: 'Time series with custom tickformat'}, + xaxis: { + tickformat: '%d %B (%a)\n %Y' // For more time formatting types, see: https://github.com/d3/d3-time-format/blob/master/README.md + } + }; + + Plotly.newPlot('myDiv', data, layout); +}) diff --git a/content/plotly_js/fundamentals/tick-format/using-tickformat.html b/content/plotly_js/fundamentals/tick-format/using-tickformat.html new file mode 100644 index 00000000000..bc65b70cff2 --- /dev/null +++ b/content/plotly_js/fundamentals/tick-format/using-tickformat.html @@ -0,0 +1,23 @@ +--- +name: Using Tickformat +language: plotly_js +suite: tick-formatting +order: 2.0 +sitemap: false +arrangement: horizontal +--- + +var x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; +var y = [0.18, 0.38, 0.56, 0.46, 0.59, 0.4, 0.78, 0.77, 0.74, 0.42, 0.45, 0.39]; +var data = [{ + x: x, + y: y, + type: 'scatter' +}]; +var layout = { + yaxis: { + tickformat: '%' // For more formatting types, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format + } +} + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/fundamentals/uirevision/uirevision-index.html b/content/plotly_js/fundamentals/uirevision/uirevision-index.html new file mode 100644 index 00000000000..ae70e4898c3 --- /dev/null +++ b/content/plotly_js/fundamentals/uirevision/uirevision-index.html @@ -0,0 +1,14 @@ +--- +description: Persist user interactions using uirevision with Plotly.react or Dash. +display_as: file_settings +language: plotly_js +layout: base +name: uirevision in Plotly.react +order: 3 +page_type: example_index +permalink: javascript/uirevision/ +thumbnail: thumbnail/uirevision.gif +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","uirevision" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/fundamentals/uirevision/uirevision-persist.html b/content/plotly_js/fundamentals/uirevision/uirevision-persist.html new file mode 100644 index 00000000000..12bd05db9e7 --- /dev/null +++ b/content/plotly_js/fundamentals/uirevision/uirevision-persist.html @@ -0,0 +1,53 @@ +--- +arrangement: horizontal +language: plotly_js +markdown_content: 'Adding a `uirevision` attribute and then keeping it the same during + the next call to Plotly.react ensures that user + + interactions persist. + + ' +name: Persist User Changes +order: 1 +plot_url: https://codepen.io/plotly/embed/ebMJEW/?height=550&theme-id=15263&default-tab=result +sitemap: false +suite: uirevision +--- + +const rand = () => Math.random(); +var x = [1, 2, 3, 4, 5]; +const new_data = (trace) => Object.assign(trace, {y: x.map(rand)}); + +// add random data to three line traces +var data = [ + {mode:'lines', line: {color: "#b55400"}}, + {mode: 'lines', line: {color: "#393e46"}}, + {mode: 'lines', line: {color: "#222831"}} +].map(new_data); + +var layout = { + title: {text: 'User Zoom Persists
When uirevision Unchanged'}, + uirevision:'true', + xaxis: {autorange: true}, + yaxis: {autorange: true} +}; + +Plotly.react('myDiv', data, layout); + +var myPlot = document.getElementById('myDiv'); + +var cnt = 0; +var interval = setInterval(function() { + data = data.map(new_data); + + // user interaction will mutate layout and set autorange to false + // so we need to reset it to true + layout.xaxis.autorange = true; + layout.yaxis.autorange = true; + + // not changing uirevision will ensure that user interactions are unchanged + // layout.uirevision = rand(); + + Plotly.react('myDiv', data, layout); + if(cnt === 100) clearInterval(interval); +}, 2500); diff --git a/content/plotly_js/fundamentals/uirevision/uirevision-reset.html b/content/plotly_js/fundamentals/uirevision/uirevision-reset.html new file mode 100644 index 00000000000..eddee1a31e3 --- /dev/null +++ b/content/plotly_js/fundamentals/uirevision/uirevision-reset.html @@ -0,0 +1,52 @@ +--- +arrangement: horizontal +language: plotly_js +markdown_content: 'Changing the `uirevision` attribute during a Plotly.react call + will reset previous user interactions in the updated plot. + + ' +name: Reset User Changes +order: 2 +plot_url: https://codepen.io/plotly/embed/REMrgv/?height=550&theme-id=15263&default-tab=result +sitemap: false +suite: uirevision +--- + +const rand = () => Math.random(); +var x = [1, 2, 3, 4, 5]; +const new_data = (trace) => Object.assign(trace, {y: x.map(rand)}); + +// add random data to three line traces +var data = [ + {mode:'lines', line: {color: "#b55400"}}, + {mode: 'lines', line: {color: "#393e46"}}, + {mode: 'lines', line: {color: "#222831"}} +].map(new_data); + +var layout = { + title: {text: 'User Zoom Resets
When uirevision Changes'}, + uirevision:'true', + xaxis: {autorange: true}, + yaxis: {autorange: true} +}; + +Plotly.react('myDiv', data, layout); + +var myPlot = document.getElementById('myDiv'); + +var cnt = 0; +var interval = setInterval(function() { + data = data.map(new_data); + + // user interaction will mutate layout and set autorange to false + // so we need to reset it to true + layout.xaxis.autorange = true; + layout.yaxis.autorange = true; + + // a new random number should ensure that uirevision will be different + // and so the graph will autorange after the Plotly.react + layout.uirevision = rand(); + + Plotly.react('myDiv', data, layout); + if(cnt === 100) clearInterval(interval); +}, 2500); \ No newline at end of file diff --git a/content/plotly_js/maps/bubble-maps/USA-bubble-map.html b/content/plotly_js/maps/bubble-maps/USA-bubble-map.html new file mode 100644 index 00000000000..3ee9eae6601 --- /dev/null +++ b/content/plotly_js/maps/bubble-maps/USA-bubble-map.html @@ -0,0 +1,66 @@ +--- +name: USA Bubble Map +language: plotly_js +suite: bubble-maps +order: 2 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_us_cities.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var cityName = unpack(rows, 'name'), + cityPop = unpack(rows, 'pop'), + cityLat = unpack(rows, 'lat'), + cityLon = unpack(rows, 'lon'), + color = [,"rgb(255,65,54)","rgb(133,20,75)","rgb(255,133,27)","lightgrey"], + citySize = [], + hoverText = [], + scale = 50000; + + for ( var i = 0 ; i < cityPop.length; i++) { + var currentSize = cityPop[i] / scale; + var currentText = cityName[i] + " pop: " + cityPop[i]; + citySize.push(currentSize); + hoverText.push(currentText); + } + + var data = [{ + type: 'scattergeo', + locationmode: 'USA-states', + lat: cityLat, + lon: cityLon, + hoverinfo: 'text', + text: hoverText, + marker: { + size: citySize, + line: { + color: 'black', + width: 2 + }, + } + }]; + + var layout = { + title: {text: '2014 US City Populations'}, + showlegend: false, + geo: { + 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)' + }, + }; + + Plotly.newPlot("myDiv", data, layout, {showLink: false}); + +}); diff --git a/content/plotly_js/maps/bubble-maps/bubble-map.html b/content/plotly_js/maps/bubble-maps/bubble-map.html new file mode 100644 index 00000000000..42144cbe1ab --- /dev/null +++ b/content/plotly_js/maps/bubble-maps/bubble-map.html @@ -0,0 +1,39 @@ +--- +name: Europe Bubble Map +language: plotly_js +suite: bubble-maps +order: 1 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + type: 'scattergeo', + mode: 'markers', + locations: ['FRA', 'DEU', 'RUS', 'ESP'], + marker: { + size: [20, 30, 15, 10], + color: [10, 20, 40, 50], + cmin: 0, + cmax: 50, + colorscale: 'Greens', + colorbar: { + title: {text: 'Some rate'}, + ticksuffix: '%', + showticksuffix: 'last' + }, + line: { + color: 'black' + } + }, + name: 'europe data' +}]; + +var layout = { + 'geo': { + 'scope': 'europe', + 'resolution': 50 + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/maps/bubble-maps/bubble_maps_plotlyjs_index.html b/content/plotly_js/maps/bubble-maps/bubble_maps_plotlyjs_index.html new file mode 100644 index 00000000000..2effd407915 --- /dev/null +++ b/content/plotly_js/maps/bubble-maps/bubble_maps_plotlyjs_index.html @@ -0,0 +1,16 @@ +--- +description: How to make a D3.js-based bubble map in JavaScript. A bubble map overlays + a bubble chart on a map. +display_as: maps +language: plotly_js +layout: base +name: Bubble Maps +order: 6 +page_type: example_index +permalink: javascript/bubble-maps/ +redirect_from: javascript-graphing-library/bubble-maps/ +thumbnail: thumbnail/bubble-map.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","bubble-maps" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/choropleth-mapbox/US_states.html b/content/plotly_js/maps/choropleth-mapbox/US_states.html new file mode 100644 index 00000000000..b87485c7ab3 --- /dev/null +++ b/content/plotly_js/maps/choropleth-mapbox/US_states.html @@ -0,0 +1,20 @@ +--- +name: Dark tile +language: plotly_js +suite: tile-county-choropleth +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + This example uses [zmin and zmax](https://plotly.com/javascript/reference/choroplethmap/#choroplethmap-zmin) to define the lower bound and upper bound of the color domain. If these attributes are not set, Plotly [determines the color domain](https://plotly.com/javascript/reference/heatmap/#heatmap-zauto) based on the input data. +--- + +var data = [{ + type: "choroplethmap", name: "US states", geojson: "https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json", locations: [ "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY" ], +z: [ 141, 140, 155, 147, 132, 146, 151, 137, 146, 136, 145, 141, 149, 151, 138, 158, 164, 141, 146, 145, 142, 150, 155, 160, 156, 161, 147, 164, 150, 152, 155, 167, 145, 146, 151, 154, 161, 145, 155, 150, 151, 162, 172, 169, 170, 151, 152, 173, 160, 176 ], +zmin: 25, zmax: 280, colorbar: {y: 0, yanchor: "bottom", title: {text: "US states", side: "right"}}} + ]; + +var layout = {map: {style: "dark", center: {lon: -110, lat: 50}, zoom: 0.8}, width: 600, height: 400, margin: {t: 0, b: 0}}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/maps/choropleth-mapbox/basic-choropleth1.html b/content/plotly_js/maps/choropleth-mapbox/basic-choropleth1.html new file mode 100644 index 00000000000..4dd495c25f1 --- /dev/null +++ b/content/plotly_js/maps/choropleth-mapbox/basic-choropleth1.html @@ -0,0 +1,21 @@ +--- +name: Basic Tile +language: plotly_js +suite: tile-county-choropleth +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + + This tutorial uses [Maplibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) to make a map of US states using [vector tiles](https://plotly.com/javascript/map-layers/). +--- + +var data = [{ + type: "choroplethmap", locations: ["NY", "MA", "VT"], z: [-50, -10, -20], + geojson: "https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json" +}]; + +var layout = {map: {center: {lon: -74, lat: 43}, zoom: 3.5}, + width: 600, height:400}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/maps/choropleth-mapbox/basic-mapbox.html b/content/plotly_js/maps/choropleth-mapbox/basic-mapbox.html new file mode 100644 index 00000000000..0df34d16597 --- /dev/null +++ b/content/plotly_js/maps/choropleth-mapbox/basic-mapbox.html @@ -0,0 +1,27 @@ +--- +name: Basic Tile using Mapbox +language: plotly_js +suite: tile-county-choropleth +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + + > Mapbox traces are deprecated and may be removed in a future version of Plotly.js. + + Earlier examples use traces that render with [Maplibre GL JS](https://maplibre.org/maplibre-gl-js/docs/). + These traces were introduced in Plotly.js 2.35.0 and replace Mapbox-based tile maps, + which are now deprecated. Here's one of the earlier examples using the Mapbox-based `choroplethmapbox` trace +--- + +var data = [{ + type: "choroplethmapbox", locations: ["NY", "MA", "VT"], z: [-50, -10, -20], + geojson: "https://raw.githubusercontent.com/python-visualization/folium/master/examples/data/us-states.json" +}]; + +var layout = {mapbox: {center: {lon: -74, lat: 43}, zoom: 3.5}, + width: 600, height:400}; + +var config = {mapboxAccessToken: "your access token"}; + +Plotly.newPlot('myDiv', data, layout, config); \ No newline at end of file diff --git a/content/plotly_js/maps/choropleth-mapbox/choropleth-geojson-object.html b/content/plotly_js/maps/choropleth-mapbox/choropleth-geojson-object.html new file mode 100644 index 00000000000..b95fc9463a3 --- /dev/null +++ b/content/plotly_js/maps/choropleth-mapbox/choropleth-geojson-object.html @@ -0,0 +1,26 @@ +--- +name: Streets Tile +language: plotly_js +suite: tile-county-choropleth +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + + The following example sets `geojson object` of type `feature` and geometries of type 'Polygon'. For more information see [geojson attribute](https://plotly.com/javascript/reference/choroplethmap/#choroplethmap-geojson) in the reference page. + As you see, the scattermap trace is above the Choropleth map trace. To set the Choropleth map trace above all the other traces you should set [below attribute](https://plotly.com/javascript/reference/choroplethmap/#choroplethmap-below). +--- +var data = [ + {type: "scattermap", lon: [-86], lat: [34], marker: {size: 20, color: 'purple'}}, + { + type: "choroplethmap",locations: ["AL"], z: [10], coloraxis: "coloraxis", geojson: {type: "Feature", id: "AL", geometry: {type: "Polygon", coordinates: [[ + [-86, 35], [-85, 34], [-85, 32], [-85, 32], [-85, 32], [-85, 32], [-85, 31], + [-86, 31], [-87, 31], [-87, 31], [-88, 30], [-88, 30], [-88, 30], [-88, 30], + [-88, 34], [-88, 35]]] + }}}]; + +var layout = {width: 600, height: 400, map: {style: 'streets', + center: {lon: -86, lat: 33}, zoom: 5}, marker: {line: {color: "blue"}}, + coloraxis: {showscale: false, colorscale: "Viridis"}}; + +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/maps/choropleth-mapbox/choropleth_plotly_js_index.html b/content/plotly_js/maps/choropleth-mapbox/choropleth_plotly_js_index.html new file mode 100644 index 00000000000..e759a0652c3 --- /dev/null +++ b/content/plotly_js/maps/choropleth-mapbox/choropleth_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make a tile-based choropleth map in JavaScript. A Choropleth map shades geographic regions by value. +display_as: maps +language: plotly_js +layout: base +name: Choropleth Tile Map +order: 4 +page_type: example_index +permalink: javascript/tile-county-choropleth/ +redirect_from: javascript/mapbox-county-choropleth/ +thumbnail: thumbnail/mapbox-choropleth.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","tile-county-choropleth" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/choropleth-maps/US-pop-by-state-choropleth.html b/content/plotly_js/maps/choropleth-maps/US-pop-by-state-choropleth.html new file mode 100644 index 00000000000..dc4755bcf4b --- /dev/null +++ b/content/plotly_js/maps/choropleth-maps/US-pop-by-state-choropleth.html @@ -0,0 +1,38 @@ +--- +name: Choropleth Map of 2014 US Population by State +language: plotly_js +suite: choropleth-maps +order: 5 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_usa_states.csv', function(err, rows){ + function unpack(rows, key) { +return rows.map(function(row) { return row[key]; }); +} +var data = [{ + type: 'choropleth', + locationmode: 'USA-states', + locations: unpack(rows, 'Postal'), + z: unpack(rows, 'Population'), + text: unpack(rows, 'State'), + autocolorscale: true +}]; + +var layout = { +title: {text: '2014 US Popultaion by State'}, + geo:{ + scope: 'usa', + countrycolor: 'rgb(255, 255, 255)', + showland: true, + landcolor: 'rgb(217, 217, 217)', + showlakes: true, + lakecolor: 'rgb(255, 255, 255)', + subunitcolor: 'rgb(255, 255, 255)', + lonaxis: {}, + lataxis: {} + } +}; +Plotly.newPlot("myDiv", data, layout, {showLink: false}); +}); diff --git a/content/plotly_js/maps/choropleth-maps/choropleth-north-america.html b/content/plotly_js/maps/choropleth-maps/choropleth-north-america.html new file mode 100644 index 00000000000..c776d3660f4 --- /dev/null +++ b/content/plotly_js/maps/choropleth-maps/choropleth-north-america.html @@ -0,0 +1,51 @@ +--- +name: USA Choropleth Map +language: plotly_js +suite: choropleth-maps +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_us_ag_exports.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var data = [{ + type: 'choropleth', + locationmode: 'USA-states', + locations: unpack(rows, 'code'), + z: unpack(rows, 'total exports'), + text: unpack(rows, 'state'), + zmin: 0, + zmax: 17000, + colorscale: [ + [0, 'rgb(242,240,247)'], [0.2, 'rgb(218,218,235)'], + [0.4, 'rgb(188,189,220)'], [0.6, 'rgb(158,154,200)'], + [0.8, 'rgb(117,107,177)'], [1, 'rgb(84,39,143)'] + ], + colorbar: { + title: {text: 'Millions USD'}, + thickness: 0.2 + }, + marker: { + line:{ + color: 'rgb(255,255,255)', + width: 2 + } + } + }]; + + + var layout = { + title: {text: '2011 US Agriculture Exports by State'}, + geo:{ + scope: 'usa', + showlakes: true, + lakecolor: 'rgb(255,255,255)' + } + }; + + Plotly.newPlot("myDiv", data, layout, {showLink: false}); +}); diff --git a/content/plotly_js/maps/choropleth-maps/choropleth-world-robinson.html b/content/plotly_js/maps/choropleth-maps/choropleth-world-robinson.html new file mode 100644 index 00000000000..1035bb8550a --- /dev/null +++ b/content/plotly_js/maps/choropleth-maps/choropleth-world-robinson.html @@ -0,0 +1,35 @@ +--- +name: World Choropleth Map (Robinson Projection) +language: plotly_js +suite: choropleth-maps +order: 1 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2010_alcohol_consumption_by_country.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var data = [{ + type: 'choropleth', + locationmode: 'country names', + locations: unpack(rows, 'location'), + z: unpack(rows, 'alcohol'), + text: unpack(rows, 'location'), + autocolorscale: true + }]; + + var layout = { + title: {text: 'Pure alcohol consumption
among adults (age 15+) in 2010'}, + geo: { + projection: { + type: 'robinson' + } + } + }; + + Plotly.newPlot("myDiv", data, layout, {showLink: false}); + +}); diff --git a/content/plotly_js/maps/choropleth-maps/choropleth_plotly_js_index.html b/content/plotly_js/maps/choropleth-maps/choropleth_plotly_js_index.html new file mode 100644 index 00000000000..60cce827f14 --- /dev/null +++ b/content/plotly_js/maps/choropleth-maps/choropleth_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make a D3.js-based choropleth map in JavaScript. A choropleth + map shades geographic regions by value. +display_as: maps +language: plotly_js +layout: base +name: Choropleth Maps +order: 9 +permalink: javascript/choropleth-maps/ +redirect_from: javascript-graphing-library/choropleth-maps/ +thumbnail: thumbnail/choropleth.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","choropleth-maps" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/choropleth-maps/countrygdp-choropleth-map.html b/content/plotly_js/maps/choropleth-maps/countrygdp-choropleth-map.html new file mode 100644 index 00000000000..a27603f18b8 --- /dev/null +++ b/content/plotly_js/maps/choropleth-maps/countrygdp-choropleth-map.html @@ -0,0 +1,53 @@ +--- +name: Country GDP Choropleth Map +language: plotly_js +suite: choropleth-maps +order: 4 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_world_gdp_with_codes.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var data = [{ + type: 'choropleth', + locations: unpack(rows, 'CODE'), + z: unpack(rows, 'GDP (BILLIONS)'), + text: unpack(rows, 'COUNTRY'), + colorscale: [ + [0,'rgb(5, 10, 172)'],[0.35,'rgb(40, 60, 190)'], + [0.5,'rgb(70, 100, 245)'], [0.6,'rgb(90, 120, 245)'], + [0.7,'rgb(106, 137, 247)'],[1,'rgb(220, 220, 220)']], + autocolorscale: false, + reversescale: true, + marker: { + line: { + color: 'rgb(180,180,180)', + width: 0.5 + } + }, + tick0: 0, + zmin: 0, + dtick: 1000, + colorbar: { + autotic: false, + tickprefix: '$', + title: {text: 'GDP
Billions US$'} + } + }]; + + var layout = { + title: {text: '2014 Global GDP
Source: CIA World Factbook'}, + geo:{ + showframe: false, + showcoastlines: false, + projection:{ + type: 'mercator' + } + } + }; + Plotly.newPlot("myDiv", data, layout, {showLink: false}); +}); diff --git a/content/plotly_js/maps/choropleth-maps/florida-counties.html b/content/plotly_js/maps/choropleth-maps/florida-counties.html new file mode 100644 index 00000000000..9ea84a72715 --- /dev/null +++ b/content/plotly_js/maps/choropleth-maps/florida-counties.html @@ -0,0 +1,49 @@ +--- +name: Choropleth Map of Florida Counties Colored by Political Party +language: plotly_js +suite: choropleth-maps +order: 6 +sitemap: false +arrangement: horizontal +--- + +d3.json('https://raw.githubusercontent.com/plotly/datasets/master/florida-red-data.json', function(redjson) { + + d3.json('https://raw.githubusercontent.com/plotly/datasets/master/florida-blue-data.json', function(bluejson) { + + Plotly.newPlot('myDiv', [{ + type: 'scattermap', + lat: [46], + lon: [-74] + }], { + title: {text: "Florida Counties"}, + height: 600, + width: 600, + map: { + center: { + lat: 28, + lon: -84 + }, + style: 'light', + zoom: 4.8, + layers: [ + { + sourcetype: 'geojson', + source: redjson, + type: 'fill', + color: 'rgba(163,22,19,0.8)' + }, + { + sourcetype: 'geojson', + source: bluejson, + type: 'fill', + color: 'rgba(40,0,113,0.8)' + }, + ] + } + }); + + +}); + +}); diff --git a/content/plotly_js/maps/density-mapbox/basic_density_mapbox.html b/content/plotly_js/maps/density-mapbox/basic_density_mapbox.html new file mode 100644 index 00000000000..6c168a37133 --- /dev/null +++ b/content/plotly_js/maps/density-mapbox/basic_density_mapbox.html @@ -0,0 +1,17 @@ +--- +name: Stamen Terrain Tile +language: plotly_js +suite: tile-density-heatmaps +order: 5 +sitemap: false +layout: base +arrangement: horizontal +markdown_content: | + + +--- +var data = [{type: 'densitymapbox', lon: [10, 20, 30], lat: [15, 25, 35], z: [1, 3, 2]}]; + +var layout = {width: 600, height: 400, mapbox: {style: 'https://tiles.stadiamaps.com/styles/stamen_watercolor.json?api_key=YOUR-API-KEY'}}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/maps/density-mapbox/density_plotly_js_index.html b/content/plotly_js/maps/density-mapbox/density_plotly_js_index.html new file mode 100644 index 00000000000..7bc025f8819 --- /dev/null +++ b/content/plotly_js/maps/density-mapbox/density_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make a tile-based density heatmap in JavaScript. A density heatmap + uses a variable binding expression to display population density. +display_as: maps +language: plotly_js +layout: base +name: Tile Density Heatmap +order: 3 +page_type: example_index +permalink: javascript/tile-density-heatmaps/ +redirect_from: javascript/mapbox-density-heatmaps/ +thumbnail: thumbnail/mapbox-density.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","tile-density-heatmaps" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/density-mapbox/earthquack_density.html b/content/plotly_js/maps/density-mapbox/earthquack_density.html new file mode 100644 index 00000000000..f5aae9ac2b0 --- /dev/null +++ b/content/plotly_js/maps/density-mapbox/earthquack_density.html @@ -0,0 +1,26 @@ +--- +name: Outdoors Tile +language: plotly_js +layout: base +suite: tile-density-heatmaps +order: 3 +sitemap: false +arrangement: horizontal + +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/earthquakes-23k.csv', + function(err, rows){function unpack(rows, key) {return rows.map(function(row){ return row[key]; +})}; + +var data = [{ + lon: unpack(rows, 'Longitude'), lat: unpack(rows, 'Latitude'), radius:10, + z: unpack(rows, 'Magnitude'), type: "densitymap", coloraxis: 'coloraxis', + hoverinfo: 'skip'}]; + +var layout = { + map: {center: {lon: 60, lat: 30}, style: "outdoors", zoom: 2}, + coloraxis: {colorscale: "Viridis"}, title: {text: "Earthquake Magnitude"}, + width: 600, height: 400, margin: {t: 30, b: 0}}; + +Plotly.newPlot('myDiv', data, layout); +}) diff --git a/content/plotly_js/maps/density-mapbox/light-tile-mapbox.html b/content/plotly_js/maps/density-mapbox/light-tile-mapbox.html new file mode 100644 index 00000000000..ed0cd357636 --- /dev/null +++ b/content/plotly_js/maps/density-mapbox/light-tile-mapbox.html @@ -0,0 +1,27 @@ +--- +name: Light Tile (Mapbox) - Requires Token +language: plotly_js +layout: base +suite: tile-density-heatmaps +order: 7 +sitemap: false +arrangement: horizontal +markdown_content: | + **Mapbox traces are deprecated and may be removed in a future version of Plotly.js.** + + Earlier examples use traces that render with [Maplibre GL JS](https://maplibre.org/maplibre-gl-js/docs/). + These traces were introduced in Plotly.js 2.35.0 and replace Mapbox-based tile maps, + which are now deprecated. Here's one of the earlier examples written using the Mapbox-based `densitymapbox` trace. +--- +var data = [ + {type: "densitymapbox", lon: [10, 20, 30], lat: [15, 25, 35], z: [1, 3, 2], + radius: 50, colorbar: {y: 1, yanchor: 'top', len: 0.45}}, + {type: 'densitymapbox', lon: [-10, -20, -30], lat: [15, 25, 35], + radius: [50, 100, 10], colorbar: {y: 0, yanchor: 'bottom', len: 0.45} + }]; + +var layout = {mapbox: {style: 'light', center: {lat: 20}}, width: 600, height: 400}; + +var config = {mapboxAccessToken: "your access token"}; + +Plotly.newPlot('myDiv', data, layout, config); diff --git a/content/plotly_js/maps/density-mapbox/multi_density-mapbox.html b/content/plotly_js/maps/density-mapbox/multi_density-mapbox.html new file mode 100644 index 00000000000..31023bc4249 --- /dev/null +++ b/content/plotly_js/maps/density-mapbox/multi_density-mapbox.html @@ -0,0 +1,20 @@ +--- +name: Light Tile +language: plotly_js +layout: base +suite: tile-density-heatmaps +order: 2 +sitemap: false +arrangement: horizontal + +--- +var data = [ + {type: "densitymap", lon: [10, 20, 30], lat: [15, 25, 35], z: [1, 3, 2], + radius: 50, colorbar: {y: 1, yanchor: 'top', len: 0.45}}, + {type: 'densitymap', lon: [-10, -20, -30], lat: [15, 25, 35], + radius: [50, 100, 10], colorbar: {y: 0, yanchor: 'bottom', len: 0.45} + }]; + +var layout = {map: {style: 'light', center: {lat: 20}}, width: 600, height: 400}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/maps/fill-area-on-mapbox/access-token.html b/content/plotly_js/maps/fill-area-on-mapbox/access-token.html new file mode 100644 index 00000000000..dd3da713df2 --- /dev/null +++ b/content/plotly_js/maps/fill-area-on-mapbox/access-token.html @@ -0,0 +1,39 @@ +--- +name: Overview +language: plotly_js +suite: filled-area-on-map +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + There are three different ways to show a filled area in a tile-based map. +
    +
  1. Use a [scattermap](https://plotly.com/javascript/reference/scattermap/) trace and set `fill` attribute to 'toself'
  2. +
  3. Use a map layout (i.e. by minimally using an empty Scattermap trace) and add a GeoJSON layer
  4. +
  5. Use the [Choroplethmap](https://plotly.com/javascript/map-county-choropleth/) trace type
  6. +
+
Filled `Scattermap` Trace
+ The following example uses `Scattermap` and sets `fill = 'toself'`. +--- +var data = [ + { + type: "scattermap", + fill: "toself", + lon: [-74, -70, -70, -74], + lat: [47, 47, 45, 45], + marker: { size: 10, color: "orange" } + } +]; + +var layout = { + map: { + style: "stamen-terrain", + center: { lon: -73, lat: 46 }, + zoom: 5 + }, + showlegend: false, + height: 450, + width: 600 +}; + +Plotly.newPlot("myDiv", data, layout); diff --git a/content/plotly_js/maps/fill-area-on-mapbox/fill-area_plotly_js_index.html b/content/plotly_js/maps/fill-area-on-mapbox/fill-area_plotly_js_index.html new file mode 100644 index 00000000000..2f563f4bf50 --- /dev/null +++ b/content/plotly_js/maps/fill-area-on-mapbox/fill-area_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make an area on Map using a D3.js-based scattermap. +display_as: maps +has_thumbnail: true +language: plotly_js +layout: base +name: Filled Area on Tile Maps +order: 10 +page_type: u-guide +permalink: javascript/filled-area-on-map/ +redirect_from: javascript/filled-area-on-mapbox/ +thumbnail: thumbnail/area.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","filled-area-on-map" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/fill-area-on-mapbox/geojson_layers.html b/content/plotly_js/maps/fill-area-on-mapbox/geojson_layers.html new file mode 100644 index 00000000000..c29ed77db76 --- /dev/null +++ b/content/plotly_js/maps/fill-area-on-mapbox/geojson_layers.html @@ -0,0 +1,57 @@ +--- +name: GeoJSON Layers +language: plotly_js +suite: filled-area-on-map +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + + This example shows an area below [water layer](https://plotly.com/javascript/reference/choroplethmap/#choroplethmap-below), and sets geojson object of type feature and geometries of type [MultiPolygon](https://plotly.com/javascript/reference/choroplethmap/#choroplethmap-geojson). +--- +var data = [{ + type: "scattermap", mode: "markers", + lon: [-73.605], lat: [45.51], + marker: { size: 20, color: ["cyan"] } + }]; + +var layout = { + map: { + style: "dark", + center: { lon: -73.6, lat: 45.515}, + zoom: 12, layers: [{ + source: { + type: "FeatureCollection", + features: [{ + type: "Feature", + geometry: { + type: "MultiPolygon", + coordinates: [[[ + [-73.606352888, 45.507489991], [-73.606133883, 45.50687600], + [-73.605905904, 45.506773980], [-73.603533905, 45.505698946], + [-73.602475870, 45.506856969], [-73.600031904, 45.505696003], + [-73.599379992, 45.505389066], [-73.599119902, 45.505632008], + [-73.598896977, 45.505514039], [-73.598783894, 45.505617001], + [-73.591308727, 45.516246185], [-73.591380782, 45.516280145], + [-73.596778656, 45.518690062], [-73.602796770, 45.521348046], + [-73.612239983, 45.525564037], [-73.612422919, 45.525642061], + [-73.617229085, 45.527751983], [-73.617279234, 45.527774160], + [-73.617304713, 45.527741334], [-73.617492052, 45.527498362], + [-73.617533258, 45.527512253], [-73.618074188, 45.526759105], + [-73.618271651, 45.526500673], [-73.618446320, 45.526287943], + [-73.618968507, 45.525698560], [-73.619388002, 45.525216750], + [-73.619532966, 45.525064183], [-73.619686662, 45.524889290], + [-73.619787038, 45.524770086], [-73.619925742, 45.524584939], + [-73.619954486, 45.524557690], [-73.620122362, 45.524377961], + [-73.620201713, 45.524298907], [-73.620775593, 45.523650879] + ]]] + } + }] + }, + type: "fill", below: "water", color: "teal" + }] + }, + height: 450, width: 700 +}; + +Plotly.newPlot("myDiv", data, layout); diff --git a/content/plotly_js/maps/fill-area-on-mapbox/multi-filled-area.html b/content/plotly_js/maps/fill-area-on-mapbox/multi-filled-area.html new file mode 100644 index 00000000000..600fa264ee2 --- /dev/null +++ b/content/plotly_js/maps/fill-area-on-mapbox/multi-filled-area.html @@ -0,0 +1,25 @@ +--- +name: Multiple Filled Areas with a Scattermap trace +language: plotly_js +suite: filled-area-on-map +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + + The following example shows how to use `null` in your data to draw multiple filled areas. Such gaps in trace data are unconnected by default, but this can be controlled via the [connectgaps](https://plotly.com/javascript/reference/scattermap/#scattermap-connectgaps) attribute. +--- +var data = [{ + type: "scattermap", + mode: "lines", + fill: "toself", + lon: [-10, -10, 8, 8, -10, null, 30, 30, 50, 50, 30, null, 100, 100, 80, 80, 100], + lat: [30, 6, 6, 30, 30, null, 20, 30, 30, 20, 20, null, 40, 50, 50, 40, 40] + }] + +var layout = { + map: {style: "stamen-terrain", center: {lon: 40, lat: 20}, 'zoom': 1.5}, + showlegend: false, + width:700, height: 700} + +Plotly.newPlot("myDiv", data, layout) diff --git a/content/plotly_js/maps/lines-on-maps/flightpath-london-to-nyc.html b/content/plotly_js/maps/lines-on-maps/flightpath-london-to-nyc.html new file mode 100644 index 00000000000..7c831309570 --- /dev/null +++ b/content/plotly_js/maps/lines-on-maps/flightpath-london-to-nyc.html @@ -0,0 +1,50 @@ +--- +name: London to NYC Great Circle +language: plotly_js +suite: lines-on-maps +order: 2 +sitemap: false +arrangement: horizontal +--- +var data = [{ + type: 'scattergeo', + lat: [ 40.7127, 51.5072 ], + lon: [ -74.0059, 0.1275 ], + mode: 'lines', + line:{ + width: 2, + color: 'blue' + } + }]; + +var layout = { + title: {text: 'London to NYC Great Circle'}, + showlegend: false, + geo: { + resolution: 50, + showland: true, + showlakes: true, + landcolor: 'rgb(204, 204, 204)', + countrycolor: 'rgb(204, 204, 204)', + lakecolor: 'rgb(255, 255, 255)', + projection: { + type: 'equirectangular' + }, + coastlinewidth: 2, + lataxis: { + range: [ 20, 60 ], + showgrid: true, + tickmode: 'linear', + dtick: 10 + }, + lonaxis:{ + range: [-100, 20], + showgrid: true, + tickmode: 'linear', + dtick: 20 + } + } +}; + +Plotly.newPlot('myDiv', data, layout); + diff --git a/content/plotly_js/maps/lines-on-maps/lines-on-orthographic.html b/content/plotly_js/maps/lines-on-maps/lines-on-orthographic.html new file mode 100644 index 00000000000..53767f2a271 --- /dev/null +++ b/content/plotly_js/maps/lines-on-maps/lines-on-orthographic.html @@ -0,0 +1,72 @@ +--- +name: Lines on an Orthographic Map +language: plotly_js +suite: lines-on-maps +order: 1 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/globe_contours.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var data = []; + var scl =['rgb(213,62,79)','rgb(244,109,67)','rgb(253,174,97)','rgb(254,224,139)','rgb(255,255,191)','rgb(230,245,152)','rgb(171,221,164)','rgb(102,194,165)','rgb(50,136,189)']; + var allLats = []; + var allLons = []; + + for ( var i = 0 ; i < scl.length; i++){ + var latHead = 'lat-'+i; + var lonHead = 'lon-'+i; + var lat = unpack(rows, latHead); + var lon = unpack(rows, lonHead); + allLats.push(lat); + allLons.push(lon); + } + + for ( var i = 0 ; i < scl.length; i++) { + var current = { + type:'scattergeo', + lon: allLons[i], + lat: allLats[i], + mode: 'lines', + line: { + width: 2, + color: scl[i] + } + } + data.push(current); + }; + + + var layout = { + geo: { + projection: { + type: 'orthographic', + rotation: { + lon: -100, + lat: 40 + }, + }, + showocean: true, + oceancolor: 'rgb(0, 255, 255)', + showland: true, + landcolor: 'rgb(230, 145, 56)', + showlakes: true, + lakecolor: 'rgb(0, 255, 255)', + showcountries: true, + lonaxis: { + showgrid: true, + gridcolor: 'rgb(102, 102, 102)' + }, + lataxis: { + showgrid: true, + gridcolor: 'rgb(102, 102, 102)' + } + } + }; + + Plotly.newPlot("myDiv", data, layout, {showLink: false}); +}); diff --git a/content/plotly_js/maps/lines-on-maps/lines_on_maps_plotly_js_index.html b/content/plotly_js/maps/lines-on-maps/lines_on_maps_plotly_js_index.html new file mode 100644 index 00000000000..b22ea5adaa4 --- /dev/null +++ b/content/plotly_js/maps/lines-on-maps/lines_on_maps_plotly_js_index.html @@ -0,0 +1,17 @@ +--- +description: How to draw D3.js-based lines, great circles, and contours on maps in + JavaScript. Lines on maps can show distance between geographic points or be contour + lines (isolines, isopleths, or isarithms). +display_as: maps +language: plotly_js +layout: base +name: Lines on Maps +order: 5 +page_type: example_index +permalink: javascript/lines-on-maps/ +redirect_from: javascript-graphing-library/lines-on-maps/ +thumbnail: thumbnail/flight-paths.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","lines-on-maps" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/lines-on-maps/us-flight-paths-map.html b/content/plotly_js/maps/lines-on-maps/us-flight-paths-map.html new file mode 100644 index 00000000000..153c32d5cd2 --- /dev/null +++ b/content/plotly_js/maps/lines-on-maps/us-flight-paths-map.html @@ -0,0 +1,59 @@ +--- +name: US Flight Paths Map +language: plotly_js +suite: lines-on-maps +order: 3 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/c34aaa0b1b3cddad335173cb7bc0181897201ee6/2011_february_aa_flight_paths.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; });} + + function getMaxOfArray(numArray) { + return Math.max.apply(null, numArray); + } + + var data = []; + var count = unpack(rows, 'cnt'); + var startLongitude = unpack(rows, 'start_lon'); + var endLongitude = unpack(rows, 'end_lon'); + var startLat = unpack(rows, 'start_lat'); + var endLat = unpack(rows, 'end_lat'); + + for ( var i = 0 ; i < count.length; i++ ) { + var opacityValue = count[i]/getMaxOfArray(count); + + var result = { + type: 'scattergeo', + locationmode: 'USA-states', + lon: [ startLongitude[i] , endLongitude[i] ], + lat: [ startLat[i] , endLat[i] ], + mode: 'lines', + line: { + width: 1, + color: 'red' + }, + opacity: opacityValue + }; + + data.push(result); + }; + + var layout = { + title: {text: 'Feb. 2011 American Airline flight paths'}, + showlegend: false, + geo:{ + scope: 'north america', + projection: { + type: 'azimuthal equal area' + }, + showland: true, + landcolor: 'rgb(243,243,243)', + countrycolor: 'rgb(204,204,204)' + } + }; + + Plotly.newPlot("myDiv", data, layout, {showLink: false}); + +}); diff --git a/content/plotly_js/maps/mapbox-layers/Open-street-map.html b/content/plotly_js/maps/mapbox-layers/Open-street-map.html new file mode 100644 index 00000000000..30569ab159e --- /dev/null +++ b/content/plotly_js/maps/mapbox-layers/Open-street-map.html @@ -0,0 +1,39 @@ +--- +name: OpenStreetMap tiles +language: plotly_js +suite: map-layers +order: 3 +sitemap: false +arrangement: horizontal +markdown_content: | + + Here is a simple map rendered with "open-street-map" tiles. +--- +d3.csv( + "https://raw.githubusercontent.com/plotly/datasets/master/2015_06_30_precipitation.csv", + function(err, rows) { + function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); + } + + var data = [ + { + type: "scattermap", + text: unpack(rows, "Globvalue"), + lon: unpack(rows, "Lon"), + lat: unpack(rows, "Lat"), + marker: { color: "fuchsia", size: 4 } + } + ]; + + var layout = { + dragmode: "zoom", + map: { style: "open-street-map", center: { lat: 38, lon: -90 }, zoom: 3 }, + margin: { r: 0, t: 0, b: 0, l: 0 } + }; + + Plotly.newPlot("myDiv", data, layout); + } +); diff --git a/content/plotly_js/maps/mapbox-layers/access-token.html b/content/plotly_js/maps/mapbox-layers/access-token.html new file mode 100644 index 00000000000..aa232bf04fe --- /dev/null +++ b/content/plotly_js/maps/mapbox-layers/access-token.html @@ -0,0 +1,29 @@ +--- +name: Mapbox Maps and Access Tokens +language: plotly_js +suite: map-layers +order: 10 +sitemap: false +arrangement: horizontal +markdown_content: | + + > Mapbox traces are deprecated and may be removed in a future version of Plotly.js. + + The word "mapbox" in the trace names and `layout.mapbox` refers to the Mapbox GL JS open-source library. + If your basemap in `layout.mapbox.style` uses data from the Mapbox *service*, + then you will need to register for a free account at https://mapbox.com/ and obtain a Mapbox Access token. + If your basemap uses data from the [Stadia Maps service](https://www.stadiamaps.com) (see below for details), you'll need to register for a Stadia Maps account and token. + + To use a token, provide it as `mapboxAccessToken` in the `setPlotConfig` function, or as a variable that would be passed as an argument of `newPlot`. + If your `layout.mapbox.style` does not use data from the Mapbox service, you do *not* need to register for a Mapbox account. +
Base Maps in `layout.mapbox.style`
+ The accepted values for `layout.mapbox.style` are one of the following tiles. +
    +
  1. `"white-bg"` yields an empty white canvas which results in no external HTTP requests
  2. +
  3. `"open-street-map"`, `"carto-positron"`, or `"carto-darkmatter"` yield maps composed of *raster* tiles from various public tile servers which do not require signups or access tokens
  4. +
  5. `"stamen-terrain"`, `"stamen-toner"` or `"stamen-watercolor"` yield maps composed of *raster* tiles from the [Stadia Maps service](https://stadiamaps.com/) and require a Stadia Maps account and token.
  6. +
  7. `"basic"`, `"streets"`, `"outdoors"`, `"light"`, `"dark"`, `"satellite"`, or `"satellite-streets"` yield maps composed of *vector* tiles from the Mapbox service, and *do* require a Mapbox Access Token or an on-premise Mapbox installation.
  8. +
  9. A Mapbox service style URL, which requires a Mapbox Access Token or an on-premise Mapbox installation.
  10. +
  11. A Mapbox Style object as defined at https://docs.mapbox.com/mapbox-gl-js/style-spec/
  12. +
+--- diff --git a/content/plotly_js/maps/mapbox-layers/dark-tile.html b/content/plotly_js/maps/mapbox-layers/dark-tile.html new file mode 100644 index 00000000000..8c9fc5d2505 --- /dev/null +++ b/content/plotly_js/maps/mapbox-layers/dark-tile.html @@ -0,0 +1,26 @@ +--- +name: Dark tiles +language: plotly_js +suite: map-layers +order: 7 +sitemap: false +arrangement: horizontal +--- +var url = "https://maplibre.org/maplibre-gl-js/docs/assets/significant-earthquakes-2015.geojson"; + +d3.json(url, (err, raw) => { + var lon = raw.features.map(f => f.geometry.coordinates[0]); + var lat = raw.features.map(f => f.geometry.coordinates[1]); + var z = raw.features.map(f => f.properties.mag); + + var data = [ + { type: "scattermap", lon: lon, lat: lat, z: z, hoverinfo: "y" } + ]; + + var layout = { + map: { style: "dark", zoom: 2, center: { lon: -150, lat: 60 } }, + margin: { t: 0, b: 0 } + }; + + Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/maps/mapbox-layers/environment_canada.html b/content/plotly_js/maps/mapbox-layers/environment_canada.html new file mode 100644 index 00000000000..9d2086ec376 --- /dev/null +++ b/content/plotly_js/maps/mapbox-layers/environment_canada.html @@ -0,0 +1,44 @@ +--- +name: Base Tiles from the USGS, radar overlay from Environment Canada +language: plotly_js +suite: map-layers +order: 6 +sitemap: false +arrangement: horizontal +markdown_content: | + + Here is the same example, with in addition, a WMS layer from Environment Canada which displays near-real-time radar imagery in partly-transparent raster tiles, rendered above the go.Scattermap trace, as is the default. +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2015_06_30_precipitation.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + +var data = [{ + type: 'scattermap', text: unpack(rows, 'Globvalue'), + lon: unpack(rows, 'Lon'), lat: unpack(rows, 'Lat'), + marker: {color: 'fuchsia', size: 4} + }]; + +var layout = { + dragmode: 'zoom', + map: { + style: 'white-bg', + layers: [ + { + "below": 'traces', + "sourcetype": "raster", + "source": [ + "https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}" + ] + }, + { + sourcetype: "raster", + source: ["https://geo.weather.gc.ca/geomet/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX={bbox-epsg-3857}&CRS=EPSG:3857&WIDTH=1000&HEIGHT=1000&LAYERS=RADAR_1KM_RDBR&TILED=true&FORMAT=image/png"]}], + below: 'traces', + center: {lat: 38, lon: -90}, zoom: 4}, + margin: {r: 0, t: 0, b: 0, l: 0}, + showlegend: false}; + +Plotly.newPlot('myDiv', data, layout); + }); diff --git a/content/plotly_js/maps/mapbox-layers/how-layers-work.html b/content/plotly_js/maps/mapbox-layers/how-layers-work.html new file mode 100644 index 00000000000..4c533908be2 --- /dev/null +++ b/content/plotly_js/maps/mapbox-layers/how-layers-work.html @@ -0,0 +1,17 @@ +--- +name: How Layers work in Tile-based Maps +language: plotly_js +suite: map-layers +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + + If your figure contains one or more traces of type `Scattermap`, `Choroplethmap` or `Densitymap`, the `layout` object in your figure contains configuration information for the map itself. The map is composed of various layers, of three different types. +
    +
  1. `layout.map.style` defines the lowest layers, also known as your "base map"
  2. +
  3. The various traces in `data` are by default rendered above the base map (although this can be controlled via the `below` attribute).
  4. +
  5. `layout.map.layers` is an array that defines more layers that are by default rendered above the traces in `data` (although this can also be controlled via the `below` attribute).
  6. +
+ +--- diff --git a/content/plotly_js/maps/mapbox-layers/mapbox-layers_plotly_js_index.html b/content/plotly_js/maps/mapbox-layers/mapbox-layers_plotly_js_index.html new file mode 100644 index 00000000000..3e36160d217 --- /dev/null +++ b/content/plotly_js/maps/mapbox-layers/mapbox-layers_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make a tile-based maps in JavaScript with various base layers. +display_as: maps +language: plotly_js +layout: base +name: Tile Map Layers +order: 2 +page_type: example_index +permalink: javascript/tile-map-layers/ +redirect_from: javascript/mapbox-layers/ +thumbnail: thumbnail/mapbox-layers.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","map-layers" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/mapbox-layers/specify-a-base-map.html b/content/plotly_js/maps/mapbox-layers/specify-a-base-map.html new file mode 100644 index 00000000000..229dfabcc58 --- /dev/null +++ b/content/plotly_js/maps/mapbox-layers/specify-a-base-map.html @@ -0,0 +1,12 @@ +--- +name: Using "layout.map.layers" to Specify a Base Map +language: plotly_js +suite: map-layers +order: 4 +sitemap: false +arrangement: horizontal +markdown_content: | + + If you have access to your own private tile servers, or wish to use a tile server not included in the list above, the recommended approach is to set layout.map.style to "white-bg" and to use layout.map.layers with below to specify a custom base map. + If you omit the below attribute when using this approach, your data will likely be hidden by fully-opaque raster tiles! +--- diff --git a/content/plotly_js/maps/mapbox-layers/white-bg.html b/content/plotly_js/maps/mapbox-layers/white-bg.html new file mode 100644 index 00000000000..425781cf1a8 --- /dev/null +++ b/content/plotly_js/maps/mapbox-layers/white-bg.html @@ -0,0 +1,50 @@ +--- +name: Base Tiles from the USGS +language: plotly_js +suite: map-layers +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + + Here is an example of a map which uses a public USGS imagery map, specified in layout.map.layers, and which is rendered below the data layer. +--- +d3.csv( + "https://raw.githubusercontent.com/plotly/datasets/master/2015_06_30_precipitation.csv", + function(err, rows) { + function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); + } + +var data = [ + { + type: "scattermap", + text: unpack(rows, "Globvalue"), + lon: unpack(rows, "Lon"), + lat: unpack(rows, "Lat"), + marker: { color: "fuchsia", size: 4 } + } +]; + +var layout = { + dragmode: "zoom", + map: { + style: "white-bg", + layers: [ + { + sourcetype: "raster", + source: ["https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}"], + below: "traces" + } + ], + center: { lat: 38, lon: -90 }, + zoom: 3 + }, + margin: { r: 0, t: 0, b: 0, l: 0 } +}; + +Plotly.newPlot("myDiv", data, layout); + } +); diff --git a/content/plotly_js/maps/maplibre-migration/migrate-to-maplibre_plotly_js_index.html b/content/plotly_js/maps/maplibre-migration/migrate-to-maplibre_plotly_js_index.html new file mode 100644 index 00000000000..8105293a31d --- /dev/null +++ b/content/plotly_js/maps/maplibre-migration/migrate-to-maplibre_plotly_js_index.html @@ -0,0 +1,56 @@ +--- +description: How to migrate from Mapbox traces to Maplibre traces. +display_as: maps +language: plotly_js +layout: base +name: Migrate to Maplibre +order: 1 +page_type: example_index +permalink: javascript/maplibre-migration/ +thumbnail: thumbnail/area.jpg +--- + +

With the release of Plotly.js v2.35.0, we are introducing a new set of trace types for maps with tile underlays:

+ +
    +
  • Choroplethmap
  • +
  • Scattermap
  • +
  • Densitymap
  • +
+ +

These traces replace the existing Mapbox traces, Choroplethmapbox, Scattermapbox, + Densitymapbox, but use MapLibre as the map renderer rather than + Mapbox. +

+ +

When switching to the new traces, keep an eye out for improved rendering performance, WebGL2 support, and over time, + improved features in the Plotly map traces inherited from the MapLibre renderer, including projection support, globe + views, terrain support, and support for modern mapping standards.

+ +

You can learn more about the motivations for this change in our announcement + post.

+ +

As a result of removing Mapbox as the rendering engine, we're also removing the Mapbox branding from these trace + names. + This means that migrating from Mapbox traces to MapLibre traces will require some code changes in your projects.

+ +
    +
  1. Change trace names from *mapbox to *map. For any existing trace name ending in + *mapbox, + ensure you've removed the "box" suffix. +
  2. +
  3. If in use, update layout.mapbox argument in your layout configuration to layout.map. + The nested properties are identical in the new map traces, so no other changes should be required.
  4. +
  5. If in use, update mapbox_style to map_style.
  6. +
  7. Verify your map_style settings. With mapbox traces, we bundle basic, + streets, + outdoors, light, dark, satellite, and + satellite-streets styles, + using Mapbox styling. These style names are still available, but they now reference slightly different styles + provided by other tools. +
  8. +
+ +

Note that Mapbox API keys are no longer required for Plotly-provided styles, but using external styles in your Plotly + maps remains supported with the existing API.

\ No newline at end of file diff --git a/content/plotly_js/maps/plotly_js-map-index.html b/content/plotly_js/maps/plotly_js-map-index.html new file mode 100644 index 00000000000..377ee3ea7aa --- /dev/null +++ b/content/plotly_js/maps/plotly_js-map-index.html @@ -0,0 +1,27 @@ +--- +permalink: javascript/maps/ +description: Plotly.js makes interactive, publication-quality graphs online. Examples of how to make maps. +name: Maps +layout: langindex +language: plotly_js +display_as: maps +thumbnail: thumbnail/mixed.jpg +--- + + +
+
+ +
+ +
+

Plotly.js Maps

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","maps" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/maps/scatter-plot-on-maps/US-airport-map.html b/content/plotly_js/maps/scatter-plot-on-maps/US-airport-map.html new file mode 100644 index 00000000000..8eca7fd36be --- /dev/null +++ b/content/plotly_js/maps/scatter-plot-on-maps/US-airport-map.html @@ -0,0 +1,64 @@ +--- +name: US Airports Map +language: plotly_js +suite: scatter-plots-on-maps +order: 2 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_february_us_airport_traffic.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var scl = [[0,'rgb(5, 10, 172)'],[0.35,'rgb(40, 60, 190)'],[0.5,'rgb(70, 100, 245)'], [0.6,'rgb(90, 120, 245)'],[0.7,'rgb(106, 137, 247)'],[1,'rgb(220, 220, 220)']]; + + var data = [{ + type:'scattergeo', + locationmode: 'USA-states', + lon: unpack(rows, 'long'), + lat: unpack(rows, 'lat'), + hoverinfor: unpack(rows, 'airport'), + text: unpack(rows, 'airport'), + mode: 'markers', + marker: { + size: 8, + opacity: 0.8, + reversescale: true, + autocolorscale: false, + symbol: 'square', + line: { + width: 1, + color: 'rgb(102,102,102)' + }, + colorscale: scl, + cmin: 0, + color: unpack(rows, 'cnt'), + colorbar: { + title: {text: 'Incoming Flights February 2011'} + } + } + }]; + + + var layout = { + title: {text: 'Most Trafficked US airports'}, + colorbar: true, + geo: { + scope: 'usa', + projection: { + type: 'albers usa' + }, + showland: true, + landcolor: 'rgb(250,250,250)', + subunitcolor: 'rgb(217,217,217)', + countrycolor: 'rgb(217,217,217)', + countrywidth: 0.5, + subunitwidth: 0.5 + } + }; + + Plotly.newPlot("myDiv", data, layout, {showLink: false}); + +}); diff --git a/content/plotly_js/maps/scatter-plot-on-maps/canadian-cities.html b/content/plotly_js/maps/scatter-plot-on-maps/canadian-cities.html new file mode 100644 index 00000000000..40535e0c07a --- /dev/null +++ b/content/plotly_js/maps/scatter-plot-on-maps/canadian-cities.html @@ -0,0 +1,71 @@ +--- +name: Canadian Cities Map +language: plotly_js +suite: scatter-plots-on-maps +order: 1 +sitemap: false +arrangement: horizontal +--- +var data = [{ + type: 'scattergeo', + mode: 'markers+text', + text: [ + 'Montreal', 'Toronto', 'Vancouver', 'Calgary', 'Edmonton', + 'Ottawa', 'Halifax', 'Victoria', 'Winnepeg', 'Regina' + ], + lon: [ + -73.57, -79.24, -123.06, -114.1, -113.28, + -75.43, -63.57, -123.21, -97.13, -104.6 + ], + lat: [ + 45.5, 43.4, 49.13, 51.1, 53.34, 45.24, + 44.64, 48.25, 49.89, 50.45 + ], + marker: { + size: 7, + color: [ + '#bebada', '#fdb462', '#fb8072', '#d9d9d9', '#bc80bd', + '#b3de69', '#8dd3c7', '#80b1d3', '#fccde5', '#ffffb3' + ], + line: { + width: 1 + } + }, + name: 'Canadian cities', + textposition: [ + 'top right', 'top left', 'top center', 'bottom right', 'top right', + 'top left', 'bottom right', 'bottom left', 'top right', 'top right' + ], +}]; + +var layout = { + title: { + text: 'Canadian cities', + font: { + family: 'Droid Serif, serif', + size: 16 + } + }, + geo: { + scope: 'north america', + resolution: 50, + lonaxis: { + 'range': [-130, -55] + }, + lataxis: { + 'range': [40, 70] + }, + showrivers: true, + rivercolor: '#fff', + showlakes: true, + lakecolor: '#fff', + showland: true, + landcolor: '#EAEAAE', + countrycolor: '#d3d3d3', + countrywidth: 1.5, + subunitcolor: '#d3d3d3' + } +}; + +Plotly.newPlot('myDiv', data, layout); + diff --git a/content/plotly_js/maps/scatter-plot-on-maps/north-america-percipitation-map.html b/content/plotly_js/maps/scatter-plot-on-maps/north-america-percipitation-map.html new file mode 100644 index 00000000000..72305d52738 --- /dev/null +++ b/content/plotly_js/maps/scatter-plot-on-maps/north-america-percipitation-map.html @@ -0,0 +1,83 @@ +--- +name: North America Precipitation Map +language: plotly_js +suite: scatter-plots-on-maps +order: 3 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2015_06_30_precipitation.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + scl = [[0, 'rgb(150,0,90)'],[0.125, 'rgb(0, 0, 200)'],[0.25,'rgb(0, 25, 255)'],[0.375,'rgb(0, 152, 255)'],[0.5,'rgb(44, 255, 150)'],[0.625,'rgb(151, 255, 0)'],[0.75,'rgb(255, 234, 0)'],[0.875,'rgb(255, 111, 0)'],[1,'rgb(255, 0, 0)']]; + + var data = [{ + type: 'scattergeo', + mode: 'markers', + text: unpack(rows, 'Globvalue'), + lon: unpack(rows, 'Lon'), + lat: unpack(rows, 'Lat'), + marker: { + color: unpack(rows, 'Globvalue'), + colorscale: scl, + cmin: 0, + cmax: 1.4, + reversescale: true, + opacity: 0.2, + size: 2, + colorbar:{ + thickness: 10, + title: {side: + 'right' + }, + outlinecolor: 'rgba(68,68,68,0)', + ticks: 'outside', + ticklen: 3, + shoticksuffix: 'last', + ticksuffix: 'inches', + dtick: 0.1 + } + }, + name: 'NA Precipitation' + }]; + + var layout = { + geo:{ + scope: 'north america', + showland: true, + landcolor: 'rgb(212,212,212)', + subunitcolor: 'rgb(255,255,255)', + countrycolor: 'rgb(255,255,255)', + showlakes: true, + lakecolor: 'rgb(255,255,255)', + showsubunits: true, + showcountries: true, + resolution: 50, + projection: { + type: 'conic conformal', + rotation: { + long: -100 + } + }, + }, + longaxis: { + showgrid: true, + gridwidth: 0.5, + range: [ -140.0, -55.0 ], + dtick: 5 + }, + lataxis: { + showgrid: true, + gridwidth: 0.5, + range: [ 20.0, 60.0 ], + dtick: 5 + }, + title: {text: 'North America Precipitation'}, + width: 600, + height: 600 + }; + + Plotly.newPlot('myDiv', data, layout); + }); diff --git a/content/plotly_js/maps/scatter-plot-on-maps/scatter_maps_plotly_js_index.html b/content/plotly_js/maps/scatter-plot-on-maps/scatter_maps_plotly_js_index.html new file mode 100644 index 00000000000..a155923345b --- /dev/null +++ b/content/plotly_js/maps/scatter-plot-on-maps/scatter_maps_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make D3.js-based scatter plots on maps in JavaScript. Scatter + plots on maps highlight geographic areas and can be colored by value. +display_as: maps +language: plotly_js +layout: base +name: Scatter Plots on Maps +order: 7 +permalink: javascript/scatter-plots-on-maps/ +redirect_from: javascript-graphing-library/scatter-plots-on-maps/ +thumbnail: thumbnail/scatter-plot-on-maps.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","scatter-plots-on-maps" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/scattermapbox/scattermapbox_basic-mapbox.html b/content/plotly_js/maps/scattermapbox/scattermapbox_basic-mapbox.html new file mode 100644 index 00000000000..b8c3d7243d9 --- /dev/null +++ b/content/plotly_js/maps/scattermapbox/scattermapbox_basic-mapbox.html @@ -0,0 +1,46 @@ +--- +name: Basic Example (Mapbox) +language: plotly_js +suite: scatter-tile-maps +order: 10 +sitemap: false +arrangement: horizontal +markdown_content: | + + > Mapbox traces are deprecated and may be removed in a future version of Plotly.js. + + Earlier examples use traces that render with [Maplibre GL JS](https://maplibre.org/maplibre-gl-js/docs/). + These traces were introduced in Plotly.js 2.35.0 and replace Mapbox-based tile maps, + which are now deprecated. Here's one of the earlier examples using the Mapbox-based `choroplethmapbox` trace +--- + +var data = [{ + type:'scattermapbox', + lat:['45.5017'], + lon:['-73.5673'], + mode:'markers', + marker: { + size:14 + }, + text:['Montreal'] +}] + +var layout = { + autosize: true, + hovermode:'closest', + mapbox: { + bearing:0, + center: { + lat:45, + lon:-73 + }, + pitch:0, + zoom:5 + }, +} + +Plotly.setPlotConfig({ + mapboxAccessToken: "your access token" +}) + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/maps/scattermapbox/scattermapbox_basic.html b/content/plotly_js/maps/scattermapbox/scattermapbox_basic.html new file mode 100644 index 00000000000..1e49a08baab --- /dev/null +++ b/content/plotly_js/maps/scattermapbox/scattermapbox_basic.html @@ -0,0 +1,35 @@ +--- +name: Basic Example +language: plotly_js +suite: scatter-tile-maps +order: 1 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + type:'scattermap', + lat:['45.5017'], + lon:['-73.5673'], + mode:'markers', + marker: { + size:14 + }, + text:['Montreal'] +}] + +var layout = { + autosize: true, + hovermode:'closest', + map: { + bearing:0, + center: { + lat:45, + lon:-73 + }, + pitch:0, + zoom:5 + }, +} + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/maps/scattermapbox/scattermapbox_colorscale.html b/content/plotly_js/maps/scattermapbox/scattermapbox_colorscale.html new file mode 100644 index 00000000000..9696a6a3464 --- /dev/null +++ b/content/plotly_js/maps/scattermapbox/scattermapbox_colorscale.html @@ -0,0 +1,72 @@ +--- +name: Adding Colorscale to Maps +language: plotly_js +suite: scatter-tile-maps +order: 3 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/2015_06_30_precipitation.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + scl = [[0, 'rgb(150,0,90)'],[0.125, 'rgb(0, 0, 200)'],[0.25,'rgb(0, 25, 255)'],[0.375,'rgb(0, 152, 255)'],[0.5,'rgb(44, 255, 150)'],[0.625,'rgb(151, 255, 0)'],[0.75,'rgb(255, 234, 0)'],[0.875,'rgb(255, 111, 0)'],[1,'rgb(255, 0, 0)']]; + + var data = [{ + type: 'scattermap', + mode: 'markers', + text: unpack(rows, 'Globvalue'), + lon: unpack(rows, 'Lon'), + lat: unpack(rows, 'Lat'), + marker: { + color: unpack(rows, 'Globvalue'), + colorscale: scl, + cmin: 0, + cmax: 1.4, + reversescale: true, + opacity: 0.5, + size: 3, + colorbar:{ + thickness: 10, + title: {side: + 'right' + }, + outlinecolor: 'rgba(68,68,68,0)', + ticks: 'outside', + ticklen: 3, + shoticksuffix: 'last', + ticksuffix: 'inches', + dtick: 0.1 + } + }, + name: 'NA Precipitation' + }]; + + layout = { + dragmode: 'zoom', + map: { + center: { + lat: 38.03697222, + lon: -90.70916722 + }, + domain: { + x: [0, 1], + y: [0, 1] + }, + style: 'light', + zoom: 3 + }, + margin: { + r: 0, + t: 0, + b: 0, + l: 0, + pad: 0 + }, + showlegend: false + }; + + Plotly.newPlot('myDiv', data, layout); + }); diff --git a/content/plotly_js/maps/scattermapbox/scattermapbox_lines.html b/content/plotly_js/maps/scattermapbox/scattermapbox_lines.html new file mode 100644 index 00000000000..8b4f827d9b6 --- /dev/null +++ b/content/plotly_js/maps/scattermapbox/scattermapbox_lines.html @@ -0,0 +1,71 @@ +--- +name: Adding Lines to Maps +language: plotly_js +suite: scatter-tile-maps +order: 4 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/c34aaa0b1b3cddad335173cb7bc0181897201ee6/2011_february_aa_flight_paths.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; });} + + function getMaxOfArray(numArray) { + return Math.max.apply(null, numArray); + } + + var data = []; + var count = unpack(rows, 'cnt'); + var startLongitude = unpack(rows, 'start_lon'); + var endLongitude = unpack(rows, 'end_lon'); + var startLat = unpack(rows, 'start_lat'); + var endLat = unpack(rows, 'end_lat'); + + for ( var i = 0 ; i < count.length; i++ ) { + var opacityValue = count[i]/getMaxOfArray(count); + + var result = { + type: 'scattermap', + lon: [ startLongitude[i] , endLongitude[i] ], + lat: [ startLat[i] , endLat[i] ], + mode: 'lines', + line: { + width: 1, + color: 'red' + }, + opacity: opacityValue + }; + + data.push(result); + }; + + layout = { + dragmode: 'zoom', + map: { + center: { + lat: 38.03697222, + lon: -90.70916722 + }, + domain: { + x: [0, 1], + y: [0, 1] + }, + style: 'dark', + zoom: 2 + }, + margin: { + r: 0, + t: 0, + b: 0, + l: 0, + pad: 0 + }, + paper_bgcolor: '#191A1A', + plot_bgcolor: '#191A1A', + showlegend: false + }; + + Plotly.newPlot("myDiv", data, layout, {showLink: false}); + +}); diff --git a/content/plotly_js/maps/scattermapbox/scattermapbox_multiple.html b/content/plotly_js/maps/scattermapbox/scattermapbox_multiple.html new file mode 100644 index 00000000000..5205be9370e --- /dev/null +++ b/content/plotly_js/maps/scattermapbox/scattermapbox_multiple.html @@ -0,0 +1,70 @@ +--- +name: Multiple Markers +language: plotly_js +suite: scatter-tile-maps +order: 2 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/bcdunbar/datasets/master/meteorites_subset.csv', function(err, rows){ + + var classArray = unpack(rows, 'class'); + var classes = [...new Set(classArray)]; + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + var data = classes.map(function(classes) { + var rowsFiltered = rows.filter(function(row) { + return (row.class === classes); + }); + return { + type: 'scattermap', + name: classes, + lat: unpack(rowsFiltered, 'reclat'), + lon: unpack(rowsFiltered, 'reclong') + }; + }); + + var layout = { + title: {text: 'Meteorite Landing Locations'}, + font: { + color: 'white' + }, + dragmode: 'zoom', + map: { + center: { + lat: 38.03697222, + lon: -90.70916722 + }, + domain: { + x: [0, 1], + y: [0, 1] + }, + style: 'dark', + zoom: 1 + }, + margin: { + r: 20, + t: 40, + b: 20, + l: 20, + pad: 0 + }, + paper_bgcolor: '#191A1A', + plot_bgcolor: '#191A1A', + showlegend: true, + annotations: [{ + x: 0, + y: 0, + xref: 'paper', + yref: 'paper', + text: 'Source: NASA', + showarrow: false + }] + }; + + Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/maps/scattermapbox/scattermapbox_plotly_js_index.html b/content/plotly_js/maps/scattermapbox/scattermapbox_plotly_js_index.html new file mode 100644 index 00000000000..efef2c95699 --- /dev/null +++ b/content/plotly_js/maps/scattermapbox/scattermapbox_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make scatter plots on tile maps in Plotly.JS +display_as: maps +language: plotly_js +layout: base +name: Scatter Plots on Tile Maps +order: 8 +permalink: javascript/scatter-tile-maps/ +redirect_from: javascript/scattermapbox/ +thumbnail: thumbnail/scatter-mapbox.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","scatter-tile-maps" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/maps/scattermapbox/symbols.html b/content/plotly_js/maps/scattermapbox/symbols.html new file mode 100644 index 00000000000..a66df21a855 --- /dev/null +++ b/content/plotly_js/maps/scattermapbox/symbols.html @@ -0,0 +1,28 @@ +--- +name: Set Marker Symbols +language: plotly_js +suite: scatter-tile-maps +order: 5 +sitemap: false +arrangement: horizontal +markdown_content: | + This example uses [symbol attribute](https://plotly.com/javascript/reference/scattermap/#scattermap-marker-symbol) to set the marker symbol. +--- +var data = [ + { + type: "scattermap", + mode: "markers+text+lines", + lon: [-75, -80, -50], + lat: [45, 20, -20], + marker: { size: 20, symbol: ["bus", "harbor", "airport"] }, + text: ["Bus", "Harbor", "Airport"], + textposition: "bottom right" + } +]; + +var layout = { + map: { style: "outdoors", zoom: 0.7 }, + showlegend: false, height: 500, width: 700 +}; + +Plotly.newPlot("myDiv", data, layout); diff --git a/content/plotly_js/plotly_js-index.html b/content/plotly_js/plotly_js-index.html new file mode 100644 index 00000000000..1e7a8104181 --- /dev/null +++ b/content/plotly_js/plotly_js-index.html @@ -0,0 +1,177 @@ +--- +name: Plotly JavaScript Graphing Library +permalink: /javascript/ +description: A free open source interactive javascript graphing library. Plotly.js is built on d3.js and webgl and supports over 20 types of interactive charts. +language: plotly_js +layout: langindex +display_as: false +redirect_from: /javascript-graphing-library/ +--- + + +
+
+ +
+ +
+

Plotly JavaScript Open Source Graphing Library

+

+ Built on top of d3.js and stack.gl, Plotly.js is a high-level, declarative charting library. plotly.js ships with over 40 chart types, including 3D charts, statistical graphs, and SVG maps. +
plotly.js is free and open source and you can view the source, report issues or contribute on GitHub. +

+
+
+
+
+ {% include layouts/dashplug.html %} +
+
+ Read more about plotly.js features +
+ +
+ +
+ Sophisticated chart types +
+
+ plotly.js abstracts the types of statistical and scientific charts that you would find in packages like matplotlib, ggplot2, or MATLAB. +
+ + +
+ +
+
d3.json('https://plotly.com/~DanielCarrera/13.json', function(figure){
+                  var trace = {
+                    x: figure.data[0].x, y: figure.data[0].y, z: figure.data[0].z,
+                    type: 'contour', autocolorscale: false,
+                    colorscale: [[0,"rgb(  0,  0,  0)"],[0.3,"rgb(230,  0,  0)"],[0.6,"rgb(255,210,  0)"],[1,"rgb(255,255,255)"]],
+                    reversescale: true, zmax: 2.5, zmin: -2.5
+                  };
+                  var layout = {
+                    title: {
+                      text: 'turbulence simulation'
+                  },
+                    xaxis: {
+                      title: {
+                          text: 'radial direction'
+                      },
+                      showline: true,
+                      mirror: 'allticks',
+                      ticks: 'inside'
+                    },
+                    yaxis: {
+                        title: {
+                            text: 'vertical direction'
+                        },
+                        showline: true,
+                        mirror: 'allticks',
+                        ticks: 'inside'
+                    },
+                    margin: {l: 40, b: 40, t: 60},
+                    annotations: [{
+                      showarrow: false,
+                      text: 'Credit: Daniel Carrera',
+                      x: 0, y: 0, xref: 'paper', yref: 'paper'
+                    }]
+                  }
+                  Plotly.newPlot(document.getElementById('contour-plot'), [trace], layout, {showLink: false});
+                });
+ + + +
Fully customizable
+
+ plotly.js charts are described declaratively as JSON objects. Every aspect of the charts, such as colors, grid lines, and the legend, has a corresponding set of JSON attributes. + +
+ +
d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/wind_speed_laurel_nebraska.csv', function(rows){
+                    var trace = {
+                      type: 'scatter',                    // set the chart type
+                      mode: 'lines',                      // connect points with lines
+                      x: rows.map(function(row){          // set the x-data
+                        return row['Time'];
+                      }),
+                      y: rows.map(function(row){          // set the x-data
+                        return row['10 Min Sampled Avg'];
+                      }),
+                      line: {                             // set the width of the line.
+                        width: 1
+                      },
+                      error_y: {
+                        array: rows.map(function(row){    // set the height of the error bars
+                          return row['10 Min Std Dev'];
+                        }),
+                        thickness: 0.5,                   // set the thickness of the error bars
+                        width: 0
+                      }
+                    };
+
+                    var layout = {
+                      yaxis: {
+                        title: {
+                          text: "Wind Speed"
+                        }
+                      },       // set the y axis title
+                      xaxis: {
+                        showgrid: false,                  // remove the x-axis grid lines
+                        tickformat: "%B, %Y"              // customize the date format to "month, day"
+                      },
+                      margin: {                           // update the left, bottom, right, top margin
+                        l: 40, b: 10, r: 10, t: 20
+                      }
+                    };
+
+                    Plotly.newPlot(document.getElementById('wind-speed'), [trace], layout, {showLink: false});
+                });
+ + + +
High performance
+
+
+ Most plotly graphs are drawn with SVG. This offers great compatibility across browsers and publication-quality vector image export. Unfortunately, there are inherent performance limitations with the number of SVG elements that you can draw in the DOM.

+ plotly.js uses stack.gl for high performance 2D and 3D charting.

+
+
+
+ +
+
+ This chart was drawn with the plotly.js chart type scattergl. scattergl charts render an order of magnitude faster than their SVG counterparts.
+
+
+
+
+ + + +
+
+ All 3D charts in plotly.js are rendered with WebGL, leveraging the power of the GPU for fast interactivity. + view the interactive version +
+
+
+
Universal
+
+ By abstracting charts to a declarative JSON structure, plotly.js is used as a browser-based charting library for Python, R, MATLAB. +
+ +
+
+
+
+ + +
+
+
+ +{% assign languagelist = site.posts | where:"language","plotly_js" | sort: "order" %} +{% include posts/mainlang_documentation_eg.html %} diff --git a/content/plotly_js/plotly_js_function_ref.html b/content/plotly_js/plotly_js_function_ref.html new file mode 100644 index 00000000000..c256e8e203e --- /dev/null +++ b/content/plotly_js/plotly_js_function_ref.html @@ -0,0 +1,629 @@ +--- +name: Function Reference +permalink: /javascript/plotlyjs-function-reference/ +description: Plotly.js function reference. How to create, update, and modify graphs drawn with Plotly's JavaScript Graphing Library. +language: plotly_js +layout: base +redirect_from: /javascript-graphing-library/plotlyjs-function-reference +--- + + + +

Common parameters

+ +
+
graphDiv
+
The functions documented here all create or modify a plot that is drawn into a <div> element on the page, commonly referred to as graphDiv or plotDiv. The first argument to each function on this page is a reference to this element, and it can be either a DOM node, i.e. the output of document.getElementById(), or a string, in which case it will be treated as the id of the div. A note on sizing: You can either supply height and width in the layout object (see below), or give the <div> a height and width in CSS.
+ +
data
+
The data to be plotted is described in an array usually called data, whose elements are trace objects of various types (e.g. scatter, bar etc) as documented in the Full Reference. +
+
layout
+
The layout of the plot – non-data-related visual attributes such as the title, annotations etc – is described in an object usually called layout, as documented in/ the Full Reference. +
+
config
+
High-level configuration options for the plot, such as the scroll/zoom/hover behaviour, is described in an object usually called config, as documented here. The difference between config and layout is that layout relates to the content of the plot, whereas config relates to the context in which the plot is being shown. +
+
frames
+
Animation frames are described in an object usually called frames as per the example here. + They can contain data and layout objects, which define any changes to be animated, and a traces + object that defines which traces to animate. Additionally, frames containing name and/or group + attributes can be referenced by Plotly.animate + after they are added by Plotly.addFrames +
+
+ + +

Plotly.newPlot

+ +Draws a new plot in an <div> element, overwriting any existing plot. To update an existing plot in a <div>, it is much more efficient to use Plotly.react than to overwrite it. +

+
+Signature +
+
Plotly.newPlot(graphDiv, data, layout, config)
+
+
+
graphDiv
+
DOM node or string id of a DOM node
+
data
+
array of objects, see documentation
(defaults to [])
+
layout
+
object, see documentation/
(defaults to {})
+
config
+
object, see documentation
(defaults to {})
+
+
+
Plotly.newPlot(graphDiv, obj)
+
+
+
graphDiv
+
DOM node or string id of a DOM node
+
obj
+
single object with keys for data, layout, config and frames, see above for contents
(defaults to {data: [], layout: {}, config: {}, frames: []})
+
+
+
+
+

+ + +After plotting, the data or layout can always be retrieved from the <div> element in which the plot was drawn: +

+var graphDiv = document.getElementById('id_of_the_div')
+
+var data = [{
+  x: [1999, 2000, 2001, 2002],
+  y: [10, 15, 13, 17],
+  type: 'scatter'
+}];
+
+var layout = {
+  title: {
+    text: 'Sales Growth'
+  },
+  xaxis: {
+    title: {
+      text: 'Year'
+    },
+    showgrid: false,
+    zeroline: false
+  },
+  yaxis: {
+    title: {
+      text: 'Percent'
+    },
+    showline: false
+  }
+};
+Plotly.newPlot(graphDiv, data, layout);
+
+...
+var dataRetrievedLater = graphDiv.data;
+var layoutRetrievedLater = graphDiv.layout;
+
+ + +

Plotly.react

+ +Plotly.react has the same signature as Plotly.newPlot above, and can be used in its place to create a plot, but when called again on the same <div> will update it far more efficiently than Plotly.newPlot, which would destroy and recreate the plot. Plotly.react is as fast as Plotly.restyle/Plotly.relayout documented below. +

+Important Note: In order to use this method to plot new items in arrays under data such as x or marker.color etc, these items must either have been added immutably (i.e. the identity of the parent array must have changed) or the value of layout.datarevision must have changed. + +

Plotly.restyle

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+ +An efficient means of changing attributes in the data array in an existing plot. When restyling, you may choose to have the specified changes affect as many traces as desired. The update is given as a single object and the traces that are affected are given as a list of traces indices. Note, leaving the trace indices unspecified assumes that you want to restyle all the traces. + +

+
+Signature +
+
Plotly.restyle(graphDiv, update [, traceIndices])
+
+
+
graphDiv
+
DOM node or string id of a DOM node
+
update
+
object, see below for examples
(defaults to {})
+
traceIndices
+
array of integer indices into existing value of data
(optional, default behaviour is to apply to all traces)
+
+ +
+
+

+ +

+// restyle a single trace using attribute strings
+var update = {
+    opacity: 0.4,
+    'marker.color': 'red'
+};
+Plotly.restyle(graphDiv, update, 0);
+
+// restyle all traces using attribute strings
+var update = {
+    opacity: 0.4,
+    'marker.color': 'red'
+};
+Plotly.restyle(graphDiv, update);
+
+// restyle two traces using attribute strings
+var update = {
+    opacity: 0.4,
+    'marker.color': 'red'
+};
+Plotly.restyle(graphDiv, update, [1, 2]);
+
+ +

See the Pen Plotly.restyle by plotly (@plotly) on CodePen.

+ + +

+ +The above examples have applied values across single or multiple traces. However, you can also specify arrays of values to apply to traces in turn. + +

+// restyle the first trace's marker color 'red' and the second's 'green'
+var update = {
+    'marker.color': ['red', 'green']
+};
+Plotly.restyle(graphDiv, update, [0, 1])
+
+// alternate between red and green for all traces (note omission of traces)
+var update = {
+    'marker.color': ['red', 'green']
+};
+Plotly.restyle(graphDiv, update)
+
+ +

See the Pen Plotly.restyle Traces in Turn by plotly (@plotly) on CodePen.

+ +

+ +In restyle, arrays are assumed to be used in conjunction with the trace indices provided. Therefore, to apply an array as a value, you need to wrap it in an additional array. For example: + +

+// update the color attribute of the first trace so that the markers within the same trace
+// have different colors
+var update = {
+    'marker.color': [['red', 'green']]
+}
+Plotly.restyle(graphDiv, update, [0])
+
+// update two traces with new z data
+var update = {z: [[[1,2,3], [2,1,2], [1,1,1]], [[0,1,1], [0,2,1], [3,2,1]]]};
+Plotly.restyle(graphDiv, update, [1, 2])
+
+ +

See the Pen Plotly.restyle Arrays by plotly (@plotly) on CodePen.

+ +

+ +The term attribute strings is used above to mean flattened (e.g., {marker: {color: 'red'}} vs. {'marker.color': red}). When you pass an attribute string to restyle inside the update object, it’s assumed to mean update only this attribute. Therefore, if you wish to replace and entire sub-object, you may simply specify one less level of nesting. + +

+// replace the entire marker object with the one provided
+var update = {
+    marker: {color: 'red'}
+};
+Plotly.restyle(graphDiv, update, [0])
+
+ +

See the Pen Plotly.restyle Attribute strings by plotly (@plotly) on CodePen.

+ +

+ +Finally, you may wish to selectively reset or ignore certain properties when restyling. This may be useful when specifying multiple properties for multiple traces so that you can carefully target what is and is not affected. In general `null` resets a property to the default while `undefined` applies no change to the current state. + +

+// Set the first trace's line to red, the second to the default, and ignore the third
+Plotly.restyle(graphDiv, {
+  'line.color': ['red', null, undefined]
+}, [0, 1, 2])
+
+ +

See the Pen null vs. undefined in Plotly.restyle by plotly (@plotly) on CodePen.

+ + +

Plotly.relayout

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+ +An efficient means of updating the layout object of an existing plot. The call signature and arguments for relayout are similar (but simpler) to restyle. Because there are no indices to deal with, arrays need not be wrapped. Also, no argument specifying applicable trace indices is passed in. + +

+
+Signature +
+
Plotly.relayout(graphDiv, update)
+
+
+
graphDiv
+
DOM node or string id of a DOM node
+
update
+
object, see below for examples
(defaults to {})
+
+
+
+
+

+ + +

+// update only values within nested objects
+var update = {
+    title: {text: 'some new title'}, // updates the title
+    'xaxis.range': [0, 5],   // updates the xaxis range
+    'yaxis.range[1]': 15     // updates the end of the yaxis range
+};
+Plotly.relayout(graphDiv, update)
+
+ +

See the Pen Plotly.relayout by plotly (@plotly) on CodePen.

+ + +

Plotly.update

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+ +An efficient means of updating both the data array and layout object in an existing plot, basically a combination of Plotly.restyle and Plotly.relayout. +

+
+Signature +
+
Plotly.update(graphDiv, data_update, layout_update, [, traceIndices])
+
+
+
graphDiv
+
DOM node or string id of a DOM node
+
data_update
+
object, see Plotly.restyle above
(defaults to {})
+
layout_update
+
object, see Plotly.relayout above
(defaults to {})
+
traceIndices
+
array of integer indices into existing value of data, see Plotly.restyle above
(optional, default behaviour is to apply to all traces)
+
+
+
+
+

+ +

+//update the layout and all the traces
+var layout_update = {
+    title: {text: 'some new title'}, // updates the title
+};
+var data_update = {
+    'marker.color': 'red'
+};
+Plotly.update(graphDiv, data_update, layout_update)
+
+//update the layout and a single trace
+var layout_update = {
+    title: {text: 'some new title'}, // updates the title
+};
+var data_update = {
+    'marker.color': 'red'
+};
+Plotly.update(graphDiv, data_update, layout_update,0)
+
+//update the layout and two specific traces
+var layout_update = {
+    title: {text: 'some new title'}, // updates the title
+};
+var data_update = {
+    'marker.color': 'red'
+};
+Plotly.update(graphDiv, data_update, layout_update, [0,2])
+
+
+ + +

See the Pen Plotly.update by plotly (@plotly) on CodePen.

+ + +

Plotly.validate

+ +Plotly.validate allows users to validate their input data array and layout object. This can be done on the data array and layout object passed into Plotly.newPlot or on an updated graphDiv with Plotly.validate(graphDiv.data, graphDiv.layout). +

+
+Signature +
+
Plotly.validate(data, layout)
+
+
+
data
+
array of objects +
layout
+
object +
+
+
+
+

+ +

+var data = [{
+  type: 'bar',
+  y: [2, 1, 3, 2],
+  orientation: 'horizontal'
+}];
+
+var out = Plotly.validate(data, layout);
+console.log(out[0].msg)
+// "In data trace 0, key orientation is set to an invalid value (horizontal)"
+
+ +

Plotly.makeTemplate

+ +Plotly.makeTemplate copies the style information from a figure. It does this by returning a template object which can be passed to the layout.template attribute of another figure. +

+
+Signature +
+
Plotly.makeTemplate(figure)
+
+
+
figure or DOM Node
+
where figure is a plot object, with {data, layout} members. If a DOM node is used + it must be a div element already containing a plot. +
+
+
+
+

+ +

+var figure = {
+  data: [{
+    type: 'bar',
+    marker: {color: 'red'},
+    y: [2, 1, 3, 2],
+  }],
+  layout:{
+    title: {
+      text: 'Quarterly Earnings'
+    }
+  }
+};
+
+var template = Plotly.makeTemplate(figure);
+
+var newData = [{
+  type:'bar',
+  y:[3,2,5,8]
+}]
+
+var layout = {template:template}
+
+Plotly.newPlot(graphDiv,newData,layout)
+
+
+ +

Plotly.validateTemplate

+ +Plotly.validateTemplate allows users to Test for consistency between the given figure and a template, +either already included in the figure or given separately. Note that not every issue identified here is necessarily +a problem, it depends on what you're using the template for. +

+
+Signature +
+
Plotly.validateTemplate(figure, template)
+
+
+
figure or DOM Node
+
where figure is a plot object, with {data, layout} members. +
template
+
the template, with its own {data, layout}, to test. + If omitted, we will look for a template already attached as + the plot's layout.template attribute. +
+
+
+
+

+ +

+var out = Plotly.validateTemplate(figure, template);
+console.log(out[0].msg)
+// "The template has 1 traces of type bar but there are none in the data."
+
+ +

Plotly.addTraces

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+ +This allows you to add new traces to an existing graphDiv at any location in its data array. Every graphDiv object has a data component which is an array of JSON blobs that each describe one trace. The full list of trace types can be found in the Full Reference. + + +

+// add a single trace to an existing graphDiv
+Plotly.addTraces(graphDiv, {y: [2,1,2]});
+
+// add two traces
+Plotly.addTraces(graphDiv, [{y: [2,1,2]}, {y: [4, 5, 7]}]);
+
+// add a trace at the beginning of the data array
+Plotly.addTraces(graphDiv, {y: [1, 5, 7]}, 0);
+
+ +

See the Pen Plotly.addtraces by plotly (@plotly) on CodePen.

+ + +

Plotly.deleteTraces

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+This allows you to remove traces from an existing graphDiv by specifying the indices of the traces to be removed. + +

+// remove the first trace
+Plotly.deleteTraces(graphDiv, 0);
+
+// remove the last two traces
+Plotly.deleteTraces(graphDiv, [-2, -1]);
+
+ +

See the Pen Plotly.deleteTraces by plotly (@plotly) on CodePen.

+ + +

Plotly.moveTraces

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+This allows you to reorder traces in an existing graphDiv. This will change the ordering of the layering and the legend. + +All traces defined in graphDiv are ordered in an array. They are drawn one by one from first to last. Each time a new layer or trace is drawn to the canvas the new trace is drawn directly over the current canvas, replacing the colors of the traces and background. This algorithm to image stacking/drawing is known as the Painter's Algorithm. As its name implies the Painter's Algorithm is typically the manner in which a painter paints a landscape, starting from objects with the most perspective depth and progressively moving forward and layering over the background objects. + +

+// move the first trace (at index 0) the the end of the data array
+Plotly.moveTraces(graphDiv, 0);
+
+// move selected traces (at indices [0, 3, 5]) to the end of the data array
+Plotly.moveTraces(graphDiv, [0, 3, 5]);
+
+// move last trace (at index -1) to the beginning of the data array (index 0)
+Plotly.moveTraces(graphDiv, -1, 0);
+
+// move selected traces (at indices [1, 4, 5]) to new indices [0, 3, 2]
+Plotly.moveTraces(graphDiv, [1, 4, 5], [0, 3, 2]);
+
+ +

See the Pen Plotly.moveTraces by plotly (@plotly) on CodePen.

+ + +

Plotly.extendTraces

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+This allows you to add data to traces in an existing graphDiv. + +

+// extend one trace
+Plotly.extendTraces(graphDiv, {y: [[rand()]]}, [0])
+
+// extend multiple traces
+Plotly.extendTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1])
+
+// extend multiple traces up to a maximum of 10 points per trace
+Plotly.extendTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1], 10)
+
+ +

See the Pen Plotly.extendTraces by plotly (@plotly) on CodePen.

+ + +

Plotly.prependTraces

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+This allows you to prepend data to an existing trace graphDiv. + +

+// prepend one trace
+Plotly.prependTraces(graphDiv, {y: [[rand()]]}, [0])
+
+// prepend multiple traces
+Plotly.prependTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1])
+
+// prepend multiple traces up to a maximum of 10 points per trace
+Plotly.prependTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1], 10)
+
+ +

Plotly.addFrames

+This function has comparable performance to Plotly.react and is faster than redrawing the whole plot with Plotly.newPlot.

+This allows you to add animation frames to a graphDiv. The group or name attribute of a frame can +be used by Plotly.animate in place of a frame object (or array of +frame objects). +See example here. + +

Plotly.animate

+Add dynamic behaviour to plotly graphs with Plotly.animate. + +

+
+Signature +
+ +
Plotly.animate(graphDiv, frameOrGroupNameOrFrameList, animationAttributes)
+
+
+
graphDiv
+
DOM node or string id of a DOM node
+
frameOrGroupNameOrFrameList
+
A frame to be animated or an array of frames to be animated in sequence. Frames added by + Plotly.addFrames which have a + group attribute, can be animated by passing their group name here. + Similarly, you can reference frames by an array of strings of frame name values.
+
animationAttributes
+
An object, see documentation for examples.
+
+
+
+
+

+ + +

+Plotly.newPlot('graph', [{
+  x: [1, 2, 3],
+  y: [0, 0.5, 1],
+  line: {simplify: false},
+}]);
+
+function randomize() {
+  Plotly.animate('graph', {
+    data: [{y: [Math.random(), Math.random(), Math.random()]}],
+    traces: [0],
+    layout: {}
+  }, {
+    transition: {
+      duration: 500,
+      easing: 'cubic-in-out'
+    },
+	  frame: {
+		  duration: 500
+	  }
+  })
+}
+
+ +

See the Pen Plotly.animate by plotly (@plotly) on CodePen.

+ + + +

Plotly.purge

+ +Using purge will clear the div, and remove any Plotly plots that have been placed in it. +

+// purge will be used on the div that you wish clear of Plotly plots
+Plotly.purge(graphDiv);
+
+ +

See the Pen Plotly.purge by plotly (@plotly) on CodePen.

+ + +

Plotly.toImage

+ +toImage will generate a promise to an image of the plot in data URL format. +

+// Plotly.toImage will turn the plot in the given div into a data URL string
+// toImage takes the div as the first argument and an object specifying image properties as the other
+Plotly.toImage(graphDiv, {format: 'png', width: 800, height: 600}).then(function(dataUrl) {
+    // use the dataUrl
+})
+
+ +

See the Pen Plotly.toImage by plotly (@plotly) on CodePen.

+ + +

Plotly.downloadImage

+ +downloadImage will trigger a request to download the image of a Plotly plot. +

+// downloadImage will accept the div as the first argument and an object specifying image properties as the other
+Plotly.downloadImage(graphDiv, {format: 'png', width: 800, height: 600, filename: 'newplot'});
+
+ +

See the Pen Plotly.toImage by plotly (@plotly) on CodePen.

+ + +

Using events

+ +Plots emit events prefixed with plotly_ when clicked or hovered over, and event handlers can be bound to events using the on method that is exposed by the plot div object. For more information and examples of how to use Plotly events see: https://plotly.com/javascript/plotlyjs-events/. diff --git a/content/plotly_js/plotlyjs-getting-started.html b/content/plotly_js/plotlyjs-getting-started.html new file mode 100644 index 00000000000..8792041a2fe --- /dev/null +++ b/content/plotly_js/plotlyjs-getting-started.html @@ -0,0 +1,105 @@ +--- +name: Getting Started +permalink: javascript/getting-started/ +description: Getting Started with plotly +layout: base +language: plotly_js +redirect_from: javascript-graphing-library/getting-started/ +--- + + +
+

NPM

+
+

+ You can install Plotly.js from NPM via npm install plotly.js-dist or yarn add plotly.js-dist +

+ +
+ +
+

plotly.js CDN

+
+

+ You can also use the ultrafast plotly.js CDN link. This CDN is graciously provided by the incredible team at Fastly. +

+ +
<head>
+               <script src="https://cdn.plot.ly/plotly-{{site.data.jsversion.version}}.min.js" charset="utf-8"></script>
+</head>
+ +
+
+ +
+

Download

+
+

+ Download the minified plotly.js source code and dependencies. +

+ +

+ Include the downloaded scripts before the end of the </head> tag in your HTML document: +

+ +
<head>
+	<script src="plotly-{{site.data.jsversion.version}}.min.js" charset="utf-8"></script>
+</head>
+
+ +
+ +

+ + Download plotly.js +

+ +
+ +
+

Start plotting!

+
+

+ In your HTML document, create an empty DIV to draw the graph in: +

+ +
<div id="tester" style="width:600px;height:250px;"></div>
+ +

+ Now you can make interactive plotly.js charts using Plotly.newPlot(). +

+
<script>
+	TESTER = document.getElementById('tester');
+	Plotly.newPlot( TESTER, [{
+	x: [1, 2, 3, 4, 5],
+	y: [1, 2, 4, 8, 16] }], {
+	margin: { t: 0 } } );
+</script>
+ +

+ Now you can pass Plotly.newPlot() either the ID of the DIV ("tester") or the DIV DOM element (TESTER). +

+ +
+
+ +
+

Hello World Example

+
+ +
+
+ + + + diff --git a/content/plotly_js/scientific/carpet-contour/add_contours.html b/content/plotly_js/scientific/carpet-contour/add_contours.html new file mode 100644 index 00000000000..03876167bcb --- /dev/null +++ b/content/plotly_js/scientific/carpet-contour/add_contours.html @@ -0,0 +1,69 @@ +--- +name: Add Contours +language: plotly_js +suite: contourcarpet +order: 2 +sitemap: false +arrangement: horizontal +description: +--- + +var trace1 = { + type: 'contourcarpet', + a: [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], + b: [4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6], + z: [1, 1.96, 2.56, 3.0625, 4, 5.0625, 1, 7.5625, 9, 12.25, 15.21, 14.0625], + autocontour: false, + contours: { + start: 1, + end: 14, + size: 1 + }, + line: { + width: 2, + smoothing: 0 + }, + colorbar: { + len: 0.4, + y: 0.25 + } +} + +var trace2 = { + type: 'carpet', + a: [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], + b: [4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6], + x: [2, 3, 4, 5, 2.2, 3.1, 4.1, 5.1, 1.5, 2.5, 3.5, 4.5], + y: [1, 1.4, 1.6, 1.75, 2, 2.5, 2.7, 2.75, 3, 3.5, 3.7, 3.75], + aaxis: { + tickprefix: "a = ", + smoothing: 0, + minorgridcount: 9, + type: 'linear' +}, + baxis: { + tickprefix: "b = ", + smoothing: 0, + minorgridcount: 9, + type: 'linear' + } +} + +var layout = { + title: { + text: "Cheater plot with 1d input" + }, + margin: { + t: 40, r: 30, b: 30, l: 30 + }, + yaxis: { + range: [0.388,4.361] + }, + xaxis: { + range: [0.667,5.932] + } +} + +var data = [trace1,trace2] + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/scientific/carpet-contour/basic_contourcarpet.html b/content/plotly_js/scientific/carpet-contour/basic_contourcarpet.html new file mode 100644 index 00000000000..1fac3e8c30f --- /dev/null +++ b/content/plotly_js/scientific/carpet-contour/basic_contourcarpet.html @@ -0,0 +1,48 @@ +--- +name: Basic Carpet Plot +language: plotly_js +suite: contourcarpet +order: 1 +sitemap: false +arrangement: horizontal +description: +--- + +var trace1 = { + type: 'carpet', + a: [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], + b: [4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6], + x: [2, 3, 4, 5, 2.2, 3.1, 4.1, 5.1, 1.5, 2.5, 3.5, 4.5], + y: [1, 1.4, 1.6, 1.75, 2, 2.5, 2.7, 2.75, 3, 3.5, 3.7, 3.75], + aaxis: { + tickprefix: "a = ", + smoothing: 0, + minorgridcount: 9, + type: 'linear' +}, + baxis: { + tickprefix: "b = ", + smoothing: 0, + minorgridcount: 9, + type: 'linear' + } +} + +var layout = { + title: { + text: "Cheater plot with 1d input" + }, + margin: { + t: 40, r: 30, b: 30, l: 30 + }, + yaxis: { + range: [0.388,4.361] + }, + xaxis: { + range: [0.667,5.932] + } +} + +var data = [trace1] + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/scientific/carpet-contour/contourcarpet_index.html b/content/plotly_js/scientific/carpet-contour/contourcarpet_index.html new file mode 100644 index 00000000000..25d2904f137 --- /dev/null +++ b/content/plotly_js/scientific/carpet-contour/contourcarpet_index.html @@ -0,0 +1,13 @@ +--- +description: How to make D3.js-based carpet contour plots in Plotly.js. +display_as: scientific +language: plotly_js +layout: base +name: Carpet Contour Plot +order: 11 +permalink: javascript/carpet-contour/ +thumbnail: thumbnail/contourcarpet.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","contourcarpet" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/carpet-contour/mulitple_contourcarpet.html b/content/plotly_js/scientific/carpet-contour/mulitple_contourcarpet.html new file mode 100644 index 00000000000..d8c00502812 --- /dev/null +++ b/content/plotly_js/scientific/carpet-contour/mulitple_contourcarpet.html @@ -0,0 +1,189 @@ +--- +name: Add Multiple Traces +language: plotly_js +suite: contourcarpet +order: 3 +sitemap: false +arrangement: horizontal +description: +--- +function Get(url){ + var Httpreq = new XMLHttpRequest(); + Httpreq.open("GET",url,false); + Httpreq.send(null); + return Httpreq.responseText; +} + +var json_obj = JSON.parse(Get("https://raw.githubusercontent.com/bcdunbar/datasets/master/airfoil_data.json")); + +var trace1 = { + a: json_obj[0].a, + b: json_obj[0].b, + baxis: { + startline: false, + endline: false, + showticklabels: "none", + smoothing: 0, + showgrid: false + }, + x: json_obj[0].x, + y: json_obj[0].y, + type: "carpet", + aaxis:{ + startlinewidth: 2, + startline: true, + showticklabels: "none", + endline: true, + showgrid: false, + endlinewidth: 2, + smoothing: 0 + } + } + + var trace2 = { + autocolorscale: false, + zmax: 1, + name: "Pressure", + colorscale: "Viridis", + zmin: -8, + colorbar: { + y: 0, + yanchor: "bottom", + title: {side: + 'right' + }, + len: 0.75, + title: { + text: "Pressure coefficient, cp" + }, + }, + contours: { + start: -1, + size: 0.025, + end: 1.000, + showlines: false + }, + line: { + smoothing: 0 + }, + z: json_obj[1].z, + type: "contourcarpet", + autocontour: false, + zauto: false + } + + var trace3 = { + opacity: 0.300, + showlegend: true, + name: "Streamlines", + autocontour: true, + ncontours: 50, + contours: { + coloring: "none" + }, + line: { + color: "white", + width: 1 + }, + z: json_obj[2].z, + type: "contourcarpet" + } + + var trace4 = { + showlegend: true, + name: "Pressure
contours", + autocontour: false, + z: json_obj[3].z, + type: "contourcarpet", + line: { + color: "rgba(0, 0, 0, 0.5)", + smoothing: 1 + }, + contours: { + size: 0.250, + start: -4, + coloring: "none", + end: 1.000, + showlines: true + } + } + + var trace5 = { + legendgroup: "g1", + name: "Surface
pressure", + mode: "lines", + hoverinfo: "skip", + x: json_obj[4].x, + y: json_obj[4].y, + line: { + color: "rgba(255, 0, 0, 0.5)", + width: 1, + shape: "spline", + smoothing: 1 + }, + fill: "toself", + type: "scatter", + fillcolor: "rgba(255, 0, 0, 0.2)" + } + + var trace6 = { + showlegend: false, + legendgroup: "g1", + mode: "lines", + hoverinfo: "skip", + x: json_obj[5].x, + y: json_obj[5].y, + line: { + color: "rgba(255, 0, 0, 0.3)", + width: 1 + }, + type: "scatter" + } + + var trace7 = { + showlegend: false, + legendgroup: "g1", + name: "cp", + text: json_obj[6].text, + mode: "lines", + hoverinfo: "text", + x: json_obj[6].x, + y: json_obj[6].y, + line: { + color: "rgba(255, 0, 0, 0.2)", + width: 0 + }, + type: "scatter" + } + +data = [trace1,trace2,trace3,trace4,trace5,trace6,trace7] + +var layout = { + yaxis: { + zeroline: false, + range: [-1.800,1.800], + showgrid: false + }, + dragmode: "pan", + height: 700, + xaxis: { + zeroline: false, + scaleratio: 1, + scaleanchor: "y", + range: [-3.800,3.800], + showgrid: false + }, + title: { + text: "Flow over a Karman-Trefftz airfoil" + }, + hovermode: "closest", + margin: { + r: 60, + b: 40, + l: 40, + t: 80 + }, + width: 900 + } + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/carpet-scatter/add-scattercarpet-trace.html b/content/plotly_js/scientific/carpet-scatter/add-scattercarpet-trace.html new file mode 100644 index 00000000000..fe745769e2f --- /dev/null +++ b/content/plotly_js/scientific/carpet-scatter/add-scattercarpet-trace.html @@ -0,0 +1,39 @@ +--- +name: Add Carpet Scatter Trace +language: plotly_js +suite: scattercarpet +order: 2 +sitemap: false +arrangement: horizontal +description: +--- + +var trace1 = { + type: 'carpet', + a: [4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6].map(a => a * 1e-6), + b: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3].map(b => b * 1e6), + y: [2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10], + aaxis: { + tickprefix: 'a = ', + ticksuffix: 'm', + smoothing: 1, + minorgridcount: 9, + }, + baxis: { + tickprefix: 'b = ', + ticksuffix: 'Pa', + smoothing: 1, + minorgridcount: 9, + } +} + +var trace2 = { + type: 'scattercarpet', + a: [4, 4.5, 5, 6].map(a => a * 1e-6), + b: [1.5, 2.5, 1.5, 2.5].map(b => b * 1e6), + line: {shape: 'spline', smoothing: 1} +} + +var data = [trace1,trace2] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/scientific/carpet-scatter/basic-scattercarpet.html b/content/plotly_js/scientific/carpet-scatter/basic-scattercarpet.html new file mode 100644 index 00000000000..436c9a0ff5e --- /dev/null +++ b/content/plotly_js/scientific/carpet-scatter/basic-scattercarpet.html @@ -0,0 +1,32 @@ +--- +name: Basic Carpet Plot +language: plotly_js +suite: scattercarpet +order: 1 +sitemap: false +arrangement: horizontal +description: +--- + +var trace1 = { + type: 'carpet', + a: [4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6].map(a => a * 1e-6), + b: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3].map(b => b * 1e6), + y: [2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10], + aaxis: { + tickprefix: 'a = ', + ticksuffix: 'm', + smoothing: 1, + minorgridcount: 9, + }, + baxis: { + tickprefix: 'b = ', + ticksuffix: 'Pa', + smoothing: 1, + minorgridcount: 9, + } +} + +var data = [trace1] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/scientific/carpet-scatter/multiple_scattercarpet.html b/content/plotly_js/scientific/carpet-scatter/multiple_scattercarpet.html new file mode 100644 index 00000000000..5d02f5b58ad --- /dev/null +++ b/content/plotly_js/scientific/carpet-scatter/multiple_scattercarpet.html @@ -0,0 +1,106 @@ +--- +name: Add Multiple Carpet Scatter Traces +language: plotly_js +suite: scattercarpet +order: 3 +sitemap: false +arrangement: horizontal +description: +--- + +var trace1 = { + type: "carpet", + a: [0.1, 0.2, 0.3], + b: [1, 2, 3], + y: [ + [1, 2.2, 3], + [1.5, 2.7, 3.5], + [1.7, 2.9, 3.7] + ], + cheaterslope: 1, + aaxis: { + title: { + text: "a" + }, + tickmode: "linear", + dtick: 0.05, + minorgridcount: 9 + }, + baxis: { + title: { + text: "b" + }, + tickmode: "linear", + dtick: 0.5, + minorgridcount: 9 + } +} + +var trace2 = { + type: "scattercarpet", + name: "b = 1.5", + a: [0.05, 0.15, 0.25, 0.35], + b: [1.5, 1.5, 1.5, 1.5] +} + +var trace3 = { + type: "scattercarpet", + name: "b = 2", + a: [0.05, 0.15, 0.25, 0.35], + b: [2, 2, 2, 2] +} + +var trace4 = { + type: "scattercarpet", + name: "b = 2.5", + a: [0.05, 0.15, 0.25, 0.35], + b: [2.5, 2.5, 2.5, 2.5] +} + +var trace5 = { + type: "scattercarpet", + name: "a = 0.15", + a: [0.15, 0.15, 0.15, 0.15], + b: [0.5, 1.5, 2.5, 3.5], + line: { + smoothing: 1, + shape: "spline" + } +} + +var trace6 = { + type: "scattercarpet", + name: "a = 0.2", + a: [0.2, 0.2, 0.2, 0.2], + b: [0.5, 1.5, 2.5, 3.5], + line: { + smoothing: 1, + shape: "spline" + }, + marker: { + size: [10, 20, 30, 40], + color: ["#000", "#f00", "#ff0", "#fff"] + } +} + +var trace7 = { + type: "scattercarpet", + name: "a = 0.25", + a: [0.25, 0.25, 0.25, 0.25], + b: [0.5, 1.5, 2.5, 3.5], + line: { + smoothing: 1, + shape: "spline" + } +} + +var data = [trace1,trace2,trace3,trace4,trace5,trace6,trace7] + +var layout = { + title: { + text: "scattercarpet extrapolation, clipping, and smoothing" + }, + hovermode: "closest" +} + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/scientific/carpet-scatter/scattercarpet_index.html b/content/plotly_js/scientific/carpet-scatter/scattercarpet_index.html new file mode 100644 index 00000000000..bb32bd1b223 --- /dev/null +++ b/content/plotly_js/scientific/carpet-scatter/scattercarpet_index.html @@ -0,0 +1,13 @@ +--- +description: How to make D3.js-based carpet scatter plots in Plotly.js. +display_as: scientific +language: plotly_js +layout: base +name: Carpet Scatter Plot +order: 10 +permalink: javascript/carpet-scatter/ +thumbnail: thumbnail/scattercarpet.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","scattercarpet" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/carpet/add_axis_carpet.html b/content/plotly_js/scientific/carpet/add_axis_carpet.html new file mode 100644 index 00000000000..908c19bad00 --- /dev/null +++ b/content/plotly_js/scientific/carpet/add_axis_carpet.html @@ -0,0 +1,32 @@ +--- +name: Add A and B axis +language: plotly_js +suite: carpet +order: 3 +sitemap: false +arrangement: horizontal +description: +--- + +var data = { + type: 'carpet', + a: [4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6], + b: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], + y: [2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10], + aaxis: { + tickprefix: 'a = ', + ticksuffix: 'm', + smoothing: 1, + minorgridcount: 9 + }, + baxis: { + tickprefix: 'b = ', + ticksuffix: 'Pa', + smoothing: 1, + minorgridcount: 9 + } +} + +var data = [data] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/scientific/carpet/add_parameter_values.html b/content/plotly_js/scientific/carpet/add_parameter_values.html new file mode 100644 index 00000000000..9f5a265d207 --- /dev/null +++ b/content/plotly_js/scientific/carpet/add_parameter_values.html @@ -0,0 +1,20 @@ +--- +name: Add Parameter Values +language: plotly_js +suite: carpet +order: 2 +sitemap: false +arrangement: horizontal +description: +--- + +var data = { + type: 'carpet', + a: [4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6], + b: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], + y: [2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10] +} + +var data = [data] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/scientific/carpet/carpet_index.html b/content/plotly_js/scientific/carpet/carpet_index.html new file mode 100644 index 00000000000..5f11c12b807 --- /dev/null +++ b/content/plotly_js/scientific/carpet/carpet_index.html @@ -0,0 +1,14 @@ +--- +description: How to make D3.js-based carpet plots in Plotly.js. +display_as: scientific +language: plotly_js +layout: base +name: Carpet Plot +order: 9 +permalink: javascript/carpet-plot/ +redirect_from: javascript/carpet-plots/ +thumbnail: thumbnail/carpet.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","carpet" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/carpet/points-and-contours.html b/content/plotly_js/scientific/carpet/points-and-contours.html new file mode 100644 index 00000000000..b01c45d64a5 --- /dev/null +++ b/content/plotly_js/scientific/carpet/points-and-contours.html @@ -0,0 +1,9 @@ +--- +name: Add Points and Contours +language: plotly_js +suite: carpet +order: 5 +sitemap: false +arrangement: horizontal +description: To add points and lines see Carpet Scatter Plots or to add contours see Carpet Contour Plots +--- diff --git a/content/plotly_js/scientific/carpet/set_coordinates.html b/content/plotly_js/scientific/carpet/set_coordinates.html new file mode 100644 index 00000000000..65de33a62f9 --- /dev/null +++ b/content/plotly_js/scientific/carpet/set_coordinates.html @@ -0,0 +1,17 @@ +--- +name: Set X and Y Coordinates +language: plotly_js +suite: carpet +order: 1 +sitemap: false +arrangement: horizontal +description: +--- +var data = { + type: 'carpet', + y: [2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10] +} + +var data = [data] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/scientific/carpet/styled_carpet.html b/content/plotly_js/scientific/carpet/styled_carpet.html new file mode 100644 index 00000000000..3f5469d0791 --- /dev/null +++ b/content/plotly_js/scientific/carpet/styled_carpet.html @@ -0,0 +1,41 @@ +--- +name: Style A and B axis +language: plotly_js +suite: carpet +order: 4 +sitemap: false +arrangement: horizontal +description: +--- + +var trace1 = { + type: "carpet", + a: [4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6], + b: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], + y: [2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10], + aaxis: { + tickprefix: 'a = ', + ticksuffix: 'm', + smoothing: 1, + minorgridcount: 9, + minorgridcolor: 'white', + gridcolor: 'white', + color: 'white' + }, + baxis: { + tickprefix: 'b = ', + ticksuffix: 'pa', + smoothing: 1, + minorgridcount: 9, + minorgridcolor: 'white', + gridcolor: 'white', + color: 'white' + } +} + +var layout = { + plot_bgcolor: 'black', + paper_bgcolor: 'black' +} + +Plotly.newPlot('myDiv', [trace1], layout) diff --git a/content/plotly_js/scientific/contour/basic-contour.html b/content/plotly_js/scientific/contour/basic-contour.html new file mode 100644 index 00000000000..06ac1a5e057 --- /dev/null +++ b/content/plotly_js/scientific/contour/basic-contour.html @@ -0,0 +1,26 @@ +--- +name: Basic Contour Plot +language: plotly_js +suite: contour +order: 2 +sitemap: false +arrangement: horizontal +--- + +var data = [ { + z: [[10, 10.625, 12.5, 15.625, 20], + [5.625, 6.25, 8.125, 11.25, 15.625], + [2.5, 3.125, 5.0, 8.125, 12.5], + [0.625, 1.25, 3.125, 6.25, 10.625], + [0, 0.625, 2.5, 5.625, 10]], + type: 'contour' + } +]; + +var layout = { + title: { + text: 'Basic Contour Plot' + } +} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/color-bar-size-for-contour-plots.html b/content/plotly_js/scientific/contour/color-bar-size-for-contour-plots.html new file mode 100644 index 00000000000..0bc303da534 --- /dev/null +++ b/content/plotly_js/scientific/contour/color-bar-size-for-contour-plots.html @@ -0,0 +1,32 @@ +--- +name: Color Bar Size +language: plotly_js +suite: contour +order: 12 +sitemap: false +arrangement: horizontal +--- + +var data = [ { + 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]], + type: 'contour', + colorbar:{ + thickness: 75, + thicknessmode: 'pixels', + len: 0.9, + lenmode: 'fraction', + outlinewidth: 0 + } +}]; + +var layout = { + title: { + text: 'Colorbar Size for Contour Plots' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/color-bar-title.html b/content/plotly_js/scientific/contour/color-bar-title.html new file mode 100644 index 00000000000..0bc69b96e3f --- /dev/null +++ b/content/plotly_js/scientific/contour/color-bar-title.html @@ -0,0 +1,34 @@ +--- +name: Color Bar Title +language: plotly_js +suite: contour +order: 11 +sitemap: false +arrangement: horizontal +--- +var data = [ { + 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]], + type: 'contour', + colorbar:{ + title: { + text: 'Color Bar Title', + side: 'right', + font: { + size: 14, + family: 'Arial, sans-serif' + } + } + } +}]; + +var layout = { + title: { + text: 'Colorbar with a Title' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/colorscale-for-contour-plot.html b/content/plotly_js/scientific/contour/colorscale-for-contour-plot.html new file mode 100644 index 00000000000..c299d2d6fbe --- /dev/null +++ b/content/plotly_js/scientific/contour/colorscale-for-contour-plot.html @@ -0,0 +1,26 @@ +--- +name: Colorscale for Contour Plot +language: plotly_js +suite: contour +order: 4 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + 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]], + type: 'contour', + colorscale: 'Jet', +}]; + +var layout = { + title: { + text: 'Colorscale for Contour Plot' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/connect-gaps-in-matrix-contour.html b/content/plotly_js/scientific/contour/connect-gaps-in-matrix-contour.html new file mode 100644 index 00000000000..84f86c588e8 --- /dev/null +++ b/content/plotly_js/scientific/contour/connect-gaps-in-matrix-contour.html @@ -0,0 +1,93 @@ +--- +name: Connect the Gaps between Null Values in the Z Matrix +language: plotly_js +suite: contour +order: 7 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + z: [[null, null, null, 12, 13, 14, 15, 16], + [null, 1, null, 11, null, null, null, 17], + [null, 2, 6, 7, null, null, null, 18], + [null, 3, null, 8, null, null, null, 19], + [5, 4, 10, 9, null, null, null, 20], + [null, null, null, 27, null, null, null, 21], + [null, null, null, 26, 25, 24, 23, 22]], + type: 'contour', + showscale: false, + xaxis: 'x1', + yaxis: 'y1' +}; + +var trace2 = { + z: [[null, null, null, 12, 13, 14, 15, 16], + [null, 1, null, 11, null, null, null, 17], + [null, 2, 6, 7, null, null, null, 18], + [null, 3, null, 8, null, null, null, 19], + [5, 4, 10, 9, null, null, null, 20], + [null, null, null, 27, null, null, null, 21], + [null, null, null, 26, 25, 24, 23, 22]], + connectgaps: true, + type: 'contour', + showscale: false, + xaxis: 'x2', + yaxis: 'y2' +}; + +var trace3 = { + z: [[null, null, null, 12, 13, 14, 15, 16], + [null, 1, null, 11, null, null, null, 17], + [null, 2, 6, 7, null, null, null, 18], + [null, 3, null, 8, null, null, null, 19], + [5, 4, 10, 9, null, null, null, 20], + [null, null, null, 27, null, null, null, 21], + [null, null, null, 26, 25, 24, 23, 22]], + zsmooth: 'best', + type: 'heatmap', + showscale: false, + xaxis: 'x3', + yaxis: 'y3' +}; + +var trace4 = { + z: [[null, null, null, 12, 13, 14, 15, 16], + [null, 1, null, 11, null, null, null, 17], + [null, 2, 6, 7, null, null, null, 18], + [null, 3, null, 8, null, null, null, 19], + [5, 4, 10, 9, null, null, null, 20], + [null, null, null, 27, null, null, null, 21], + [null, null, null, 26, 25, 24, 23, 22]], + zsmooth: 'best', + type: 'heatmap', + showscale: false, + connectgaps: true, + xaxis: 'x4', + yaxis: 'y4' +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + title: { + text: 'Connect the Gaps Between Null Values in the Z Matrix' + }, + xaxis: {domain: [0, 0.45], + anchor: 'y1'}, + yaxis: {domain: [0.55, 1], + anchor: 'x1'}, + xaxis2: {domain: [0.55, 1], + anchor: 'y2'}, + yaxis2: {domain: [0.55, 1], + anchor: 'x2'}, + xaxis3: {domain: [0, 0.45], + anchor: 'y3'}, + yaxis3: {domain: [0, 0.45], + anchor: 'x3'}, + xaxis4: {domain: [0.55, 1], + anchor: 'y4'}, + yaxis4: {domain: [0, 0.45], + anchor: 'x4'} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/contour-line-labels.html b/content/plotly_js/scientific/contour/contour-line-labels.html new file mode 100644 index 00000000000..694f68e5097 --- /dev/null +++ b/content/plotly_js/scientific/contour/contour-line-labels.html @@ -0,0 +1,34 @@ +--- +name: Contour Line Labels +language: plotly_js +suite: contour +order: 9.5 +sitemap: false +arrangement: horizontal +--- + +var data = [ { + z: [[10, 10.625, 12.5, 15.625, 20], + [5.625, 6.25, 8.125, 11.25, 15.625], + [2.5, 3.125, 5.0, 8.125, 12.5], + [0.625, 1.25, 3.125, 6.25, 10.625], + [0, 0.625, 2.5, 5.625, 10]], + type: 'contour', + contours: { + coloring: 'heatmap', + showlabels: true, + labelfont: { + family: 'Raleway', + size: 12, + color: 'white', + } + } +}]; + +var layout = { + title: { + text: 'Contour with Labels' + } +} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/contour-lines.html b/content/plotly_js/scientific/contour/contour-lines.html new file mode 100644 index 00000000000..20e3ba0a961 --- /dev/null +++ b/content/plotly_js/scientific/contour/contour-lines.html @@ -0,0 +1,28 @@ +--- +name: Contour Lines +language: plotly_js +suite: contour +order: 9 +sitemap: false +arrangement: horizontal +--- +var data = [ { + 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]], + type: 'contour', + colorscale: 'Jet', + contours:{ + coloring: 'lines' + } +}]; + +var layout = { + title: { + text: 'Contour Lines' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/contour_plotly_js_index.html b/content/plotly_js/scientific/contour/contour_plotly_js_index.html new file mode 100644 index 00000000000..8eb71c59c82 --- /dev/null +++ b/content/plotly_js/scientific/contour/contour_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make a D3.js-based contour plot in javascript. Examples of contour + plots of matrices with subplots, custom color-scales, and smoothing. +display_as: scientific +language: plotly_js +layout: base +name: Contour Plots +order: 1 +page_type: example_index +permalink: javascript/contour-plots/ +redirect_from: javascript-graphing-library/contour-plots/ +thumbnail: thumbnail/contour.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","contour" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/contour/cumtom-size-and-range-contour.html b/content/plotly_js/scientific/contour/cumtom-size-and-range-contour.html new file mode 100644 index 00000000000..086c133901c --- /dev/null +++ b/content/plotly_js/scientific/contour/cumtom-size-and-range-contour.html @@ -0,0 +1,32 @@ +--- +name: Customizing Size and Range of a Contour Plot's Contours +language: plotly_js +suite: contour +order: 5 +sitemap: false +arrangement: horizontal +--- + +var data = [ { + 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]], + type: 'contour', + colorscale: 'Jet', + autocontour: false, + contours: { + start: 0, + end: 8, + size: 2 + } +}]; + +var layout = { + title: { + text: 'Customizing Size and Range of Contours' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/custom-colorscale-for-contour-plot.html b/content/plotly_js/scientific/contour/custom-colorscale-for-contour-plot.html new file mode 100644 index 00000000000..92dc1e37e53 --- /dev/null +++ b/content/plotly_js/scientific/contour/custom-colorscale-for-contour-plot.html @@ -0,0 +1,27 @@ +--- +name: Custom Colorscale for Contour Plot +language: plotly_js +suite: contour +order: 10 +sitemap: false +arrangement: horizontal +--- + +var data = [ { + 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]], + type: 'contour', + colorscale: [[0, 'rgb(166,206,227)'], [0.25, 'rgb(31,120,180)'], [0.45, 'rgb(178,223,138)'], [0.65, 'rgb(51,160,44)'], [0.85, 'rgb(251,154,153)'], [1, 'rgb(227,26,28)']] +} +]; + +var layout = { + title: { + text: 'Custom Contour Plot Colorscale' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/customizing-spacing-between-x-and-y-ticks.html b/content/plotly_js/scientific/contour/customizing-spacing-between-x-and-y-ticks.html new file mode 100644 index 00000000000..f5ca487b622 --- /dev/null +++ b/content/plotly_js/scientific/contour/customizing-spacing-between-x-and-y-ticks.html @@ -0,0 +1,29 @@ +--- +name: Customizing Spacing Between X and Y Ticks +language: plotly_js +suite: contour +order: 6 +sitemap: false +arrangement: horizontal +--- +var data = [ { + 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]], + type: 'contour', + colorscale: 'Jet', + dx: 10, + x0: 5, + dy: 10, + y0: 10 +}]; + +var layout = { + title: { + text: 'Customizing Spacing Between X and Y Axis Ticks' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/setting-xy-coordinates-contour.html b/content/plotly_js/scientific/contour/setting-xy-coordinates-contour.html new file mode 100644 index 00000000000..5ec10a793d6 --- /dev/null +++ b/content/plotly_js/scientific/contour/setting-xy-coordinates-contour.html @@ -0,0 +1,26 @@ +--- +name: Setting X and Y Coordinates in a Contour Plot +language: plotly_js +suite: contour +order: 3 +sitemap: false +arrangement: horizontal +--- +var data = [{ + 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]], + x: [-9, -6, -5 , -3, -1], + y: [0, 1, 4, 5, 7], + type: 'contour' +}]; + +var layout = { + title: { + text: 'Setting the X and Y Coordinates in a Contour Plot' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/simple-contour.html b/content/plotly_js/scientific/contour/simple-contour.html new file mode 100644 index 00000000000..848434a750d --- /dev/null +++ b/content/plotly_js/scientific/contour/simple-contour.html @@ -0,0 +1,31 @@ +--- +name: Simple Contour Plot +language: plotly_js +suite: contour +order: 1 +sitemap: false +arrangement: horizontal +--- +var size = 100, x = new Array(size), y = new Array(size), z = new Array(size), i, j; + +for(var i = 0; i < size; i++) { + x[i] = y[i] = -2 * Math.PI + 4 * Math.PI * i / size; + z[i] = new Array(size); +} + +for(var i = 0; i < size; i++) { + for(j = 0; j < size; j++) { + var r2 = x[i]*x[i] + y[j]*y[j]; + z[i][j] = Math.sin(x[i]) * Math.cos(y[j]) * Math.sin(r2) / Math.log(r2+1); + } +} + +var data = [ { + z: z, + x: x, + y: y, + type: 'contour' + } +]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/scientific/contour/smooth-contour-coloring.html b/content/plotly_js/scientific/contour/smooth-contour-coloring.html new file mode 100644 index 00000000000..4edd1f618e8 --- /dev/null +++ b/content/plotly_js/scientific/contour/smooth-contour-coloring.html @@ -0,0 +1,27 @@ +--- +name: Smooth Contour Coloring +language: plotly_js +suite: contour +order: 9 +sitemap: false +arrangement: horizontal +--- +var data = [ { + 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]], + type: 'contour', + contours: { + coloring: 'heatmap' + } +}]; + +var layout = { + title: { + text: 'Smooth Contour Coloring' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/smoothing-contour-lines.html b/content/plotly_js/scientific/contour/smoothing-contour-lines.html new file mode 100644 index 00000000000..530270c86e9 --- /dev/null +++ b/content/plotly_js/scientific/contour/smoothing-contour-lines.html @@ -0,0 +1,55 @@ +--- +name: Smoothing Contour Lines +language: plotly_js +suite: contour +order: 8 +sitemap: false +arrangement: horizontal +--- + +var data = [ { + 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]], + type: 'contour', + line:{ + smoothing: 0 + }, + xaxis: 'x1', + yaxis: 'y1' +}, +{ + 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]], + type: 'contour', + line:{ + smoothing: 0.85 + }, + xaxis: 'x2', + yaxis: 'y2' +}]; + +var layout = { + title: { + text: 'Smoothing Contour Lines' + }, + xaxis: {domain: [0, 0.45], + anchor: 'y1'}, + yaxis: {domain: [0, 1], + anchor: 'x1'}, + xaxis2: {domain: [0.55, 1], + anchor: 'y2'}, + yaxis2: {domain: [0, 1], + anchor: 'x2'} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/contour/styling-color-bar-ticks-for-contour-plots.html b/content/plotly_js/scientific/contour/styling-color-bar-ticks-for-contour-plots.html new file mode 100644 index 00000000000..20fc2ad9254 --- /dev/null +++ b/content/plotly_js/scientific/contour/styling-color-bar-ticks-for-contour-plots.html @@ -0,0 +1,36 @@ +--- +name: Styling Color Bar Ticks for Contour Plots +language: plotly_js +suite: contour +order: 13 +sitemap: false +arrangement: horizontal +--- +var data = [ { + 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]], + type: 'contour', + colorbar:{ + ticks: 'outside', + dtick: 1, + tickwidth: 2, + ticklen: 10, + tickcolor: 'grey', + showticklabels: true, + tickfont: { + size: 15 + }, + xpad: 50 + } +}]; + +var layout = { + title: { + text: 'Styling Color Bar Ticks for Contour Plots' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/heatmap/annotated-heatmap.html b/content/plotly_js/scientific/heatmap/annotated-heatmap.html new file mode 100644 index 00000000000..8f8e2e0a09f --- /dev/null +++ b/content/plotly_js/scientific/heatmap/annotated-heatmap.html @@ -0,0 +1,80 @@ +--- +name: Annotated Heatmap +language: plotly_js +suite: heatmap +order: 3 +sitemap: false +arrangement: horizontals +--- +var xValues = ['A', 'B', 'C', 'D', 'E']; + +var yValues = ['W', 'X', 'Y', 'Z']; + +var zValues = [ + [0.00, 0.00, 0.75, 0.75, 0.00], + [0.00, 0.00, 0.75, 0.75, 0.00], + [0.75, 0.75, 0.75, 0.75, 0.75], + [0.00, 0.00, 0.00, 0.75, 0.00] +]; + +var colorscaleValue = [ + [0, '#3D9970'], + [1, '#001f3f'] +]; + +var data = [{ + x: xValues, + y: yValues, + z: zValues, + type: 'heatmap', + colorscale: colorscaleValue, + showscale: false +}]; + +var layout = { + title: { + text: 'Annotated Heatmap' + }, + annotations: [], + xaxis: { + ticks: '', + side: 'top' + }, + yaxis: { + ticks: '', + ticksuffix: ' ', + width: 700, + height: 700, + autosize: false + } +}; + +for ( var i = 0; i < yValues.length; i++ ) { + for ( var j = 0; j < xValues.length; j++ ) { + var currentValue = zValues[i][j]; + if (currentValue != 0.0) { + var textColor = 'white'; + }else{ + var textColor = 'black'; + } + var result = { + xref: 'x1', + yref: 'y1', + x: xValues[j], + y: yValues[i], + text: zValues[i][j], + font: { + family: 'Arial', + size: 12, + color: 'rgb(50, 171, 96)' + }, + showarrow: false, + font: { + color: textColor + } + }; + layout.annotations.push(result); + } +} + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/heatmap/basic-heatmap.html b/content/plotly_js/scientific/heatmap/basic-heatmap.html new file mode 100644 index 00000000000..9422646bd9a --- /dev/null +++ b/content/plotly_js/scientific/heatmap/basic-heatmap.html @@ -0,0 +1,16 @@ +--- +name: Basic Heatmap +language: plotly_js +suite: heatmap +order: 1 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + z: [[1, 20, 30], [20, 1, 60], [30, 60, 1]], + type: 'heatmap' + } +]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/scientific/heatmap/heatmap-with-unequal-block-sizes.html b/content/plotly_js/scientific/heatmap/heatmap-with-unequal-block-sizes.html new file mode 100644 index 00000000000..5392dde5ba6 --- /dev/null +++ b/content/plotly_js/scientific/heatmap/heatmap-with-unequal-block-sizes.html @@ -0,0 +1,113 @@ +--- +name: Heatmap with Unequal Block Sizes +language: plotly_js +suite: heatmap +order: 4 +sitemap: false +arrangement: horizontal +--- +function linspace(a,b,n) { + return d3.range(n).map(function(i){return a+i*(b-a)/(n-1);}); +} +//number of spiral loops + +var nspiral = 2; + +// angle + +var th = linspace(((-Math.PI) / 13), (2 * Math.PI * nspiral), 1000); + +//Empty Value Containers + +var xValues = []; +var yValues = []; +var yShift = []; +var finalX = []; +var finalY = []; + +//spiral + +for(var i = 0; i < th.length; i++){ + var a = 1.120529; + var b = 0.306349; + var r = a * Math.exp((-b) * th[i]); + var xResult = (r * Math.cos(th[i])); + var yResult = (r * Math.sin(th[i])); + xValues.push(xResult); + yValues.push(yResult); +} + +function getMaxOfArray(numArray) { + return Math.max.apply(null, numArray); +}; + +function getMinOfArray(numArray) { + return Math.min.apply(null, numArray); +}; + +//Shift spiral north so that it is centered + +var yShift = (1.6 - (getMaxOfArray(yValues) - getMinOfArray(yValues))) / 2; + +var spiralTrace = { + x: xValues.map(function(xi) { return -(xi) + xValues[0]; }), + y: yValues.map(function(yi) { return yi - yValues[0] + yShift; }), + type: 'scatter', + line: { + color: 'white', + width: 3 + } +}; + +//Build the rectangles as a heatmap and specify the edges of the heatmap squares + +var phi = (1 + Math.sqrt(5)) / 2; +var xe = [0, 1, (1 + (1 / Math.pow(phi,4))), 1 + (1 / Math.pow(phi,3)), phi]; +var ye = [0, (1 / Math.pow(phi,3)), (1 / Math.pow(phi,3)) + (1 / Math.pow(phi,4)), (1 / Math.pow(phi,2)), 1]; + +var zValues = [ + [13, 3, 3, 5], + [13, 2, 1, 5], + [13, 10, 11, 12], + [13, 8, 8, 8] +]; + +var hm = { + x: xe, + y: ye.map(function(yi) { return yi + yShift; }), + z: zValues, + type: 'heatmap', + colorscale: 'Viridis' +}; + +var axisTemplate = { + range: [0, 1.6], + autorange: false, + showgrid: false, + zeroline: false, + linecolor: 'black', + showticklabels: false, + ticks: '' +}; + +var data = [spiralTrace, hm]; + +var layout = { + title: { + text: 'Heatmap with Unequal Block Sizes' + }, + margin: { + t: 200, + r: 200, + b: 200, + l: 200 + }, + xaxis: axisTemplate, + yaxis: axisTemplate, + showlegend: false, + width: 700, + height: 700, + autosize: false +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/heatmap/heatmap_plotly_js_index.html b/content/plotly_js/scientific/heatmap/heatmap_plotly_js_index.html new file mode 100644 index 00000000000..358720715db --- /dev/null +++ b/content/plotly_js/scientific/heatmap/heatmap_plotly_js_index.html @@ -0,0 +1,19 @@ +--- +description: How to make a D3.js-based heatmap in javascript with a matrix. Seven + examples of colored and labeled heatmaps with custom colorscales. +display_as: scientific +language: plotly_js +layout: base +name: Heatmaps +order: 2 +page_type: example_index +permalink: javascript/heatmaps/ +redirect_from: +- javascript-graphing-library/heatmaps/ +- javascript-graphing-library/heatmap-webgl/ +- javascript/heatmap-webgl/ +thumbnail: thumbnail/heatmap.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","heatmap" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/heatmap/labelled-heatmap.html b/content/plotly_js/scientific/heatmap/labelled-heatmap.html new file mode 100644 index 00000000000..19275880c91 --- /dev/null +++ b/content/plotly_js/scientific/heatmap/labelled-heatmap.html @@ -0,0 +1,22 @@ +--- +name: Heatmap with Categorical Axis Labels +language: plotly_js +suite: heatmap +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + + In this example we also show how to ignore [hovertext](https://plotly.com/javascript/hover-text-and-formatting/) when we have missing values in the data by setting the [hoverongaps](https://plotly.com/javascript/reference/heatmap/#heatmap-hoverongaps) to False. +--- +var data = [ + { + z: [[1, null, 30, 50, 1], [20, 1, 60, 80, 30], [30, 60, 1, -10, 20]], + x: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], + y: ['Morning', 'Afternoon', 'Evening'], + type: 'heatmap', + hoverongaps: false + } +]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/scientific/log/log_plotly_js_index.html b/content/plotly_js/scientific/log/log_plotly_js_index.html new file mode 100644 index 00000000000..12ea2b6969b --- /dev/null +++ b/content/plotly_js/scientific/log/log_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make a plot with D3.js-based logarithmic axes in javascript. +display_as: scientific +language: plotly_js +layout: base +name: Log Plots +order: 5 +page_type: example_index +permalink: javascript/log-plot/ +redirect_from: javascript-graphing-library/log-plot/ +thumbnail: thumbnail/log.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","log" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/log/plotly-log-axes.html b/content/plotly_js/scientific/log/plotly-log-axes.html new file mode 100644 index 00000000000..c2eb1cbaf09 --- /dev/null +++ b/content/plotly_js/scientific/log/plotly-log-axes.html @@ -0,0 +1,34 @@ +--- +name: Logarithmic Axes +language: plotly_js +suite: log +order: 2 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [8, 7, 6, 5, 4, 3, 2, 1, 0], + type: 'scatter' +}; + +var trace2 = { + x: [0, 1, 2, 3, 4, 5, 6, 7, 8], + y: [0, 1, 2, 3, 4, 5, 6, 7, 8], + type: 'scatter' +}; + +var data = [trace1, trace2]; + +var layout = { + xaxis: { + type: 'log', + autorange: true + }, + yaxis: { + type: 'log', + autorange: true + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/parcoords/adding_dimensions.html b/content/plotly_js/scientific/parcoords/adding_dimensions.html new file mode 100644 index 00000000000..f7c7f918c80 --- /dev/null +++ b/content/plotly_js/scientific/parcoords/adding_dimensions.html @@ -0,0 +1,44 @@ +--- +name: Adding Dimensions +language: plotly_js +suite: parcoords +order: 1 +sitemap: false +arrangement: horizontal +description: +markdown_content: | + Parallel coordinates are richly interactive by default. Drag the lines along the axes to filter regions and drag the axis names across the plot to rearrange variables: ![IPython terminal](https://s3-us-west-1.amazonaws.com/plotly-tutorials/plotly-documentation/images/js_parcoords_ex1.gif) +--- + +var trace = { + type: 'parcoords', + line: { + color: 'blue' + }, + + dimensions: [{ + range: [1, 5], + constraintrange: [1, 2], + label: 'A', + values: [1,4] + }, { + range: [1,5], + label: 'B', + values: [3,1.5], + tickvals: [1.5,3,4.5] + }, { + range: [1, 5], + label: 'C', + values: [2,4], + tickvals: [1,2,4,5], + ticktext: ['text 1','text 2','text 4','text 5'] + }, { + range: [1, 5], + label: 'D', + values: [4,2] + }] +}; + +var data = [trace] + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/scientific/parcoords/advanced_parcoords.html b/content/plotly_js/scientific/parcoords/advanced_parcoords.html new file mode 100644 index 00000000000..e2f94d111e8 --- /dev/null +++ b/content/plotly_js/scientific/parcoords/advanced_parcoords.html @@ -0,0 +1,79 @@ +--- +name: Advanced Parallel Coordinates Plot +language: plotly_js +suite: parcoords +order: 3 +sitemap: false +arrangement: horizontal +description: +--- + +d3.csv('https://raw.githubusercontent.com/bcdunbar/datasets/master/parcoords_data.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var data = [{ + type: 'parcoords', + line: { + showscale: true, + reversescale: true, + colorscale: 'Jet', + cmin: -4000, + cmax: -100, + color: unpack(rows, 'colorVal') + }, + + dimensions: [{ + constraintrange: [100000, 150000], + range: [32000, 227900], + label: 'Block height', + values: unpack(rows, 'blockHeight') + }, { + range: [0, 700000], + label: 'Block width', + values: unpack(rows, 'blockWidth') + }, { + label: 'Cylinder material', + tickvals: [0, 0.5, 1, 2, 3], + ticktext: ['A', 'AB', 'B', 'Y', 'Z'], + values: unpack(rows, 'cycMaterial') + }, { + label: 'Block material', + tickvals: [0, 1, 2, 3], + range: [-1, 4], + values: unpack(rows, 'blockMaterial') + }, { + range: [134, 3154], + label: 'Total weight', + visible: true, + values: unpack(rows, 'totalWeight') + }, { + range: [9, 19984], + label: 'Assembly penalty weight', + values: unpack(rows, 'assemblyPW') + }, { + range: [49000, 568000], + label: 'Height st width', + values: unpack(rows, 'HstW') + }, { + range: [-28000, 196430], + label: 'Min height width', + values: unpack(rows, 'minHW') + }, { + range: [98453, 501789], + label: 'Min width diameter', + values: unpack(rows, 'minWD') + }, { + range: [1417, 107154], + label: 'RF block', + values: unpack(rows, 'rfBlock') + }] +}]; + +Plotly.newPlot('myDiv', data); + +}); diff --git a/content/plotly_js/scientific/parcoords/annotated_parcoords.html b/content/plotly_js/scientific/parcoords/annotated_parcoords.html new file mode 100644 index 00000000000..6878b28f183 --- /dev/null +++ b/content/plotly_js/scientific/parcoords/annotated_parcoords.html @@ -0,0 +1,61 @@ +--- +name: Annotated Parallel Coordinates Plot +language: plotly_js +suite: parcoords +order: 2.5 +sitemap: false +arrangement: horizontal +description: +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/iris-id.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var data = [{ + type: 'parcoords', + pad: [80,80,80,80], + line: { + color: unpack(rows, 'species_id'), + colorscale: [[0, 'red'], [0.5, 'green'], [1, 'blue']] + }, + + dimensions: [{ + range: [2, 4.5], + label: 'sepal_width', + values: unpack(rows, 'sepal_width') + }, { + constraintrange: [5, 6], + range: [4,8], + label: 'sepal_length', + values: unpack(rows, 'sepal_length') + }, { + label: 'petal_width', + range: [0, 2.5], + values: unpack(rows, 'petal_width') + }, { + label: 'petal_length', + range: [1, 7], + values: unpack(rows, 'petal_length') + }] +}]; + +var layout = { + width: 800, + annotations: [ + {showarrow: false, + text: 'Higher sepal width', + x: 0, y: 1, xref: 'paper', yref: 'paper'}, + {showarrow: false, + text: 'Lower petal width and length', + x: 0.9, y: .25, xref: 'paper', yref: 'paper' + }] +}; + +Plotly.newPlot('myDiv', data, layout); + +}); diff --git a/content/plotly_js/scientific/parcoords/basic_parcoords.html b/content/plotly_js/scientific/parcoords/basic_parcoords.html new file mode 100644 index 00000000000..2658f8da508 --- /dev/null +++ b/content/plotly_js/scientific/parcoords/basic_parcoords.html @@ -0,0 +1,53 @@ +--- +name: Basic Parallel Coordinates Plot +language: plotly_js +suite: parcoords +order: 2 +sitemap: false +arrangement: horizontal +description: +--- + +d3.csv('https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv', function(err, rows){ + +function unpack(rows, key) { + return rows.map(function(row) { + return row[key]; + }); +} + +var data = [{ + type: 'parcoords', + pad: [80,80,80,80], + line: { + color: unpack(rows, 'species_id'), + colorscale: [[0, 'red'], [0.5, 'green'], [1, 'blue']] + }, + + dimensions: [{ + range: [2, 4.5], + label: 'sepal_width', + values: unpack(rows, 'sepal_width') + }, { + constraintrange: [5, 6], + range: [4,8], + label: 'sepal_length', + values: unpack(rows, 'sepal_length') + }, { + label: 'petal_width', + range: [0, 2.5], + values: unpack(rows, 'petal_width') + }, { + label: 'petal_length', + range: [1, 7], + values: unpack(rows, 'petal_length') + }] +}]; + +var layout = { + width: 800 +}; + +Plotly.newPlot('myDiv', data, layout); + +}); diff --git a/content/plotly_js/scientific/parcoords/parcoords_index.html b/content/plotly_js/scientific/parcoords/parcoords_index.html new file mode 100644 index 00000000000..eafcf6764e5 --- /dev/null +++ b/content/plotly_js/scientific/parcoords/parcoords_index.html @@ -0,0 +1,14 @@ +--- +description: How to make D3.js-based parallel coordinates plots in Plotly.js. +display_as: scientific +language: plotly_js +layout: base +name: Parallel Coordinates Plot +order: 4 +page_type: example_index +permalink: javascript/parallel-coordinates-plot/ +thumbnail: thumbnail/parcoords.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","parcoords" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/plotly_js-scientific-index.html b/content/plotly_js/scientific/plotly_js-scientific-index.html new file mode 100644 index 00000000000..f4d7c6eff2b --- /dev/null +++ b/content/plotly_js/scientific/plotly_js-scientific-index.html @@ -0,0 +1,27 @@ +--- +permalink: javascript/scientific-charts/ +description: Plotly.js makes interactive, publication-quality graphs online. Examples of how to make scientific graphs such as heatmaps and contour plots. +name: Scientific Charts +layout: langindex +language: plotly_js +display_as: scientific +thumbnail: thumbnail/mixed.jpg +--- + + +
+
+ +
+ +
+

Plotly.js Scientific Charts

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","scientific" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/scientific/radar/basic-radar.html b/content/plotly_js/scientific/radar/basic-radar.html new file mode 100644 index 00000000000..51f055fbeb9 --- /dev/null +++ b/content/plotly_js/scientific/radar/basic-radar.html @@ -0,0 +1,27 @@ +--- +name: Basic Radar Chart +language: plotly_js +suite: radar +order: 1 +sitemap: false +arrangement: horizontal +--- + +data = [{ + type: 'scatterpolar', + r: [39, 28, 8, 7, 28, 39], + theta: ['A','B','C', 'D', 'E', 'A'], + fill: 'toself' +}] + +layout = { + polar: { + radialaxis: { + visible: true, + range: [0, 50] + } + }, + showlegend: false +} + +Plotly.newPlot("myDiv", data, layout) diff --git a/content/plotly_js/scientific/radar/multiple-trace-radar.html b/content/plotly_js/scientific/radar/multiple-trace-radar.html new file mode 100644 index 00000000000..71a89ac4256 --- /dev/null +++ b/content/plotly_js/scientific/radar/multiple-trace-radar.html @@ -0,0 +1,36 @@ +--- +name: Multiple Trace Radar Chart +language: plotly_js +suite: radar +order: 2 +sitemap: false +arrangement: horizontal +--- + +data = [ + { + type: 'scatterpolar', + r: [39, 28, 8, 7, 28, 39], + theta: ['A','B','C', 'D', 'E', 'A'], + fill: 'toself', + name: 'Group A' + }, + { + type: 'scatterpolar', + r: [1.5, 10, 39, 31, 15, 1.5], + theta: ['A','B','C', 'D', 'E', 'A'], + fill: 'toself', + name: 'Group B' + } +] + +layout = { + polar: { + radialaxis: { + visible: true, + range: [0, 50] + } + } +} + +Plotly.newPlot("myDiv", data, layout) diff --git a/content/plotly_js/scientific/radar/radar-chart-plotlyjs-index.html b/content/plotly_js/scientific/radar/radar-chart-plotlyjs-index.html new file mode 100644 index 00000000000..b094187a2b6 --- /dev/null +++ b/content/plotly_js/scientific/radar/radar-chart-plotlyjs-index.html @@ -0,0 +1,13 @@ +--- +description: How to make D3.js-based radar charts in Plotly.js. +display_as: scientific +language: plotly_js +layout: base +name: Radar Charts +order: 8 +permalink: javascript/radar-chart/ +thumbnail: thumbnail/radar.gif +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","radar" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/scatterpolar/area-polar-chart.html b/content/plotly_js/scientific/scatterpolar/area-polar-chart.html new file mode 100644 index 00000000000..4236155ea06 --- /dev/null +++ b/content/plotly_js/scientific/scatterpolar/area-polar-chart.html @@ -0,0 +1,78 @@ +--- +name: Area Polar Chart +language: plotly_js +suite: scatterpolar +order: 2 +sitemap: false +arrangement: horizontal +--- + +data = [ + { + type: "scatterpolar", + mode: "lines", + r: [0, 1.5, 1.5, 0, 2.5, 2.5, 0], + theta: [0, 10, 25, 0, 205, 215, 0], + fill: "toself", + fillcolor: '#709BFF', + line: { + color: 'black' + } + }, + { + type: "scatterpolar", + mode: "lines", + r: [0, 3.5, 3.5, 0], + theta: [0, 55, 75, 0], + fill: "toself", + fillcolor: '#E4FF87', + line: { + color: 'black' + } + }, + { + type: "scatterpolar", + mode: "lines", + r: [0, 4.5, 4.5, 0, 4.5, 4.5, 0], + theta: [0, 100, 120, 0, 305, 320, 0], + fill: "toself", + fillcolor: '#FFAA70', + line: { + color: 'black' + } + }, + { + type: "scatterpolar", + mode: "lines", + r: [0, 4, 4, 0], + theta: [0, 165, 195, 0], + fill: "toself", + fillcolor: '#FFDF70', + line: { + color: 'black' + } + }, + { + type: "scatterpolar", + mode: "lines", + r: [0, 3, 3, 0], + theta: [0, 262.5, 277.5, 0], + fill: "toself", + fillcolor: '#B6FFB4', + line: { + color: 'black' + } + } +] + +layout = { + polar: { + radialaxis: { + visible: true, + range: [0, 5] + } + }, + showlegend: false +} + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/scientific/scatterpolar/categorical-polar-chart.html b/content/plotly_js/scientific/scatterpolar/categorical-polar-chart.html new file mode 100644 index 00000000000..f38ffadd78d --- /dev/null +++ b/content/plotly_js/scientific/scatterpolar/categorical-polar-chart.html @@ -0,0 +1,104 @@ +--- +name: Categorical Polar Chart +language: plotly_js +suite: scatterpolar +order: 3 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + type: "scatterpolar", + name: "angular categories", + r: [5, 4, 2, 4, 5], + theta: ["a", "b", "c", "d", "a"], + fill: "toself" + }, + { + type: "scatterpolar", + name: "radial categories", + r: ["a", "b", "c", "d", "b", "f", "a"], + theta: [1, 4, 2, 1.5, 1.5, 6, 5], + thetaunit: "radians", + fill: "toself", + subplot: "polar2" + }, + { + type: "scatterpolar", + name: "angular categories (w/ categoryarray)", + r: [5, 4, 2, 4, 5], + theta: ["a", "b", "c", "d", "a"], + fill: "toself", + subplot: "polar3" + }, + { + type: "scatterpolar", + name: "radial categories (w/ category descending)", + r: ["a", "b", "c", "d", "b", "f", "a", "a"], + theta: [45, 90, 180, 200, 300, 15, 20, 45], + fill: "toself", + subplot: "polar4" + }, + { + type: "scatterpolar", + name: "angular categories (w/ extra category)", + r: [5, 4, 2, 4, 5, 5], + theta: ["b", "c", "d", "e", "a", "b"], + fill: "toself" + } + ] + +var layout = { + polar: { + domain: { + x: [0, 0.46], + y: [0.56, 1] + }, + radialaxis: { + angle: 45 + }, + angularaxis: { + direction: "clockwise", + period: 6 + } + }, + polar2: { + domain: { + x: [0, 0.46], + y: [0, 0.44] + }, + radialaxis: { + angle: 180, + tickangle: -180 + } + }, + polar3: { + domain: { + x: [0.54, 1], + y: [0.56, 1] + }, + sector: [150, 400], + radialaxis: { + angle: -45 + }, + angularaxis: { + categoryarray: ["d", "a", "c", "b"] + } + }, + polar4: { + domain: { + x: [0.54, 1], + y: [0, 0.44] + }, + radialaxis: { + categoryorder: "category descending" + }, + angularaxis: { + thetaunit: "radians", + dtick: 0.3141592653589793 + } + } + } + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/scientific/scatterpolar/directions-polar-chart.html b/content/plotly_js/scientific/scatterpolar/directions-polar-chart.html new file mode 100644 index 00000000000..07412653e7d --- /dev/null +++ b/content/plotly_js/scientific/scatterpolar/directions-polar-chart.html @@ -0,0 +1,82 @@ +--- +name: Polar Chart Directions +language: plotly_js +suite: scatterpolar +order: 4 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + type: "scatterpolar", + mode: "lines+markers", + r: [1,2,3,4,5], + theta: [0,90,180,360,0], + line: { + color: "#ff66ab" + }, + marker: { + color: "#8090c7", + symbol: "square", + size: 8 + }, + subplot: "polar" + }, + { + type: "scatterpolar", + mode: "lines+markers", + r: [1,2,3,4,5], + theta: [0,90,180,360,0], + line: { + color: "#ff66ab" + }, + marker: { + color: "#8090c7", + symbol: "square", + size: 8 + }, + subplot: "polar2" + } + ] + +var layout = { + showlegend: false, + polar: { + domain: { + x: [0,0.4], + y: [0,1] + }, + radialaxis: { + tickfont: { + size: 8 + } + }, + angularaxis: { + tickfont: { + size: 8 + }, + rotation: 90, + direction: "counterclockwise" + } + }, + polar2: { + domain: { + x: [0.6,1], + y: [0,1] + }, + radialaxis: { + tickfont: { + size: 8 + } + }, + angularaxis: { + tickfont: { + size: 8 + }, + direction: "clockwise" + } + } + } + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/scientific/scatterpolar/line-polar-chart.html b/content/plotly_js/scientific/scatterpolar/line-polar-chart.html new file mode 100644 index 00000000000..bae87b851ef --- /dev/null +++ b/content/plotly_js/scientific/scatterpolar/line-polar-chart.html @@ -0,0 +1,80 @@ +--- +name: Line Polar Plot +language: plotly_js +suite: scatterpolar +order: 1 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/polar_dataset.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + +var trace1 = { + r: unpack(rows, 'x1'), + theta: unpack(rows, 'y'), + mode: 'lines', + name: 'Figure8', + line: {color: 'peru'}, + type: 'scatterpolar' +}; + +var trace2 = { + r: unpack(rows, 'x2'), + theta: unpack(rows, 'y'), + mode: 'lines', + name: 'Cardioid', + line: {color: 'darkviolet'}, + type: 'scatterpolar' +}; + +var trace3 = { + r: unpack(rows, 'x3'), + theta: unpack(rows, 'y'), + mode: 'lines', + name: 'Hypercardioid', + line: {color: 'deepskyblue'}, + type: 'scatterpolar' +}; + +var trace4 = { + + r: unpack(rows, 'x4'), + theta: unpack(rows, 'y'), + mode: 'lines', + name: 'Subcardioid', + line: {color: 'orangered'}, + type: 'scatterpolar' +}; + +var trace5 = { + + r: unpack(rows, 'x5'), + theta: unpack(rows, 'y'), + mode: 'lines', + name: 'Supercardioid', + marker: { + color: 'none', + line: {color: 'green'} + }, + type: 'scatterpolar' +}; + +var data = [trace1, trace2, trace3, trace4, trace5]; + +var layout = { + title: { + text: 'Mic Patterns' + }, + font: { + family: 'Arial, sans-serif;', + size: 12, + color: '#000' + }, + showlegend: true, + orientation: -90 +}; +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/scientific/scatterpolar/scatterpolar-plotlyjs-index.html b/content/plotly_js/scientific/scatterpolar/scatterpolar-plotlyjs-index.html new file mode 100644 index 00000000000..d576ada0394 --- /dev/null +++ b/content/plotly_js/scientific/scatterpolar/scatterpolar-plotlyjs-index.html @@ -0,0 +1,16 @@ +--- +description: How to make D3.js-based polar charts in Plotly.js. +display_as: scientific +language: plotly_js +layout: base +name: Polar Charts +order: 12 +permalink: javascript/polar-chart/ +redirect_from: +- javascript/legacy-polar-chart/ +- javascript-graphing-library/polar-chart/ +thumbnail: thumbnail/polar.gif +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","scatterpolar" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/scatterpolar/sector-polar-chart.html b/content/plotly_js/scientific/scatterpolar/sector-polar-chart.html new file mode 100644 index 00000000000..5a81cc807a2 --- /dev/null +++ b/content/plotly_js/scientific/scatterpolar/sector-polar-chart.html @@ -0,0 +1,80 @@ +--- +name: Polar Chart Sector +language: plotly_js +suite: scatterpolar +order: 5 +sitemap: false +arrangement: horizontal +--- + +var data = [ + { + type: "scatterpolar", + mode: "lines+markers", + r: [1,2,3,4,5], + theta: [0,90,180,360,0], + line: { + color: "#ff66ab" + }, + marker: { + color: "#8090c7", + symbol: "square", + size: 8 + }, + subplot: "polar" + }, + { + type: "scatterpolar", + mode: "lines+markers", + r: [1,2,3,4,5], + theta: [0,90,180,360,0], + line: { + color: "#ff66ab" + }, + marker: { + color: "#8090c7", + symbol: "square", + size: 8 + }, + subplot: "polar2" + } + ] + +var layout = { + showlegend: false, + polar: { + sector: [145,215], + domain: { + x: [0,0.4], + y: [0,1] + }, + radialaxis: { + tickfont: { + size: 8 + } + }, + angularaxis: { + tickfont: { + size: 8 + } + } + }, + polar2: { + domain: { + x: [0.6,1], + y: [0,1] + }, + radialaxis: { + tickfont: { + size: 8 + } + }, + angularaxis: { + tickfont: { + size: 8 + } + } + } + } + +Plotly.newPlot('myDiv', data, layout) diff --git a/content/plotly_js/scientific/scatterpolar/subplots-polar-charts.html b/content/plotly_js/scientific/scatterpolar/subplots-polar-charts.html new file mode 100644 index 00000000000..c217fc1c089 --- /dev/null +++ b/content/plotly_js/scientific/scatterpolar/subplots-polar-charts.html @@ -0,0 +1,83 @@ +--- +name: Polar Chart Subplots +language: plotly_js +suite: scatterpolar +order: 6 +sitemap: false +arrangement: horizontal +--- + +var data = [{ + type: "scatterpolargl", + r: [1, 2, 3], + theta: [50, 100, 200], + marker: {symbol: "square"} + }, { + type: "scatterpolargl", + r: [1, 2, 3], + theta: [1, 2, 3], + thetaunit: "radians" + }, { + type: "scatterpolargl", + r: ["a", "b", "c", "b"], + theta: ["D", "C", "B", "A"], + subplot: "polar2" + }, { + type: "scatterpolargl", + r: [50, 300, 900], + theta: [0, 90, 180], + subplot: "polar3" + }, { + type: "scatterpolargl", + mode: "lines", + r: [3, 3, 4, 3], + theta: [0, 45, 90, 270], + fill: "toself", + subplot: "polar4" + }] + +var layout = { + polar: { + domain: { + x: [0, 0.46], + y: [0.56, 1] + }, + radialaxis: { + range: [1, 4] + }, + angularaxis: { + thetaunit: "radians" + } + }, + polar2: { + domain: { + x: [0, 0.46], + y: [0, 0.42] + } + }, + polar3: { + domain: { + x: [0.54, 1], + y: [0.56, 1] + }, + radialaxis: { + type: "log", + tickangle: 45 + }, + sector: [0, 180] + }, + polar4: { + domain: { + x: [0.54, 1], + y: [0, 0.44] + }, + radialaxis: { + visible: false, + range: [0, 6] + } + }, + showlegend: false + } + + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/scientific/scatterpolar/webgl-polar-chart.html b/content/plotly_js/scientific/scatterpolar/webgl-polar-chart.html new file mode 100644 index 00000000000..971b8f62c37 --- /dev/null +++ b/content/plotly_js/scientific/scatterpolar/webgl-polar-chart.html @@ -0,0 +1,142 @@ +--- +name: Webgl Polar Chart +language: plotly_js +suite: scatterpolar +order: 7 +sitemap: false +arrangement: horizontal +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/hobbs-pearson-trials.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + +var data = [ + { + type: "scatterpolargl", + r: unpack(rows, 'trial_1_r'), + theta: unpack(rows, 'trial_1_theta'), + mode: "markers", + name: "Trial 1", + marker: { + color: "rgb(27,158,119)", + size: 15, + line: { + color: "white" + }, + opacity: 0.7 + }, + cliponaxis: false + }, + { + type: "scatterpolargl", + r: unpack(rows, "trial_2_r"), + theta: unpack(rows, "trial_2_theta"), + mode: "markers", + name: "Trial 2", + marker: { + color: "rgb(217,95,2)", + size: 20, + line: { + color: "white" + }, + "opacity": 0.7 + }, + "cliponaxis": false + }, + { + type: "scatterpolargl", + r: unpack(rows, "trial_3_r"), + theta: unpack(rows, "trial_3_theta"), + mode: "markers", + name: "Trial 3", + marker: { + color: "rgb(117,112,179)", + size: 12, + line: { + color: "white" + }, + opacity: 0.7 + }, + cliponaxis: false + }, + { + type: "scatterpolargl", + r: unpack(rows, "trial_4_r"), + theta: unpack(rows, "trial_4_theta"), + mode: "markers", + name: "Trial 4", + marker: { + color: "rgb(231,41,138)", + size: 22, + line: { + color: "white" + }, + opacity: 0.7 + }, + cliponaxis: false + }, + { + type: "scatterpolargl", + r: unpack(rows, "trial_5_r"), + theta: unpack(rows, "trial_5_theta"), + mode: "markers", + name: "Trial 5", + marker: { + color: "rgb(102,166,30)", + size: 19, + line: { + color: "white" + }, + opacity: 0.7 + }, + cliponaxis: false + }, + { + type: "scatterpolargl", + r: unpack(rows, "trial_6_r"), + theta: unpack(rows, "trial_6_theta"), + mode: "markers", + name: "Trial 6", + marker: { + color: "rgb(230,171,2)", + size: 10, + line: { + color: "white" + }, + opacity: 0.7 + }, + cliponaxis: false + } + ] + +var layout = { + title: { + text: "Hobbs-Pearson Trials" + }, + font: { + size: 15 + }, + showlegend: false, + polar: { + bgcolor: "rgb(223, 223, 223)", + angularaxis: { + tickwidth: 2, + linewidth: 3, + layer: "below traces" + }, + radialaxis: { + side: "counterclockwise", + showline: true, + linewidth: 2, + tickwidth: 2, + gridcolor: "white", + gridwidth: 2 + } + }, + paper_bgcolor: "rgb(223, 223, 223)", + } + +Plotly.newPlot('myDiv', data, layout); +}) diff --git a/content/plotly_js/scientific/ternary-contour/soil-types-ternary-fill-plot.html b/content/plotly_js/scientific/ternary-contour/soil-types-ternary-fill-plot.html new file mode 100644 index 00000000000..1418f5d3bf2 --- /dev/null +++ b/content/plotly_js/scientific/ternary-contour/soil-types-ternary-fill-plot.html @@ -0,0 +1,72 @@ +--- +name: Basic Filled Ternary Plot +language: plotly_js +suite: ternary-contour +order: 1 +sitemap: false +arrangement: horizontal +description: Inspired from Daven Quinn's block +--- +var url = 'https://gist.githubusercontent.com/davenquinn/988167471993bc2ece29/raw/f38d9cb3dd86e315e237fde5d65e185c39c931c2/data.json'; + +var colors = ['#8dd3c7','#ffffb3','#bebada','#fb8072','#80b1d3','#fdb462','#b3de69','#fccde5','#d9d9d9','#bc80bd','#ccebc5','#ffed6f']; + + +d3.json(url, function(err, rawData) { + if(err) throw err; + + plot(rawData); +}); + +function plot(rawData) { + var data = Object.keys(rawData).map(function(k, i) { + var pts = rawData[k]; + pts = pts.concat(pts[0]); + + return { + type: 'scatterternary', + mode: 'lines', + name: k, + a: pts.map(function(d) { return d.clay }), + b: pts.map(function(d) { return d.sand }), + c: pts.map(function(d) { return d.silt }), + line: { color: '#444' }, + fill: 'toself', + fillcolor: colors[i], + hoveron:'fills+points' + }; + }); + + var layout = { + ternary: { + sum: 100, + aaxis: makeAxis('Clay'), + baxis: makeAxis('Sand'), + caxis: makeAxis('Silt') + }, + showlegend: false, + width: 700, + annotations: [{ + showarrow: false, + text: 'Soil Types Fill Plot', + x: 0.15, + y: 1.1 + }] + }; + + Plotly.newPlot('myDiv', data, layout); +} + +function makeAxis(title) { + return { + title: { + text: title + }, + ticksuffix: '%', + min: 0.01, + linewidth: 2, + ticks: 'outside', + ticklen: 8, + showgrid: true, + }; +} diff --git a/content/plotly_js/scientific/ternary-contour/ternary-contour-plot_plotly_js_index.html b/content/plotly_js/scientific/ternary-contour/ternary-contour-plot_plotly_js_index.html new file mode 100644 index 00000000000..7ea02da88a8 --- /dev/null +++ b/content/plotly_js/scientific/ternary-contour/ternary-contour-plot_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to create D3.js-based ternary contour plots. Examples of Ternary + Contour Plots with plotly. +display_as: scientific +language: plotly_js +layout: base +name: Ternary Contour Plots +order: 7 +permalink: javascript/ternary-contour/ +thumbnail: thumbnail/ternary-contour.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","ternary-contour" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/ternary-plots/basic-ternary-plot.html b/content/plotly_js/scientific/ternary-plots/basic-ternary-plot.html new file mode 100644 index 00000000000..1043b2312eb --- /dev/null +++ b/content/plotly_js/scientific/ternary-plots/basic-ternary-plot.html @@ -0,0 +1,73 @@ +--- +name: Basic Ternary Plot with Markers +language: plotly_js +suite: ternary-plot +order: 1 +sitemap: false +arrangement: horizontal +description: Inspired from Tom Pearson's block +--- + +var rawData = [ + {journalist:75,developer:25,designer:0,label:'point 1'}, + {journalist:70,developer:10,designer:20,label:'point 2'}, + {journalist:75,developer:20,designer:5,label:'point 3'}, + {journalist:5,developer:60,designer:35,label:'point 4'}, + {journalist:10,developer:80,designer:10,label:'point 5'}, + {journalist:10,developer:90,designer:0,label:'point 6'}, + {journalist:20,developer:70,designer:10,label:'point 7'}, + {journalist:10,developer:20,designer:70,label:'point 8'}, + {journalist:15,developer:5,designer:80,label:'point 9'}, + {journalist:10,developer:10,designer:80,label:'point 10'}, + {journalist:20,developer:10,designer:70,label:'point 11'}, +]; + +Plotly.newPlot('myDiv', [{ + type: 'scatterternary', + mode: 'markers', + a: rawData.map(function(d) { return d.journalist; }), + b: rawData.map(function(d) { return d.developer; }), + c: rawData.map(function(d) { return d.designer; }), + text: rawData.map(function(d) { return d.label; }), + marker: { + symbol: 100, + color: '#DB7365', + size: 14, + line: { width: 2 } + }, +}], { + ternary: { + sum: 100, + aaxis: makeAxis('Journalist', 0), + baxis: makeAxis('
Developer', 45), + caxis: makeAxis('
Designer', -45), + bgcolor: '#fff1e0' + }, + annotations: [{ + showarrow: false, + text: 'Replica of Tom Pearson\'s block', + x: 1.0, + y: 1.3, + font: { size: 15 } + }], + paper_bgcolor: '#fff1e0', +}); + +function makeAxis(title, tickangle) { + return { + title: { + text: title, + font: { + size: 20 + } + }, + tickangle: tickangle, + tickfont: { + size: 15 + }, + tickcolor: 'rgba(0,0,0,0)', + ticklen: 5, + showline: true, + showgrid: true + }; +} diff --git a/content/plotly_js/scientific/ternary-plots/soil-types-ternary-plot.html b/content/plotly_js/scientific/ternary-plots/soil-types-ternary-plot.html new file mode 100644 index 00000000000..08292721714 --- /dev/null +++ b/content/plotly_js/scientific/ternary-plots/soil-types-ternary-plot.html @@ -0,0 +1,66 @@ +--- +name: Soil Types Ternary Plot +language: plotly_js +suite: ternary-plot +order: 2 +sitemap: false +arrangement: horizontal +description: Inspired from Daven Quinn's block +--- + +var url = 'https://gist.githubusercontent.com/davenquinn/988167471993bc2ece29/raw/f38d9cb3dd86e315e237fde5d65e185c39c931c2/data.json'; + +d3.json(url, function(err, rawData) { + if(err) throw err; + + plot(rawData); +}); + +function plot(rawData) { + var data = Object.keys(rawData).map(function(k) { + var pts = rawData[k]; + + return { + type: 'scatterternary', + mode: 'lines', + name: k, + a: pts.map(function(d) { return d.clay }), + b: pts.map(function(d) { return d.sand }), + c: pts.map(function(d) { return d.silt }), + line: { color: '#c00' } + }; + }); + + var layout = { + ternary: { + sum: 100, + aaxis: makeAxis('Clay'), + baxis: makeAxis('Sand'), + caxis: makeAxis('Silt') + }, + showlegend: false, + width: 700, + annotations: [{ + showarrow: false, + text: 'Replica of Daven Quinn\'s block', + x: 0.15, + y: 1.1 + }] + }; + + Plotly.newPlot('myDiv', data, layout); +} + +function makeAxis(title) { + return { + title: { + text: title + }, + ticksuffix: '%', + min: 0.01, + linewidth: 2, + ticks: 'outside', + ticklen: 8, + showgrid: true, + }; +} diff --git a/content/plotly_js/scientific/ternary-plots/ternary-plot_plotly_js_index.html b/content/plotly_js/scientific/ternary-plots/ternary-plot_plotly_js_index.html new file mode 100644 index 00000000000..20b676f8c97 --- /dev/null +++ b/content/plotly_js/scientific/ternary-plots/ternary-plot_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to create D3.js-based ternary plots. Examples of Ternary Plots with + plotly. +display_as: scientific +language: plotly_js +layout: base +name: Ternary Plots +order: 3 +page_type: example_index +permalink: javascript/ternary-plots/ +redirect_from: javascript/ternary-plot/ +thumbnail: thumbnail/ternary-plot.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","ternary-plot" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/scientific/wind-rose/wind-rose-chart.html b/content/plotly_js/scientific/wind-rose/wind-rose-chart.html new file mode 100644 index 00000000000..c0c58f1f000 --- /dev/null +++ b/content/plotly_js/scientific/wind-rose/wind-rose-chart.html @@ -0,0 +1,48 @@ +--- +name: Wind Rose Chart +language: plotly_js +suite: wind-rose +sitemap: false +arrangement: horizontal +order: 17 +--- +var data = [{ + r: [77.5, 72.5, 70.0, 45.0, 22.5, 42.5, 40.0, 62.5], + theta: ["North", "N-E", "East", "S-E", "South", "S-W", "West", "N-W"], + name: "11-14 m/s", + marker: {color: "rgb(106,81,163)"}, + type: "barpolar" + }, { + r: [57.5, 50.0, 45.0, 35.0, 20.0, 22.5, 37.5, 55.0], + theta: ["North", "N-E", "East", "S-E", "South", "S-W", "West", "N-W"], + name: "8-11 m/s", + marker: {color: "rgb(158,154,200)"}, + type: "barpolar" + }, { + r: [40.0, 30.0, 30.0, 35.0, 7.5, 7.5, 32.5, 40.0], + theta: ["North", "N-E", "East", "S-E", "South", "S-W", "West", "N-W"], + name: "5-8 m/s", + marker: {color: "rgb(203,201,226)"}, + type: "barpolar" + }, { + r: [20.0, 7.5, 15.0, 22.5, 2.5, 2.5, 12.5, 22.5], + theta: ["North", "N-E", "East", "S-E", "South", "S-W", "West", "N-W"], + name: "< 5 m/s", + marker: {color: "rgb(242,240,247)"}, + type: "barpolar" + }] +var layout = { + title: { + text: "Wind Speed Distribution in Laurel, NE" + }, + font: {size: 16}, + legend: {font: {size: 16}}, + polar: { + barmode: "overlay", + bargap: 0, + radialaxis: {ticksuffix: "%", angle: 45, dtick: 20}, + angularaxis: {direction: "clockwise"} + } + } + +Plotly.newPlot("myDiv", data, layout) \ No newline at end of file diff --git a/content/plotly_js/scientific/wind-rose/wind-rose_plotlyjs_index.html b/content/plotly_js/scientific/wind-rose/wind-rose_plotlyjs_index.html new file mode 100644 index 00000000000..54eb1fc4374 --- /dev/null +++ b/content/plotly_js/scientific/wind-rose/wind-rose_plotlyjs_index.html @@ -0,0 +1,14 @@ +--- +description: How to graph D3.js-based wind rose charts in plotly.js . +display_as: scientific +language: plotly_js +layout: base +name: Wind Rose Charts +order: 6 +permalink: javascript/wind-rose-charts/ +redirect_from: javascript-graphing-library/wind-rose-charts/ +thumbnail: thumbnail/wind-rose.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","wind-rose" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/SPC/spc-basic-distribution.html b/content/plotly_js/statistical/SPC/spc-basic-distribution.html new file mode 100644 index 00000000000..3a88e4314bc --- /dev/null +++ b/content/plotly_js/statistical/SPC/spc-basic-distribution.html @@ -0,0 +1,114 @@ +--- +name: SPC Control Chart & Distribution +language: plotly_js +suite: SPC +order: 2 +sitemap: false +arrangement: horizontal +description: +--- + +var Data = { + type: 'scatter', + x: [1,2,3,4,5,6,7,8,9], + y: [4,2,-1,4,-5,-7,0,3,8], + mode: 'lines+markers', + name: 'Data', + showlegend: true, + hoverinfo: 'all', + line: { + color: 'blue', + width: 2 + }, + marker: { + color: 'blue', + size: 8, + symbol: 'circle' + } +} + +var Viol = { + type: 'scatter', + x: [6,9], + y: [-7,8], + mode: 'markers', + name: 'Violation', + showlegend: true, + marker: { + color: 'rgb(255,65,54)', + line: {width: 3}, + opacity: 0.5, + size: 12, + symbol: 'circle-open' + } +} + +var CL = { + type: 'scatter', + x: [0.5, 10, null, 0.5, 10], + y: [-5, -5, null, 5, 5], + mode: 'lines', + name: 'LCL/UCL', + showlegend: true, + line: { + color: 'red', + width: 2, + dash: 'dash' + } +} + +var Centre = { + type: 'scatter', + x: [0.5, 10], + y: [0, 0], + mode: 'lines', + name: 'Centre', + showlegend: true, + line: { + color: 'grey', + width: 2 + } +} + +var histo = { + type: 'histogram', + x: [1,2,3,4,5,6,7,8,9], + y: [4,2,-1,4,-5,-7,0,3,8], + name: 'Distribution', + orientation: 'h', + marker: { + color: 'blue', + line: { + color: 'white', + width: 1 + } + }, + xaxis: 'x2', + yaxis: 'y2' +} + +var data = [Data,Viol,CL,Centre,histo] + +// layout +var layout = { + title: { + text: 'Basic SPC Chart' + }, + xaxis: { + domain: [0, 0.7], // 0 to 70% of width + zeroline: false + }, + yaxis: { + range: [-10,10], + zeroline: false + }, + xaxis2: { + domain: [0.8, 1] // 70 to 100% of width + }, + yaxis2: { + anchor: 'x2', + showticklabels: false + } +} + +Plotly.newPlot('myDiv', data,layout); diff --git a/content/plotly_js/statistical/SPC/spc-basic.html b/content/plotly_js/statistical/SPC/spc-basic.html new file mode 100644 index 00000000000..0e9cce56753 --- /dev/null +++ b/content/plotly_js/statistical/SPC/spc-basic.html @@ -0,0 +1,88 @@ +--- +name: Basic SPC Control Chart +language: plotly_js +suite: SPC +order: 1 +sitemap: false +arrangement: horizontal +description: +--- + +var Data = { + type: 'scatter', + x: [1,2,3,4,5,6,7,8,9], + y: [4,2,-1,4,-5,-7,0,3,8], + mode: 'lines+markers', + name: 'Data', + showlegend: true, + hoverinfo: 'all', + line: { + color: 'blue', + width: 2 + }, + marker: { + color: 'blue', + size: 8, + symbol: 'circle' + } +} + +var Viol = { + type: 'scatter', + x: [6,9], + y: [-7,8], + mode: 'markers', + name: 'Violation', + showlegend: true, + marker: { + color: 'rgb(255,65,54)', + line: {width: 3}, + opacity: 0.5, + size: 12, + symbol: 'circle-open' + } +} + +var CL = { + type: 'scatter', + x: [0.5, 10, null, 0.5, 10], + y: [-5, -5, null, 5, 5], + mode: 'lines', + name: 'LCL/UCL', + showlegend: true, + line: { + color: 'red', + width: 2, + dash: 'dash' + } +} + +var Centre = { + type: 'scatter', + x: [0.5, 10], + y: [0, 0], + mode: 'lines', + name: 'Centre', + showlegend: true, + line: { + color: 'grey', + width: 2 + } +} + +var data = [Data,Viol,CL,Centre] + +var layout = { + title: { + text: 'Basic SPC Chart' + }, + xaxis: { + zeroline: false + }, + yaxis: { + range: [-10,10], + zeroline: false + } +} + +Plotly.newPlot('myDiv', data,layout); diff --git a/content/plotly_js/statistical/SPC/spc-control-charts_plotly_js_index.html b/content/plotly_js/statistical/SPC/spc-control-charts_plotly_js_index.html new file mode 100644 index 00000000000..00a0556da8f --- /dev/null +++ b/content/plotly_js/statistical/SPC/spc-control-charts_plotly_js_index.html @@ -0,0 +1,13 @@ +--- +description: How to make a D3.js-based SPC Control Charts in javascript. +display_as: statistical +language: plotly_js +layout: base +name: SPC Control Charts +order: 7 +permalink: javascript/spc-control-charts/ +thumbnail: thumbnail/SPC.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","SPC" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/box/basic-box-plot.html b/content/plotly_js/statistical/box/basic-box-plot.html new file mode 100644 index 00000000000..9d8a6acaeb4 --- /dev/null +++ b/content/plotly_js/statistical/box/basic-box-plot.html @@ -0,0 +1,28 @@ +--- +name: Basic Box Plot +arrangement: horizontal +language: plotly_js +suite: box +order: 1 +sitemap: false +--- +var y0 = []; +var y1 = []; +for (var i = 0; i < 50; i ++) { + y0[i] = Math.random(); + y1[i] = Math.random() + 1; +} + +var trace1 = { + y: y0, + type: 'box' +}; + +var trace2 = { + y: y1, + type: 'box' +}; + +var data = [trace1, trace2]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/box/box-grouped.html b/content/plotly_js/statistical/box/box-grouped.html new file mode 100644 index 00000000000..2f7805c8ec3 --- /dev/null +++ b/content/plotly_js/statistical/box/box-grouped.html @@ -0,0 +1,48 @@ +--- +name: Grouped Box Plot +arrangement: horizontal +language: plotly_js +suite: box +order: 4 +sitemap: false +--- +var x = ['day 1', 'day 1', 'day 1', 'day 1', 'day 1', 'day 1', + 'day 2', 'day 2', 'day 2', 'day 2', 'day 2', 'day 2'] + +var trace1 = { + 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: x, + name: 'kale', + marker: {color: '#3D9970'}, + type: 'box' +}; + +var trace2 = { + 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: x, + name: 'radishes', + marker: {color: '#FF4136'}, + type: 'box' +}; + +var trace3 = { + 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: x, + name: 'carrots', + marker: {color: '#FF851B'}, + type: 'box' +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + yaxis: { + title: { + text: 'normalized moisture' + }, + zeroline: false + }, + boxmode: 'group' +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/box/box-plot-jitter.html b/content/plotly_js/statistical/box/box-plot-jitter.html new file mode 100644 index 00000000000..619360e7083 --- /dev/null +++ b/content/plotly_js/statistical/box/box-plot-jitter.html @@ -0,0 +1,19 @@ +--- +name: Box Plot That Displays the Underlying Data +arrangement: horizontal +language: plotly_js +suite: box +order: 2 +sitemap: false +--- +var data = [ + { + y: [0, 1, 1, 2, 3, 5, 8, 13, 21], + boxpoints: 'all', + jitter: 0.3, + pointpos: -1.8, + type: 'box' + } +]; + +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/box/box-plot-styling-mean-and-sd.html b/content/plotly_js/statistical/box/box-plot-styling-mean-and-sd.html new file mode 100644 index 00000000000..dbdbfa37210 --- /dev/null +++ b/content/plotly_js/statistical/box/box-plot-styling-mean-and-sd.html @@ -0,0 +1,39 @@ +--- +name: Box Plot Styling Mean and Standard Deviation +arrangement: horizontal +language: plotly_js +suite: box +order: 6 +sitemap: false +--- + +var trace1 = { + 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], + type: 'box', + name: 'Only Mean', + marker: { + color: 'rgb(8,81,156)' + }, + boxmean: true +}; + +var trace2 = { + 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], + type: 'box', + name: 'Mean and Standard Deviation', + marker: { + color: 'rgb(10,140,208)' + }, + boxmean: 'sd' +}; + + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'Box Plot Styling Mean and Standard Deviation' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/box/box-plot-styling-outliers.html b/content/plotly_js/statistical/box/box-plot-styling-outliers.html new file mode 100644 index 00000000000..b420963f2ab --- /dev/null +++ b/content/plotly_js/statistical/box/box-plot-styling-outliers.html @@ -0,0 +1,67 @@ +--- +name: Box Plot Styling Outliers +arrangement: horizontal +language: plotly_js +suite: box +order: 5 +sitemap: false +--- + +var trace1 = { + 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], + type: 'box', + name: 'All Points', + jitter: 0.3, + pointpos: -1.8, + marker: { + color: 'rgb(7,40,89)' + }, + boxpoints: 'all' +}; + +var trace2 = { + 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], + type: 'box', + name: 'Only Wiskers', + marker: { + color: 'rgb(9,56,125)' + }, + boxpoints: false +}; + +var trace3 = { + 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], + type: 'box', + name: 'Suspected Outlier', + marker: { + color: 'rgb(8,81,156)', + outliercolor: 'rgba(219, 64, 82, 0.6)', + line: { + outliercolor: 'rgba(219, 64, 82, 1.0)', + outlierwidth: 2 + } + }, + boxpoints: 'suspectedoutliers' +}; + +var trace4 = { + 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], + type: 'box', + name: 'Wiskers and Outliers', + marker: { + color: 'rgb(107,174,214)' + }, + boxpoints: 'Outliers' +}; + + + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + title: { + text: 'Box Plot Styling Outliers' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/box/box_plotly_js_index.html b/content/plotly_js/statistical/box/box_plotly_js_index.html new file mode 100644 index 00000000000..433b986e017 --- /dev/null +++ b/content/plotly_js/statistical/box/box_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make a D3.js-based box plot in javascript. Seven examples of box + plots in javascript that are grouped, colored, and display the underlying data distribution. +display_as: statistical +language: plotly_js +layout: base +name: Box Plots +order: 2 +page_type: example_index +permalink: javascript/box-plots/ +redirect_from: javascript-graphing-library/box-plots/ +thumbnail: thumbnail/box.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","box" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/box/colored-box-plot.html b/content/plotly_js/statistical/box/colored-box-plot.html new file mode 100644 index 00000000000..6c4a6b840e0 --- /dev/null +++ b/content/plotly_js/statistical/box/colored-box-plot.html @@ -0,0 +1,36 @@ +--- +name: Colored Box Plot +arrangement: horizontal +language: plotly_js +suite: box +order: 8 +sitemap: false +--- + +var trace1 = { + y: [1, 2, 3, 4, 4, 4, 8, 9, 10], + type: 'box', + name: 'Sample A', + marker:{ + color: 'rgb(214,12,140)' + } +}; + +var trace2 = { + y: [2, 3, 3, 3, 3, 5, 6, 6, 7], + type: 'box', + name: 'Sample B', + marker:{ + color: 'rgb(0,128,128)' + } +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'Colored Box Plot' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/box/fully-styled-box-plots.html b/content/plotly_js/statistical/box/fully-styled-box-plots.html new file mode 100644 index 00000000000..a90b3cdaabd --- /dev/null +++ b/content/plotly_js/statistical/box/fully-styled-box-plots.html @@ -0,0 +1,84 @@ +--- +name: Fully Styled Box Plot +arrangement: horizontal +language: plotly_js +suite: box +order: 10 +sitemap: false +--- + +var xData = ['Carmelo
Anthony', 'Dwyane
Wade', + 'Deron
Williams', 'Brook
Lopez', + 'Damian
Lillard', 'David
West', + 'Blake
Griffin', 'David
Lee', + 'Demar
Derozan']; + +function getrandom(num , mul) { + var value = [ ]; + for ( i = 0; i <= num; i++ ) { + var rand = Math.random() * mul; + value.push(rand); + } + return value; +} + +var yData = [ + 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), + ]; +var 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)']; + +var data = []; + +for ( var i = 0; i < xData.length; i ++ ) { + var result = { + type: 'box', + y: yData[i], + name: xData[i], + boxpoints: 'all', + jitter: 0.5, + whiskerwidth: 0.2, + fillcolor: 'cls', + marker: { + size: 2 + }, + line: { + width: 1 + } + }; + data.push(result); +}; + +layout = { + title: { + text: 'Points Scored by the Top 9 Scoring NBA Players in 2012' + }, + yaxis: { + autorange: true, + showgrid: true, + zeroline: true, + dtick: 5, + gridcolor: 'rgb(255, 255, 255)', + gridwidth: 1, + zerolinecolor: 'rgb(255, 255, 255)', + zerolinewidth: 2 + }, + margin: { + l: 40, + r: 30, + b: 80, + t: 100 + }, + paper_bgcolor: 'rgb(243, 243, 243)', + plot_bgcolor: 'rgb(243, 243, 243)', + showlegend: false +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/box/grouped-horizontal-box-plots.html b/content/plotly_js/statistical/box/grouped-horizontal-box-plots.html new file mode 100644 index 00000000000..b35d4109e0b --- /dev/null +++ b/content/plotly_js/statistical/box/grouped-horizontal-box-plots.html @@ -0,0 +1,58 @@ +--- +name: Grouped Horizontal Box Plot +arrangement: horizontal +language: plotly_js +suite: box +order: 7 +sitemap: false +--- + +var y = ['day 1', 'day 1', 'day 1', 'day 1', 'day 1', 'day 1', + 'day 2', 'day 2', 'day 2', 'day 2', 'day 2', 'day 2'] + +var trace1 = { + 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: y, + name: 'kale', + marker: {color: '#3D9970'}, + type: 'box', + boxmean: false, + orientation: 'h' +}; + +var trace2 = { + 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: y, + name: 'radishes', + marker: {color: '#FF4136'}, + type: 'box', + boxmean: false, + orientation: 'h' +}; + +var trace3 = { + 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: y, + name: 'carrots', + marker: {color: '#FF851B'}, + type: 'box', + boxmean: false, + orientation: 'h' +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + title: { + text: 'Grouped Horizontal Box Plot' + }, + xaxis: { + title: { + text: 'normalized moisture' + }, + zeroline: false + }, + boxmode: 'group' +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/box/horizontal-box-plot.html b/content/plotly_js/statistical/box/horizontal-box-plot.html new file mode 100644 index 00000000000..3ade96e0742 --- /dev/null +++ b/content/plotly_js/statistical/box/horizontal-box-plot.html @@ -0,0 +1,30 @@ +--- +name: Horizontal Box Plot +arrangement: horizontal +language: plotly_js +suite: box +order: 3 +sitemap: false +--- + +var trace1 = { + x: [1, 2, 3, 4, 4, 4, 8, 9, 10], + type: 'box', + name: 'Set 1' +}; + +var trace2 = { + x: [2, 3, 3, 3, 3, 5, 6, 6, 7], + type: 'box', + name: 'Set 2' +}; + +var data = [trace1, trace2]; + +var layout = { + title: { + text: 'Horizontal Box Plot' + }, +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/box/rainbow-box-plot.html b/content/plotly_js/statistical/box/rainbow-box-plot.html new file mode 100644 index 00000000000..d0462ceb658 --- /dev/null +++ b/content/plotly_js/statistical/box/rainbow-box-plot.html @@ -0,0 +1,73 @@ +--- +name: Rainbow Box Plot +arrangement: horizontal +language: plotly_js +suite: box +order: 12 +sitemap: false +--- +function linspace(a,b,n) { + return d3.range(n).map(function(i){return a+i*(b-a)/(n-1);}); +} +var boxNumber = 30; +var boxColor = []; +var allColors = linspace(0, 360, boxNumber); +var data = []; +var yValues = []; + +//Colors + +for( var i = 0; i < boxNumber; i++ ){ + var result = 'hsl('+ allColors[i] +',50%'+',50%)'; + boxColor.push(result); +} + +function getRandomArbitrary(min, max) { + return Math.random() * (max - min) + min; +}; + +//Create Y Values + +for( var i = 0; i < boxNumber; i++ ){ + var ySingleArray = []; + for( var j = 0; j < 10; j++ ){ + var randomNum = getRandomArbitrary(0, 1); + var yIndValue = 3.5*Math.sin(Math.PI * i/boxNumber) + i/boxNumber+(1.5+0.5*Math.cos(Math.PI*i/boxNumber))*randomNum; + ySingleArray.push(yIndValue); + } + yValues.push(ySingleArray); +} + +//Create Traces + +for( var i = 0; i < boxNumber; i++ ){ + var result = { + y: yValues[i], + type:'box', + marker:{ + color: boxColor[i] + } + }; + data.push(result); +}; + +//Format the layout + +var layout = { + xaxis: { + showgrid: false, + zeroline: false, + tickangle: 60, + showticklabels: false + }, + yaxis: { + zeroline: false, + gridcolor: 'white' + }, + paper_bgcolor: 'rgb(233,233,233)', + plot_bgcolor: 'rgb(233,233,233)', + showlegend:false +}; + + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/continuous-error-bars/continuous-error-bar_plotly_js_index.html b/content/plotly_js/statistical/continuous-error-bars/continuous-error-bar_plotly_js_index.html new file mode 100644 index 00000000000..daff10e22ad --- /dev/null +++ b/content/plotly_js/statistical/continuous-error-bars/continuous-error-bar_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to add D3.js-based continuous error bars to a line, scatter, or bar + chart. +display_as: statistical +language: plotly_js +layout: base +name: Continuous Error Bars +order: 5 +page_type: example_index +permalink: javascript/continuous-error-bars/ +thumbnail: thumbnail/error-cont.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","continuous-error-bar" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/continuous-error-bars/continuous-variable.html b/content/plotly_js/statistical/continuous-error-bars/continuous-variable.html new file mode 100644 index 00000000000..e8102ebcafb --- /dev/null +++ b/content/plotly_js/statistical/continuous-error-bars/continuous-variable.html @@ -0,0 +1,81 @@ +--- +name: Asymmetric Error Bars with a Constant Offset +language: plotly_js +suite: continuous-error-bar +order: 2 +sitemap: false +arrangement: horizontal +--- + +function random_date(start, end, mul) + { + return new Date(start.getTime() + mul * (end.getTime() - start.getTime())); + } + +function date_list(y1,m1,d1,y2,m2,d2,count) + { + var a =[]; + for(i=0;iNotice the hover text!" + }, + yaxis: { + title: { + text: "Wind speed (m/s)" + } + } +}; +Plotly.newPlot('myDiv', data, layout); \ No newline at end of file diff --git a/content/plotly_js/statistical/continuous-error-bars/filled-lines.html b/content/plotly_js/statistical/continuous-error-bars/filled-lines.html new file mode 100644 index 00000000000..ab4be94aad5 --- /dev/null +++ b/content/plotly_js/statistical/continuous-error-bars/filled-lines.html @@ -0,0 +1,88 @@ +--- +name: Filled Lines +arrangement: horizontal +language: plotly_js +suite: continuous-error-bar +order: 1 +sitemap: false +--- + +var trace1 = { + x: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], + y: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0], + fill: "tozerox", + fillcolor: "rgba(0,100,80,0.2)", + line: {color: "transparent"}, + name: "Fair", + showlegend: false, + type: "scatter" +}; +var trace2 = { + x: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], + y: [5.5, 3, 5.5, 8, 6, 3, 8, 5, 6, 5.5, 4.75, 5, 4, 7, 2, 4, 7, 4.4, 2, 4.5], + fill: "tozerox", + fillcolor: "rgba(0,176,246,0.2)", + line: {color: "transparent"}, + name: "Premium", + showlegend: false, + type: "scatter" +}; +var trace3 = { + x: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], + y: [11, 9, 7, 5, 3, 1, 3, 5, 3, 1, -1, 1, 3, 1, -0.5, 1, 3, 5, 7, 9], + fill: "tozerox", + fillcolor: "rgba(231,107,243,0.2)", + line: {color: "transparent"}, + name: "Ideal", + showlegend: false, + type: "scatter" +}; +var trace4 = { + x: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + y: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + line: {color: "rgb(0,100,80)"}, + mode: "lines", + name: "Fair", + type: "scatter" +}; +var trace5 = { + x: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + y: [5, 2.5, 5, 7.5, 5, 2.5, 7.5, 4.5, 5.5, 5], + line: {color: "rgb(0,176,246)"}, + mode: "lines", + name: "Premium", + type: "scatter" +}; +var trace6 = { + x: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + y: [10, 8, 6, 4, 2, 0, 2, 4, 2, 0], + line: {color: "rgb(231,107,243)"}, + mode: "lines", + name: "Ideal", + type: "scatter" +}; +var data = [trace1, trace2, trace3, trace4, trace5, trace6]; +var layout = { + paper_bgcolor: "rgb(255,255,255)", + plot_bgcolor: "rgb(229,229,229)", + xaxis: { + gridcolor: "rgb(255,255,255)", + range: [1, 10], + showgrid: true, + showline: false, + showticklabels: true, + tickcolor: "rgb(127,127,127)", + ticks: "outside", + zeroline: false + }, + yaxis: { + gridcolor: "rgb(255,255,255)", + showgrid: true, + showline: false, + showticklabels: true, + tickcolor: "rgb(127,127,127)", + ticks: "outside", + zeroline: false + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/density-plots/2D-density-histogram-slider-control.html b/content/plotly_js/statistical/density-plots/2D-density-histogram-slider-control.html new file mode 100644 index 00000000000..05304b605b5 --- /dev/null +++ b/content/plotly_js/statistical/density-plots/2D-density-histogram-slider-control.html @@ -0,0 +1,15 @@ +--- +name: 2D Histogram Contour Plot with Slider Control +plot_url: https://jsfiddle.net/plotlygraphs/y9sdy76h/4/embedded/result,js,html/ +language: plotly_js +suite: 2d-density-plot +order: 17 +sitemap: false +height: 800 +arrangement: horizontal +--- +Add slider controls to 2d-density-plot plots with the postMessage API. + +See the code on JSFiddle. + +Watch the 5 second video of how it works. diff --git a/content/plotly_js/statistical/density-plots/2dhistogram-contour-subplots.html b/content/plotly_js/statistical/density-plots/2dhistogram-contour-subplots.html new file mode 100644 index 00000000000..1d9b8ab48da --- /dev/null +++ b/content/plotly_js/statistical/density-plots/2dhistogram-contour-subplots.html @@ -0,0 +1,105 @@ +--- +name: 2D Histogram Contour Plot
with Histogram Subplots +arrangement: horizontal +language: plotly_js +suite: 2d-density-plot +order: 0 +sitemap: false + +--- +// from http://bl.ocks.org/mbostock/4349187 +// Sample from a normal distribution with mean 0, stddev 1. + +function normal() { + var x = 0, + y = 0, + rds, c; + do { + x = Math.random() * 2 - 1; + y = Math.random() * 2 - 1; + rds = x * x + y * y; + } while (rds == 0 || rds > 1); + c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform + return x * c; // throw away extra sample y * c +} + +var N = 2000, + a = -1, + b = 1.2; + +var step = (b - a) / (N - 1); +var t = new Array(N), x = new Array(N), y = new Array(N); + +for(var i = 0; i < N; i++){ + t[i] = a + step * i; + x[i] = (Math.pow(t[i], 3)) + (0.3 * normal() ); + y[i] = (Math.pow(t[i], 6)) + (0.3 * normal() ); +} + +var trace1 = { + x: x, + y: y, + mode: 'markers', + name: 'points', + marker: { + color: 'rgb(102,0,0)', + size: 2, + opacity: 0.4 + }, + type: 'scatter' +}; +var trace2 = { + x: x, + y: y, + name: 'density', + ncontours: 20, + colorscale: 'Hot', + reversescale: true, + showscale: false, + type: 'histogram2dcontour' +}; +var trace3 = { + x: x, + name: 'x density', + marker: {color: 'rgb(102,0,0)'}, + yaxis: 'y2', + type: 'histogram' +}; +var trace4 = { + y: y, + name: 'y density', + marker: {color: 'rgb(102,0,0)'}, + xaxis: 'x2', + type: 'histogram' +}; +var data = [trace1, trace2, trace3, trace4]; +var layout = { + showlegend: false, + autosize: false, + width: 600, + height: 550, + margin: {t: 50}, + hovermode: 'closest', + bargap: 0, + xaxis: { + domain: [0, 0.85], + showgrid: false, + zeroline: false + }, + yaxis: { + domain: [0, 0.85], + showgrid: false, + zeroline: false + }, + xaxis2: { + domain: [0.85, 1], + showgrid: false, + zeroline: false + }, + yaxis2: { + domain: [0.85, 1], + showgrid: false, + zeroline: false + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/density-plots/density-plots-index.html b/content/plotly_js/statistical/density-plots/density-plots-index.html new file mode 100644 index 00000000000..f233b532fad --- /dev/null +++ b/content/plotly_js/statistical/density-plots/density-plots-index.html @@ -0,0 +1,16 @@ +--- +description: How to make a D3.js-based 2d density plot in JavaScript. Examples of + density plots with kernel density estimations, custom color-scales, and smoothing. +display_as: statistical +language: plotly_js +layout: base +name: 2d Density Plots +order: 4 +page_type: example_index +permalink: javascript/2d-density-plots/ +redirect_from: javascript-graphing-library/2d-density-plots/ +thumbnail: thumbnail/2d-density-plot.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite", "2d-density-plot" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/error-bar/basic-error-bar.html b/content/plotly_js/statistical/error-bar/basic-error-bar.html new file mode 100644 index 00000000000..a34fc62a49d --- /dev/null +++ b/content/plotly_js/statistical/error-bar/basic-error-bar.html @@ -0,0 +1,21 @@ +--- +name: Basic Symmetric Error Bars +language: plotly_js +suite: error-bar +order: 1 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [0, 1, 2], + y: [6, 10, 2], + error_y: { + type: 'data', + array: [1, 2, 3], + visible: true + }, + type: 'scatter' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/error-bar/error-bar-asymmetric-array.html b/content/plotly_js/statistical/error-bar/error-bar-asymmetric-array.html new file mode 100644 index 00000000000..ab22e4c0ab1 --- /dev/null +++ b/content/plotly_js/statistical/error-bar/error-bar-asymmetric-array.html @@ -0,0 +1,22 @@ +--- +name: Asymmetric Error Bars +language: plotly_js +suite: error-bar +order: 4 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [1, 2, 3, 4], + y: [2, 1, 3, 4], + error_y: { + type: 'data', + symmetric: false, + array: [0.1, 0.2, 0.1, 0.1], + arrayminus: [0.2, 0.4, 1, 0.2] + }, + type: 'scatter' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/error-bar/error-bar-asymmetric-constant.html b/content/plotly_js/statistical/error-bar/error-bar-asymmetric-constant.html new file mode 100644 index 00000000000..8aeabe07ff8 --- /dev/null +++ b/content/plotly_js/statistical/error-bar/error-bar-asymmetric-constant.html @@ -0,0 +1,22 @@ +--- +name: Asymmetric Error Bars with a Constant Offset +language: plotly_js +suite: error-bar +order: 7 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [1, 2, 3, 4], + y: [2, 1, 3, 4], + error_y: { + type: 'percent', + symmetric: false, + value: 15, + valueminus: 25 + }, + type: 'scatter' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/error-bar/error-bar-bar.html b/content/plotly_js/statistical/error-bar/error-bar-bar.html new file mode 100644 index 00000000000..1e5bf402b7d --- /dev/null +++ b/content/plotly_js/statistical/error-bar/error-bar-bar.html @@ -0,0 +1,33 @@ +--- +name: Bar Chart with Error Bars +language: plotly_js +suite: error-bar +order: 2 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: ['Trial 1', 'Trial 2', 'Trial 3'], + y: [3, 6, 4], + name: 'Control', + error_y: { + type: 'data', + array: [1, 0.5, 1.5], + visible: true + }, + type: 'bar' +}; +var trace2 = { + x: ['Trial 1', 'Trial 2', 'Trial 3'], + y: [4, 7, 3], + name: 'Experimental', + error_y: { + type: 'data', + array: [0.5, 1, 2], + visible: true + }, + type: 'bar' +}; +var data = [trace1, trace2]; +var layout = {barmode: 'group'}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/error-bar/error-bar-horizontal.html b/content/plotly_js/statistical/error-bar/error-bar-horizontal.html new file mode 100644 index 00000000000..df384de05b3 --- /dev/null +++ b/content/plotly_js/statistical/error-bar/error-bar-horizontal.html @@ -0,0 +1,20 @@ +--- +name: Horizontal Error Bars +language: plotly_js +suite: error-bar +order: 3 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [1, 2, 3, 4], + y: [2, 1, 3, 4], + error_x: { + type: 'percent', + value: 10 + }, + type: 'scatter' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/error-bar/error-bar-style.html b/content/plotly_js/statistical/error-bar/error-bar-style.html new file mode 100644 index 00000000000..0b76dfce68e --- /dev/null +++ b/content/plotly_js/statistical/error-bar/error-bar-style.html @@ -0,0 +1,49 @@ +--- +name: Colored and Styled Error Bars +language: plotly_js +suite: error-bar +order: 5 +sitemap: false +arrangement: horizontal +--- +function linspace(a,b,n) { + return d3.range(n).map(function(i){return a+i*(b-a)/(n-1);}); +} +x_theo = linspace(-4, 4, 100) +sincx = Math.sin(x_theo) / x_theo +var x = [-3.8, -3.03, -1.91, -1.46, -0.89, -0.24, -0.0, 0.41, 0.89, 1.01, 1.91, 2.28, 2.79, 3.56] +var y = [-0.02, 0.04, -0.01, -0.27, 0.36, 0.75, 1.03, 0.65, 0.28, 0.02, -0.11, 0.16, 0.04, -0.15] + +var trace1 = { + x: x_theo, + y: sincx, + name: 'sinc(x)', + type: 'scatter' +}; +var trace2 = { + x: x, + y: y, + mode: 'markers', + name: 'measured', + error_y: { + type: 'constant', + value: 0.1, + color: '#85144B', + thickness: 1.5, + width: 3, + }, + error_x: { + type: 'constant', + value: 0.2, + color: '#85144B', + thickness: 1.5, + width: 3, + }, + marker: { + color: '#85144B', + size: 8 + }, + type: 'scatter' +}; +var data = [trace1, trace2]; +Plotly.newPlot('myDiv', data, {}, {showSendToCloud: true}); diff --git a/content/plotly_js/statistical/error-bar/error-bar_plotly_js_index.html b/content/plotly_js/statistical/error-bar/error-bar_plotly_js_index.html new file mode 100644 index 00000000000..d54d13508e7 --- /dev/null +++ b/content/plotly_js/statistical/error-bar/error-bar_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to add error bars to a D3.js-based line, scatter, or bar chart. Seven + examples of symmetric, asymmetric, horizontal, and colored error bars. +display_as: statistical +language: plotly_js +layout: base +name: Error Bars +order: 1 +page_type: example_index +permalink: javascript/error-bars/ +redirect_from: javascript-graphing-library/error-bars/ +thumbnail: thumbnail/error-bar.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","error-bar" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/error-bar/percent-error-bar.html b/content/plotly_js/statistical/error-bar/percent-error-bar.html new file mode 100644 index 00000000000..659461dea7f --- /dev/null +++ b/content/plotly_js/statistical/error-bar/percent-error-bar.html @@ -0,0 +1,21 @@ +--- +name: Error Bars as a Percentage of the y-Value +language: plotly_js +suite: error-bar +order: 6 +sitemap: false +arrangement: horizontal +--- +var data = [ + { + x: [0, 1, 2], + y: [6, 10, 2], + error_y: { + type: 'percent', + value: 50, + visible: true + }, + type: 'scatter' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram/basic-histogram.html b/content/plotly_js/statistical/histogram/basic-histogram.html new file mode 100644 index 00000000000..90706ddb97f --- /dev/null +++ b/content/plotly_js/statistical/histogram/basic-histogram.html @@ -0,0 +1,19 @@ +--- +name: Basic Histogram +arrangement: horizontal +language: plotly_js +suite: histogram +order: 4 +sitemap: false +--- +var x = []; +for (var i = 0; i < 500; i ++) { + x[i] = Math.random(); +} + +var trace = { + x: x, + type: 'histogram', + }; +var data = [trace]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram/cumulative-histogram.html b/content/plotly_js/statistical/histogram/cumulative-histogram.html new file mode 100644 index 00000000000..27626f36482 --- /dev/null +++ b/content/plotly_js/statistical/histogram/cumulative-histogram.html @@ -0,0 +1,20 @@ +--- +name: Cumulative Histogram +arrangement: horizontal +language: plotly_js +suite: histogram +order: 9 +sitemap: false +--- +var x = []; +for (var i = 0; i < 500; i ++) { + x[i] = Math.random(); +} + +var trace = { + x: x, + type: 'histogram', + cumulative: {enabled: true} + }; +var data = [trace]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram/histfunc.html b/content/plotly_js/statistical/histogram/histfunc.html new file mode 100644 index 00000000000..7e3408bd07c --- /dev/null +++ b/content/plotly_js/statistical/histogram/histfunc.html @@ -0,0 +1,30 @@ +--- +name: Specify Binning Function +arrangement: horizontal +language: plotly_js +suite: histogram +order: 10 +sitemap: false +--- + +var x = ["Apples","Apples","Apples","Oranges", "Bananas"] +var y = ["5","10","3","10","5"] + +var data = [ + { + histfunc: "count", + y: y, + x: x, + type: "histogram", + name: "count" + }, + { + histfunc: "sum", + y: y, + x: x, + type: "histogram", + name: "sum" + } +] + +Plotly.newPlot('myDiv', data) diff --git a/content/plotly_js/statistical/histogram/histogram_plotly_js_index.html b/content/plotly_js/statistical/histogram/histogram_plotly_js_index.html new file mode 100644 index 00000000000..6c55f91273a --- /dev/null +++ b/content/plotly_js/statistical/histogram/histogram_plotly_js_index.html @@ -0,0 +1,17 @@ +--- +description: How to make a D3.js-based histogram in JavaScript. Seven examples of + colored, horizontal, and normal histogram bar charts. +display_as: statistical +language: plotly_js +layout: base +name: Histograms +order: 3 +page_type: example_index +permalink: javascript/histograms/ +plottype: histogram +redirect_from: javascript-graphing-library/histograms/ +thumbnail: thumbnail/histogram.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","histogram" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/histogram/horizontal-histogram.html b/content/plotly_js/statistical/histogram/horizontal-histogram.html new file mode 100644 index 00000000000..85984655a42 --- /dev/null +++ b/content/plotly_js/statistical/histogram/horizontal-histogram.html @@ -0,0 +1,23 @@ +--- +name: Horizontal Histogram +arrangement: horizontal +language: plotly_js +suite: histogram +order: 5 +sitemap: false +--- +var y = []; +for (var i = 0; i < 500; i ++) { + y[i] = Math.random(); +} + +var data = [ + { + y: y, + type: 'histogram', + marker: { + color: 'pink', + }, + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram/normalized-histogram.html b/content/plotly_js/statistical/histogram/normalized-histogram.html new file mode 100644 index 00000000000..3a877e704c9 --- /dev/null +++ b/content/plotly_js/statistical/histogram/normalized-histogram.html @@ -0,0 +1,24 @@ +--- +name: Normalized Histogram +arrangement: horizontal +language: plotly_js +suite: histogram +order: 9 +sitemap: false +--- +var x = []; +for (var i = 0; i < 500; i ++) { + x[i] = Math.random(); +} + +var data = [ + { + x: x, + type: 'histogram', + histnorm: 'probability', + marker: { + color: 'rgb(255,255,100)', + }, + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram/overlaid-histogram.html b/content/plotly_js/statistical/histogram/overlaid-histogram.html new file mode 100644 index 00000000000..104da6cbe2f --- /dev/null +++ b/content/plotly_js/statistical/histogram/overlaid-histogram.html @@ -0,0 +1,36 @@ +--- +name: Overlaid Histogram +arrangement: horizontal +language: plotly_js +suite: histogram +order: 6 +sitemap: false +--- +var x1 = []; +var x2 = []; +for (var i = 1; i < 500; i++) +{ + k = Math.random(); + x1.push(Math.random() + 1); + x2.push(Math.random() + 1.1); +} +var trace1 = { + x: x1, + type: "histogram", + opacity: 0.5, + marker: { + color: 'green', + }, +}; +var trace2 = { + x: x2, + type: "histogram", + opacity: 0.6, + marker: { + color: 'red', + }, +}; + +var data = [trace1, trace2]; +var layout = {barmode: "overlay"}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/histogram/stacked-histogram.html b/content/plotly_js/statistical/histogram/stacked-histogram.html new file mode 100644 index 00000000000..69e6a5f20a7 --- /dev/null +++ b/content/plotly_js/statistical/histogram/stacked-histogram.html @@ -0,0 +1,26 @@ +--- +name: Stacked Histograms +arrangement: horizontal +language: plotly_js +suite: histogram +order: 7 +sitemap: false +--- +var x1 = []; +var x2 = []; +for (var i = 0; i < 500; i ++) { + x1[i] = Math.random(); + x2[i] = Math.random(); +} + +var trace1 = { + x: x1, + type: "histogram", +}; +var trace2 = { + x: x2, + type: "histogram", +}; +var data = [trace1, trace2]; +var layout = {barmode: "stack"}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/histogram/style-histogram.html b/content/plotly_js/statistical/histogram/style-histogram.html new file mode 100644 index 00000000000..bff87ef1a4f --- /dev/null +++ b/content/plotly_js/statistical/histogram/style-histogram.html @@ -0,0 +1,82 @@ +--- +name: Colored and Styled Histograms +arrangement: horizontal +language: plotly_js +suite: histogram +order: 8 +sitemap: false +--- +var x1 = []; +var x2 = []; +var y1 = []; +var y2 = []; +for (var i = 1; i < 500; i++) +{ + k = Math.random(); + x1.push(k*5); + x2.push(k*10); + y1.push(k); + y2.push(k*2); +} +var trace1 = { + x: x1, + y: y1, + name: 'control', + autobinx: false, + histnorm: "count", + marker: { + color: "rgba(255, 100, 102, 0.7)", + line: { + color: "rgba(255, 100, 102, 1)", + width: 1 + } + }, + opacity: 0.5, + type: "histogram", + xbins: { + end: 2.8, + size: 0.06, + start: .5 + } +}; +var trace2 = { + x: x2, + y: y2, + autobinx: false, + marker: { + color: "rgba(100, 200, 102, 0.7)", + line: { + color: "rgba(100, 200, 102, 1)", + width: 1 + } + }, + name: "experimental", + opacity: 0.75, + type: "histogram", + xbins: { + end: 4, + size: 0.06, + start: -3.2 + + } +}; +var data = [trace1, trace2]; +var layout = { + bargap: 0.05, + bargroupgap: 0.2, + barmode: "overlay", + title: { + text: "Sampled Results" + }, + xaxis: { + title: { + text: "Value" + } + }, + yaxis: { + title: { + text: "Count" + } + } +}; +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/histogram2d/2d-histogram-options.html b/content/plotly_js/statistical/histogram2d/2d-histogram-options.html new file mode 100644 index 00000000000..70bb4ac3239 --- /dev/null +++ b/content/plotly_js/statistical/histogram2d/2d-histogram-options.html @@ -0,0 +1,37 @@ +--- +name: 2D Histogram Binning and Styling Options +language: plotly_js +suite: histogram2d +order: 1 +sitemap: false +arrangement: horizontal +--- +var x = []; +var y = []; +for (var i = 0; i < 500; i ++) { + x[i] = Math.random(); + y[i] = Math.random() + 1; +} + +var data = [ + { + x: x, + y: y, + histnorm: 'probability', + autobinx: false, + xbins: { + start: -3, + end: 3, + size: 0.1 + }, + autobiny: false, + ybins: { + start: -2.5, + end: 4, + size: 0.1 + }, + colorscale: [['0', 'rgb(12,51,131)'], ['0.25', 'rgb(10,136,186)'], ['0.5', 'rgb(242,211,56)'], ['0.75', 'rgb(242,143,56)'], ['1', 'rgb(217,30,30)']], + type: 'histogram2d' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram2d/2d-histogram-scatter.html b/content/plotly_js/statistical/histogram2d/2d-histogram-scatter.html new file mode 100644 index 00000000000..2fc53fed3a5 --- /dev/null +++ b/content/plotly_js/statistical/histogram2d/2d-histogram-scatter.html @@ -0,0 +1,65 @@ +--- +name: 2D Histogram Overlaid with a Scatter Chart +language: plotly_js +suite: histogram2d +order: 2 +sitemap: false +arrangement: horizontal +--- +var x0 = []; +var y0 = []; +var x1 = []; +var y1 = []; +var x2 = []; +var y2 = []; + +for (var i = 0; i < 500; i ++) +{ + x0[i] = Math.random() + 1; + y0[i] = Math.random() + 1.5; +} + +for (var i = 0; i < 100; i ++) +{ + x1[i] = Math.random(); + y1[i] = Math.random() + 1; +} + +for (var i = 0; i < 500; i ++) +{ + x2[i] = Math.random()*2; + y2[i] = Math.random()*3; +} + +var trace1 = { + x: x0, + y: y0, + mode: 'markers', + marker: { + symbol: 'circle', + opacity: 0.7, + color:'rgb(200,111,200)', + }, + type: 'scatter', +}; +var trace2 = { + x: x1, + y: y1, + mode: 'markers', + marker: { + symbol: 'square', + opacity: 0.7, + color:'cyan', + }, + type: 'scatter' +}; +var trace3 = { + x: x2, + y: y2, + type: 'histogram2d', + colorscale : [['0' , 'rgb(0,225,100)'],['1', 'rgb(100,0,200)']], + +}; + +var data = [trace1, trace2, trace3]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram2d/2d-histogram.html b/content/plotly_js/statistical/histogram2d/2d-histogram.html new file mode 100644 index 00000000000..4a82ec32f2f --- /dev/null +++ b/content/plotly_js/statistical/histogram2d/2d-histogram.html @@ -0,0 +1,23 @@ +--- +name: 2D Histogram of a Bivariate Normal Distribution +language: plotly_js +suite: histogram2d +order: 0 +sitemap: false +arrangement: horizontal +--- +var x = []; +var y = []; +for (var i = 0; i < 500; i ++) { + x[i] = Math.random(); + y[i] = Math.random() + 1; +} + +var data = [ + { + x: x, + y: y, + type: 'histogram2d' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram2d/histogram2d_plotly_js_index.html b/content/plotly_js/statistical/histogram2d/histogram2d_plotly_js_index.html new file mode 100644 index 00000000000..859be05212a --- /dev/null +++ b/content/plotly_js/statistical/histogram2d/histogram2d_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make a D3.js-based 2D histogram in javascript. A 2D histogram + is a visualization of a bivariate distribution. +display_as: statistical +language: plotly_js +layout: base +name: 2D Histograms +order: 6 +permalink: javascript/2D-Histogram/ +redirect_from: javascript-graphing-library/2D-Histogram/ +thumbnail: thumbnail/histogram2d.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","histogram2d" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/histogram2dcontour/basic-hist2dcontour.html b/content/plotly_js/statistical/histogram2dcontour/basic-hist2dcontour.html new file mode 100644 index 00000000000..9fb8021ced2 --- /dev/null +++ b/content/plotly_js/statistical/histogram2dcontour/basic-hist2dcontour.html @@ -0,0 +1,24 @@ +--- +name: Basic 2D Histogram Contour +language: plotly_js +suite: hist2dcontour +order: 1 +sitemap: false +arrangement: horizontal +--- + +var x = []; +var y = []; +for (var i = 0; i < 500; i ++) { + x[i] = Math.random(); + y[i] = Math.random() + 1; +} + +var data = [ + { + x: x, + y: y, + type: 'histogram2dcontour' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram2dcontour/colorscale-hist2dcontour.html b/content/plotly_js/statistical/histogram2dcontour/colorscale-hist2dcontour.html new file mode 100644 index 00000000000..4bc7f9e29f0 --- /dev/null +++ b/content/plotly_js/statistical/histogram2dcontour/colorscale-hist2dcontour.html @@ -0,0 +1,25 @@ +--- +name: 2D Histogram Contour Colorscale +language: plotly_js +suite: hist2dcontour +order: 2 +sitemap: false +arrangement: horizontal +--- + +var x = []; +var y = []; +for (var i = 0; i < 500; i ++) { + x[i] = Math.random(); + y[i] = Math.random() + 1; +} + +var data = [ + { + x: x, + y: y, + colorscale: 'Blues', + type: 'histogram2dcontour' + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/histogram2dcontour/hist2dcontour-plotlyjs-index.html b/content/plotly_js/statistical/histogram2dcontour/hist2dcontour-plotlyjs-index.html new file mode 100644 index 00000000000..031cc44bbfd --- /dev/null +++ b/content/plotly_js/statistical/histogram2dcontour/hist2dcontour-plotlyjs-index.html @@ -0,0 +1,13 @@ +--- +description: How to make D3.js-based 2D Histogram Contour plots in Plotly.js. +display_as: statistical +language: plotly_js +layout: base +name: 2D Histogram Contour +order: 11 +permalink: javascript/2d-histogram-contour/ +thumbnail: thumbnail/hist2dcontour.png +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","hist2dcontour" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/histogram2dcontour/styled-hist2dcontour.html b/content/plotly_js/statistical/histogram2dcontour/styled-hist2dcontour.html new file mode 100644 index 00000000000..ecbf306d843 --- /dev/null +++ b/content/plotly_js/statistical/histogram2dcontour/styled-hist2dcontour.html @@ -0,0 +1,40 @@ +--- +name: Styled 2D Histogram Contour +language: plotly_js +suite: hist2dcontour +order: 3 +sitemap: false +arrangement: horizontal +--- + +var x = []; +var y = []; +for (var i = 0; i < 500; i ++) { + x[i] = Math.random(); + y[i] = Math.random() + 1; +} + +var data = [ + { + x: x, + y: y, + colorscale: 'Blues', + type: 'histogram2dcontour', + contours: { + showlabels: true, + labelfont: { + family: 'Raleway', + color: 'white' + } + }, + hoverlabel: { + bgcolor: 'white', + bordercolor: 'black', + font: { + family: 'Raleway', + color: 'black' + } + } + } +]; +Plotly.newPlot('myDiv', data); diff --git a/content/plotly_js/statistical/parcats/basic-parcats-counts.html b/content/plotly_js/statistical/parcats/basic-parcats-counts.html new file mode 100644 index 00000000000..6e6c9cfca3b --- /dev/null +++ b/content/plotly_js/statistical/parcats/basic-parcats-counts.html @@ -0,0 +1,28 @@ +--- +name: Basic Parallel Categories Diagram with Counts +arrangement: horizontal +language: plotly_js +suite: parcats +order: 2 +sitemap: false +markdown_content: | + If the frequency of occurrence for each combination of attributes is known in advance, this can be specified using + the `counts` property +--- +var trace1 = { + type: 'parcats', + dimensions: [ + {label: 'Hair', + values: ['Black', 'Brown', 'Brown', 'Brown', 'Red']}, + {label: 'Eye', + values: ['Brown', 'Brown', 'Brown', 'Blue', 'Blue']}, + {label: 'Sex', + values: ['Female', 'Male', 'Female', 'Male', 'Male']}], + counts: [6, 10, 40, 23, 7] +}; + +var data = [ trace1 ]; + +var layout = {width: 600}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/statistical/parcats/basic-parcats.html b/content/plotly_js/statistical/parcats/basic-parcats.html new file mode 100644 index 00000000000..a3b73df997b --- /dev/null +++ b/content/plotly_js/statistical/parcats/basic-parcats.html @@ -0,0 +1,44 @@ +--- +name: Basic Parallel Categories Diagram +arrangement: horizontal +language: plotly_js +suite: parcats +order: 1 +sitemap: false +markdown_content: | + The parallel categories diagram is a visualization of multi-dimensional categorical data sets. Each variable in + the data set is represented by a column of rectangles, where each rectangle corresponds to a discrete value + taken on by that variable. The relative heights of the rectangles reflect the relative frequency of occurrence of + the corresponding value. + + Combinations of category rectangles across dimensions are connected by ribbons, where the height of the ribbon + corresponds to the relative frequency of occurrence of the combination of categories in the data set. + + In this example, we visualize the hair color, eye color, and sex of a sample of 8 people. Hovering over a + category rectangle displays a tooltip with the number of people with that single trait. Hovering over a ribbon + in the diagram displays a tooltip with the number of people with a particular combination of the three + traits connected by the ribbon. + + The dimension labels can be dragged horizontally to reorder the dimensions and the category rectangles can be + dragged vertically to reorder the categories within a dimension. +--- +var trace1 = { + type: 'parcats', + dimensions: [ + {label: 'Hair', + values: ['Black', 'Black', 'Black', 'Brown', + 'Brown', 'Brown', 'Red', 'Brown']}, + {label: 'Eye', + values: ['Brown', 'Brown', 'Brown', 'Brown', + 'Brown', 'Blue', 'Blue', 'Blue']}, + {label: 'Sex', + values: ['Female', 'Female', 'Female', 'Male', + 'Female', 'Male', 'Male', 'Male']}] +}; + +var data = [ trace1 ]; + +var layout = {width: 600}; + +Plotly.newPlot('myDiv', data, layout); + diff --git a/content/plotly_js/statistical/parcats/brushing-parcats.html b/content/plotly_js/statistical/parcats/brushing-parcats.html new file mode 100644 index 00000000000..307c71271bc --- /dev/null +++ b/content/plotly_js/statistical/parcats/brushing-parcats.html @@ -0,0 +1,100 @@ +--- +name: Parallel Categories Linked Brushing +arrangement: horizontal +language: plotly_js +suite: parcats +order: 4 +sitemap: false +markdown_content: | + This example demonstrates how the `plotly_selected` and `plotly_click` events can be used to implement linked + brushing between 3 categorical dimensions displayed with a `parcats` trace and 2 continuous dimensions displayed + with a `scatter` trace. + + This example also sets the `line.shape` property to `hspline` to cause the ribbons to curve between categories. +--- +var gd = document.getElementById("myDiv"); +var categoricalDimensionLabels = [ + 'body-style', + 'drive-wheels', + 'fuel-type' +]; + +d3.csv( + 'https://raw.githubusercontent.com/plotly/datasets/master/imports-85.csv', + function(carsData) { + // Preprocess Data + var mpg = carsData.map(function(row) { return row['highway-mpg'] }); + var horsepower = carsData.map(function(row) { return row['horsepower'] }); + + var categoricalDimensions = categoricalDimensionLabels.map( + function(dimLabel) { + // Extract column + var values = carsData.map(function(row) { + return row[dimLabel] + }); + + return { + values: values, + label: dimLabel + }; + }); + + // Colors + var color = new Int8Array(carsData.length); + var colorscale = [[0, 'gray'], [1, 'firebrick']]; + + // Layout + var layout = { + width: 600, + height: 800, + xaxis: {title: {text: 'Horsepower'}}, + yaxis: {domain: [0.6, 1], title: {text: 'MPG'}}, + dragmode: 'lasso', + hovermode: 'closest' + }; + + // Build Traces + var traces = [ + {type: 'scatter', + x: horsepower, + y: mpg, + marker: {color: 'gray'}, + mode: 'markers', + selected: {'marker': {'color': 'firebrick'}}, + unselected: {'marker': {'opacity': 0.3}} + }, + {type: 'parcats', + domain: {y: [0, 0.4]}, + dimensions:categoricalDimensions, + line: { + colorscale: colorscale, + cmin: 0, + cmax: 1, + color: color, + shape: 'hspline'}, + labelfont: {size: 14} + } + ]; + + // Make plot + Plotly.newPlot('myDiv', traces, layout); + + // Update color on selection and click + var update_color = function(points_data) { + var new_color = new Int8Array(carsData.length); + var selection = [] + for(var i = 0; i < points_data.points.length; i++) { + new_color[points_data.points[i].pointNumber] = 1; + selection.push(points_data.points[i].pointNumber); + } + + // Update selected points in scatter plot + Plotly.restyle('myDiv', {'selectedpoints': [selection]}, 0) + + // Update color of selected paths in parallel categories diagram + Plotly.restyle('myDiv', {'line.color': [new_color]}, 1) + }; + + gd.on('plotly_selected', update_color); + gd.on('plotly_click', update_color); + }); diff --git a/content/plotly_js/statistical/parcats/multi-brushing-parcats.html b/content/plotly_js/statistical/parcats/multi-brushing-parcats.html new file mode 100644 index 00000000000..33dd8e58450 --- /dev/null +++ b/content/plotly_js/statistical/parcats/multi-brushing-parcats.html @@ -0,0 +1,109 @@ +--- +name: Parallel Categories with Multi-Color Linked Brushing +plot_url: https://codepen.io/plotly/embed/EOjmrW/?height=801&theme-id=15263&default-tab=result +arrangement: horizontal +language: plotly_js +suite: parcats +order: 5 +sitemap: false +markdown_content: | + This example extends the previous example to support brushing with multiple colors. The radio buttons above may + be used to select the active color, and this color will be applied when points are selected in the `scatter` + trace and when categories or ribbons are clicked in the `parcats` trace. +--- +var gd = document.getElementById('myDiv'); +var categoricalDimensionLabels = [ + 'body-style', + 'drive-wheels', + 'fuel-type' +]; + +d3.csv( + 'https://raw.githubusercontent.com/plotly/datasets/master/imports-85.csv', + function(carsData) { + // Preprocess Data + var mpg = carsData.map(function(row) { return row['highway-mpg'] }); + var horsepower = carsData.map(function(row) { return row['horsepower'] }); + + var categoricalDimensions = categoricalDimensionLabels.map( + function(dimLabel) { + // Extract column + var values = carsData.map(function(row) { + return row[dimLabel] + }); + + return { + values: values, + label: dimLabel + }; + } + ); + + // Colors + var color = new Int8Array(carsData.length); + var colorscale = [[0, 'gray'], [0.33, 'gray'], + [0.33, 'firebrick'], [0.66, 'firebrick'], + [0.66, 'blue'], [1.0, 'blue']]; + + // Layout + var layout = { + width: 600, + height: 800, + xaxis: {title: {text: 'Horsepower'}}, + yaxis: {domain: [0.6, 1], title: {text: 'MPG'}}, + dragmode: 'lasso', + hovermode: 'closest' + }; + + // Build Traces + var traces = [ + {type: 'scatter', + x: horsepower, + y: mpg, + marker: {color: color, + colorscale: colorscale, + cmin: -0.5, + cmax: 2.5, + showscale: true, + colorbar: {tickvals: [0, 1, 2], + ticktext: ['None', 'Red', 'Blue']}}, + mode: 'markers', + }, + {type: 'parcats', + domain: {y: [0, 0.4]}, + dimensions:categoricalDimensions, + line: { + colorscale: colorscale, + cmin: -0.5, + cmax: 2.5, + color: color, + shape: 'hspline'}, + labelfont: {size: 14} + } + ]; + + // Make plot + Plotly.newPlot('myDiv', traces, layout); + + // Update color on selection and click + var update_color = function(points_data) { + var new_color = color; + var color_value = document.querySelector('input[name="rate"]:checked').value; + console.log(color_value); + var selection = [] + for(var i = 0; i < points_data.points.length; i++) { + new_color[points_data.points[i].pointNumber] = color_value; + selection.push(points_data.points[i].pointNumber); + } + + // Update selected points in scatter plot + Plotly.restyle'myDiv', {'marker.color': [new_color]}, 0) + + // Update color of selected paths in parallel categories diagram + Plotly.restyle'myDiv', + {'line.color': [new_color]}, 1) + }; + + gd.on('plotly_selected', update_color); + gd.on('plotly_click', update_color); + }); diff --git a/content/plotly_js/statistical/parcats/parcats_plotly_js_index.html b/content/plotly_js/statistical/parcats/parcats_plotly_js_index.html new file mode 100644 index 00000000000..31b4e6dff89 --- /dev/null +++ b/content/plotly_js/statistical/parcats/parcats_plotly_js_index.html @@ -0,0 +1,13 @@ +--- +description: How to make parallel categories diagrams in JavaScript +display_as: statistical +language: plotly_js +layout: base +name: Parallel Categories Diagram +order: 9 +permalink: javascript/parallel-categories-diagram/ +thumbnail: thumbnail/parcats.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","parcats" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/parcats/titanic-parcats.html b/content/plotly_js/statistical/parcats/titanic-parcats.html new file mode 100644 index 00000000000..6c36ff11e99 --- /dev/null +++ b/content/plotly_js/statistical/parcats/titanic-parcats.html @@ -0,0 +1,65 @@ +--- +name: Mutli-Color Parallel Categories Diagram +arrangement: horizontal +language: plotly_js +suite: parcats +order: 3 +sitemap: false +markdown_content: | + The color of the ribbons can be specified with the `line.color` property. Similar to other trace types, this + property may be set to an array of numbers, which are then mapped to colors according to the the colorscale + specified in the `line.colorscale` property. + + Here is an example of visualizing the survival rate of passengers in the titanic dataset, where the ribbons are + colored based on survival outcome. + + By setting the `hoveron` property to `'color'` and the `hoverinfo` property to `'count+probability'` the tooltips + now display count and probability information for each color (outcome) per category. + + By setting the `arrangement` property to `'freeform'` it is now possible to drag categories horizontally to + reorder dimensions as well as vertically to reorder categories within the dimension. +--- +var gd = document.getElementById('myDiv'); + +d3.csv( + "https://raw.githubusercontent.com/plotly/datasets/master/titanic.csv", + function(titanicData) { + var classDim = { + values: titanicData.map(function(row) {return row['Pclass']}), + categoryorder: 'category ascending', + label: "Class" + }; + + var genderDim = { + values: titanicData.map(function(row) {return row['Sex']}), + label: "Gender" + }; + + var survivalDim = { + values: titanicData.map(function(row) {return row['Survived']}), + label: "Outcome", + categoryarray: [0, 1], + ticktext: ['perished', 'survived'], + }; + + var color = survivalDim.values; + var colorscale = [[0, 'lightsteelblue'], [1, 'mediumseagreen']]; + + // Build Traces + var traces = [ + {type: 'parcats', + dimensions: [classDim, genderDim, survivalDim], + line: {color: color, + colorscale: colorscale}, + hoveron: 'color', + hoverinfo: 'count+probability', + labelfont: {size: 14}, + arrangement: 'freeform' + } + ]; + + var layout = {width: 600}; + + // Make plot + Plotly.newPlot('myDiv', traces, layout); + }); diff --git a/content/plotly_js/statistical/plotly_js-statistical-index.html b/content/plotly_js/statistical/plotly_js-statistical-index.html new file mode 100644 index 00000000000..18e9e93b56c --- /dev/null +++ b/content/plotly_js/statistical/plotly_js-statistical-index.html @@ -0,0 +1,27 @@ +--- +permalink: javascript/statistical-charts/ +description: Plotly.js makes interactive, publication-quality graphs online. Examples of how to make statistical charts such as boxplots and histograms. +name: Statistical Charts +layout: langindex +language: plotly_js +display_as: statistical +thumbnail: thumbnail/mixed.jpg +--- + + +
+
+ +
+ +
+

Plotly.js Statistical Charts

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","statistical" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/statistical/splom/diabetes.html b/content/plotly_js/statistical/splom/diabetes.html new file mode 100644 index 00000000000..6d7011df9f3 --- /dev/null +++ b/content/plotly_js/statistical/splom/diabetes.html @@ -0,0 +1,97 @@ +--- +name: Splom of Diabetes Dataset +language: plotly_js +suite: splom +order: 2 +sitemap: false +arrangement: horizontal +markdown_content: | + Diabetes dataset is downloaded from [kaggle](https://www.kaggle.com/uciml/pima-indians-diabetes-database/data). It is used to predict the onset of diabetes based on 8 diagnostic measures. The diabetes file contains the diagnostic measures for 768 patients, that are labeled as non-diabetic (Outcome=0), respectively diabetic (Outcome=1). The splom associated to the 8 variables can illustrate the strength of the relationship between pairs of measures for diabetic/nondiabetic patients. +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/diabetes.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + text = [] + for (i=0; i < unpack(rows, 'Outcome').length; i++) { + if (unpack(rows, 'Outcome')[i] == "0") { + text.push("Diabetic") + } else { + text.push("Non-Diabetic") + } + } + + var pl_colorscale=[ + [0.0, '#119dff'], + [0.5, '#119dff'], + [0.5, '#ef553b'], + [1, '#ef553b'] + ] + + var axis = () => ({ + showline:false, + zeroline:false, + gridcolor:'#ffff', + ticklen:2, + tickfont:{size:10}, + title:{font:{size:12}} + }) + + var data = [{ + type: 'splom', + dimensions: [ + {label:'Pregnancies', values:unpack(rows, 'Pregnancies')}, + {label:'Glucose', values:unpack(rows, 'Glucose')}, + {label:'BloodPressure', values:unpack(rows, 'BloodPressure')}, + {label:'SkinThickness', values:unpack(rows, 'SkinThickness')}, + {label:'Insulin', values:unpack(rows, 'Insulin')}, + {label:'BMI', values:unpack(rows, 'BMI')}, + {label:'DiabPedigreeFun', values:unpack(rows, 'DiabetesPedigreeFunction')}, + {label:'Age', values:unpack(rows, 'Age')} + ], + text:text, + marker: { + color: unpack(rows, 'Outcome'), + colorscale:pl_colorscale, + size: 5, + line: { + color: 'white', + width: 0.5 + } + } + }] + + var layout = { + title: { + text: "Scatterplot Matrix (SPLOM) for Diabetes Dataset
Data source: [1]" + }, + height: 1000, + width: 1000, + autosize: false, + hovermode:'closest', + dragmode:'select', + plot_bgcolor:'rgba(240,240,240, 0.95)', + xaxis:axis(), + yaxis:axis(), + xaxis2:axis(), + xaxis3:axis(), + xaxis4:axis(), + xaxis5:axis(), + xaxis6:axis(), + xaxis7:axis(), + xaxis8:axis(), + yaxis2:axis(), + yaxis3:axis(), + yaxis4:axis(), + yaxis5:axis(), + yaxis6:axis(), + yaxis7:axis(), + yaxis8:axis() + } + + Plotly.react('myDiv', data, layout); + +}); diff --git a/content/plotly_js/statistical/splom/iris.html b/content/plotly_js/statistical/splom/iris.html new file mode 100644 index 00000000000..e59f476cd3e --- /dev/null +++ b/content/plotly_js/statistical/splom/iris.html @@ -0,0 +1,87 @@ +--- +name: Splom of Iris Dataset +language: plotly_js +suite: splom +order: 1 +sitemap: false +arrangement: horizontal +markdown_content: | + The Iris dataset contains four data variables, sepal length, sepal width, petal length petal width, for 150 iris flowers. The flowers are labeled as Iris-setosa, Iris-versicolor, Iris-virginica. +--- + +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/iris-data.csv', function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key.replace('.',' ')]; }); + } + + colors = [] + for (i=0; i < unpack(rows, 'class').length; i++) { + if (unpack(rows, 'class')[i] == "Iris-setosa") { + colors.push(0) + } else if (unpack(rows, 'class')[i] == "Iris-versicolor") { + colors.push(0.5) + } else if (unpack(rows, 'class')[i] == "Iris-virginica") { + colors.push(1) + } + } + + var pl_colorscale=[ + [0.0, '#19d3f3'], + [0.333, '#19d3f3'], + [0.333, '#e763fa'], + [0.666, '#e763fa'], + [0.666, '#636efa'], + [1, '#636efa'] + ] + + var axis = () => ({ + showline:false, + zeroline:false, + gridcolor:'#ffff', + ticklen:4 + }) + + var data = [{ + type: 'splom', + dimensions: [ + {label:'sepal length', values:unpack(rows,'sepal length')}, + {label:'sepal width', values:unpack(rows,'sepal width')}, + {label:'petal length', values:unpack(rows,'petal length')}, + {label:'petal width', values:unpack(rows,'petal width')} + ], + text: unpack(rows, 'class'), + marker: { + color: colors, + colorscale:pl_colorscale, + size: 7, + line: { + color: 'white', + width: 0.5 + } + } + }] + + var layout = { + title: { + text: 'Iris Data set' + }, + height: 800, + width: 800, + autosize: false, + hovermode:'closest', + dragmode:'select', + plot_bgcolor:'rgba(240,240,240, 0.95)', + xaxis:axis(), + yaxis:axis(), + xaxis2:axis(), + xaxis3:axis(), + xaxis4:axis(), + yaxis2:axis(), + yaxis3:axis(), + yaxis4:axis() + } + + Plotly.react('myDiv', data, layout) + +}); diff --git a/content/plotly_js/statistical/splom/splom-plotlyjs-index.html b/content/plotly_js/statistical/splom/splom-plotlyjs-index.html new file mode 100644 index 00000000000..76166e8c98e --- /dev/null +++ b/content/plotly_js/statistical/splom/splom-plotlyjs-index.html @@ -0,0 +1,13 @@ +--- +description: How to make D3.js-based splom in Plotly.js. +display_as: statistical +language: plotly_js +layout: base +name: Splom +order: 10 +permalink: javascript/splom/ +thumbnail: thumbnail/splom_image.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","splom" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/statistical/violin/advanced-violin.html b/content/plotly_js/statistical/violin/advanced-violin.html new file mode 100644 index 00000000000..d2b0937d426 --- /dev/null +++ b/content/plotly_js/statistical/violin/advanced-violin.html @@ -0,0 +1,581 @@ +--- +name: Advanced Violin Plot +language: plotly_js +suite: violin +order: 6 +sitemap: false +arrangement: horizontal +width: 700 +--- + +var trace1 = { + text: "sample length: 32", + hoveron: "points+kde", + meanline: { + visible: true + }, + legendgroup: "F", + scalegroup: "F", + points: "all", + pointpos: 1, + box: { + visible: true + }, + jitter: 0, + scalemode: "count", + marker: { + line: { + width: 2, + color: "#bebada" + }, + symbol: "line-ns" + }, + showlegend: false, + side: "positive", + type: "violin", + name: "F", + span: [ + 0 + ], + line: { + color: "#bebada" + }, + y0: "Thursday", + x: [ + 10.07, + 34.83, + 10.65, + 12.43, + 24.08, + 13.42, + 12.48, + 29.8, + 14.52, + 11.38, + 20.27, + 11.17, + 12.26, + 18.26, + 8.51, + 10.33, + 14.15, + 13.16, + 17.47, + 27.05, + 16.43, + 8.35, + 18.64, + 11.87, + 19.81, + 43.11, + 13.0, + 12.74, + 13.0, + 16.4, + 16.47, + 18.78 + ], + orientation: "h" + } + + +var trace2 = { + text: "sample length: 30", + hoveron: "points+kde", + meanline: { + visible: true + }, + legendgroup: "M", + scalegroup: "M", + points: "all", + pointpos: -0.6, + box: { + visible: true + }, + jitter: 0, + scalemode: "count", + marker: { + line: { + width: 2, + color: "#8dd3c7" + }, + symbol: "line-ns" + }, + showlegend: false, + side: "negative", + type: "violin", + name: "M", + span: [ + 0 + ], + line: { + color: "#8dd3c7" + }, + y0: "Thursday", + x: [ + 27.2, + 22.76, + 17.29, + 19.44, + 16.66, + 32.68, + 15.98, + 13.03, + 18.28, + 24.71, + 21.16, + 11.69, + 14.26, + 15.95, + 8.52, + 22.82, + 19.08, + 16.0, + 34.3, + 41.19, + 9.78, + 7.51, + 28.44, + 15.48, + 16.58, + 7.56, + 10.34, + 13.51, + 18.71, + 20.53 + ], + orientation: "h" + } + +var trace3 = { + text: "sample length: 9", + hoveron: "points+kde", + meanline: { + visible: true + }, + legendgroup: "F", + scalegroup: "F", + points: "all", + pointpos: 0.4, + box: { + visible: true + }, + jitter: 0, + scalemode: "count", + marker: { + line: { + width: 2, + color: "#bebada" + }, + symbol: "line-ns" + }, + showlegend: false, + side: "positive", + type: "violin", + name: "F", + span: [ + 0 + ], + line: { + color: "#bebada" + }, + y0: "Friday", + x: [ + 5.75, + 16.32, + 22.75, + 11.35, + 15.38, + 13.42, + 15.98, + 16.27, + 10.09 + ], + orientation: "h" + } + + +var trace4= { + text: "sample length: 10", + hoveron: "points+kde", + meanline: { + visible: true + }, + legendgroup: "M", + scalegroup: "M", + points: "all", + pointpos: -0.3, + box: { + visible: true + }, + jitter: 0, + scalemode: "count", + marker: { + line: { + width: 2, + color: "#8dd3c7" + }, + symbol: "line-ns" + }, + showlegend: false, + side: "negative", + type: "violin", + name: "M", + span: [ + 0 + ], + line: { + color: "#8dd3c7" + }, + y0: "Friday", + x: [ + 28.97, + 22.49, + 40.17, + 27.28, + 12.03, + 21.01, + 12.46, + 12.16, + 8.58, + 13.42 + ], + orientation: "h" + } + +var trace5 = { + text: "sample length: 28", + hoveron: "points+kde", + meanline: { + visible: true + }, + legendgroup: "F", + scalegroup: "F", + points: "all", + pointpos: 0.55, + box: { + visible: true + }, + jitter: 0, + scalemode: "count", + marker: { + line: { + width: 2, + color: "#bebada" + }, + symbol: "line-ns" + }, + showlegend: true, + side: "positive", + type: "violin", + name: "F", + span: [ + 0 + ], + line: { + color: "#bebada" + }, + y0: "Saturday", + x: [ + 20.29, + 15.77, + 19.65, + 15.06, + 20.69, + 16.93, + 26.41, + 16.45, + 3.07, + 17.07, + 26.86, + 25.28, + 14.73, + 44.3, + 22.42, + 20.92, + 14.31, + 7.25, + 10.59, + 10.63, + 12.76, + 13.27, + 28.17, + 12.9, + 30.14, + 22.12, + 35.83, + 27.18 + ], + orientation: "h" + } + +var trace4 = { + text: "sample length: 59", + hoveron: "points+kde", + meanline: { + visible: true + }, + legendgroup: "M", + scalegroup: "M", + points: "all", + pointpos: -1.1, + box: { + visible: true + }, + jitter: 0, + scalemode: "count", + marker: { + line: { + width: 2, + color: "#8dd3c7" + }, + symbol: "line-ns" + }, + showlegend: true, + side: "negative", + type: "violin", + name: "M", + span: [ + 0 + ], + line: { + color: "#8dd3c7" + }, + y0: "Saturday", + x: [ + 20.65, + 17.92, + 39.42, + 19.82, + 17.81, + 13.37, + 12.69, + 21.7, + 9.55, + 18.35, + 17.78, + 24.06, + 16.31, + 18.69, + 31.27, + 16.04, + 38.01, + 11.24, + 48.27, + 20.29, + 13.81, + 11.02, + 18.29, + 17.59, + 20.08, + 20.23, + 15.01, + 12.02, + 10.51, + 17.92, + 15.36, + 20.49, + 25.21, + 18.24, + 14.0, + 50.81, + 15.81, + 26.59, + 38.73, + 24.27, + 30.06, + 25.89, + 48.33, + 28.15, + 11.59, + 7.74, + 20.45, + 13.28, + 24.01, + 15.69, + 11.61, + 10.77, + 15.53, + 10.07, + 12.6, + 32.83, + 29.03, + 22.67, + 17.82 + ], + orientation: "h" + } + +var trace6 = { + text: "sample length: 18", + hoveron: "points+kde", + meanline: { + visible: true + }, + legendgroup: "F", + scalegroup: "F", + points: "all", + pointpos: 0.45, + box: { + visible: true + }, + jitter: 0, + scalemode: "count", + marker: { + line: { + width: 2, + color: "#bebada" + }, + symbol: "line-ns" + }, + showlegend: false, + side: "positive", + type: "violin", + name: "F", + span: [ + 0 + ], + line: { + color: "#bebada" + }, + y0: "Sunday", + 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 + ], + orientation: "h" + } + +var trace7 = { + text: "sample length: 58", + hoveron: "points+kde", + meanline: { + visible: true + }, + legendgroup: "M", + scalegroup: "M", + points: "all", + pointpos: -0.9, + box: { + visible: true + }, + jitter: 0, + scalemode: "count", + marker: { + line: { + width: 2, + color: "#8dd3c7" + }, + symbol: "line-ns" + }, + showlegend: false, + side: "negative", + type: "violin", + name: "M", + span: [ + 0 + ], + line: { + color: "#8dd3c7" + }, + y0: "Sunday", + x: [ + 10.34, + 21.01, + 23.68, + 25.29, + 8.77, + 26.88, + 15.04, + 14.78, + 10.27, + 15.42, + 18.43, + 21.58, + 16.29, + 17.46, + 13.94, + 9.68, + 30.4, + 18.29, + 22.23, + 32.4, + 28.55, + 18.04, + 12.54, + 9.94, + 25.56, + 19.49, + 38.07, + 23.95, + 29.93, + 14.07, + 13.13, + 17.26, + 24.55, + 19.77, + 48.17, + 16.49, + 21.5, + 12.66, + 13.81, + 24.52, + 20.76, + 31.71, + 7.25, + 31.85, + 16.82, + 32.9, + 17.89, + 14.48, + 34.63, + 34.65, + 23.33, + 45.35, + 23.17, + 40.55, + 20.69, + 30.46, + 23.1, + 15.69 + ], + orientation: "h" + } + +var data = [trace1,trace2,trace3,trace4,trace5,trace6,trace7] + +var layout = { + hovermode: "closest", + width: 400, + yaxis: { + showgrid: true + }, + title: { + text: "Total bill distribution
scaled by number of bills per gender" + }, + legend: { + tracegroupgap: 0 + }, + violingap: 0, + violingroupgap: 0, + violinmode: "overlay", + height: 700 + } + +Plotly.newPlot("myDiv", data, layout) diff --git a/content/plotly_js/statistical/violin/basic-violin.html b/content/plotly_js/statistical/violin/basic-violin.html new file mode 100644 index 00000000000..98d4efb0985 --- /dev/null +++ b/content/plotly_js/statistical/violin/basic-violin.html @@ -0,0 +1,45 @@ +--- +name: Basic Violin Plot +language: plotly_js +suite: violin +order: 1 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + +var data = [{ + type: 'violin', + y: unpack(rows, 'total_bill'), + points: 'none', + box: { + visible: true + }, + boxpoints: false, + line: { + color: 'black' + }, + fillcolor: '#8dd3c7', + opacity: 0.6, + meanline: { + visible: true + }, + x0: "Total Bill" +}] + +var layout = { + title: { + text: "" + }, + yaxis: { + zeroline: false + } +} + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/statistical/violin/grouped-violin.html b/content/plotly_js/statistical/violin/grouped-violin.html new file mode 100644 index 00000000000..8d3e1ddaf6d --- /dev/null +++ b/content/plotly_js/statistical/violin/grouped-violin.html @@ -0,0 +1,63 @@ +--- +name: Grouped Violin Plot +language: plotly_js +suite: violin +order: 3 +sitemap: false +arrangement: horizontal +--- + +// need to fix data + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + +var data = [{ + type: 'violin', + x: unpack(rows, 'day'), + y: unpack(rows, 'total_bill'), + legendgroup: 'M', + scalegroup: 'M', + name: 'M', + box: { + visible: true + }, + line: { + color: 'blue', + }, + meanline: { + visible: true + } +}, { + type: 'violin', + x: unpack(rows, 'day'), + y: unpack(rows, 'total_bill'), + legendgroup: 'F', + scalegroup: 'F', + name: 'F', + box: { + visible: true + }, + line: { + color: 'pink', + }, + meanline: { + visible: true + } +}] + +var layout = { + title: { + text: "Grouped Violin Plot" + }, + yaxis: { + zeroline: false + }, + violinmode: 'group' +} + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/statistical/violin/horizontal-violin.html b/content/plotly_js/statistical/violin/horizontal-violin.html new file mode 100644 index 00000000000..7c3e773cb4c --- /dev/null +++ b/content/plotly_js/statistical/violin/horizontal-violin.html @@ -0,0 +1,45 @@ +--- +name: Horizontal Violin Plot +language: plotly_js +suite: violin +order: 4 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + +var data = [{ + type: 'violin', + x: unpack(rows, 'total_bill'), + points: 'none', + box: { + visible: true + }, + boxpoints: false, + line: { + color: 'black' + }, + fillcolor: '#8dd3c7', + opacity: 0.6, + meanline: { + visible: true + }, + y0: "Total Bill" +}] + +var layout = { + title: { + text: "Basic Horizontal Violin Plot" + }, + xaxis: { + zeroline: false + } +} + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/statistical/violin/split-violin.html b/content/plotly_js/statistical/violin/split-violin.html new file mode 100644 index 00000000000..4867b711320 --- /dev/null +++ b/content/plotly_js/statistical/violin/split-violin.html @@ -0,0 +1,67 @@ +--- +name: Split Violin Plot +language: plotly_js +suite: violin +order: 5 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/violin_data.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + +var data = [{ + type: 'violin', + x: unpack(rows, 'day'), + y: unpack(rows, 'total_bill'), + legendgroup: 'Yes', + scalegroup: 'Yes', + name: 'Yes', + side: 'negative', + box: { + visible: true + }, + line: { + color: 'blue', + width: 2 + }, + meanline: { + visible: true + } +}, { + type: 'violin', + x: unpack(rows, 'day'), + y: unpack(rows, 'total_bill'), + legendgroup: 'No', + scalegroup: 'No', + name: 'No', + side: 'positive', + box: { + visible: true + }, + line: { + color: 'green', + width: 2 + }, + meanline: { + visible: true + } +}] + +var layout = { + title: { + text: "Split Violin Plot" + }, + yaxis: { + zeroline: false + }, + violingap: 0, + violingroupgap: 0, + violinmode: "overlay", +} + +Plotly.newPlot('myDiv', data, layout); +}); diff --git a/content/plotly_js/statistical/violin/violin-plotlyjs-index.html b/content/plotly_js/statistical/violin/violin-plotlyjs-index.html new file mode 100644 index 00000000000..727b49f0490 --- /dev/null +++ b/content/plotly_js/statistical/violin/violin-plotlyjs-index.html @@ -0,0 +1,13 @@ +--- +description: How to make D3.js-based violin plots in Plotly.js. +display_as: statistical +language: plotly_js +layout: base +name: Violin Plot +order: 8 +permalink: javascript/violin/ +thumbnail: thumbnail/violin.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","violin" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/streaming/basic-example.html b/content/plotly_js/streaming/basic-example.html new file mode 100644 index 00000000000..11e0407a40a --- /dev/null +++ b/content/plotly_js/streaming/basic-example.html @@ -0,0 +1,30 @@ +--- +name: Basic Streaming +plot_url: https://codepen.io/plotly/embed/dRaawR/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: streaming +order: 1 +sitemap: false +arrangement: horizontal +--- + +function rand() { + return Math.random(); +} + +Plotly.newPlot('myDiv', [{ + y: [1,2,3].map(rand), + mode: 'lines', + line: {color: '#80CAF6'} +}]); + +var cnt = 0; + +var interval = setInterval(function() { + + Plotly.extendTraces('myDiv', { + y: [[rand()]] + }, [0]) + + if(++cnt === 100) clearInterval(interval); +}, 300); diff --git a/content/plotly_js/streaming/mulitple-trace.html b/content/plotly_js/streaming/mulitple-trace.html new file mode 100644 index 00000000000..57f193f9046 --- /dev/null +++ b/content/plotly_js/streaming/mulitple-trace.html @@ -0,0 +1,34 @@ +--- +name: Multiple Traces +plot_url: https://codepen.io/plotly/embed/jwoEYr/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: streaming +order: 2 +sitemap: false +arrangement: horizontal +--- + +function rand() { + return Math.random(); +} + +Plotly.newPlot('myDiv', [{ + y: [1,2,3].map(rand), + mode: 'lines', + line: {color: '#80CAF6'} +}, { + y: [1,2,3].map(rand), + mode: 'lines', + line: {color: '#DF56F1'} +}]); + +var cnt = 0; + +var interval = setInterval(function() { + + Plotly.extendTraces('myDiv', { + y: [[rand()], [rand()]] + }, [0, 1]) + + if(++cnt === 100) clearInterval(interval); +}, 300); diff --git a/content/plotly_js/streaming/streaming-30-points.html b/content/plotly_js/streaming/streaming-30-points.html new file mode 100644 index 00000000000..a5a0b4fdfe0 --- /dev/null +++ b/content/plotly_js/streaming/streaming-30-points.html @@ -0,0 +1,40 @@ +--- +name: 30 Points Using Update +plot_url: https://codepen.io/plotly/embed/xLwQPr/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: streaming +order: 5 +sitemap: false +arrangement: horizontal +--- + +var arrayLength = 30 +var newArray = [] + +for(var i = 0; i < arrayLength; i++) { + var y = Math.round(Math.random()*10) + 1 + newArray[i] = y +} + +Plotly.newPlot('myDiv', [{ + y: newArray, + mode: 'lines', + line: {color: '#80CAF6'} +}]); + +var cnt = 0; + +var interval = setInterval(function() { + + var y = Math.round(Math.random()*10) + 1 + newArray = newArray.concat(y) + newArray.splice(0, 1) + + var data_update = { + y: [newArray] + }; + + Plotly.update('myDiv', data_update) + + if(++cnt === 100) clearInterval(interval); +}, 1000); diff --git a/content/plotly_js/streaming/streaming-subplots.html b/content/plotly_js/streaming/streaming-subplots.html new file mode 100644 index 00000000000..6e36427f82b --- /dev/null +++ b/content/plotly_js/streaming/streaming-subplots.html @@ -0,0 +1,71 @@ +--- +name: Streaming Subplots +plot_url: https://codepen.io/plotly/embed/rwPRVe/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: streaming +order: 6 +sitemap: false +arrangement: horizontal +--- + +function rand() { + return Math.random(); +} + +var time = new Date(); + +var trace1 = { + x: [], + y: [], + mode: 'lines', + line: { + color: '#80CAF6', + shape: 'spline' + } +} + +var trace2 = { + x: [], + y: [], + xaxis: 'x2', + yaxis: 'y2', + mode: 'lines', + line: {color: '#DF56F1'} +}; + +var layout = { + xaxis: { + type: 'date', + domain: [0, 1], + showticklabels: false + }, + yaxis: {domain: [0.6,1]}, + xaxis2: { + type: 'date', + anchor: 'y2', + domain: [0, 1] + }, + yaxis2: { + anchor: 'x2', + domain: [0, 0.4]}, +} + +var data = [trace1,trace2]; + +Plotly.newPlot('myDiv', data, layout); + +var cnt = 0; + +var interval = setInterval(function() { + + var time = new Date(); + + var update = { + x: [[time], [time]], + y: [[rand()], [rand()]] + } + + Plotly.extendTraces('myDiv', update, [0,1]) + + if(++cnt === 100) clearInterval(interval); +}, 1000); diff --git a/content/plotly_js/streaming/streaming-timestamp.html b/content/plotly_js/streaming/streaming-timestamp.html new file mode 100644 index 00000000000..96bd88205c7 --- /dev/null +++ b/content/plotly_js/streaming/streaming-timestamp.html @@ -0,0 +1,41 @@ +--- +name: Streaming with Timestamp +plot_url: https://codepen.io/plotly/embed/YQBBbE/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: streaming +order: 3 +sitemap: false +arrangement: horizontal +--- + +function rand() { + return Math.random(); +} + +var time = new Date(); + +var data = [{ + x: [time], + y: [rand()], + mode: 'lines', + line: {color: '#80CAF6'} +}] + + +Plotly.newPlot('myDiv', data); + +var cnt = 0; + +var interval = setInterval(function() { + + var time = new Date(); + + var update = { + x: [[time]], + y: [[rand()]] + } + + Plotly.extendTraces('myDiv', update, [0]) + + if(++cnt === 100) clearInterval(interval); +}, 1000); diff --git a/content/plotly_js/streaming/streaming-timestamp_range.html b/content/plotly_js/streaming/streaming-timestamp_range.html new file mode 100644 index 00000000000..e5332dcc462 --- /dev/null +++ b/content/plotly_js/streaming/streaming-timestamp_range.html @@ -0,0 +1,51 @@ +--- +name: Extend Traces & Relayout +plot_url: https://codepen.io/plotly/embed/yXZwBL/?height=500&theme-id=15263&default-tab=result +language: plotly_js +suite: streaming +order: 4 +sitemap: false +arrangement: horizontal +--- + +function rand() { + return Math.random(); +} + +var time = new Date(); + +var data = [{ + x: [time], + y: [rand], + mode: 'lines', + line: {color: '#80CAF6'} +}] + +Plotly.newPlot('myDiv', data); + +var cnt = 0; + +var interval = setInterval(function() { + + var time = new Date(); + + var update = { + x: [[time]], + y: [[rand()]] + } + + var olderTime = time.setMinutes(time.getMinutes() - 1); + var futureTime = time.setMinutes(time.getMinutes() + 1); + + var minuteView = { + xaxis: { + type: 'date', + range: [olderTime,futureTime] + } + }; + + Plotly.relayout('myDiv', minuteView); + Plotly.extendTraces('myDiv', update, [0]) + + if(++cnt === 100) clearInterval(interval); +}, 1000); diff --git a/content/plotly_js/streaming/streaming_index.html b/content/plotly_js/streaming/streaming_index.html new file mode 100644 index 00000000000..3b340d8d4a4 --- /dev/null +++ b/content/plotly_js/streaming/streaming_index.html @@ -0,0 +1,14 @@ +--- +name: Streaming +permalink: javascript/streaming/ +description: How to create D3.js-based streaming plots in Plotly.js. +layout: base +thumbnail: thumbnail/streaming-thumb-square.gif +language: plotly_js +page_type: example_index +display_as: streaming +order: 1 +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","streaming" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} diff --git a/content/plotly_js/subplot/3d-subplots/subplots.html b/content/plotly_js/subplot/3d-subplots/subplots.html new file mode 100644 index 00000000000..048e1ebc464 --- /dev/null +++ b/content/plotly_js/subplot/3d-subplots/subplots.html @@ -0,0 +1,105 @@ +--- +name: Multiple 3D Subplots +language: plotly_js +suite: 3d-subplots +order: 0 +sitemap: false +arrangement: horizontal +--- + +function getrandom(num , mul) { + var value = [ ]; + for ( i=0; i <= num; i++ ) { + var rand = Math.random() * mul; + value.push(rand); + } + return value; +} + +var trace1 = { + opacity: 0.5, + color: 'rgba(255,127,80,0.7)', + type: 'mesh3d', + x: getrandom(50 , -75), + y: getrandom(50 , 75), + z: getrandom(50 , 75), + scene: "scene1" + }; + +var trace2 = { + opacity: 0.5, + color: 'pink', + type: 'mesh3d', + x: getrandom(50 , -75), + y: getrandom(50 , 75), + z: getrandom(50 , 75), + scene: "scene2" + }; + +var trace3 = { + opacity:0.4, + color:'rgb(033,255,100)', + type: 'mesh3d', + x: getrandom(50 , -75), + y: getrandom(50 , -75), + z: getrandom(50 , -75), + scene: "scene3", + }; + +var trace4 = { + opacity: 0.5, + color:'rgb(200,100,200)', + type: 'mesh3d', + x: getrandom(50 , -75), + y: getrandom(50 , 75), + z: getrandom(50 , 75), + scene: "scene4" + }; + +var trace5 = { + opacity: 0.5, + color:'rgb(00,150,200)', + type: 'mesh3d', + x: getrandom(50 , 100), + y: getrandom(50 , 100), + z: getrandom(50 , 100), + scene: "scene5", + } + +var layout = { + scene1: { + domain: { + x: [0.0, 0.5], + y: [0.5, 1.0] + },}, + scene2: { + domain: { + x: [0.5, 1], + y: [0.5, 1.0] + }}, + scene3: { + domain: { + x: [0.0, 0.33], + y: [0, 0.5] + },}, + scene4: { + domain: { + x: [0.33, 0.66], + y: [0, 0.5] + }}, + scene5: { + domain: { + x: [0.66, 0.99], + y: [0, 0.5] + },}, + height: 600, + margin: { + l: 0, + r: 0, + b: 0, + t: 0, + pad: 0 + }, +} + +Plotly.newPlot('myDiv', [trace1,trace2,trace3,trace4,trace5], layout); \ No newline at end of file diff --git a/content/plotly_js/subplot/3d-subplots/subplots_index.html b/content/plotly_js/subplot/3d-subplots/subplots_index.html new file mode 100644 index 00000000000..c71596cf83c --- /dev/null +++ b/content/plotly_js/subplot/3d-subplots/subplots_index.html @@ -0,0 +1,15 @@ +--- +description: How to make 3D Subplots in javascript. +display_as: multiple_axes +language: plotly_js +layout: base +name: 3D Subplots +order: 3 +page_type: example_index +permalink: javascript/3d-subplots/ +redirect_from: javascript-graphing-library/3d-subplots/ +thumbnail: thumbnail/3d-subplots.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","3d-subplots" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/subplot/insets/insets_plotly_js_index.html b/content/plotly_js/subplot/insets/insets_plotly_js_index.html new file mode 100644 index 00000000000..467f5d55c14 --- /dev/null +++ b/content/plotly_js/subplot/insets/insets_plotly_js_index.html @@ -0,0 +1,15 @@ +--- +description: How to make an inset graph in D3.js-based javascript charts. +display_as: multiple_axes +language: plotly_js +layout: base +name: Inset Plots +order: 2 +page_type: example_index +permalink: javascript/insets/ +redirect_from: javascript-graphing-library/insets/ +thumbnail: thumbnail/insets.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","insets" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/subplot/insets/simple-inset.html b/content/plotly_js/subplot/insets/simple-inset.html new file mode 100644 index 00000000000..f82e7b786bc --- /dev/null +++ b/content/plotly_js/subplot/insets/simple-inset.html @@ -0,0 +1,37 @@ +--- +name: Simple Inset Graph +language: plotly_js +suite: insets +order: 1 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3], + y: [4, 3, 2], + type: 'scatter' +}; + +var trace2 = { + x: [20, 30, 40], + y: [30, 40, 50], + xaxis: 'x2', + yaxis: 'y2', + type: 'scatter' +}; + +var data = [trace1, trace2]; + +var layout = { + yaxis2: { + domain: [0.6, 0.95], + anchor: 'x2' + }, + xaxis2: { + domain: [0.6, 0.95], + anchor: 'y2' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/mixed-subplots/mixed-subplots-index.html b/content/plotly_js/subplot/mixed-subplots/mixed-subplots-index.html new file mode 100644 index 00000000000..1095c2c778b --- /dev/null +++ b/content/plotly_js/subplot/mixed-subplots/mixed-subplots-index.html @@ -0,0 +1,14 @@ +--- +description: How to make Mixed Subplots in javascript. +display_as: multiple_axes +language: plotly_js +layout: base +name: Mixed Subplots +order: 4 +page_type: example_index +permalink: javascript/mixed-subplots/ +thumbnail: thumbnail/mixed_subplot.JPG +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","mixed-subplots" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/subplot/mixed-subplots/mixed-subplots.html b/content/plotly_js/subplot/mixed-subplots/mixed-subplots.html new file mode 100644 index 00000000000..442b32f5e41 --- /dev/null +++ b/content/plotly_js/subplot/mixed-subplots/mixed-subplots.html @@ -0,0 +1,145 @@ +--- +name: Mixed Subplots +language: plotly_js +suite: mixed-subplots +order: 0 +sitemap: false +arrangement: horizontal +--- +d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/volcano_db.csv', function(err, rows){ + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + +var trace1 = { + x: unpack(rows, 'Status'), + y: unpack(rows, 'Type'), + z: unpack(rows, 'Elev'), + marker: { + size: 2, + color: unpack(rows, 'Elev'), + colorscale: 'Reds', + line: {color: 'transparent'} + }, + mode: 'markers', + type: 'scatter3d', + text: unpack(rows, 'Country'), + hoverinfo: 'x+y+z+text', + showlegend: false +}; + +var x = unpack(rows, 'Elev'); + +var trace2 = { + x: unpack(rows, 'Elev'), + type: 'histogram', + hoverinfo: 'x+y', + showlegend: false, + xaxis: 'x2', + yaxis: 'y2', + marker: { + color: 'red' + }}; + +var trace3 = { + geo: 'geo3', + type:'scattergeo', + locationmode: 'world', + lon: unpack(rows, 'Longitude'), + lat: unpack(rows, 'Latitude'), + hoverinfo: 'text', + text: unpack(rows, 'Elev'), + mode: 'markers', + showlegend: false, + marker: { + size: 4, + color: unpack(rows, 'Elev'), + colorscale: 'Reds', + opacity: 0.8, + symbol: 'circle', + line: { + width: 1 + } + } +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + paper_bgcolor: 'black', + plot_bgcolor: 'black', + title: {text: 'Volcano Database: Elevation'}, + font: {color: 'white'}, + colorbar: true, + annotations: [{ + x: 0, + y: 0, + xref: 'paper', + yref: 'paper', + text: 'Source: NOAA', + showarrow: false + }], + geo3: { + domain: { + x: [0, 0.45], + y: [0.02, 0.98] + }, + scope: 'world', + projection: { + type: 'orthographic' + }, + showland: true, + showocean: true, + showlakes: true, + landcolor: 'rgb(250,250,250)', + lakecolor: 'rgb(127,205,255)', + oceancolor: 'rgb(6,66,115)', + subunitcolor: 'rgb(217,217,217)', + countrycolor: 'rgb(217,217,217)', + countrywidth: 0.5, + subunitwidth: 0.5, + bgcolor: 'black' + }, + scene: {domain: { + x: [0.55, 1], + y: [0, 0.6] + }, + xaxis: { + title: { + text: 'Status' + }, + showticklabels: false, + showgrid: true, + gridcolor: 'white' + }, + yaxis: { + title: { + text: 'Type' + }, + showticklabels: false, + showgrid: true, + gridcolor: 'white' + }, + zaxis: { + title: { + text: 'Elev' + }, + showgrid: true, + gridcolor: 'white' + } + }, + yaxis2: { + anchor: 'x2', + domain: [0.7, 1], + showgrid: false + }, + xaxis2: { + tickangle: 45, + anchor: 'y2', + ticksuffix: 'm', + domain: [0.6, 1]}, +}; + +Plotly.newPlot("myDiv", data, layout, {showLink: false}); + +}); diff --git a/content/plotly_js/subplot/multiple-axes/multiple-axes-double.html b/content/plotly_js/subplot/multiple-axes/multiple-axes-double.html new file mode 100644 index 00000000000..8eed0bc93db --- /dev/null +++ b/content/plotly_js/subplot/multiple-axes/multiple-axes-double.html @@ -0,0 +1,44 @@ +--- +name: Two Y-Axes +language: plotly_js +suite: multiple-axes +order: 5 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3], + y: [40, 50, 60], + name: 'yaxis data', + type: 'scatter' +}; + +var trace2 = { + x: [2, 3, 4], + y: [4, 5, 6], + name: 'yaxis2 data', + yaxis: 'y2', + type: 'scatter' +}; + +var data = [trace1, trace2]; + +var layout = { + title: {text: 'Double Y Axis Example'}, + yaxis: { + title: { + text: 'yaxis title' + } + }, + yaxis2: { + title: { + text: 'yaxis2 title', + font: {color: 'rgb(148, 103, 189)'} + }, + tickfont: {color: 'rgb(148, 103, 189)'}, + overlaying: 'y', + side: 'right' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/multiple-axes/multiple-axes-multiple.html b/content/plotly_js/subplot/multiple-axes/multiple-axes-multiple.html new file mode 100644 index 00000000000..efa3d831854 --- /dev/null +++ b/content/plotly_js/subplot/multiple-axes/multiple-axes-multiple.html @@ -0,0 +1,90 @@ +--- +name: Multiple Y-Axes +language: plotly_js +suite: multiple-axes +order: 6 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3], + y: [4, 5, 6], + name: 'yaxis1 data', + type: 'scatter' +}; + +var trace2 = { + x: [2, 3, 4], + y: [40, 50, 60], + name: 'yaxis2 data', + yaxis: 'y2', + type: 'scatter' +}; + +var trace3 = { + x: [4, 5, 6], + y: [40000, 50000, 60000], + name: 'yaxis3 data', + yaxis: 'y3', + type: 'scatter' +}; + +var trace4 = { + x: [5, 6, 7], + y: [400000, 500000, 600000], + name: 'yaxis4 data', + yaxis: 'y4', + type: 'scatter' +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + title: { + text: 'multiple y-axes example', + font: {color: '#1f77b4'} + }, + width: 800, + xaxis: {domain: [0.3, 0.7]}, + yaxis: { + title: { + text: 'yaxis title', + font: {color: '#1f77b4'} + }, + tickfont: {color: '#1f77b4'} + }, + yaxis2: { + title: { + text: 'yaxis2 title', + font: {color: '#ff7f0e'} + }, + tickfont: {color: '#ff7f0e'}, + anchor: 'free', + overlaying: 'y', + side: 'left', + position: 0.15 + }, + yaxis3: { + title: { + text: 'yaxis4 title', + font: {color: '#d62728'} + }, + tickfont: {color: '#d62728'}, + anchor: 'x', + overlaying: 'y', + side: 'right' + }, + yaxis4: { + title: { + text: 'yaxis5 title', + font: {color: '#9467bd'} + }, + tickfont: {color: '#9467bd'}, + anchor: 'free', + overlaying: 'y', + side: 'right', + position: 0.85 + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/multiple-axes/multiple-axes_plotly_js_index.html b/content/plotly_js/subplot/multiple-axes/multiple-axes_plotly_js_index.html new file mode 100644 index 00000000000..f4fcdf1bce2 --- /dev/null +++ b/content/plotly_js/subplot/multiple-axes/multiple-axes_plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a graph with D3.js-based multiple axes in javascript. +display_as: multiple_axes +language: plotly_js +layout: base +name: Multiple Axes +order: 6 +permalink: javascript/multiple-axes/ +redirect_from: javascript-graphing-library/multiple-axes/ +thumbnail: thumbnail/multiple-axes.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","multiple-axes" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/subplot/plotly_js-subplots-index.html b/content/plotly_js/subplot/plotly_js-subplots-index.html new file mode 100644 index 00000000000..d56cbde1633 --- /dev/null +++ b/content/plotly_js/subplot/plotly_js-subplots-index.html @@ -0,0 +1,27 @@ +--- +permalink: javascript/subplot-charts/ +description: Plotly.js makes interactive, publication-quality graphs online. Examples of how to make subplots, insets, and multiple axes charts. +name: Subplots +layout: langindex +language: plotly_js +display_as: multiple_axes +thumbnail: thumbnail/mixed.jpg +--- + + +
+
+ +
+ +
+

Plotly.js Subplots

+

{{page.description}}

+ {% include layouts/dashplug.html %} +
+
+
+
+ + {% assign languagelist = site.posts | where:"language","plotly_js" | where:"display_as","multiple_axes" | where: "layout","base" | sort: "order" %} + {% include posts/documentation_eg.html %} diff --git a/content/plotly_js/subplot/subplot-table/table-subplot-plotly_js_index.html b/content/plotly_js/subplot/subplot-table/table-subplot-plotly_js_index.html new file mode 100644 index 00000000000..5d676769682 --- /dev/null +++ b/content/plotly_js/subplot/subplot-table/table-subplot-plotly_js_index.html @@ -0,0 +1,14 @@ +--- +description: How to make a D3.js-based table subplots in javascript. +display_as: multiple_axes +language: plotly_js +layout: base +name: Table Subplots +order: 5 +page_type: example_index +permalink: javascript/table-subplots/ +thumbnail: thumbnail/table_subplots.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","subplot_table" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/plotly_js/subplot/subplot-table/table-subplot.html b/content/plotly_js/subplot/subplot-table/table-subplot.html new file mode 100644 index 00000000000..063fc6358b4 --- /dev/null +++ b/content/plotly_js/subplot/subplot-table/table-subplot.html @@ -0,0 +1,125 @@ +--- +name: Table and Chart Subplot +language: plotly_js +suite: subplot_table +order: 1 +sitemap: false +arrangement: horizontal +--- + +d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv", function(err, rows){ + + function unpack(rows, key) { + return rows.map(function(row) { return row[key]; }); + } + + // header values + var headerNames = d3.keys(rows[0]); + var headerValues = [headerNames[1],headerNames[2], + headerNames[3],headerNames[4]]; + + // cell values + var cellValues = []; + for (i = 0; i < headerValues.length; i++) { + cellValue = unpack(rows, headerValues[i]); + cellValues[i] = cellValue; + } + + // clean date + for (i = 0; i < cellValues[0].length; i++) { + var dateValue = cellValues[0][i].split(' ')[0] + cellValues[0][i] = dateValue + } + + // create table + var table = { + type: 'table', + columnwidth: [150,200,200,150], + columnorder: [0,1,2,3], + header: { + values: headerValues, + align: "center", + line: {width: 1, color: 'rgb(50, 50, 50)'}, + fill: {color: ['rgb(235, 100, 230)']}, + font: {family: "Arial", size: 11, color: "white"} + }, + cells: { + values: cellValues, + align: ["center", "center"], + line: {color: "black", width: 1}, + fill: {color: ['rgb(235, 193, 238)', 'rgba(228, 222, 249, 0.65)']}, + font: {family: "Arial", size: 10, color: ["black"]} + }, + xaxis: 'x', + yaxis: 'y', + domain: {x: [0,0.4], y: [0,1]} + } + + // create 1st plot + var trace1 = { + x: unpack(rows, 'Date'), + y: unpack(rows, 'Hash-rate'), + xaxis: 'x1', + yaxis: 'y1', + mode: 'lines', + line: {width: 2, color: '#9748a1'}, + name: 'hash-rate-TH/s' + } + // create 2nd plot + var trace2 = { + x: unpack(rows, 'Date'), + y: unpack(rows, 'Mining-revenue-USD'), + xaxis: 'x2', + yaxis: 'y2', + mode: 'lines', + line: {width: 2, color: '#b04553'}, + name: 'Mining-revenue-USD' + } + + // create 3rd plot + var trace3 = { + x: unpack(rows, 'Date'), + y: unpack(rows, 'Transaction-fees-BTC'), + xaxis: 'x3', + yaxis: 'y3', + mode: 'lines', + line: {width: 2, color: '#af7bbd'}, + name: 'Transaction-fees-BTC' + } + + var data = [table,trace1,trace2,trace3] + + // define subplot axes + var axis = { + showline: true, + zeroline: false, + showgrid: true, + mirror:true, + ticklen: 4, + gridcolor: '#ffffff', + tickfont: {size: 10}, + } + + var axis1 = {domain: [0.5, 1], anchor: 'y1', showticklabels: false} + var axis2 = {domain: [0.5, 1], anchor: 'y2', showticklabels: false} + var axis3 = {domain: [0.5, 1], anchor: 'y3'} + var axis4 = {domain: [0.66, 0.98], anchor: 'x1', hoverformat: '.2f'} + var axis5 = {domain: [0.34, 0.64], anchor: 'x2', tickprefix: '$', hoverformat: '.2f'} + var axis6 = {domain: [0.0, 0.32], anchor: 'x3', tickprefix: '\u20BF', hoverformat: '.2f'} + + // define layout + var layout = { + title: {text: "Bitcoin mining stats for 180 days"}, + plot_bgcolor: 'rgba(228, 222, 249, 0.65)', + showlegend: false, + xaxis1: Object.assign(axis1,axis), + xaxis2: Object.assign(axis2,axis), + xaxis3: Object.assign(axis3,axis), + yaxis1: Object.assign(axis4,axis), + yaxis2: Object.assign(axis5,axis), + yaxis3: Object.assign(axis6,axis) + } + + Plotly.newPlot('myDiv', data, layout); + +}); diff --git a/content/plotly_js/subplot/subplots/custom-size-subplot.html b/content/plotly_js/subplot/subplots/custom-size-subplot.html new file mode 100644 index 00000000000..76757e5a618 --- /dev/null +++ b/content/plotly_js/subplot/subplots/custom-size-subplot.html @@ -0,0 +1,31 @@ +--- +name: Custom Sized Subplot +language: plotly_js +suite: subplots +order: 3 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3], + y: [4, 5, 6], + type: 'scatter' +}; + +var trace2 = { + x: [20, 30, 40], + y: [50, 60, 70], + xaxis: 'x2', + yaxis: 'y2', + type: 'scatter' +}; + +var data = [trace1, trace2]; + +var layout = { + xaxis: {domain: [0, 0.7]}, + yaxis2: {anchor: 'x2'}, + xaxis2: {domain: [0.8, 1]} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/subplots/multiple-custom-sized-subplots.html b/content/plotly_js/subplot/subplots/multiple-custom-sized-subplots.html new file mode 100644 index 00000000000..6e30b690bf2 --- /dev/null +++ b/content/plotly_js/subplot/subplots/multiple-custom-sized-subplots.html @@ -0,0 +1,82 @@ +--- +name: Multiple Custom Sized Subplots +language: plotly_js +suite: subplots +order: 9 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2], + y: [1, 2], + type: 'scatter', + name: '(1,1)' +}; + +var trace2 = { + x: [1, 2], + y: [1, 2], + type: 'scatter', + name: '(1,2)', + xaxis: 'x2', + yaxis: 'y2' +}; + +var trace3 = { + x: [1, 2], + y: [1, 2], + type: 'scatter', + name: '(1,2)', + xaxis: 'x3', + yaxis: 'y3' +}; + +var trace4 = { + x: [1, 2], + y: [1, 2], + type: 'scatter', + name: '(1,2)', + xaxis: 'x4', + yaxis: 'y4' +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + title: {text: 'Multiple Custom Sized Subplots'}, + xaxis: { + domain: [0, 0.45], + anchor: 'y1' + }, + yaxis: { + domain: [0.5, 1], + anchor: 'x1' + }, + xaxis2: { + domain: [0.55, 1], + anchor: 'y2' + }, + yaxis2: { + domain: [0.8, 1], + anchor: 'x2' + }, + xaxis3: { + domain: [0.55, 1], + anchor: 'y3' + }, + yaxis3: { + domain: [0.5, 0.75], + anchor: 'x3' + }, + xaxis4: { + domain: [0, 1], + anchor: 'y4' + }, + yaxis4: { + domain: [0, 0.45], + anchor: 'x4' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/subplots/multiple-subplots.html b/content/plotly_js/subplot/subplots/multiple-subplots.html new file mode 100644 index 00000000000..1617656afc5 --- /dev/null +++ b/content/plotly_js/subplot/subplots/multiple-subplots.html @@ -0,0 +1,45 @@ +--- +name: Multiple Subplots +language: plotly_js +suite: subplots +order: 4 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [1, 2, 3], + y: [4, 5, 6], + type: 'scatter' +}; + +var trace2 = { + x: [20, 30, 40], + y: [50, 60, 70], + xaxis: 'x2', + yaxis: 'y2', + type: 'scatter' +}; + +var trace3 = { + x: [300, 400, 500], + y: [600, 700, 800], + xaxis: 'x3', + yaxis: 'y3', + type: 'scatter' +}; + +var trace4 = { + x: [4000, 5000, 6000], + y: [7000, 8000, 9000], + xaxis: 'x4', + yaxis: 'y4', + type: 'scatter' +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + grid: {rows: 2, columns: 2, pattern: 'independent'}, +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/subplots/shared-axes-subplots.html b/content/plotly_js/subplot/subplots/shared-axes-subplots.html new file mode 100644 index 00000000000..c8bb278711d --- /dev/null +++ b/content/plotly_js/subplot/subplots/shared-axes-subplots.html @@ -0,0 +1,51 @@ +--- +name: Subplots with Shared Axes +language: plotly_js +suite: subplots +order: 5 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3], + y: [2, 3, 4], + type: 'scatter' +}; + +var trace2 = { + x: [20, 30, 40], + y: [5, 5, 5], + xaxis: 'x2', + yaxis: 'y', + type: 'scatter' +}; + +var trace3 = { + x: [2, 3, 4], + y: [600, 700, 800], + xaxis: 'x', + yaxis: 'y3', + type: 'scatter' +}; + +var trace4 = { + x: [4000, 5000, 6000], + y: [7000, 8000, 9000], + xaxis: 'x4', + yaxis: 'y4', + type: 'scatter' +}; + +var data = [trace1, trace2, trace3, trace4]; + +var layout = { + grid: { + rows: 2, + columns: 2, + subplots:[['xy','x2y'], ['xy3','x4y4']], + roworder:'bottom to top' + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/subplots/simple-subplot.html b/content/plotly_js/subplot/subplots/simple-subplot.html new file mode 100644 index 00000000000..2107b76b658 --- /dev/null +++ b/content/plotly_js/subplot/subplots/simple-subplot.html @@ -0,0 +1,30 @@ +--- +name: Simple Subplot +language: plotly_js +suite: subplots +order: 2 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [1, 2, 3], + y: [4, 5, 6], + type: 'scatter' +}; + +var trace2 = { + x: [20, 30, 40], + y: [50, 60, 70], + xaxis: 'x2', + yaxis: 'y2', + type: 'scatter' +}; + +var data = [trace1, trace2]; + +var layout = { + grid: {rows: 1, columns: 2, pattern: 'independent'}, +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/subplots/stacked-coupled-subplots.html b/content/plotly_js/subplot/subplots/stacked-coupled-subplots.html new file mode 100644 index 00000000000..45bbe4f8971 --- /dev/null +++ b/content/plotly_js/subplot/subplots/stacked-coupled-subplots.html @@ -0,0 +1,38 @@ +--- +name: Stacked Subplots with a Shared X-Axis +language: plotly_js +suite: subplots +order: 7 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2], + y: [10, 11, 12], + type: 'scatter' +}; + +var trace2 = { + x: [2, 3, 4], + y: [100, 110, 120], + yaxis: 'y2', + type: 'scatter' +}; + +var trace3 = { + x: [3, 4, 5], + y: [1000, 1100, 1200], + yaxis: 'y3', + type: 'scatter' +}; + +var data = [trace1, trace2, trace3]; + +var layout = { + yaxis: {domain: [0, 0.33]}, + legend: {traceorder: 'reversed'}, + yaxis2: {domain: [0.33, 0.66]}, + yaxis3: {domain: [0.66, 1]} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/subplots/stacked-subplots.html b/content/plotly_js/subplot/subplots/stacked-subplots.html new file mode 100644 index 00000000000..5727bf8364c --- /dev/null +++ b/content/plotly_js/subplot/subplots/stacked-subplots.html @@ -0,0 +1,41 @@ +--- +name: Stacked Subplots +language: plotly_js +suite: subplots +order: 6 +sitemap: false +arrangement: horizontal +--- +var trace1 = { + x: [0, 1, 2], + y: [10, 11, 12], + type: 'scatter' +}; + +var trace2 = { + x: [2, 3, 4], + y: [100, 110, 120], + xaxis: 'x2', + yaxis: 'y2', + type: 'scatter' +}; + +var trace3 = { + x: [3, 4, 5], + y: [1000, 1100, 1200], + xaxis: 'x3', + yaxis: 'y3', + type: 'scatter' +}; + +var data = [trace1, trace2, trace3]; + +var layout = { +grid: { + rows: 3, + columns: 1, + pattern: 'independent', + roworder: 'bottom to top'} +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/content/plotly_js/subplot/subplots/subplots_plotly_js_index.html b/content/plotly_js/subplot/subplots/subplots_plotly_js_index.html new file mode 100644 index 00000000000..040868d0a6b --- /dev/null +++ b/content/plotly_js/subplot/subplots/subplots_plotly_js_index.html @@ -0,0 +1,16 @@ +--- +description: How to make D3.js-based subplots in Plotly.js. Seven examples of stacked, + custom-sized, and gridded subplots. +display_as: multiple_axes +language: plotly_js +layout: base +name: Subplots +order: 1 +page_type: example_index +permalink: javascript/subplots/ +redirect_from: javascript-graphing-library/subplots/ +thumbnail: thumbnail/subplots.jpg +--- + +{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","subplots" | sort: "order" %} +{% include posts/auto_examples.html examples=examples %} \ No newline at end of file diff --git a/content/reference_pages/javascript/annotations.html b/content/reference_pages/javascript/annotations.html new file mode 100644 index 00000000000..5bd2f953abd --- /dev/null +++ b/content/reference_pages/javascript/annotations.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/annotations/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.annotations +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.annotations

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="annotations" %} + +
+
diff --git a/content/reference_pages/javascript/bar.html b/content/reference_pages/javascript/bar.html new file mode 100644 index 00000000000..b33d7f8a936 --- /dev/null +++ b/content/reference_pages/javascript/bar.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/bar/ +layout: langindex +page_type: reference +language: plotly_js +name: bar Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: bar Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="bar" trace_data=site.data.plotschema.traces.bar %} + +
+
diff --git a/content/reference_pages/javascript/barpolar.html b/content/reference_pages/javascript/barpolar.html new file mode 100644 index 00000000000..82dc1c153db --- /dev/null +++ b/content/reference_pages/javascript/barpolar.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/barpolar/ +layout: langindex +page_type: reference +language: plotly_js +name: barpolar Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: barpolar Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="barpolar" trace_data=site.data.plotschema.traces.barpolar %} + +
+
diff --git a/content/reference_pages/javascript/box.html b/content/reference_pages/javascript/box.html new file mode 100644 index 00000000000..344cae3f52e --- /dev/null +++ b/content/reference_pages/javascript/box.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/box/ +layout: langindex +page_type: reference +language: plotly_js +name: box Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: box Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="box" trace_data=site.data.plotschema.traces.box %} + +
+
diff --git a/content/reference_pages/javascript/candlestick.html b/content/reference_pages/javascript/candlestick.html new file mode 100644 index 00000000000..0486eb9450b --- /dev/null +++ b/content/reference_pages/javascript/candlestick.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/candlestick/ +layout: langindex +page_type: reference +language: plotly_js +name: candlestick Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: candlestick Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="candlestick" trace_data=site.data.plotschema.traces.candlestick %} + +
+
diff --git a/content/reference_pages/javascript/carpet.html b/content/reference_pages/javascript/carpet.html new file mode 100644 index 00000000000..1602dd22e3a --- /dev/null +++ b/content/reference_pages/javascript/carpet.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/carpet/ +layout: langindex +page_type: reference +language: plotly_js +name: carpet Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: carpet Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="carpet" trace_data=site.data.plotschema.traces.carpet %} + +
+
diff --git a/content/reference_pages/javascript/choropleth.html b/content/reference_pages/javascript/choropleth.html new file mode 100644 index 00000000000..076532ca611 --- /dev/null +++ b/content/reference_pages/javascript/choropleth.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/choropleth/ +layout: langindex +page_type: reference +language: plotly_js +name: choropleth Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: choropleth Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="choropleth" trace_data=site.data.plotschema.traces.choropleth %} + +
+
diff --git a/content/reference_pages/javascript/choroplethmap.html b/content/reference_pages/javascript/choroplethmap.html new file mode 100644 index 00000000000..8fd926f4813 --- /dev/null +++ b/content/reference_pages/javascript/choroplethmap.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/choroplethmap/ +layout: langindex +page_type: reference +language: plotly_js +name: choroplethmap Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: choroplethmap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="choroplethmap" trace_data=site.data.plotschema.traces.choroplethmap %} + +
+
diff --git a/content/reference_pages/javascript/choroplethmapbox.html b/content/reference_pages/javascript/choroplethmapbox.html new file mode 100644 index 00000000000..f6d7694e4e9 --- /dev/null +++ b/content/reference_pages/javascript/choroplethmapbox.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/choroplethmapbox/ +layout: langindex +page_type: reference +language: plotly_js +name: choroplethmapbox Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: choroplethmapbox Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="choroplethmapbox" trace_data=site.data.plotschema.traces.choroplethmapbox %} + +
+
diff --git a/content/reference_pages/javascript/coloraxis.html b/content/reference_pages/javascript/coloraxis.html new file mode 100644 index 00000000000..c405abd308b --- /dev/null +++ b/content/reference_pages/javascript/coloraxis.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/coloraxis/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.coloraxis +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.coloraxis

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="coloraxis" %} + +
+
diff --git a/content/reference_pages/javascript/cone.html b/content/reference_pages/javascript/cone.html new file mode 100644 index 00000000000..32bee7faf12 --- /dev/null +++ b/content/reference_pages/javascript/cone.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/cone/ +layout: langindex +page_type: reference +language: plotly_js +name: cone Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: cone Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="cone" trace_data=site.data.plotschema.traces.cone %} + +
+
diff --git a/content/reference_pages/javascript/contour.html b/content/reference_pages/javascript/contour.html new file mode 100644 index 00000000000..94bc67169c0 --- /dev/null +++ b/content/reference_pages/javascript/contour.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/contour/ +layout: langindex +page_type: reference +language: plotly_js +name: contour Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: contour Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="contour" trace_data=site.data.plotschema.traces.contour %} + +
+
diff --git a/content/reference_pages/javascript/contourcarpet.html b/content/reference_pages/javascript/contourcarpet.html new file mode 100644 index 00000000000..551a375a7af --- /dev/null +++ b/content/reference_pages/javascript/contourcarpet.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/contourcarpet/ +layout: langindex +page_type: reference +language: plotly_js +name: contourcarpet Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: contourcarpet Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="contourcarpet" trace_data=site.data.plotschema.traces.contourcarpet %} + +
+
diff --git a/content/reference_pages/javascript/densitymap.html b/content/reference_pages/javascript/densitymap.html new file mode 100644 index 00000000000..5c540d9c5c3 --- /dev/null +++ b/content/reference_pages/javascript/densitymap.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/densitymap/ +layout: langindex +page_type: reference +language: plotly_js +name: densitymap Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: densitymap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="densitymap" trace_data=site.data.plotschema.traces.densitymap %} + +
+
diff --git a/content/reference_pages/javascript/densitymapbox.html b/content/reference_pages/javascript/densitymapbox.html new file mode 100644 index 00000000000..51e34b0c06a --- /dev/null +++ b/content/reference_pages/javascript/densitymapbox.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/densitymapbox/ +layout: langindex +page_type: reference +language: plotly_js +name: densitymapbox Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: densitymapbox Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="densitymapbox" trace_data=site.data.plotschema.traces.densitymapbox %} + +
+
diff --git a/content/reference_pages/javascript/funnel.html b/content/reference_pages/javascript/funnel.html new file mode 100644 index 00000000000..fde8cab72a3 --- /dev/null +++ b/content/reference_pages/javascript/funnel.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/funnel/ +layout: langindex +page_type: reference +language: plotly_js +name: funnel Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: funnel Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="funnel" trace_data=site.data.plotschema.traces.funnel %} + +
+
diff --git a/content/reference_pages/javascript/funnelarea.html b/content/reference_pages/javascript/funnelarea.html new file mode 100644 index 00000000000..e878cd589fc --- /dev/null +++ b/content/reference_pages/javascript/funnelarea.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/funnelarea/ +layout: langindex +page_type: reference +language: plotly_js +name: funnelarea Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: funnelarea Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="funnelarea" trace_data=site.data.plotschema.traces.funnelarea %} + +
+
diff --git a/content/reference_pages/javascript/geo.html b/content/reference_pages/javascript/geo.html new file mode 100644 index 00000000000..c07c7f4030e --- /dev/null +++ b/content/reference_pages/javascript/geo.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/geo/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.geo +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.geo

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="geo" %} + +
+
diff --git a/content/reference_pages/javascript/global.html b/content/reference_pages/javascript/global.html new file mode 100644 index 00000000000..d33bd71c4e2 --- /dev/null +++ b/content/reference_pages/javascript/global.html @@ -0,0 +1,26 @@ +--- +permalink: /javascript/reference/layout/ +layout: langindex +page_type: reference +language: plotly_js +name: layout +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="global" %} + +{%- for trace in site.data.plotschema.traces -%} +{% if trace[1].layoutAttributes %} +{% assign attribute=trace[1].layoutAttributes %} +{% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" %} +{% endif %} +{%- endfor -%} + +
+
diff --git a/content/reference_pages/javascript/heatmap.html b/content/reference_pages/javascript/heatmap.html new file mode 100644 index 00000000000..e5c5543fb37 --- /dev/null +++ b/content/reference_pages/javascript/heatmap.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/heatmap/ +layout: langindex +page_type: reference +language: plotly_js +name: heatmap Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: heatmap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="heatmap" trace_data=site.data.plotschema.traces.heatmap %} + +
+
diff --git a/content/reference_pages/javascript/histogram.html b/content/reference_pages/javascript/histogram.html new file mode 100644 index 00000000000..ef851f6bbd3 --- /dev/null +++ b/content/reference_pages/javascript/histogram.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/histogram/ +layout: langindex +page_type: reference +language: plotly_js +name: histogram Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: histogram Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="histogram" trace_data=site.data.plotschema.traces.histogram %} + +
+
diff --git a/content/reference_pages/javascript/histogram2d.html b/content/reference_pages/javascript/histogram2d.html new file mode 100644 index 00000000000..1e314b5b6a0 --- /dev/null +++ b/content/reference_pages/javascript/histogram2d.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/histogram2d/ +layout: langindex +page_type: reference +language: plotly_js +name: histogram2d Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: histogram2d Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="histogram2d" trace_data=site.data.plotschema.traces.histogram2d %} + +
+
diff --git a/content/reference_pages/javascript/histogram2dcontour.html b/content/reference_pages/javascript/histogram2dcontour.html new file mode 100644 index 00000000000..959041d979d --- /dev/null +++ b/content/reference_pages/javascript/histogram2dcontour.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/histogram2dcontour/ +layout: langindex +page_type: reference +language: plotly_js +name: histogram2dcontour Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: histogram2dcontour Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="histogram2dcontour" trace_data=site.data.plotschema.traces.histogram2dcontour %} + +
+
diff --git a/content/reference_pages/javascript/icicle.html b/content/reference_pages/javascript/icicle.html new file mode 100644 index 00000000000..f43387cc1ba --- /dev/null +++ b/content/reference_pages/javascript/icicle.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/icicle/ +layout: langindex +page_type: reference +language: plotly_js +name: icicle Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: icicle Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="icicle" trace_data=site.data.plotschema.traces.icicle %} + +
+
diff --git a/content/reference_pages/javascript/image.html b/content/reference_pages/javascript/image.html new file mode 100644 index 00000000000..36df07f2e68 --- /dev/null +++ b/content/reference_pages/javascript/image.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/image/ +layout: langindex +page_type: reference +language: plotly_js +name: image Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: image Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="image" trace_data=site.data.plotschema.traces.image %} + +
+
diff --git a/content/reference_pages/javascript/images.html b/content/reference_pages/javascript/images.html new file mode 100644 index 00000000000..e5e1f99d0b7 --- /dev/null +++ b/content/reference_pages/javascript/images.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/images/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.images +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.images

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="images" %} + +
+
diff --git a/content/reference_pages/javascript/indicator.html b/content/reference_pages/javascript/indicator.html new file mode 100644 index 00000000000..53a041edd07 --- /dev/null +++ b/content/reference_pages/javascript/indicator.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/indicator/ +layout: langindex +page_type: reference +language: plotly_js +name: indicator Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: indicator Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="indicator" trace_data=site.data.plotschema.traces.indicator %} + +
+
diff --git a/content/reference_pages/javascript/isosurface.html b/content/reference_pages/javascript/isosurface.html new file mode 100644 index 00000000000..9abc7b36bab --- /dev/null +++ b/content/reference_pages/javascript/isosurface.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/isosurface/ +layout: langindex +page_type: reference +language: plotly_js +name: isosurface Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: isosurface Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="isosurface" trace_data=site.data.plotschema.traces.isosurface %} + +
+
diff --git a/content/reference_pages/javascript/mapbox.html b/content/reference_pages/javascript/mapbox.html new file mode 100644 index 00000000000..a79d682bace --- /dev/null +++ b/content/reference_pages/javascript/mapbox.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/mapbox/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.mapbox +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.mapbox

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="mapbox" %} + +
+
diff --git a/content/reference_pages/javascript/mesh3d.html b/content/reference_pages/javascript/mesh3d.html new file mode 100644 index 00000000000..e39f2709838 --- /dev/null +++ b/content/reference_pages/javascript/mesh3d.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/mesh3d/ +layout: langindex +page_type: reference +language: plotly_js +name: mesh3d Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: mesh3d Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="mesh3d" trace_data=site.data.plotschema.traces.mesh3d %} + +
+
diff --git a/content/reference_pages/javascript/ohlc.html b/content/reference_pages/javascript/ohlc.html new file mode 100644 index 00000000000..126f885ff9a --- /dev/null +++ b/content/reference_pages/javascript/ohlc.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/ohlc/ +layout: langindex +page_type: reference +language: plotly_js +name: ohlc Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: ohlc Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="ohlc" trace_data=site.data.plotschema.traces.ohlc %} + +
+
diff --git a/content/reference_pages/javascript/parcats.html b/content/reference_pages/javascript/parcats.html new file mode 100644 index 00000000000..2fbddce2c5a --- /dev/null +++ b/content/reference_pages/javascript/parcats.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/parcats/ +layout: langindex +page_type: reference +language: plotly_js +name: parcats Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: parcats Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="parcats" trace_data=site.data.plotschema.traces.parcats %} + +
+
diff --git a/content/reference_pages/javascript/parcoords.html b/content/reference_pages/javascript/parcoords.html new file mode 100644 index 00000000000..7d71073b3e1 --- /dev/null +++ b/content/reference_pages/javascript/parcoords.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/parcoords/ +layout: langindex +page_type: reference +language: plotly_js +name: parcoords Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: parcoords Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="parcoords" trace_data=site.data.plotschema.traces.parcoords %} + +
+
diff --git a/content/reference_pages/javascript/pie.html b/content/reference_pages/javascript/pie.html new file mode 100644 index 00000000000..b47320d41bb --- /dev/null +++ b/content/reference_pages/javascript/pie.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/pie/ +layout: langindex +page_type: reference +language: plotly_js +name: pie Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: pie Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="pie" trace_data=site.data.plotschema.traces.pie %} + +
+
diff --git a/content/reference_pages/javascript/polar.html b/content/reference_pages/javascript/polar.html new file mode 100644 index 00000000000..5be2f4f4f50 --- /dev/null +++ b/content/reference_pages/javascript/polar.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/polar/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.polar +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.polar

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="polar" %} + +
+
diff --git a/content/reference_pages/javascript/sankey.html b/content/reference_pages/javascript/sankey.html new file mode 100644 index 00000000000..c7c8b45abe1 --- /dev/null +++ b/content/reference_pages/javascript/sankey.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/sankey/ +layout: langindex +page_type: reference +language: plotly_js +name: sankey Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: sankey Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="sankey" trace_data=site.data.plotschema.traces.sankey %} + +
+
diff --git a/content/reference_pages/javascript/scatter.html b/content/reference_pages/javascript/scatter.html new file mode 100644 index 00000000000..69589b0c2db --- /dev/null +++ b/content/reference_pages/javascript/scatter.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scatter/ +layout: langindex +page_type: reference +language: plotly_js +name: scatter Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scatter Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatter" trace_data=site.data.plotschema.traces.scatter %} + +
+
diff --git a/content/reference_pages/javascript/scatter3d.html b/content/reference_pages/javascript/scatter3d.html new file mode 100644 index 00000000000..3e2b48d189a --- /dev/null +++ b/content/reference_pages/javascript/scatter3d.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scatter3d/ +layout: langindex +page_type: reference +language: plotly_js +name: scatter3d Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scatter3d Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatter3d" trace_data=site.data.plotschema.traces.scatter3d %} + +
+
diff --git a/content/reference_pages/javascript/scattercarpet.html b/content/reference_pages/javascript/scattercarpet.html new file mode 100644 index 00000000000..a3622ba221d --- /dev/null +++ b/content/reference_pages/javascript/scattercarpet.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scattercarpet/ +layout: langindex +page_type: reference +language: plotly_js +name: scattercarpet Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scattercarpet Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattercarpet" trace_data=site.data.plotschema.traces.scattercarpet %} + +
+
diff --git a/content/reference_pages/javascript/scattergeo.html b/content/reference_pages/javascript/scattergeo.html new file mode 100644 index 00000000000..f04328db645 --- /dev/null +++ b/content/reference_pages/javascript/scattergeo.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scattergeo/ +layout: langindex +page_type: reference +language: plotly_js +name: scattergeo Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scattergeo Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattergeo" trace_data=site.data.plotschema.traces.scattergeo %} + +
+
diff --git a/content/reference_pages/javascript/scattergl.html b/content/reference_pages/javascript/scattergl.html new file mode 100644 index 00000000000..5dec9c6abe7 --- /dev/null +++ b/content/reference_pages/javascript/scattergl.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scattergl/ +layout: langindex +page_type: reference +language: plotly_js +name: scattergl Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scattergl Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattergl" trace_data=site.data.plotschema.traces.scattergl %} + +
+
diff --git a/content/reference_pages/javascript/scattermap.html b/content/reference_pages/javascript/scattermap.html new file mode 100644 index 00000000000..1fa6df0b36f --- /dev/null +++ b/content/reference_pages/javascript/scattermap.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scattermap/ +layout: langindex +page_type: reference +language: plotly_js +name: scattermap Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scattermap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattermap" trace_data=site.data.plotschema.traces.scattermap %} + +
+
diff --git a/content/reference_pages/javascript/scattermapbox.html b/content/reference_pages/javascript/scattermapbox.html new file mode 100644 index 00000000000..e1678d9b4dc --- /dev/null +++ b/content/reference_pages/javascript/scattermapbox.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scattermapbox/ +layout: langindex +page_type: reference +language: plotly_js +name: scattermapbox Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scattermapbox Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattermapbox" trace_data=site.data.plotschema.traces.scattermapbox %} + +
+
diff --git a/content/reference_pages/javascript/scatterpolar.html b/content/reference_pages/javascript/scatterpolar.html new file mode 100644 index 00000000000..37bf23f3f9f --- /dev/null +++ b/content/reference_pages/javascript/scatterpolar.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scatterpolar/ +layout: langindex +page_type: reference +language: plotly_js +name: scatterpolar Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scatterpolar Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatterpolar" trace_data=site.data.plotschema.traces.scatterpolar %} + +
+
diff --git a/content/reference_pages/javascript/scatterpolargl.html b/content/reference_pages/javascript/scatterpolargl.html new file mode 100644 index 00000000000..749d19d5a9a --- /dev/null +++ b/content/reference_pages/javascript/scatterpolargl.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scatterpolargl/ +layout: langindex +page_type: reference +language: plotly_js +name: scatterpolargl Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scatterpolargl Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatterpolargl" trace_data=site.data.plotschema.traces.scatterpolargl %} + +
+
diff --git a/content/reference_pages/javascript/scattersmith.html b/content/reference_pages/javascript/scattersmith.html new file mode 100644 index 00000000000..6c16ce1361f --- /dev/null +++ b/content/reference_pages/javascript/scattersmith.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scattersmith/ +layout: langindex +page_type: reference +language: plotly_js +name: scattersmith Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scattersmith Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattersmith" trace_data=site.data.plotschema.traces.scattersmith %} + +
+
diff --git a/content/reference_pages/javascript/scatterternary.html b/content/reference_pages/javascript/scatterternary.html new file mode 100644 index 00000000000..5ccab89bc94 --- /dev/null +++ b/content/reference_pages/javascript/scatterternary.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/scatterternary/ +layout: langindex +page_type: reference +language: plotly_js +name: scatterternary Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: scatterternary Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatterternary" trace_data=site.data.plotschema.traces.scatterternary %} + +
+
diff --git a/content/reference_pages/javascript/scene.html b/content/reference_pages/javascript/scene.html new file mode 100644 index 00000000000..6cce83ca60d --- /dev/null +++ b/content/reference_pages/javascript/scene.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/scene/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.scene +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.scene

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="scene" %} + +
+
diff --git a/content/reference_pages/javascript/selections.html b/content/reference_pages/javascript/selections.html new file mode 100644 index 00000000000..73a1d2570a7 --- /dev/null +++ b/content/reference_pages/javascript/selections.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/selections/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.selections +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.selections

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="selections" %} + +
+
diff --git a/content/reference_pages/javascript/shapes.html b/content/reference_pages/javascript/shapes.html new file mode 100644 index 00000000000..4ec0bad5042 --- /dev/null +++ b/content/reference_pages/javascript/shapes.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/shapes/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.shapes +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.shapes

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="shapes" %} + +
+
diff --git a/content/reference_pages/javascript/sliders.html b/content/reference_pages/javascript/sliders.html new file mode 100644 index 00000000000..dd9de438441 --- /dev/null +++ b/content/reference_pages/javascript/sliders.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/sliders/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.sliders +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.sliders

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="sliders" %} + +
+
diff --git a/content/reference_pages/javascript/smith.html b/content/reference_pages/javascript/smith.html new file mode 100644 index 00000000000..fc9a26447cb --- /dev/null +++ b/content/reference_pages/javascript/smith.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/smith/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.smith +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.smith

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="smith" %} + +
+
diff --git a/content/reference_pages/javascript/splom.html b/content/reference_pages/javascript/splom.html new file mode 100644 index 00000000000..df0f515e65e --- /dev/null +++ b/content/reference_pages/javascript/splom.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/splom/ +layout: langindex +page_type: reference +language: plotly_js +name: splom Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: splom Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="splom" trace_data=site.data.plotschema.traces.splom %} + +
+
diff --git a/content/reference_pages/javascript/streamtube.html b/content/reference_pages/javascript/streamtube.html new file mode 100644 index 00000000000..9e4f455895e --- /dev/null +++ b/content/reference_pages/javascript/streamtube.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/streamtube/ +layout: langindex +page_type: reference +language: plotly_js +name: streamtube Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: streamtube Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="streamtube" trace_data=site.data.plotschema.traces.streamtube %} + +
+
diff --git a/content/reference_pages/javascript/sunburst.html b/content/reference_pages/javascript/sunburst.html new file mode 100644 index 00000000000..4f7dacf9dff --- /dev/null +++ b/content/reference_pages/javascript/sunburst.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/sunburst/ +layout: langindex +page_type: reference +language: plotly_js +name: sunburst Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: sunburst Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="sunburst" trace_data=site.data.plotschema.traces.sunburst %} + +
+
diff --git a/content/reference_pages/javascript/surface.html b/content/reference_pages/javascript/surface.html new file mode 100644 index 00000000000..1d38999348e --- /dev/null +++ b/content/reference_pages/javascript/surface.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/surface/ +layout: langindex +page_type: reference +language: plotly_js +name: surface Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: surface Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="surface" trace_data=site.data.plotschema.traces.surface %} + +
+
diff --git a/content/reference_pages/javascript/table.html b/content/reference_pages/javascript/table.html new file mode 100644 index 00000000000..9d9b1db620b --- /dev/null +++ b/content/reference_pages/javascript/table.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/table/ +layout: langindex +page_type: reference +language: plotly_js +name: table Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: table Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="table" trace_data=site.data.plotschema.traces.table %} + +
+
diff --git a/content/reference_pages/javascript/ternary.html b/content/reference_pages/javascript/ternary.html new file mode 100644 index 00000000000..d702efeba7a --- /dev/null +++ b/content/reference_pages/javascript/ternary.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/ternary/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.ternary +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.ternary

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="ternary" %} + +
+
diff --git a/content/reference_pages/javascript/treemap.html b/content/reference_pages/javascript/treemap.html new file mode 100644 index 00000000000..09bb271df82 --- /dev/null +++ b/content/reference_pages/javascript/treemap.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/treemap/ +layout: langindex +page_type: reference +language: plotly_js +name: treemap Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: treemap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="treemap" trace_data=site.data.plotschema.traces.treemap %} + +
+
diff --git a/content/reference_pages/javascript/updatemenus.html b/content/reference_pages/javascript/updatemenus.html new file mode 100644 index 00000000000..dffea1b6a8d --- /dev/null +++ b/content/reference_pages/javascript/updatemenus.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/updatemenus/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.updatemenus +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.updatemenus

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="updatemenus" %} + +
+
diff --git a/content/reference_pages/javascript/violin.html b/content/reference_pages/javascript/violin.html new file mode 100644 index 00000000000..61087c44d25 --- /dev/null +++ b/content/reference_pages/javascript/violin.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/violin/ +layout: langindex +page_type: reference +language: plotly_js +name: violin Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: violin Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="violin" trace_data=site.data.plotschema.traces.violin %} + +
+
diff --git a/content/reference_pages/javascript/volume.html b/content/reference_pages/javascript/volume.html new file mode 100644 index 00000000000..1d9a0244b6e --- /dev/null +++ b/content/reference_pages/javascript/volume.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/volume/ +layout: langindex +page_type: reference +language: plotly_js +name: volume Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: volume Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="volume" trace_data=site.data.plotschema.traces.volume %} + +
+
diff --git a/content/reference_pages/javascript/waterfall.html b/content/reference_pages/javascript/waterfall.html new file mode 100644 index 00000000000..027faa15d36 --- /dev/null +++ b/content/reference_pages/javascript/waterfall.html @@ -0,0 +1,18 @@ +--- +permalink: /javascript/reference/waterfall/ +layout: langindex +page_type: reference +language: plotly_js +name: waterfall Traces +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: waterfall Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="waterfall" trace_data=site.data.plotschema.traces.waterfall %} + +
+
diff --git a/content/reference_pages/javascript/xaxis.html b/content/reference_pages/javascript/xaxis.html new file mode 100644 index 00000000000..ce024ddb742 --- /dev/null +++ b/content/reference_pages/javascript/xaxis.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/xaxis/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.xaxis +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.xaxis

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="xaxis" %} + +
+
diff --git a/content/reference_pages/javascript/yaxis.html b/content/reference_pages/javascript/yaxis.html new file mode 100644 index 00000000000..64d6254ab49 --- /dev/null +++ b/content/reference_pages/javascript/yaxis.html @@ -0,0 +1,19 @@ +--- +permalink: /javascript/reference/layout/yaxis/ +layout: langindex +page_type: reference +language: plotly_js +name: layout.yaxis +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +--- + +

JavaScript Figure Reference: layout.yaxis

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="yaxis" %} + +
+
diff --git a/content/reference_pages/plotly_js-ref_index.html b/content/reference_pages/plotly_js-ref_index.html new file mode 100644 index 00000000000..daf3d1485ad --- /dev/null +++ b/content/reference_pages/plotly_js-ref_index.html @@ -0,0 +1,63 @@ +--- +permalink: /javascript/reference/index/ +layout: langindex +page_type: reference +language: plotly_js +name: Reference Index +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +redirect_from: /javascript-graphing-library/reference/ +--- +

JavaScript Figure Reference

+ +
+

The pages linked in the sidebar together form the exhaustive reference for all of the attributes in the core figure data structure +that the plotly library operates on. They are automatically-generated from the + machine-readable Plotly.js schema reference.

+ +

How are Plotly attributes organized?

+
+

+ plotly.js charts are described declaratively as JSON objects. Every aspect of a plotly chart (the colors, the grids, the data, and so on) has a corresponding JSON attribute. This page contains an extensive list of these attributes.

+ + Plotly's graph description places attributes into two categories: traces (objects that describe a single series of data in a graph) and layout (attributes that apply to the rest of the chart, like the title, xaxis, or annotations). Traces are categorized by chart type (e.g. scatter, heatmap).

+ + Here is a simple example of a plotly chart inlined with links to each attribute's reference section. + +

+    data = [
+        {
+            type: 'scatter',  // all "scatter" attributes: https://plotly.com/javascript/reference/#scatter
+            x: [1, 2, 3],     // more about "x": #scatter-x
+            y: [3, 1, 6],     // #scatter-y
+            marker: {         // marker is an object, valid marker keys: #scatter-marker
+                color: 'rgb(16, 32, 77)' // more about "marker.color": #scatter-marker-color
+            }
+        },
+        {
+            type: 'bar',      // all "bar" chart attributes: #bar
+            x: [1, 2, 3],     // more about "x": #bar-x
+            y: [3, 1, 6],     // #bar-y
+            name: 'bar chart example' // #bar-name
+        }
+    ];
+
+    layout = {                     // all "layout" attributes: #layout
+        title: 'simple example',  // more about "layout.title": #layout-title
+        xaxis: {                  // all "layout.xaxis" attributes: #layout-xaxis
+            title: 'time'         // more about "layout.xaxis.title": #layout-xaxis-title
+        },
+        annotations: [            // all "annotation" attributes: #layout-annotations
+            {
+                text: 'simple annotation',    // #layout-annotations-text
+                x: 0,                         // #layout-annotations-x
+                xref: 'paper',                // #layout-annotations-xref
+                y: 0,                         // #layout-annotations-y
+                yref: 'paper'                 // #layout-annotations-yref
+            }
+        ]
+    }
+

+
+
+ + diff --git a/content/reference_pages/plotly_js-reference.html b/content/reference_pages/plotly_js-reference.html new file mode 100644 index 00000000000..820661fc921 --- /dev/null +++ b/content/reference_pages/plotly_js-reference.html @@ -0,0 +1,63 @@ +--- +permalink: /javascript/reference/ +layout: langindex +page_type: reference +language: plotly_js +name: Single-Page Reference +description: Figure attribute reference for Plotly's JavaScript open-source graphing library. +redirect_from: /javascript-graphing-library/reference/ +--- +

JavaScript Figure Reference: Single-Page

+ +
+ How are Plotly attributes organized? +
+

+ plotly.js charts are described declaratively as JSON objects. Every aspect of a plotly chart (the colors, the grids, the data, and so on) has a corresponding JSON attribute. This page contains an extensive list of these attributes.

+ + Plotly's graph description places attributes into two categories: traces (objects that describe a single series of data in a graph) and layout (attributes that apply to the rest of the chart, like the title, xaxis, or annotations). Traces are categorized by chart type (e.g. scatter, heatmap).

+ + Here is a simple example of a plotly chart inlined with links to each attribute's reference section. + +

+    data = [
+        {
+            type: 'scatter',  // all "scatter" attributes: https://plotly.com/javascript/reference/#scatter
+            x: [1, 2, 3],     // more about "x": #scatter-x
+            y: [3, 1, 6],     // #scatter-y
+            marker: {         // marker is an object, valid marker keys: #scatter-marker
+                color: 'rgb(16, 32, 77)' // more about "marker.color": #scatter-marker-color
+            }
+        },
+        {
+            type: 'bar',      // all "bar" chart attributes: #bar
+            x: [1, 2, 3],     // more about "x": #bar-x
+            y: [3, 1, 6],     // #bar-y
+            name: 'bar chart example' // #bar-name
+        }
+    ];
+
+    layout = {                     // all "layout" attributes: #layout
+        title: 'simple example',  // more about "layout.title": #layout-title
+        xaxis: {                  // all "layout.xaxis" attributes: #layout-xaxis
+            title: 'time'         // more about "layout.xaxis.title": #layout-xaxis-title
+        },
+        annotations: [            // all "annotation" attributes: #layout-annotations
+            {
+                text: 'simple annotation',    // #layout-annotations-text
+                x: 0,                         // #layout-annotations-x
+                xref: 'paper',                // #layout-annotations-xref
+                y: 0,                         // #layout-annotations-y
+                yref: 'paper'                 // #layout-annotations-yref
+            }
+        ]
+    }
+

+
+
+
+ + + + +{% include posts/plotschema-reference.html %} diff --git a/content/reference_pages/python-ref_index.html b/content/reference_pages/python-ref_index.html new file mode 100644 index 00000000000..82ae1351dec --- /dev/null +++ b/content/reference_pages/python-ref_index.html @@ -0,0 +1,55 @@ +--- +permalink: /python/reference/index/ +layout: langindex +page_type: reference +language: python +name: Reference Index +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- +

Python Figure Reference

+ +
+

The pages linked in the sidebar together form the exhaustive reference for all of the attributes in the core figure data structure +that the plotly library operates on. They are automatically-generated from the + machine-readable Plotly.js schema reference.

+

+ +

How to use these Reference pages

+ +

Figures are represented as trees with named nodes called "attributes". +The root node of the tree has three top-level attributes: data, layout and frames. +Attributes are referred to in text and in this reference by their full "path" i.e. the dot-delimited concatenation of their parents. +For example "layout.width" refers to the attribute whose key is "width" inside a dict which is +the value associated with a key "layout" at the root of the figure. If one of the parents is a list rather +than a dict, a set of brackets is inserted in the path when referring to the attribute in the abstract, +e.g. "layout.annotations[].text". Finally, as explained below, the top-level "data" +attribute defines a list of typed objects called "traces" with the schema dependent upon the type, +and these attributes' paths are listed in this reference as +"data[type=scatter].name". When manipulating +a plotly.graph_objects.Figure object, attributes can be set either directly +using Python object attributes e.g. fig.layout.title.font.family="Open Sans" +or using update methods +and "magic underscores" e.g. fig.update_layout(title_font_family="Open Sans")

+ +
+

When building a figure, it is not necessary to populate every attribute +of every object. At render-time, the JavaScript layer will compute default values +for each required unspecified attribute, depending upon the ones that are specified, +as documented in this page. An example of this would be layout.xaxis.range, +which may be specified explicitly, but if not will be computed based on the range of x values for +every trace linked to that axis. The JavaScript layer will ignore unknown attributes +or malformed values, although the plotly.graph_objects module provides +Python-side validation for attribute values. Note also that if the layout.template +key is present (as it is by default) then default values will be drawn first from the contents +of the template and only if missing from there will the JavaScript layer infer further defaults. +The built-in template can be disabled by setting layout.template="none".

+ +
+
+
+
+
+
+
+
+
diff --git a/content/reference_pages/python-reference.html b/content/reference_pages/python-reference.html new file mode 100644 index 00000000000..9f3b6c8d44e --- /dev/null +++ b/content/reference_pages/python-reference.html @@ -0,0 +1,47 @@ +--- +permalink: /python/reference/ +layout: langindex +page_type: reference +language: python +name: Single-Page Reference +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- +

Python Figure Reference: Single-Page

+ +
+

This page is the exhaustive reference for all of the attributes in the core figure data structure +that the plotly library operates on. It is automatically-generated from the + machine-readable Plotly.js schema reference.

+

+
+

Figures are represented as trees with named nodes called "attributes". +The root node of the tree has three top-level attributes: data, layout and frames. +Attributes are referred to in text and in this page by their full "path" i.e. the dot-delimited concatenation of their parents. +For example "layout.width" refers to the attribute whose key is "width" inside a dict which is +the value associated with a key "layout" at the root of the figure. If one of the parents is a list rather +than a dict, a set of brackets is inserted in the path when referring to the attribute in the abstract, +e.g. "layout.annotations[].text". Finally, as explained below, the top-level "data" +attribute defines a list of typed objects called "traces" with the schema dependent upon the type, +and these attributes' paths are listed in this page as +"data[type=scatter].name". When manipulating +a plotly.graph_objects.Figure object, attributes can be set either directly +using Python object attributes e.g. fig.layout.title.font.family="Open Sans" +or using update methods +and "magic underscores" e.g. fig.update_layout(title_font_family="Open Sans")

+ +
+

When building a figure, it is not necessary to populate every attribute +of every object. At render-time, the JavaScript layer will compute default values +for each required unspecified attribute, depending upon the ones that are specified, +as documented in this page. An example of this would be layout.xaxis.range, +which may be specified explicitly, but if not will be computed based on the range of x values for +every trace linked to that axis. The JavaScript layer will ignore unknown attributes +or malformed values, although the plotly.graph_objects module provides +Python-side validation for attribute values. Note also that if the layout.template +key is present (as it is by default) then default values will be drawn first from the contents +of the template and only if missing from there will the JavaScript layer infer further defaults. +The built-in template can be disabled by setting layout.template="none".

+ +
+ +{% include posts/plotschema-reference.html %} diff --git a/content/reference_pages/python/annotations.html b/content/reference_pages/python/annotations.html new file mode 100644 index 00000000000..c0a72bffe3c --- /dev/null +++ b/content/reference_pages/python/annotations.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/annotations/ +layout: langindex +page_type: reference +language: python +name: layout.annotations +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.annotations

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="annotations" %} + +
+
diff --git a/content/reference_pages/python/bar.html b/content/reference_pages/python/bar.html new file mode 100644 index 00000000000..2d5abab2f97 --- /dev/null +++ b/content/reference_pages/python/bar.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/bar/ +layout: langindex +page_type: reference +language: python +name: bar Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: bar Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="bar" trace_data=site.data.plotschema.traces.bar %} + +
+
diff --git a/content/reference_pages/python/barpolar.html b/content/reference_pages/python/barpolar.html new file mode 100644 index 00000000000..93567c636ac --- /dev/null +++ b/content/reference_pages/python/barpolar.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/barpolar/ +layout: langindex +page_type: reference +language: python +name: barpolar Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: barpolar Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="barpolar" trace_data=site.data.plotschema.traces.barpolar %} + +
+
diff --git a/content/reference_pages/python/box.html b/content/reference_pages/python/box.html new file mode 100644 index 00000000000..859eb3a46cd --- /dev/null +++ b/content/reference_pages/python/box.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/box/ +layout: langindex +page_type: reference +language: python +name: box Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: box Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="box" trace_data=site.data.plotschema.traces.box %} + +
+
diff --git a/content/reference_pages/python/candlestick.html b/content/reference_pages/python/candlestick.html new file mode 100644 index 00000000000..d3a214e256f --- /dev/null +++ b/content/reference_pages/python/candlestick.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/candlestick/ +layout: langindex +page_type: reference +language: python +name: candlestick Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: candlestick Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="candlestick" trace_data=site.data.plotschema.traces.candlestick %} + +
+
diff --git a/content/reference_pages/python/carpet.html b/content/reference_pages/python/carpet.html new file mode 100644 index 00000000000..c7bb5b9794c --- /dev/null +++ b/content/reference_pages/python/carpet.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/carpet/ +layout: langindex +page_type: reference +language: python +name: carpet Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: carpet Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="carpet" trace_data=site.data.plotschema.traces.carpet %} + +
+
diff --git a/content/reference_pages/python/choropleth.html b/content/reference_pages/python/choropleth.html new file mode 100644 index 00000000000..57559ff2a86 --- /dev/null +++ b/content/reference_pages/python/choropleth.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/choropleth/ +layout: langindex +page_type: reference +language: python +name: choropleth Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: choropleth Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="choropleth" trace_data=site.data.plotschema.traces.choropleth %} + +
+
diff --git a/content/reference_pages/python/choroplethmap.html b/content/reference_pages/python/choroplethmap.html new file mode 100644 index 00000000000..6ed7520d082 --- /dev/null +++ b/content/reference_pages/python/choroplethmap.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/choroplethmap/ +layout: langindex +page_type: reference +language: python +name: choroplethmap Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: choroplethmap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="choroplethmap" trace_data=site.data.plotschema.traces.choroplethmap %} + +
+
diff --git a/content/reference_pages/python/choroplethmapbox.html b/content/reference_pages/python/choroplethmapbox.html new file mode 100644 index 00000000000..f8635576da5 --- /dev/null +++ b/content/reference_pages/python/choroplethmapbox.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/choroplethmapbox/ +layout: langindex +page_type: reference +language: python +name: choroplethmapbox Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: choroplethmapbox Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="choroplethmapbox" trace_data=site.data.plotschema.traces.choroplethmapbox %} + +
+
diff --git a/content/reference_pages/python/coloraxis.html b/content/reference_pages/python/coloraxis.html new file mode 100644 index 00000000000..18439c8534b --- /dev/null +++ b/content/reference_pages/python/coloraxis.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/coloraxis/ +layout: langindex +page_type: reference +language: python +name: layout.coloraxis +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.coloraxis

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="coloraxis" %} + +
+
diff --git a/content/reference_pages/python/cone.html b/content/reference_pages/python/cone.html new file mode 100644 index 00000000000..2a65f6d6da5 --- /dev/null +++ b/content/reference_pages/python/cone.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/cone/ +layout: langindex +page_type: reference +language: python +name: cone Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: cone Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="cone" trace_data=site.data.plotschema.traces.cone %} + +
+
diff --git a/content/reference_pages/python/contour.html b/content/reference_pages/python/contour.html new file mode 100644 index 00000000000..58471cf3bfe --- /dev/null +++ b/content/reference_pages/python/contour.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/contour/ +layout: langindex +page_type: reference +language: python +name: contour Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: contour Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="contour" trace_data=site.data.plotschema.traces.contour %} + +
+
diff --git a/content/reference_pages/python/contourcarpet.html b/content/reference_pages/python/contourcarpet.html new file mode 100644 index 00000000000..cee3ae525c1 --- /dev/null +++ b/content/reference_pages/python/contourcarpet.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/contourcarpet/ +layout: langindex +page_type: reference +language: python +name: contourcarpet Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: contourcarpet Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="contourcarpet" trace_data=site.data.plotschema.traces.contourcarpet %} + +
+
diff --git a/content/reference_pages/python/densitymap.html b/content/reference_pages/python/densitymap.html new file mode 100644 index 00000000000..f7ea6577542 --- /dev/null +++ b/content/reference_pages/python/densitymap.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/densitymap/ +layout: langindex +page_type: reference +language: python +name: densitymap Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: densitymap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="densitymap" trace_data=site.data.plotschema.traces.densitymap %} + +
+
diff --git a/content/reference_pages/python/densitymapbox.html b/content/reference_pages/python/densitymapbox.html new file mode 100644 index 00000000000..e29c6ee6778 --- /dev/null +++ b/content/reference_pages/python/densitymapbox.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/densitymapbox/ +layout: langindex +page_type: reference +language: python +name: densitymapbox Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: densitymapbox Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="densitymapbox" trace_data=site.data.plotschema.traces.densitymapbox %} + +
+
diff --git a/content/reference_pages/python/funnel.html b/content/reference_pages/python/funnel.html new file mode 100644 index 00000000000..7a1e2de4a26 --- /dev/null +++ b/content/reference_pages/python/funnel.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/funnel/ +layout: langindex +page_type: reference +language: python +name: funnel Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: funnel Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="funnel" trace_data=site.data.plotschema.traces.funnel %} + +
+
diff --git a/content/reference_pages/python/funnelarea.html b/content/reference_pages/python/funnelarea.html new file mode 100644 index 00000000000..1b4aa038a4b --- /dev/null +++ b/content/reference_pages/python/funnelarea.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/funnelarea/ +layout: langindex +page_type: reference +language: python +name: funnelarea Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: funnelarea Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="funnelarea" trace_data=site.data.plotschema.traces.funnelarea %} + +
+
diff --git a/content/reference_pages/python/geo.html b/content/reference_pages/python/geo.html new file mode 100644 index 00000000000..6eb79a4cc02 --- /dev/null +++ b/content/reference_pages/python/geo.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/geo/ +layout: langindex +page_type: reference +language: python +name: layout.geo +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.geo

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="geo" %} + +
+
diff --git a/content/reference_pages/python/global.html b/content/reference_pages/python/global.html new file mode 100644 index 00000000000..af783b74f65 --- /dev/null +++ b/content/reference_pages/python/global.html @@ -0,0 +1,26 @@ +--- +permalink: /python/reference/layout/ +layout: langindex +page_type: reference +language: python +name: layout +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="global" %} + +{%- for trace in site.data.plotschema.traces -%} +{% if trace[1].layoutAttributes %} +{% assign attribute=trace[1].layoutAttributes %} +{% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" %} +{% endif %} +{%- endfor -%} + +
+
diff --git a/content/reference_pages/python/heatmap.html b/content/reference_pages/python/heatmap.html new file mode 100644 index 00000000000..f3a117263bb --- /dev/null +++ b/content/reference_pages/python/heatmap.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/heatmap/ +layout: langindex +page_type: reference +language: python +name: heatmap Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: heatmap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="heatmap" trace_data=site.data.plotschema.traces.heatmap %} + +
+
diff --git a/content/reference_pages/python/heatmapgl.html b/content/reference_pages/python/heatmapgl.html new file mode 100644 index 00000000000..3a19bc8c757 --- /dev/null +++ b/content/reference_pages/python/heatmapgl.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/heatmapgl/ +layout: langindex +page_type: reference +language: python +name: heatmapgl Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: heatmapgl Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="heatmapgl" trace_data=site.data.plotschema.traces.heatmapgl %} + +
+
diff --git a/content/reference_pages/python/histogram.html b/content/reference_pages/python/histogram.html new file mode 100644 index 00000000000..c065f32ee42 --- /dev/null +++ b/content/reference_pages/python/histogram.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/histogram/ +layout: langindex +page_type: reference +language: python +name: histogram Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: histogram Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="histogram" trace_data=site.data.plotschema.traces.histogram %} + +
+
diff --git a/content/reference_pages/python/histogram2d.html b/content/reference_pages/python/histogram2d.html new file mode 100644 index 00000000000..18411d57817 --- /dev/null +++ b/content/reference_pages/python/histogram2d.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/histogram2d/ +layout: langindex +page_type: reference +language: python +name: histogram2d Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: histogram2d Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="histogram2d" trace_data=site.data.plotschema.traces.histogram2d %} + +
+
diff --git a/content/reference_pages/python/histogram2dcontour.html b/content/reference_pages/python/histogram2dcontour.html new file mode 100644 index 00000000000..7e694a08d6a --- /dev/null +++ b/content/reference_pages/python/histogram2dcontour.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/histogram2dcontour/ +layout: langindex +page_type: reference +language: python +name: histogram2dcontour Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: histogram2dcontour Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="histogram2dcontour" trace_data=site.data.plotschema.traces.histogram2dcontour %} + +
+
diff --git a/content/reference_pages/python/icicle.html b/content/reference_pages/python/icicle.html new file mode 100644 index 00000000000..e01aba19e25 --- /dev/null +++ b/content/reference_pages/python/icicle.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/icicle/ +layout: langindex +page_type: reference +language: python +name: icicle Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: icicle Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="icicle" trace_data=site.data.plotschema.traces.icicle %} + +
+
diff --git a/content/reference_pages/python/image.html b/content/reference_pages/python/image.html new file mode 100644 index 00000000000..9e4a9df5bab --- /dev/null +++ b/content/reference_pages/python/image.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/image/ +layout: langindex +page_type: reference +language: python +name: image Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: image Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="image" trace_data=site.data.plotschema.traces.image %} + +
+
diff --git a/content/reference_pages/python/images.html b/content/reference_pages/python/images.html new file mode 100644 index 00000000000..0cb55c3ea1c --- /dev/null +++ b/content/reference_pages/python/images.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/images/ +layout: langindex +page_type: reference +language: python +name: layout.images +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.images

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="images" %} + +
+
diff --git a/content/reference_pages/python/indicator.html b/content/reference_pages/python/indicator.html new file mode 100644 index 00000000000..8e700c7b0c9 --- /dev/null +++ b/content/reference_pages/python/indicator.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/indicator/ +layout: langindex +page_type: reference +language: python +name: indicator Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: indicator Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="indicator" trace_data=site.data.plotschema.traces.indicator %} + +
+
diff --git a/content/reference_pages/python/isosurface.html b/content/reference_pages/python/isosurface.html new file mode 100644 index 00000000000..6073dafd907 --- /dev/null +++ b/content/reference_pages/python/isosurface.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/isosurface/ +layout: langindex +page_type: reference +language: python +name: isosurface Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: isosurface Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="isosurface" trace_data=site.data.plotschema.traces.isosurface %} + +
+
diff --git a/content/reference_pages/python/mapbox.html b/content/reference_pages/python/mapbox.html new file mode 100644 index 00000000000..7a033625b9b --- /dev/null +++ b/content/reference_pages/python/mapbox.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/mapbox/ +layout: langindex +page_type: reference +language: python +name: layout.mapbox +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.mapbox

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="mapbox" %} + +
+
diff --git a/content/reference_pages/python/mesh3d.html b/content/reference_pages/python/mesh3d.html new file mode 100644 index 00000000000..13cd1284aa8 --- /dev/null +++ b/content/reference_pages/python/mesh3d.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/mesh3d/ +layout: langindex +page_type: reference +language: python +name: mesh3d Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: mesh3d Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="mesh3d" trace_data=site.data.plotschema.traces.mesh3d %} + +
+
diff --git a/content/reference_pages/python/ohlc.html b/content/reference_pages/python/ohlc.html new file mode 100644 index 00000000000..b78e39c4f51 --- /dev/null +++ b/content/reference_pages/python/ohlc.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/ohlc/ +layout: langindex +page_type: reference +language: python +name: ohlc Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: ohlc Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="ohlc" trace_data=site.data.plotschema.traces.ohlc %} + +
+
diff --git a/content/reference_pages/python/parcats.html b/content/reference_pages/python/parcats.html new file mode 100644 index 00000000000..e0a1430cc1d --- /dev/null +++ b/content/reference_pages/python/parcats.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/parcats/ +layout: langindex +page_type: reference +language: python +name: parcats Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: parcats Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="parcats" trace_data=site.data.plotschema.traces.parcats %} + +
+
diff --git a/content/reference_pages/python/parcoords.html b/content/reference_pages/python/parcoords.html new file mode 100644 index 00000000000..0a5379313cf --- /dev/null +++ b/content/reference_pages/python/parcoords.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/parcoords/ +layout: langindex +page_type: reference +language: python +name: parcoords Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: parcoords Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="parcoords" trace_data=site.data.plotschema.traces.parcoords %} + +
+
diff --git a/content/reference_pages/python/pie.html b/content/reference_pages/python/pie.html new file mode 100644 index 00000000000..221a45fd213 --- /dev/null +++ b/content/reference_pages/python/pie.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/pie/ +layout: langindex +page_type: reference +language: python +name: pie Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: pie Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="pie" trace_data=site.data.plotschema.traces.pie %} + +
+
diff --git a/content/reference_pages/python/pointcloud.html b/content/reference_pages/python/pointcloud.html new file mode 100644 index 00000000000..4df8513d44c --- /dev/null +++ b/content/reference_pages/python/pointcloud.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/pointcloud/ +layout: langindex +page_type: reference +language: python +name: pointcloud Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: pointcloud Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="pointcloud" trace_data=site.data.plotschema.traces.pointcloud %} + +
+
diff --git a/content/reference_pages/python/polar.html b/content/reference_pages/python/polar.html new file mode 100644 index 00000000000..8a2d97e4b52 --- /dev/null +++ b/content/reference_pages/python/polar.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/polar/ +layout: langindex +page_type: reference +language: python +name: layout.polar +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.polar

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="polar" %} + +
+
diff --git a/content/reference_pages/python/sankey.html b/content/reference_pages/python/sankey.html new file mode 100644 index 00000000000..6d7821e072a --- /dev/null +++ b/content/reference_pages/python/sankey.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/sankey/ +layout: langindex +page_type: reference +language: python +name: sankey Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: sankey Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="sankey" trace_data=site.data.plotschema.traces.sankey %} + +
+
diff --git a/content/reference_pages/python/scatter.html b/content/reference_pages/python/scatter.html new file mode 100644 index 00000000000..4487da3f9b4 --- /dev/null +++ b/content/reference_pages/python/scatter.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scatter/ +layout: langindex +page_type: reference +language: python +name: scatter Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scatter Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatter" trace_data=site.data.plotschema.traces.scatter %} + +
+
diff --git a/content/reference_pages/python/scatter3d.html b/content/reference_pages/python/scatter3d.html new file mode 100644 index 00000000000..e5ee59b6519 --- /dev/null +++ b/content/reference_pages/python/scatter3d.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scatter3d/ +layout: langindex +page_type: reference +language: python +name: scatter3d Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scatter3d Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatter3d" trace_data=site.data.plotschema.traces.scatter3d %} + +
+
diff --git a/content/reference_pages/python/scattercarpet.html b/content/reference_pages/python/scattercarpet.html new file mode 100644 index 00000000000..03c3268fb78 --- /dev/null +++ b/content/reference_pages/python/scattercarpet.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scattercarpet/ +layout: langindex +page_type: reference +language: python +name: scattercarpet Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scattercarpet Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattercarpet" trace_data=site.data.plotschema.traces.scattercarpet %} + +
+
diff --git a/content/reference_pages/python/scattergeo.html b/content/reference_pages/python/scattergeo.html new file mode 100644 index 00000000000..2883f4a1b1e --- /dev/null +++ b/content/reference_pages/python/scattergeo.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scattergeo/ +layout: langindex +page_type: reference +language: python +name: scattergeo Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scattergeo Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattergeo" trace_data=site.data.plotschema.traces.scattergeo %} + +
+
diff --git a/content/reference_pages/python/scattergl.html b/content/reference_pages/python/scattergl.html new file mode 100644 index 00000000000..2bc3e81ba6e --- /dev/null +++ b/content/reference_pages/python/scattergl.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scattergl/ +layout: langindex +page_type: reference +language: python +name: scattergl Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scattergl Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattergl" trace_data=site.data.plotschema.traces.scattergl %} + +
+
diff --git a/content/reference_pages/python/scattermap.html b/content/reference_pages/python/scattermap.html new file mode 100644 index 00000000000..56a7debac52 --- /dev/null +++ b/content/reference_pages/python/scattermap.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scattermap/ +layout: langindex +page_type: reference +language: python +name: scattermap Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scattermap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattermap" trace_data=site.data.plotschema.traces.scattermap %} + +
+
diff --git a/content/reference_pages/python/scattermapbox.html b/content/reference_pages/python/scattermapbox.html new file mode 100644 index 00000000000..36d389ee146 --- /dev/null +++ b/content/reference_pages/python/scattermapbox.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scattermapbox/ +layout: langindex +page_type: reference +language: python +name: scattermapbox Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scattermapbox Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattermapbox" trace_data=site.data.plotschema.traces.scattermapbox %} + +
+
diff --git a/content/reference_pages/python/scatterpolar.html b/content/reference_pages/python/scatterpolar.html new file mode 100644 index 00000000000..574675f7357 --- /dev/null +++ b/content/reference_pages/python/scatterpolar.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scatterpolar/ +layout: langindex +page_type: reference +language: python +name: scatterpolar Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scatterpolar Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatterpolar" trace_data=site.data.plotschema.traces.scatterpolar %} + +
+
diff --git a/content/reference_pages/python/scatterpolargl.html b/content/reference_pages/python/scatterpolargl.html new file mode 100644 index 00000000000..9f8c37ef96a --- /dev/null +++ b/content/reference_pages/python/scatterpolargl.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scatterpolargl/ +layout: langindex +page_type: reference +language: python +name: scatterpolargl Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scatterpolargl Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatterpolargl" trace_data=site.data.plotschema.traces.scatterpolargl %} + +
+
diff --git a/content/reference_pages/python/scattersmith.html b/content/reference_pages/python/scattersmith.html new file mode 100644 index 00000000000..5ae98b58ec1 --- /dev/null +++ b/content/reference_pages/python/scattersmith.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scattersmith/ +layout: langindex +page_type: reference +language: python +name: scattersmith Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scattersmith Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scattersmith" trace_data=site.data.plotschema.traces.scattersmith %} + +
+
diff --git a/content/reference_pages/python/scatterternary.html b/content/reference_pages/python/scatterternary.html new file mode 100644 index 00000000000..2155685d7db --- /dev/null +++ b/content/reference_pages/python/scatterternary.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/scatterternary/ +layout: langindex +page_type: reference +language: python +name: scatterternary Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: scatterternary Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="scatterternary" trace_data=site.data.plotschema.traces.scatterternary %} + +
+
diff --git a/content/reference_pages/python/scene.html b/content/reference_pages/python/scene.html new file mode 100644 index 00000000000..8019b25444d --- /dev/null +++ b/content/reference_pages/python/scene.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/scene/ +layout: langindex +page_type: reference +language: python +name: layout.scene +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.scene

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="scene" %} + +
+
diff --git a/content/reference_pages/python/selections.html b/content/reference_pages/python/selections.html new file mode 100644 index 00000000000..3843b1a69b4 --- /dev/null +++ b/content/reference_pages/python/selections.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/selections/ +layout: langindex +page_type: reference +language: python +name: layout.selections +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.selections

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="selections" %} + +
+
diff --git a/content/reference_pages/python/shapes.html b/content/reference_pages/python/shapes.html new file mode 100644 index 00000000000..9eaca885080 --- /dev/null +++ b/content/reference_pages/python/shapes.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/shapes/ +layout: langindex +page_type: reference +language: python +name: layout.shapes +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.shapes

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="shapes" %} + +
+
diff --git a/content/reference_pages/python/sliders.html b/content/reference_pages/python/sliders.html new file mode 100644 index 00000000000..ba59b7e4b4e --- /dev/null +++ b/content/reference_pages/python/sliders.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/sliders/ +layout: langindex +page_type: reference +language: python +name: layout.sliders +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.sliders

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="sliders" %} + +
+
diff --git a/content/reference_pages/python/smith.html b/content/reference_pages/python/smith.html new file mode 100644 index 00000000000..9b67a0c4b43 --- /dev/null +++ b/content/reference_pages/python/smith.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/smith/ +layout: langindex +page_type: reference +language: python +name: layout.smith +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.smith

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="smith" %} + +
+
diff --git a/content/reference_pages/python/splom.html b/content/reference_pages/python/splom.html new file mode 100644 index 00000000000..0b8a80039d0 --- /dev/null +++ b/content/reference_pages/python/splom.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/splom/ +layout: langindex +page_type: reference +language: python +name: splom Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: splom Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="splom" trace_data=site.data.plotschema.traces.splom %} + +
+
diff --git a/content/reference_pages/python/streamtube.html b/content/reference_pages/python/streamtube.html new file mode 100644 index 00000000000..fd6731fad5d --- /dev/null +++ b/content/reference_pages/python/streamtube.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/streamtube/ +layout: langindex +page_type: reference +language: python +name: streamtube Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: streamtube Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="streamtube" trace_data=site.data.plotschema.traces.streamtube %} + +
+
diff --git a/content/reference_pages/python/sunburst.html b/content/reference_pages/python/sunburst.html new file mode 100644 index 00000000000..8a62a99a2b4 --- /dev/null +++ b/content/reference_pages/python/sunburst.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/sunburst/ +layout: langindex +page_type: reference +language: python +name: sunburst Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: sunburst Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="sunburst" trace_data=site.data.plotschema.traces.sunburst %} + +
+
diff --git a/content/reference_pages/python/surface.html b/content/reference_pages/python/surface.html new file mode 100644 index 00000000000..899e9a2c9db --- /dev/null +++ b/content/reference_pages/python/surface.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/surface/ +layout: langindex +page_type: reference +language: python +name: surface Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: surface Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="surface" trace_data=site.data.plotschema.traces.surface %} + +
+
diff --git a/content/reference_pages/python/table.html b/content/reference_pages/python/table.html new file mode 100644 index 00000000000..bd108a02cf7 --- /dev/null +++ b/content/reference_pages/python/table.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/table/ +layout: langindex +page_type: reference +language: python +name: table Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: table Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="table" trace_data=site.data.plotschema.traces.table %} + +
+
diff --git a/content/reference_pages/python/ternary.html b/content/reference_pages/python/ternary.html new file mode 100644 index 00000000000..001845d6c3a --- /dev/null +++ b/content/reference_pages/python/ternary.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/ternary/ +layout: langindex +page_type: reference +language: python +name: layout.ternary +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.ternary

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="ternary" %} + +
+
diff --git a/content/reference_pages/python/treemap.html b/content/reference_pages/python/treemap.html new file mode 100644 index 00000000000..aa360a5d182 --- /dev/null +++ b/content/reference_pages/python/treemap.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/treemap/ +layout: langindex +page_type: reference +language: python +name: treemap Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: treemap Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="treemap" trace_data=site.data.plotschema.traces.treemap %} + +
+
diff --git a/content/reference_pages/python/updatemenus.html b/content/reference_pages/python/updatemenus.html new file mode 100644 index 00000000000..9b407f69a00 --- /dev/null +++ b/content/reference_pages/python/updatemenus.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/updatemenus/ +layout: langindex +page_type: reference +language: python +name: layout.updatemenus +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.updatemenus

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="updatemenus" %} + +
+
diff --git a/content/reference_pages/python/violin.html b/content/reference_pages/python/violin.html new file mode 100644 index 00000000000..99f008f97ce --- /dev/null +++ b/content/reference_pages/python/violin.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/violin/ +layout: langindex +page_type: reference +language: python +name: violin Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: violin Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="violin" trace_data=site.data.plotschema.traces.violin %} + +
+
diff --git a/content/reference_pages/python/volume.html b/content/reference_pages/python/volume.html new file mode 100644 index 00000000000..b283166a0be --- /dev/null +++ b/content/reference_pages/python/volume.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/volume/ +layout: langindex +page_type: reference +language: python +name: volume Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: volume Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="volume" trace_data=site.data.plotschema.traces.volume %} + +
+
diff --git a/content/reference_pages/python/waterfall.html b/content/reference_pages/python/waterfall.html new file mode 100644 index 00000000000..4cc66511012 --- /dev/null +++ b/content/reference_pages/python/waterfall.html @@ -0,0 +1,18 @@ +--- +permalink: /python/reference/waterfall/ +layout: langindex +page_type: reference +language: python +name: waterfall Traces +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: waterfall Traces

+ +
+
+ + {% include posts/reference-trace.html trace_name="waterfall" trace_data=site.data.plotschema.traces.waterfall %} + +
+
diff --git a/content/reference_pages/python/xaxis.html b/content/reference_pages/python/xaxis.html new file mode 100644 index 00000000000..7fc83217df4 --- /dev/null +++ b/content/reference_pages/python/xaxis.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/xaxis/ +layout: langindex +page_type: reference +language: python +name: layout.xaxis +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.xaxis

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="xaxis" %} + +
+
diff --git a/content/reference_pages/python/yaxis.html b/content/reference_pages/python/yaxis.html new file mode 100644 index 00000000000..4f38d5e198b --- /dev/null +++ b/content/reference_pages/python/yaxis.html @@ -0,0 +1,19 @@ +--- +permalink: /python/reference/layout/yaxis/ +layout: langindex +page_type: reference +language: python +name: layout.yaxis +description: Figure attribute reference for Plotly's Python open-source graphing library. +--- + +

Python Figure Reference: layout.yaxis

+ +
+
+ + {% assign attribute=site.data.plotschema.layout.layoutAttributes %} + {% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="yaxis" %} + +
+
diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000000..74343c894fd --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,276 @@ +site_name: "Plotly.js Docs" +site_url: 'https://plotly.com/javascript/' +repo_url: https://github.com/plotly/plotly.js +repo_name: plotly/plotly.js +docs_dir: pages +site_dir: docs + +validation: + absolute_links: relative_to_docs + anchors: info + unrecognized_links: info + not_found: info + +plugins: + - search + - redirects: + redirect_maps: + 'mapbox-layers.md': 'tile-map-layers.md' + - gen-files: + scripts: + - bin/generate_reference_pages.py + - macros + +theme: + name: "material" + custom_dir: "pages/overrides" + font: + text: Inter + features: + - navigation.sections + - content.code.copy + - content.code.annotate + logo: https://docs.plotly.com/assets/plotly_logo_square.png + palette: + # Auto (follows system) + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + # Light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + # Dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to system preference + +markdown_extensions: + - footnotes + - pymdownx.snippets: + base_path: ["tmp"] + - markdown_include.include: + base_path: docs + - md_in_html + +extra_css: + - css/extra_css.css + - css/code-highlight.css + - https://docs.plotly.com/css/plotly-style.css + - https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css + +extra_javascript: + - javascript/highlight.js + - https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js + +nav: +- Home: index.md +- Quick Reference: + - Getting Started: getting-started.md + - Is Plotly Free?: is-plotly-free.md + - Figure Reference: reference/index/index.md # To match link to existing ploty.com/javascript + - Function Reference: plotlyjs-function-reference.md + - Event Reference: plotlyjs-events.md + - Configuration Options: configuration-options.md + - GitHub: https://github.com/plotly/plotly.js/ + - Plotly Community Forum: https://community.plotly.com/ +- Examples: + - Fundamentals: + - Overview: plotly-fundamentals.md + - Configuration: configuration-options.md + - Responsive / Fluid Layouts: responsive-fluid-layout.md + - uirevision in Plotly.react: uirevision.md + - React Plotly.js: react.md + - Analytical Apps with Dash: https://dash.plotly.com/ + - Colorway: colorway.md + - Images: images.md + - 3D Axes: 3d-axes.md + - 3D Hover Options: 3d-hover.md + - 3D Surface Lighting: 3d-surface-lighting.md + - Axes: axes.md + - Horizontal Legends: horizontal-legend.md + - Hover Text and Formatting: hover-text-and-formatting.md + - Setting the Title, Legend Entries, and Axis Titles: figure-labels.md + - Layout Template Examples: layout-template.md + - Legends: legend.md + - Setting Graph Size: setting-graph-size.md + - Formatting Ticks: tick-formatting.md + - Shapes: shapes.md + - Text Template: texttemplate.md + - Text and Annotations: text-and-annotations.md + - Text and Font Styling: font.md + - Multiple Axes: multiple-axes.md + - Subplots: subplots.md + - Basic Charts: + - Overview: basic-charts.md + - Scatter Plots: line-and-scatter.md + - Line Charts: line-charts.md + - Bar Charts: bar-charts.md + - Pie Charts: pie-charts.md + - Bubble Charts: bubble-charts.md + - Dot Plots: dot-plots.md + - Inset Plots: insets.md + - Filled Area Plots: filled-area-plots.md + - Horizontal Bar Charts: horizontal-bar-charts.md + - Sunburst Charts: sunburst-charts.md + - Sankey Diagram: sankey-diagram.md + - Treemap Charts: treemaps.md + - Tables: table.md + - Multiple Chart Types: graphing-multiple-chart-types.md + - WebGL vs SVG: webgl-vs-svg.md + - Statistical Charts: + - Overview: statistical-charts.md + - Error Bars: error-bars.md + - Box Plots: box-plots.md + - Histograms: histograms.md + - Continuous Error Bars: continuous-error-bars.md + - 2D Histograms: 2D-Histogram.md + - SPC Control Charts: spc-control-charts.md + - Violin Plots: violin.md + - Parallel Categories Diagram: parallel-categories-diagram.md + - Scatterplot Matrix: splom.md + - 2D Histogram Contour: 2d-histogram-contour.md + - Scientific Charts: + - Overview: scientific-charts.md + - Contour Plots: contour-plots.md + - Heatmaps: heatmaps.md + - Ternary Plots: ternary-plots.md + - Parallel Coordinates Plot: parallel-coordinates-plot.md + - Log Plots: log-plot.md + - Wind Rose and Polar Bar Charts: wind-rose-charts.md + - Ternary Contours: ternary-contour.md + - Radar Charts: radar-chart.md + - Carpet Plots: carpet-plot.md + - Carpet Scatter Plot: carpet-scatter.md + - Carpet Contour Plot: carpet-contour.md + - Polar Charts: polar-chart.md + - Financial Charts: + - Overview: financial-charts.md + - Waterfall Charts: waterfall-charts.md + - Indicators: indicator.md + - Candlestick Charts: candlestick-charts.md + - Funnel Chart: funnel-charts.md + - Time Series and Date Axes: time-series.md + - OHLC Charts: ohlc-charts.md + - Gauge Charts: gauge-charts.md + - Bullet Charts: bullet-charts.md + - Maps: + - Overview: maps.md + - Tile Map Layers: tile-map-layers.md + - Tile Density Heatmap: tile-density-heatmaps.md + - Tile Choropleth Maps: tile-county-choropleth.md + - Lines on Maps: lines-on-maps.md + - Bubble Maps: bubble-maps.md + - Scatter Plots on Maps: scatter-plots-on-maps.md + - Scatter Plots on Tile Maps: scatter-tile-maps.md + - Choropleth Maps: choropleth-maps.md + - Filled Area on Tile Maps: filled-area-on-map.md + - 3D Charts: + - Overview: 3d-charts.md + - 3D Scatter Plots: 3d-scatter-plots.md + - Ribbon Plots: ribbon-plots.md + - 3D Surface Plots: 3d-surface-plots.md + - 3D Mesh Plots: 3d-mesh.md + - 3D Line Plots: 3d-line-plots.md + - Trisurf Plots: trisurf.md + - 3D Cluster Graph: 3d-point-clustering.md + - 3D Cone Plots: cone-plot.md + - 3D Streamtube Plots: streamtube-plot.md + - 3D Isosurface Plots: 3d-isosurface-plots.md + - 3D Subplots: 3d-subplots.md + - Multiple Axes: + - Overview: multiple-axes.md + - Mixed Subplots: mixed-subplots.md + - Table and Chart Subplots: table-subplots.md + - Chart Events: + - Overview: chart-events.md + - Click Events: click-events.md + - Hover Events: hover-events.md + - Zoom Events: zoom-events.md + - Disable Zoom Events: disable-zoom.md + - Animations: + - Overview: plotly-animations.md + - Intro to Animations: animations.md + - Adding Sliders to Animations: gapminder-example.md + - Filled-Area Animation: filled-area-animation.md + - Map Animation: map-animations.md + - Advanced Options: + - Overview: advanced-opt.md + - Plot CSV Data from an Ajax Call: ajax-call.md + - Streaming: streaming.md + - Remove Trace from Plot: remove-trace.md + - LaTeX: LaTeX.md + - Controls: + - Overview: controls.md + - Dropdown Menus: dropdowns.md + - Custom Buttons: custom-buttons.md + - Sliders: sliders.md + - Lasso Selection: lasso-selection.md + - Range Slider and Selector: range-slider.md +- API Reference: + - Overview: reference/index.md + - Core Objects: + - Layout: reference/layout.md + - Simple Traces: + - Bar: reference/bar.md + - Contour: reference/contour.md + - Heatmap: reference/heatmap.md + - Image: reference/image.md + - Pie: reference/pie.md + - Scatter: reference/scatter.md + - Scatter GL: reference/scattergl.md + - Table: reference/table.md + - Distribution Traces: + - Box: reference/box.md + - Histogram: reference/histogram.md + - Histogram 2D: reference/histogram2d.md + - Histogram 2D Contour: reference/histogram2dcontour.md + - Violin: reference/violin.md + - Finance Traces: + - Candlestick: reference/candlestick.md + - Funnel: reference/funnel.md + - Funnel Area: reference/funnelarea.md + - Indicator: reference/indicator.md + - Ohlc: reference/ohlc.md + - Waterfall: reference/waterfall.md + - 3D Traces: + - Cone: reference/cone.md + - Isosurface: reference/isosurface.md + - Mesh 3D: reference/mesh3d.md + - Scatter 3D: reference/scatter3d.md + - Streamtube: reference/streamtube.md + - Surface: reference/surface.md + - Volume: reference/volume.md + - Map Traces: + - Choropleth: reference/choropleth.md + - Choropleth Map: reference/choroplethmap.md + - Choropleth Mapbox: reference/choroplethmapbox.md + - Density Map: reference/densitymap.md + - Density Mapbox: reference/densitymapbox.md + - Scatter Geo: reference/scattergeo.md + - Scatter Map: reference/scattermap.md + - Scatter Mapbox: reference/scattermapbox.md + - Specialized Traces: + - Bar Polar: reference/barpolar.md + - Carpet: reference/carpet.md + - Contour Carpet: reference/contourcarpet.md + - Icicle: reference/icicle.md + - Parallel Categories: reference/parcats.md + - Parallel Coordinates: reference/parcoords.md + - Sankey: reference/sankey.md + - Scatter Carpet: reference/scattercarpet.md + - Scatter Polar: reference/scatterpolar.md + - Scatter Polar GL: reference/scatterpolargl.md + - Scatter Smith: reference/scattersmith.md + - Scatter Ternary: reference/scatterternary.md + - SPLOM: reference/splom.md + - Sunburst: reference/sunburst.md + - Treemap: reference/treemap.md + +extra: + js_version: "3.1.0" diff --git a/pages/2D-Histogram.md b/pages/2D-Histogram.md new file mode 100644 index 00000000000..2e94bea5d2e --- /dev/null +++ b/pages/2D-Histogram.md @@ -0,0 +1,2 @@ +# 2D-Histogram +--8<-- "javascript/2D-Histogram/index.html" diff --git a/pages/2d-histogram-contour.md b/pages/2d-histogram-contour.md new file mode 100644 index 00000000000..89c7b49f767 --- /dev/null +++ b/pages/2d-histogram-contour.md @@ -0,0 +1,2 @@ +# 2d-histogram-contour +--8<-- "javascript/2d-histogram-contour/index.html" diff --git a/pages/3d-axes.md b/pages/3d-axes.md new file mode 100644 index 00000000000..696284570ef --- /dev/null +++ b/pages/3d-axes.md @@ -0,0 +1,2 @@ +# 3d-axes +--8<-- "javascript/3d-axes/index.html" diff --git a/pages/3d-charts.md b/pages/3d-charts.md new file mode 100644 index 00000000000..59f15018185 --- /dev/null +++ b/pages/3d-charts.md @@ -0,0 +1,69 @@ +## Plotly.js 3D Charts + +
+ + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/3d-scatter.jpg)](3d-scatter-plots.md) + + **3D Scatter Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/ribbon-plot.jpg)](ribbon-plots.md) + + **Ribbon Plots** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/3d-surface.jpg)](3d-surface-plots.md) + + **3D Surface Plots** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/3d-mesh.jpg)](3d-mesh.md) + + **3D Mesh Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/3d-line.jpg)](3d-line-plots.md) + + **3D Line Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/trisurf.jpg)](trisurf.md) + + **Trisurf Plots** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/3d-clusters.jpg)](3d-point-clustering.md) + + **3D Cluster Graph** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/3dcone.png)](cone-plot.md) + + **3D Cone Plots** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/streamtube.jpg)](streamtube-plot.md) + + **3D Streamtube Plots** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/isosurface.jpg)](3d-isosurface-plots.md) + + **3D Isosurface Plots** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/3d-subplots.jpg)](3d-subplots.md) + + **3D Subplots** + + +
\ No newline at end of file diff --git a/pages/3d-hover.md b/pages/3d-hover.md new file mode 100644 index 00000000000..4b63bd6d861 --- /dev/null +++ b/pages/3d-hover.md @@ -0,0 +1,2 @@ +# 3d-hover +--8<-- "javascript/3d-hover/index.html" diff --git a/pages/3d-isosurface-plots.md b/pages/3d-isosurface-plots.md new file mode 100644 index 00000000000..85ff502fef4 --- /dev/null +++ b/pages/3d-isosurface-plots.md @@ -0,0 +1,2 @@ +# 3d-isosurface-plots +--8<-- "javascript/3d-isosurface-plots/index.html" diff --git a/pages/3d-line-plots.md b/pages/3d-line-plots.md new file mode 100644 index 00000000000..33f19a49385 --- /dev/null +++ b/pages/3d-line-plots.md @@ -0,0 +1,2 @@ +# 3d-line-plots +--8<-- "javascript/3d-line-plots/index.html" diff --git a/pages/3d-mesh.md b/pages/3d-mesh.md new file mode 100644 index 00000000000..cb319c9ad88 --- /dev/null +++ b/pages/3d-mesh.md @@ -0,0 +1,2 @@ +# 3d-mesh +--8<-- "javascript/3d-mesh/index.html" diff --git a/pages/3d-point-clustering.md b/pages/3d-point-clustering.md new file mode 100644 index 00000000000..820353d11ff --- /dev/null +++ b/pages/3d-point-clustering.md @@ -0,0 +1,2 @@ +# 3d-point-clustering +--8<-- "javascript/3d-point-clustering/index.html" diff --git a/pages/3d-scatter-plots.md b/pages/3d-scatter-plots.md new file mode 100644 index 00000000000..d1be8c0a047 --- /dev/null +++ b/pages/3d-scatter-plots.md @@ -0,0 +1,2 @@ +# 3d-scatter-plots +--8<-- "javascript/3d-scatter-plots/index.html" diff --git a/pages/3d-subplots.md b/pages/3d-subplots.md new file mode 100644 index 00000000000..08e65a0384c --- /dev/null +++ b/pages/3d-subplots.md @@ -0,0 +1,2 @@ +# 3d-subplots +--8<-- "javascript/3d-subplots/index.html" diff --git a/pages/3d-surface-lighting.md b/pages/3d-surface-lighting.md new file mode 100644 index 00000000000..1717d8bb9f5 --- /dev/null +++ b/pages/3d-surface-lighting.md @@ -0,0 +1,2 @@ +# 3d-surface-lighting +--8<-- "javascript/3d-surface-lighting/index.html" diff --git a/pages/3d-surface-plots.md b/pages/3d-surface-plots.md new file mode 100644 index 00000000000..bb155b3f6ee --- /dev/null +++ b/pages/3d-surface-plots.md @@ -0,0 +1,2 @@ +# 3d-surface-plots +--8<-- "javascript/3d-surface-plots/index.html" diff --git a/pages/LaTeX.md b/pages/LaTeX.md new file mode 100644 index 00000000000..489616aa37a --- /dev/null +++ b/pages/LaTeX.md @@ -0,0 +1,2 @@ +# LaTeX +--8<-- "javascript/LaTeX/index.html" diff --git a/pages/advanced-opt.md b/pages/advanced-opt.md new file mode 100644 index 00000000000..a5502fa52b4 --- /dev/null +++ b/pages/advanced-opt.md @@ -0,0 +1,28 @@ +## Plotly.js Advanced Options + +
+ + +- [![]()](ajax-call.md) + + **Plot CSV Data from an Ajax Call** + + +- [![]()](streaming.md) + + **Streaming** + + + +- [![]()](remove-trace.md) + + **Remove Trace from Plot** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/venn.jpg)](LaTeX.md) + + **LaTeX** + + +
\ No newline at end of file diff --git a/pages/ajax-call.md b/pages/ajax-call.md new file mode 100644 index 00000000000..f6bcb9896bc --- /dev/null +++ b/pages/ajax-call.md @@ -0,0 +1,2 @@ +# ajax-call +--8<-- "javascript/ajax-call/index.html" diff --git a/pages/animations.md b/pages/animations.md new file mode 100644 index 00000000000..4fdf3d1cd4a --- /dev/null +++ b/pages/animations.md @@ -0,0 +1,2 @@ +# animations +--8<-- "javascript/animations/index.html" diff --git a/pages/axes.md b/pages/axes.md new file mode 100644 index 00000000000..27bf98abaa1 --- /dev/null +++ b/pages/axes.md @@ -0,0 +1,2 @@ +# axes +--8<-- "javascript/axes/index.html" diff --git a/pages/bar-charts.md b/pages/bar-charts.md new file mode 100644 index 00000000000..210ad5fbdbd --- /dev/null +++ b/pages/bar-charts.md @@ -0,0 +1,2 @@ +# bar-charts +--8<-- "javascript/bar-charts/index.html" diff --git a/pages/basic-charts.md b/pages/basic-charts.md new file mode 100644 index 00000000000..afedbb56b33 --- /dev/null +++ b/pages/basic-charts.md @@ -0,0 +1,77 @@ +## Plotly.js Basic Charts + +
+ +- [![](https://images.plot.ly/plotly-documentation/thumbnail/line-and-scatter.jpg)](line-and-scatter.md) + + **Scatter Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/line-plots.jpg)](line-charts.md) + + **Line Charts** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/bar.jpg)](bar-charts.md) + + **Bar Charts** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/pie-chart.jpg)](pie-charts.md) + + **Pie Charts** + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/bubble.jpg)](bubble-charts.md) + + **Bubble Charts** + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/dot-plot.jpg)](dot-plots.md) + + **Dot Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/insets.jpg)](insets.md) + + **Inset Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/area1.jpg)](filled-area-plots.md) + + **Filled Area Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/horizontal-bar.jpg)](horizontal-bar-charts.md) + + **Horizontal Bar Charts** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/sunburst.gif)](sunburst-charts.md) + + **Sunburst Charts** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/sankey.jpg)](sankey-diagram.md) + + **Sankey Diagrams** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/treemap.png)](treemaps.md) + + **Treemap Charts** + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/table.gif)](table.md) + + + **Tables** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/mixed2.jpg)](graphing-multiple-chart-types.md) + + **Multiple Chart Types** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/webgl.jpg)](webgl-vs-svg.md) + + **WebGL vs SVG** + +
\ No newline at end of file diff --git a/pages/box-plots.md b/pages/box-plots.md new file mode 100644 index 00000000000..c955009824c --- /dev/null +++ b/pages/box-plots.md @@ -0,0 +1,2 @@ +# box-plots +--8<-- "javascript/box-plots/index.html" diff --git a/pages/bubble-charts.md b/pages/bubble-charts.md new file mode 100644 index 00000000000..c6a2e3c1a40 --- /dev/null +++ b/pages/bubble-charts.md @@ -0,0 +1,2 @@ +# bubble-charts +--8<-- "javascript/bubble-charts/index.html" diff --git a/pages/bubble-maps.md b/pages/bubble-maps.md new file mode 100644 index 00000000000..8f1c9b74f52 --- /dev/null +++ b/pages/bubble-maps.md @@ -0,0 +1,2 @@ +# bubble-maps +--8<-- "javascript/bubble-maps/index.html" diff --git a/pages/bullet-charts.md b/pages/bullet-charts.md new file mode 100644 index 00000000000..f9f46408b50 --- /dev/null +++ b/pages/bullet-charts.md @@ -0,0 +1,2 @@ +# bullet-charts +--8<-- "javascript/bullet-charts/index.html" diff --git a/pages/candlestick-charts.md b/pages/candlestick-charts.md new file mode 100644 index 00000000000..e7f787ab541 --- /dev/null +++ b/pages/candlestick-charts.md @@ -0,0 +1,2 @@ +# candlestick-charts +--8<-- "javascript/candlestick-charts/index.html" diff --git a/pages/carpet-contour.md b/pages/carpet-contour.md new file mode 100644 index 00000000000..6bd4137c605 --- /dev/null +++ b/pages/carpet-contour.md @@ -0,0 +1,2 @@ +# carpet-contour +--8<-- "javascript/carpet-contour/index.html" diff --git a/pages/carpet-plot.md b/pages/carpet-plot.md new file mode 100644 index 00000000000..baf3e72f913 --- /dev/null +++ b/pages/carpet-plot.md @@ -0,0 +1,2 @@ +# carpet-plot +--8<-- "javascript/carpet-plot/index.html" diff --git a/pages/carpet-scatter.md b/pages/carpet-scatter.md new file mode 100644 index 00000000000..728efd792a6 --- /dev/null +++ b/pages/carpet-scatter.md @@ -0,0 +1,2 @@ +# carpet-scatter +--8<-- "javascript/carpet-scatter/index.html" diff --git a/pages/chart-events.md b/pages/chart-events.md new file mode 100644 index 00000000000..12dfbc9cd50 --- /dev/null +++ b/pages/chart-events.md @@ -0,0 +1,28 @@ +## Plotly.js Chart Events + +
+ + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/click.jpg)](click-events.md) + + **Click Events** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/hover.jpg)](hover-events.md) + + **Hover Events** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/zoom.jpg)](zoom-events.md) + + **Zoom Events** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/zoom.jpg)](disable-zoom.md) + + **Disable Zoom Events** + + +
\ No newline at end of file diff --git a/pages/choropleth-maps.md b/pages/choropleth-maps.md new file mode 100644 index 00000000000..c968090de1b --- /dev/null +++ b/pages/choropleth-maps.md @@ -0,0 +1,2 @@ +# choropleth-maps +--8<-- "javascript/choropleth-maps/index.html" diff --git a/pages/click-events.md b/pages/click-events.md new file mode 100644 index 00000000000..7c9d2cebe4b --- /dev/null +++ b/pages/click-events.md @@ -0,0 +1,2 @@ +# click-events +--8<-- "javascript/click-events/index.html" diff --git a/pages/colorway.md b/pages/colorway.md new file mode 100644 index 00000000000..fafb314ec85 --- /dev/null +++ b/pages/colorway.md @@ -0,0 +1,2 @@ +# colorway +--8<-- "javascript/colorway/index.html" diff --git a/pages/cone-plot.md b/pages/cone-plot.md new file mode 100644 index 00000000000..021f59e636f --- /dev/null +++ b/pages/cone-plot.md @@ -0,0 +1,2 @@ +# cone-plot +--8<-- "javascript/cone-plot/index.html" diff --git a/pages/configuration-options.md b/pages/configuration-options.md new file mode 100644 index 00000000000..87b30382ad7 --- /dev/null +++ b/pages/configuration-options.md @@ -0,0 +1,2 @@ +# configuration-options +--8<-- "javascript/configuration-options/index.html" diff --git a/pages/continuous-error-bars.md b/pages/continuous-error-bars.md new file mode 100644 index 00000000000..fda27338b5f --- /dev/null +++ b/pages/continuous-error-bars.md @@ -0,0 +1,2 @@ +# continuous-error-bars +--8<-- "javascript/continuous-error-bars/index.html" diff --git a/pages/contour-plots.md b/pages/contour-plots.md new file mode 100644 index 00000000000..81a073b29ff --- /dev/null +++ b/pages/contour-plots.md @@ -0,0 +1,2 @@ +# contour-plots +--8<-- "javascript/contour-plots/index.html" diff --git a/pages/controls.md b/pages/controls.md new file mode 100644 index 00000000000..c8a56b03dd8 --- /dev/null +++ b/pages/controls.md @@ -0,0 +1,33 @@ +## Plotly.js Custom Controls + +
+ + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/dropdown.jpg)](dropdowns.md) + + **Dropdown Menus** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/custom-buttons.jpg)](custom-buttons.md) + + **Custom Buttons** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/slider-component.jpg)](sliders.md) + + **Sliders** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/lasso.jpg)](lasso-selection.md) + + **Lasso Selection** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/sliders.jpg)](range-slider.md) + + **Range Slider and Selector** + + +
\ No newline at end of file diff --git a/pages/css/code-highlight.css b/pages/css/code-highlight.css new file mode 100644 index 00000000000..89294acf65b --- /dev/null +++ b/pages/css/code-highlight.css @@ -0,0 +1,61 @@ +/* Light mode (Material default) */ +[data-md-color-scheme="default"] { + --code-bg: #f6f8fa; + --code-fg: #24292e; + --code-keyword: #f34705; + --code-string: #5caaff; + --code-number: #72a125; + --code-comment: #7f7f7f; + --code-function: #6f42c1; + --code-operator: #d73a49; +} + +/* Dark mode (Material “slate”) */ +[data-md-color-scheme="slate"] { + --code-bg: #1e1e1e; + --code-fg: #d4d4d4; + --code-keyword: #c586c0; + --code-string: #ce9178; + --code-number: #b5cea8; + --code-comment: #6a9955; + --code-function: #dcdcaa; + --code-operator: #569cd6; +} + +/* Token styling */ +.hljs-keyword, +.language-python .keyword, +.language-js .keyword { + color: var(--code-keyword); +} + +.hljs-string, +.language-python .string, +.language-js .string { + color: var(--code-string); +} + +.hljs-number, +.language-python .number, +.language-js .number { + color: var(--code-number); +} + +.hljs-comment, +.language-python .comment, +.language-js .comment { + color: var(--code-comment); + font-style: italic; +} + +.hljs-function, +.language-python .function, +.language-js .function { + color: var(--code-function); +} + +.hljs-operator, +.language-python .operator, +.language-js .operator { + color: var(--code-operator); +} diff --git a/pages/css/extra_css.css b/pages/css/extra_css.css new file mode 100644 index 00000000000..cfd56892be7 --- /dev/null +++ b/pages/css/extra_css.css @@ -0,0 +1,418 @@ +.md-nav--primary { + position: relative; + display: flex; + flex-direction: column; +} + +.nav-bottom-image{ + position: sticky; + bottom: 0; + z-index: 10; + background: var(--md-default-bg-color); + padding: 30px 25px 0px 25px; + /* height: 12.1rem; */ +} + +.nav-bottom-image img{ + height: auto !important; + width: 100%; + object-fit: contain; +} + +.nav-bottom-image a::after { + font-size: 1em !important; +} + +.bottom-dash-img img { + margin-top: 20px; +} + +/* .bottom-dash-img::after { + display: none; +} */ + +/* Footer Styling */ + +.--footer-top { + -webkit-box-flex: 0; + padding: 20px; + width: 100%; +} + +.--footer-column h6 { + /* color: #3f3f3f; */ + position: relative; + margin: 0; + padding-bottom: 15px; + margin-bottom: 15px; + font-size: 14px; + padding-top: 20px; + display: block; + font-weight: bold !important; +} + +.md-footer { + background-color: var(--md-default-bg-color); +} + +.md-footer ul{ + list-style-type: none; + margin: 0; + padding: 0; +} + +.--footer-body { + -webkit-box-flex: 0; + display: flex; + list-style: none; + flex-wrap: wrap; + width: 100%; + margin: 0; + padding: 0; + margin-bottom: 10px; +} +.--footer-column { + -webkit-box-flex: 1; + flex: 1 1 20%; + padding: 10px; + min-width: 125px; +} + +.--footer-column ul a { + color: #626262; + display: inline-block; + margin: 2px 0; +} + +.--footer-column ul a::after { + display: none; +} + +.--footer-column ul a:link:not(.button){ + position: relative; + opacity: 0.95; + font-weight: 400; + color: #3f3f3f; + font-size: 14px; +} + + +@media screen and (max-width:1023px){ + .--footer-column { + -webkit-box-flex: 1; + flex: 1 1 33.3333%; + max-width: 33.3333%; + } +} + +@media screen and (min-width: 1200px){ + .--footer-body { + flex-wrap: nowrap; + } +} + +.subscribe-text { + margin-block-start: 0em; + font-size: 100%; + color: #626262; +} + +.subscribe-button { + background-color: #2186f4; + border-radius: 1.22rem; + color: #fff !important; + cursor: pointer; + font-style: italic; + font-size: 12.8px; + line-height: 1.2; + letter-spacing: 1.33px; + outline: none; + padding: .35rem .72rem; + text-align: center; + text-decoration: none; + text-transform: uppercase; + transition: background-color .2s ease-in-out; +} + +.--footer-meta { + -webkit-box-flex: 0; + padding: 20px; + font-size: 0.65rem; + font-weight: 400; + width: 100%; + border-top: none; +} + +.--footer-meta a:link:not(.button){ + position: relative; + opacity: 0.95; + margin-left: 20px; +} + +.--footer-meta a { + font-weight: 400; + display: inline-block; + margin-left: 20px; + color: #3f3f3f; + margin: 2px 0; +} + +.--footer-meta a::after { + display: none; +} + +.--footer-meta .--wrap { + display: flex; + -webkit-box-pack: justify; + justify-content: space-between; + -webkit-box-align: center; + align-items: center; + opacity: 0.8; + width: 100%; + max-width: 100%; + margin: auto; +} + +.--copyright { + color: #3f3f3f; +} + +.--footer-meta .right { + display: flex; +} + +article { + display: block; +} + +.md-footer-meta__inner { + max-width: 100% !important; +} + +/* Header Styling */ + +.download-studio-btn { + display: inline-block; + font-weight: bold; + background: #7A76FF; + color: white; + padding: 8px 16px; + border-radius: 8px; + text-decoration: none; + transition: background 0.3s ease; +} + +.md-header__inner { + margin: 0; + max-width: 100% !important; +} + +.md-header__title { + margin-left: 0 !important; +} + +.md-header__inner a { + font-weight: 600; + font-size: 0.65rem; +} + +.md-header__button.md-logo { + margin-left: 1.6rem; +} + +.md-header__inner ul a::after { + display: none; +} + +.md-header__inner ul{ + list-style-type: none; + display: flex; + margin: 0; + padding: 0; +} + +.md-header-ul li{ + margin-right: 24px; +} + +.md-header__inner ul li{ + padding: 5px; + display: flex; + -webkit-box-pack: center; + justify-content: center; + -webkit-box-align: center; + align-items: center; + text-align: center; +} + +.md-header__source a.md-source::after { + color: white !important; +} + +@media screen and (max-width: 415px){ + .md-header__inner ul{ + display: none; + } + +} + +/* Page Element Styling */ + +/* .plotlyjs-download::after { + display: none; +} */ + +div.row { + margin-left: 0; + padding-left: 0; + display: flex; + width: 100%; + flex-wrap: wrap; +} + +.more-examples { + padding: 10px; + text-decoration: none; + background: #f4f4f8; + border: 1px solid #e7e7e7; + margin-right: 10px; + display: block; + margin-top: 10px; +} + +section.sponsor--wrap { + display: flex; + margin-top: 20px; + padding: 40px; + background: #f4f4f8; + max-width: 1400px; + -webkit-box-pack: center; + justify-content: center; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + flex-direction: column; + -webkit-box-align: center; + align-items: center; +} + +.z-depth-1 { + width: 100%; +} + +fieldset.signatures { + margin: 0 0; + width: 100%; + padding: 0 30px; +} + +fieldset.signatures legend { + padding: 5px; + font-size: 16px; +} + +.cp_embed_wrapper { + width: 100%; + margin-top: 20px; +} + +/* Grid Styling */ + +/* 4 cards per row on large screens */ +.grid { + grid-template-columns: repeat(4, 1fr) !important; + gap: 1rem; +} + +/* 3 cards per row on medium-large screens (tablets landscape) */ +@media screen and (max-width: 960px) { + .grid { + grid-template-columns: repeat(3, 1fr) !important; + } +} + +/* 2 cards per row on tablets */ +@media screen and (max-width: 44.984375em) { + .grid { + grid-template-columns: repeat(2, 1fr) !important; + } +} + +.grid.cards > :is(ul, ol) > li img { + width: 100%; + height: 130px; + object-fit: contain; +} + +.grid.cards > :is(ul, ol) > li { + padding-bottom: 10px !important; +} + +.grid.cards > :is(ul, ol) > li p { + font-size: 0.7rem !important; + min-height: 2.2rem; + margin-bottom: 0; + /* margin-top: 0; */ + text-align: center; +} + +/* .grid.cards > :is(ul, ol) > li a::after { + display: none; +} */ + +/* Hamburger menu styling */ + +@media screen and (max-width: 76.2344em) { + .md-nav--primary .md-nav__title[for=__drawer] { + background-color: var(--plotly-primary-light) !important; + } +} + +@media screen and (max-width: 59.9844em) { + .md-nav__source { + background-color: #3D2B7A !important; + } + + .md-nav__source a.md-source::after { + color: white !important; + } +} + +/* Dark mode styling */ + +[data-md-color-scheme="slate"] .--footer-column h6 { + color: #a0aaba !important; +} + + +[data-md-color-scheme="slate"] .--footer-column ul a { + color: #a0aaba; +} + +[data-md-color-scheme="slate"] .--footer-meta a { + color: #a0aaba; +} + +[data-md-color-scheme="slate"] .--copyright { + color: #a0aaba; +} + +[data-md-color-scheme="slate"] .subscribe-text { + color: #a0aaba; +} + + +/* Edit button styling */ + +.edit-btn a{ + display: flex; + justify-content: right; +} + +.edit-btn a span { + margin-left: 10px; +} + +.edit-btn .icon { + display: flex; + align-items: center; +} \ No newline at end of file diff --git a/pages/custom-buttons.md b/pages/custom-buttons.md new file mode 100644 index 00000000000..30e2e3a3975 --- /dev/null +++ b/pages/custom-buttons.md @@ -0,0 +1,2 @@ +# custom-buttons +--8<-- "javascript/custom-buttons/index.html" diff --git a/pages/disable-zoom.md b/pages/disable-zoom.md new file mode 100644 index 00000000000..14e76cfdee2 --- /dev/null +++ b/pages/disable-zoom.md @@ -0,0 +1,2 @@ +# disable-zoom +--8<-- "javascript/disable-zoom/index.html" diff --git a/pages/dot-plots.md b/pages/dot-plots.md new file mode 100644 index 00000000000..2452abf34c4 --- /dev/null +++ b/pages/dot-plots.md @@ -0,0 +1,2 @@ +# dot-plots +--8<-- "javascript/dot-plots/index.html" diff --git a/pages/dropdowns.md b/pages/dropdowns.md new file mode 100644 index 00000000000..d0a7769c551 --- /dev/null +++ b/pages/dropdowns.md @@ -0,0 +1,2 @@ +# dropdowns +--8<-- "javascript/dropdowns/index.html" diff --git a/pages/error-bars.md b/pages/error-bars.md new file mode 100644 index 00000000000..0eead5ed744 --- /dev/null +++ b/pages/error-bars.md @@ -0,0 +1,2 @@ +# error-bars +--8<-- "javascript/error-bars/index.html" diff --git a/pages/figure-labels.md b/pages/figure-labels.md new file mode 100644 index 00000000000..50ed3fda362 --- /dev/null +++ b/pages/figure-labels.md @@ -0,0 +1,2 @@ +# figure-labels +--8<-- "javascript/figure-labels/index.html" diff --git a/pages/filled-area-animation.md b/pages/filled-area-animation.md new file mode 100644 index 00000000000..f5d686436dc --- /dev/null +++ b/pages/filled-area-animation.md @@ -0,0 +1,2 @@ +# filled-area-animation +--8<-- "javascript/filled-area-animation/index.html" diff --git a/pages/filled-area-on-map.md b/pages/filled-area-on-map.md new file mode 100644 index 00000000000..9ca33a82d61 --- /dev/null +++ b/pages/filled-area-on-map.md @@ -0,0 +1,2 @@ +# filled-area-on-map +--8<-- "javascript/filled-area-on-map/index.html" diff --git a/pages/filled-area-plots.md b/pages/filled-area-plots.md new file mode 100644 index 00000000000..68fc1889596 --- /dev/null +++ b/pages/filled-area-plots.md @@ -0,0 +1,2 @@ +# filled-area-plots +--8<-- "javascript/filled-area-plots/index.html" diff --git a/pages/financial-charts.md b/pages/financial-charts.md new file mode 100644 index 00000000000..f6c78c73a7f --- /dev/null +++ b/pages/financial-charts.md @@ -0,0 +1,52 @@ +## Plotly.js Financial Charts + +
+ + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/waterfall-charts.jpg)](waterfall-charts.md) + + **Waterfall Charts** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/indicator.jpg)](indicator.md) + + **Indicators** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/candlestick.jpg)](candlestick-charts.md) + + **Candlestick Charts** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/funnel.jpg)](funnel-charts.md) + + **Funnel Chart** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/time-series.jpg)](time-series.md) + + **Time Series and Date Axes** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/ohlc.jpg)](ohlc-charts.md) + + **OHLC Charts** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/gauge.jpg)](gauge-charts.md) + + **Gauge Charts** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/bullet.png)](bullet-charts.md) + + **Bullet Charts** + + +
\ No newline at end of file diff --git a/pages/font.md b/pages/font.md new file mode 100644 index 00000000000..b1ddeb886f9 --- /dev/null +++ b/pages/font.md @@ -0,0 +1,2 @@ +# font +--8<-- "javascript/font/index.html" diff --git a/pages/funnel-charts.md b/pages/funnel-charts.md new file mode 100644 index 00000000000..aaf56871953 --- /dev/null +++ b/pages/funnel-charts.md @@ -0,0 +1,2 @@ +# funnel-charts +--8<-- "javascript/funnel-charts/index.html" diff --git a/pages/gapminder-example.md b/pages/gapminder-example.md new file mode 100644 index 00000000000..27584f3f277 --- /dev/null +++ b/pages/gapminder-example.md @@ -0,0 +1,2 @@ +# gapminder-example +--8<-- "javascript/gapminder-example/index.html" diff --git a/pages/gauge-charts.md b/pages/gauge-charts.md new file mode 100644 index 00000000000..616740ce15e --- /dev/null +++ b/pages/gauge-charts.md @@ -0,0 +1,2 @@ +# gauge-charts +--8<-- "javascript/gauge-charts/index.html" diff --git a/pages/getting-started.md b/pages/getting-started.md new file mode 100644 index 00000000000..6d9d7731b99 --- /dev/null +++ b/pages/getting-started.md @@ -0,0 +1,97 @@ +# Getting Started + +
+

NPM

+
+

+ You can install Plotly.js from NPM via npm install plotly.js-dist or yarn add plotly.js-dist +

+ +
+ +
+

plotly.js CDN

+
+

+ You can also use the ultrafast plotly.js CDN link. This CDN is graciously provided by the incredible team at Fastly. +

+ +
<head>
+    <script src="https://cdn.plot.ly/plotly-{{ js_version }}.min.js" charset="utf-8"></script>
+</head>
+ +
+
+ +
+

Download

+
+

+ Download the minified plotly.js source code and dependencies. +

+ +

+ Include the downloaded scripts before the end of the </head> tag in your HTML document: +

+ +
<head>
+	<script src="plotly-{{ js_version }}.min.js" charset="utf-8"></script>
+</head>
+
+ +
+ +

+ + Download plotly.js +

+ +
+ +
+

Start plotting!

+
+

+ In your HTML document, create an empty DIV to draw the graph in: +

+ +
<div id="tester" style="width:600px;height:250px;"></div>
+ +

+ Now you can make interactive plotly.js charts using Plotly.newPlot(). +

+
<script>
+	TESTER = document.getElementById('tester');
+	Plotly.newPlot( TESTER, [{
+	x: [1, 2, 3, 4, 5],
+	y: [1, 2, 4, 8, 16] }], {
+	margin: { t: 0 } } );
+</script>
+ +

+ Now you can pass Plotly.newPlot() either the ID of the DIV ("tester") or the DIV DOM element (TESTER). +

+ +
+
+ +
+

Hello World Example

+
+ +
+
+ + + + \ No newline at end of file diff --git a/pages/graphing-multiple-chart-types.md b/pages/graphing-multiple-chart-types.md new file mode 100644 index 00000000000..4bdb0b4f565 --- /dev/null +++ b/pages/graphing-multiple-chart-types.md @@ -0,0 +1,2 @@ +# graphing-multiple-chart-types +--8<-- "javascript/graphing-multiple-chart-types/index.html" diff --git a/pages/heatmaps.md b/pages/heatmaps.md new file mode 100644 index 00000000000..55b63c01ff2 --- /dev/null +++ b/pages/heatmaps.md @@ -0,0 +1,2 @@ +# heatmaps +--8<-- "javascript/heatmaps/index.html" diff --git a/pages/histograms.md b/pages/histograms.md new file mode 100644 index 00000000000..7fe04dbe932 --- /dev/null +++ b/pages/histograms.md @@ -0,0 +1,2 @@ +# histograms +--8<-- "javascript/histograms/index.html" diff --git a/pages/horizontal-bar-charts.md b/pages/horizontal-bar-charts.md new file mode 100644 index 00000000000..d1e39744e62 --- /dev/null +++ b/pages/horizontal-bar-charts.md @@ -0,0 +1,2 @@ +# horizontal-bar-charts +--8<-- "javascript/horizontal-bar-charts/index.html" diff --git a/pages/horizontal-legend.md b/pages/horizontal-legend.md new file mode 100644 index 00000000000..cdd72305755 --- /dev/null +++ b/pages/horizontal-legend.md @@ -0,0 +1,2 @@ +# horizontal-legend +--8<-- "javascript/horizontal-legend/index.html" diff --git a/pages/hover-events.md b/pages/hover-events.md new file mode 100644 index 00000000000..22a9f641224 --- /dev/null +++ b/pages/hover-events.md @@ -0,0 +1,2 @@ +# hover-events +--8<-- "javascript/hover-events/index.html" diff --git a/pages/hover-text-and-formatting.md b/pages/hover-text-and-formatting.md new file mode 100644 index 00000000000..0fad668fdc2 --- /dev/null +++ b/pages/hover-text-and-formatting.md @@ -0,0 +1,2 @@ +# hover-text-and-formatting +--8<-- "javascript/hover-text-and-formatting/index.html" diff --git a/pages/images.md b/pages/images.md new file mode 100644 index 00000000000..2bc1094851f --- /dev/null +++ b/pages/images.md @@ -0,0 +1,2 @@ +# images +--8<-- "javascript/images/index.html" diff --git a/pages/index.md b/pages/index.md new file mode 100644 index 00000000000..656cfa3b605 --- /dev/null +++ b/pages/index.md @@ -0,0 +1 @@ +{!../README.md!} \ No newline at end of file diff --git a/pages/indicator.md b/pages/indicator.md new file mode 100644 index 00000000000..9202cbdccde --- /dev/null +++ b/pages/indicator.md @@ -0,0 +1,2 @@ +# indicator +--8<-- "javascript/indicator/index.html" diff --git a/pages/insets.md b/pages/insets.md new file mode 100644 index 00000000000..311cd4e7819 --- /dev/null +++ b/pages/insets.md @@ -0,0 +1,2 @@ +# insets +--8<-- "javascript/insets/index.html" diff --git a/pages/is-plotly-free.md b/pages/is-plotly-free.md new file mode 100644 index 00000000000..8ddc6eda7d0 --- /dev/null +++ b/pages/is-plotly-free.md @@ -0,0 +1,33 @@ +--- +name: Is Plotly.js Free? +permalink: javascript/is-plotly-free/ +redirect_from: javascript/open-source-announcement/ +description: Plotly's open-source graphing libraries are free to use, work offline and don't require any account registration. Plotly also has a commercial offering called Dash Enterprise. +layout: base +no_in_language: true +language: plotly_js +--- + +### Is Plotly.js Free? + +     **Yes.**   Plotly.js is free and open-source software, [licensed under the **MIT license**](https://github.com/plotly/plotly.js/blob/master/LICENSE). It costs nothing to [install and use](getting-started.md). You can view the source, report issues or contribute using [our Github repository](https://github.com/plotly/plotly.js). + + +### Can I use Plotly.js without signing up to any service? + +    **Yes.**   You can use Plotly.js to make, view, and distribute charts and maps without registering for any service, +obtaining any token, or creating any account. The one exception is that to view tile maps +which use tiles from the Mapbox service (which is optional, as [you can use other tile servers](../mapbox-layers/)), you will need to have a Mapbox token. + +### Can I use Plotly.js offline, without being connected to the internet? + +    **Yes.**   You can use Plotly.js to make, view, and distribute graphics totally offline. The one exception is that to view tile maps +which use tiles from a cloud-hosted service, such as Open Street Maps or Mapbox, you will need a connection to that service. You can view tile maps totally offline if you run your own local tile server and [use its tiles](../mapbox-layers/). + +### Is Dash free? + +    **Yes.**   Plotly's [Dash](https://plotly.com/dash) analytics application framework is also free and open-source software, licensed under the **MIT license**. + +### Does Plotly also make commercial software? + +    **Yes.**   Plotly has commercial offerings such as [Dash Enterprise](https://plotly.com/dash). diff --git a/pages/javascript/highlight.js b/pages/javascript/highlight.js new file mode 100644 index 00000000000..341a39c5f54 --- /dev/null +++ b/pages/javascript/highlight.js @@ -0,0 +1,6 @@ +document$.subscribe(function() { + // Highlight all the javascript code blocks + document.querySelectorAll('pre code[class*="language-"]').forEach((block) => { + hljs.highlightElement(block); + }); +}); \ No newline at end of file diff --git a/pages/lasso-selection.md b/pages/lasso-selection.md new file mode 100644 index 00000000000..422db9d6d54 --- /dev/null +++ b/pages/lasso-selection.md @@ -0,0 +1,2 @@ +# lasso-selection +--8<-- "javascript/lasso-selection/index.html" diff --git a/pages/layout-template.md b/pages/layout-template.md new file mode 100644 index 00000000000..a7577c42851 --- /dev/null +++ b/pages/layout-template.md @@ -0,0 +1,2 @@ +# layout-template +--8<-- "javascript/layout-template/index.html" diff --git a/pages/legend.md b/pages/legend.md new file mode 100644 index 00000000000..1b8280aa0e9 --- /dev/null +++ b/pages/legend.md @@ -0,0 +1,2 @@ +# legend +--8<-- "javascript/legend/index.html" diff --git a/pages/line-and-scatter.md b/pages/line-and-scatter.md new file mode 100644 index 00000000000..b5403596926 --- /dev/null +++ b/pages/line-and-scatter.md @@ -0,0 +1,2 @@ +# line-and-scatter +--8<-- "javascript/line-and-scatter/index.html" diff --git a/pages/line-charts.md b/pages/line-charts.md new file mode 100644 index 00000000000..4d8177c044d --- /dev/null +++ b/pages/line-charts.md @@ -0,0 +1,2 @@ +# line-charts +--8<-- "javascript/line-charts/index.html" diff --git a/pages/lines-on-maps.md b/pages/lines-on-maps.md new file mode 100644 index 00000000000..d3dd1d08cf5 --- /dev/null +++ b/pages/lines-on-maps.md @@ -0,0 +1,2 @@ +# lines-on-maps +--8<-- "javascript/lines-on-maps/index.html" diff --git a/pages/log-plot.md b/pages/log-plot.md new file mode 100644 index 00000000000..145e7f25a56 --- /dev/null +++ b/pages/log-plot.md @@ -0,0 +1,2 @@ +# log-plot +--8<-- "javascript/log-plot/index.html" diff --git a/pages/map-animations.md b/pages/map-animations.md new file mode 100644 index 00000000000..9f0a64d17c3 --- /dev/null +++ b/pages/map-animations.md @@ -0,0 +1,2 @@ +# map-animations +--8<-- "javascript/map-animations/index.html" diff --git a/pages/maps.md b/pages/maps.md new file mode 100644 index 00000000000..2945f08b7df --- /dev/null +++ b/pages/maps.md @@ -0,0 +1,55 @@ +## Plotly.js Maps + +
+ + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/mapbox-layers.png)](tile-map-layers.md) + + **Tile Map Layers** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/mapbox-density.png)](tile-density-heatmaps.md) + + **Tile Density Heatmap** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/mapbox-choropleth.png)](tile-county-choropleth.md) + + **Tile Choropleth Maps** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/flight-paths.jpg)](lines-on-maps.md) + + **Lines on Maps** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/bubble-map.jpg)](bubble-maps.md) + + **Bubble Maps** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/scatter-plot-on-maps.jpg)](scatter-plots-on-maps.md) + + **Scatter Plots on Maps** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/scatter-mapbox.jpg)](scatter-tile-maps.md) + + **Scatter Plots on Tile Maps** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/choropleth.jpg)](choropleth-maps.md) + + **Choropleth Maps** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/area.jpg)](filled-area-on-map.md) + + **Filled Area on Tile Maps** + + + +
\ No newline at end of file diff --git a/pages/mixed-subplots.md b/pages/mixed-subplots.md new file mode 100644 index 00000000000..e442ae238f6 --- /dev/null +++ b/pages/mixed-subplots.md @@ -0,0 +1,2 @@ +# mixed-subplots +--8<-- "javascript/mixed-subplots/index.html" diff --git a/pages/multiple-axes.md b/pages/multiple-axes.md new file mode 100644 index 00000000000..40c7e546e6c --- /dev/null +++ b/pages/multiple-axes.md @@ -0,0 +1,2 @@ +# multiple-axes +--8<-- "javascript/multiple-axes/index.html" diff --git a/pages/ohlc-charts.md b/pages/ohlc-charts.md new file mode 100644 index 00000000000..61aed0445e5 --- /dev/null +++ b/pages/ohlc-charts.md @@ -0,0 +1,2 @@ +# ohlc-charts +--8<-- "javascript/ohlc-charts/index.html" diff --git a/pages/overrides/main.html b/pages/overrides/main.html new file mode 100644 index 00000000000..1ebde6adb20 --- /dev/null +++ b/pages/overrides/main.html @@ -0,0 +1,96 @@ +{% extends "base.html" %} + +{% block site_nav %} + + + {% if nav %} + {% if page and page.meta and page.meta.hide %} + {% set hidden = "hidden" if "navigation" in page.meta.hide %} + {% endif %} + + {% endif %} + + + {% if not "toc.integrate" in features %} + {% if page and page.meta and page.meta.hide %} + {% set hidden = "hidden" if "toc" in page.meta.hide %} + {% endif %} + + {% endif %} +{% endblock %} + +{% block content %} + +{% if page.file.src_path != "index.md" and not page.url.startswith('reference/') and +not page.url.endswith(('plotly-fundamentals/', 'basic-charts/', +'statistical-charts/', 'scientific-charts/', 'financial-charts/', +'maps/', '3d-charts/', 'multiple-axes/', 'chart-events/', 'plotly-animations/', +'advanced-opt/', 'controls/')) %} +{% set filename = page.file.src_path.split('/')[-1] %} + +{% endif %} + +
+

Plotly Studio: Transform any dataset into an interactive data application in minutes with AI. Try + Plotly Studio now.

+
+
+{{ super() }} + +{% if not page.url.startswith('reference/') %} +

Dash your way to interactive web apps

+{% endif %} + +{% endblock %} \ No newline at end of file diff --git a/pages/overrides/partials/footer.html b/pages/overrides/partials/footer.html new file mode 100644 index 00000000000..9a704848664 --- /dev/null +++ b/pages/overrides/partials/footer.html @@ -0,0 +1,76 @@ +{% import "partials/language.html" as lang with context %} + \ No newline at end of file diff --git a/pages/overrides/partials/header.html b/pages/overrides/partials/header.html new file mode 100644 index 00000000000..6b6a7aa4bad --- /dev/null +++ b/pages/overrides/partials/header.html @@ -0,0 +1,80 @@ +{#- + This file was automatically generated - do not edit +-#} +{% set class = "md-header" %} +{% if "navigation.tabs.sticky" in features %} + {% set class = class ~ " md-header--shadow md-header--lifted" %} +{% elif "navigation.tabs" not in features %} + {% set class = class ~ " md-header--shadow" %} +{% endif %} +
+ + {% if "navigation.tabs.sticky" in features %} + {% if "navigation.tabs" in features %} + {% include "partials/tabs.html" %} + {% endif %} + {% endif %} +
\ No newline at end of file diff --git a/pages/parallel-categories-diagram.md b/pages/parallel-categories-diagram.md new file mode 100644 index 00000000000..02bb6a62ade --- /dev/null +++ b/pages/parallel-categories-diagram.md @@ -0,0 +1,2 @@ +# parallel-categories-diagram +--8<-- "javascript/parallel-categories-diagram/index.html" diff --git a/pages/parallel-coordinates-plot.md b/pages/parallel-coordinates-plot.md new file mode 100644 index 00000000000..7831f749cb6 --- /dev/null +++ b/pages/parallel-coordinates-plot.md @@ -0,0 +1,2 @@ +# parallel-coordinates-plot +--8<-- "javascript/parallel-coordinates-plot/index.html" diff --git a/pages/pie-charts.md b/pages/pie-charts.md new file mode 100644 index 00000000000..2849d77f121 --- /dev/null +++ b/pages/pie-charts.md @@ -0,0 +1,2 @@ +# pie-charts +--8<-- "javascript/pie-charts/index.html" diff --git a/pages/plotly-animations.md b/pages/plotly-animations.md new file mode 100644 index 00000000000..413a9606c8f --- /dev/null +++ b/pages/plotly-animations.md @@ -0,0 +1,28 @@ +## Plotly.js Animations + +
+ + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/animations.gif)](animations.md) + + **Intro to Animations** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/gapminder_animation.gif)](gapminder-example.md) + + **Adding Sliders to Animations** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/apple_stock_animation.gif)](filled-area-animation.md) + + **Filled-Area Animation** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/map-animation.gif)](map-animations.md) + + **Map Animation** + + +
\ No newline at end of file diff --git a/pages/plotly-fundamentals.md b/pages/plotly-fundamentals.md new file mode 100644 index 00000000000..f4fea3ed23c --- /dev/null +++ b/pages/plotly-fundamentals.md @@ -0,0 +1,165 @@ +## Plotly.js Fundamentals + +
+ +- [![](https://images.plot.ly/plotly-documentation/thumbnail/modebar-icons.png)](configuration-options.md) + + **Configuration Options** + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/uirevision.gif)](responsive-fluid-layout.md) + + **Responsive / Fluid Layouts** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/fluid-layout.gif)](uirevision.md) + + **uirevision in Plotly.react** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/react.png)](react.md) + + **React Plotly.js** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/dash_apps.png)](https://dash.plotly.com/) + + **Analytical Apps with Dash** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/colorway.jpg)](colorway.md) + + **Colorway** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/images.png)](images.md) + + **Images** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/theming-and-templates.png)](3d-axes.md) + + **3D Axes** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/subplots.jpg)](3d-hover.md) + + **3D Hover Options** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/3d-surface.jpg)](3d-surface-lighting.md) + + **3D Surface Lighting** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/axes.png)](axes.md) + + **Axes** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/images.png)](horizontal-legend.md) + + **Horizontal Legends** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/hover-text.png)](hover-text-and-formatting.md) + + **Hover Text and Formatting** + + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/figure-labels.png)](figure-labels.md) + + **Setting the Title, Legend Entries, and Axis Titles** + + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/plotly-express.png)](layout-template.md) + + **Layout Template Examples** + + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/legends.gif)](legend.md) + + **Legends** + + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/multiple-axes.jpg)](setting-graph-size.md) + + **Setting Graph Size** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/hover.jpg)](tick-formatting.md) + + **Formatting Ticks** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/shape.jpg)](shapes.md) + + **Shapes** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/texttemplate.jpg)](texttemplate.md) + + **Text Template** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/text-and-annotations.png)](text-and-annotations.md) + + **Text and Annotations** + + + + +- [![]()](font.md) + + **Text and Font Styling** + + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/multiple-axes.jpg)](multiple-axes.md) + + **Multiple Axes** + + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/subplots.jpg)](subplots.md) + + **Subplots** + + + +
diff --git a/pages/plotlyjs-events.md b/pages/plotlyjs-events.md new file mode 100644 index 00000000000..a7d2996b7c2 --- /dev/null +++ b/pages/plotlyjs-events.md @@ -0,0 +1,2 @@ +# plotlyjs-events +--8<-- "javascript/plotlyjs-events/index.html" diff --git a/pages/plotlyjs-function-reference.md b/pages/plotlyjs-function-reference.md new file mode 100644 index 00000000000..bcee6bacf43 --- /dev/null +++ b/pages/plotlyjs-function-reference.md @@ -0,0 +1,650 @@ +### Common Parameters + +`graphDiv` + +The functions documented here all create or modify a plot that is drawn into a `
` element on the page, commonly referred to as `graphDiv` or `plotDiv`. The first argument to each function on this page is a reference to this element, and it can be either a DOM node, i.e. the output of `document.getElementById()`, or a string, in which case it will be treated as the `id` of the `div`. A note on sizing: You can either supply height and width in the `layout` object (see below), or give the `
` a height and width in CSS. + +`data` + +The data to be plotted is described in an array usually called `data`, whose elements are trace objects of various types (e.g. `scatter`, `bar` etc) as documented [in the Full Reference](/reference/index.md). + +`layout` + +The layout of the plot – non-data-related visual attributes such as the title, annotations etc – is described in an object usually called `layout`, as documented [in the Full Reference](/reference/layout.md). + +`config` + +High-level configuration options for the plot, such as the scroll/zoom/hover behaviour, is described in an object usually called `config`, as [documented here](configuration-options.md). The difference between `config` and `layout` is that `layout` relates to the content of the plot, whereas `config` relates to the context in which the plot is being shown. + +`frames` + +Animation frames are described in an object usually called `frames` as per the [example here](gapminder-example.md). They can contain `data` and `layout` objects, which define any changes to be animated, and a `traces` object that defines which traces to animate. Additionally, frames containing `name` and/or `group` attributes can be referenced by [Plotly.animate](#plotlyanimate) after they are added by [Plotly.addFrames](#plotlyaddframes) + + +### Plotly.newPlot + +Draws a new plot in an `
` element, *overwriting any existing plot*. To update an existing plot in a `
`, it is much more efficient to use [`Plotly.react`](#plotlyreact) than to overwrite it. +
+
+Signature + +`Plotly.newPlot(graphDiv, data, layout, config)` + + `graphDiv` + + DOM node or string id of a DOM node + + `data` + + array of objects, see [documentation](/reference/index.md) + (defaults to `[]`) + + `layout` + + object, see [documentation](/reference/layout.md) + (defaults to `{}`) + + `config` + + object, see [documentation](configuration-options.md) + (defaults to `{}`) + +`Plotly.newPlot(graphDiv, obj)` + + `graphDiv` + + DOM node or string id of a DOM node + + `obj` + + single object with keys for `data`, `layout`, `config` and `frames`, see above for contents + (defaults to `{data: [], layout: {}, config: {}, frames: []}`) + +
+
+ + +After plotting, the `data` or `layout` can always be retrieved from the `
` element in which the plot was drawn: +

+var graphDiv = document.getElementById('id_of_the_div')
+
+var data = [{
+  x: [1999, 2000, 2001, 2002],
+  y: [10, 15, 13, 17],
+  type: 'scatter'
+}];
+
+var layout = {
+  title: {
+    text: 'Sales Growth'
+  },
+  xaxis: {
+    title: {
+      text: 'Year'
+    },
+    showgrid: false,
+    zeroline: false
+  },
+  yaxis: {
+    title: {
+      text: 'Percent'
+    },
+    showline: false
+  }
+};
+Plotly.newPlot(graphDiv, data, layout);
+
+...
+var dataRetrievedLater = graphDiv.data;
+var layoutRetrievedLater = graphDiv.layout;
+
+ + +### Plotly.react + +`Plotly.react` has the same signature as [`Plotly.newPlot`](#plotlynewplot) above, and can be used in its place to create a plot, but when called again on the same `
` will update it far more efficiently than [`Plotly.newPlot`](#plotlynewplot), which would destroy and recreate the plot. `Plotly.react` is as fast as `Plotly.restyle`/`Plotly.relayout` documented below. + +Important Note: In order to use this method to plot new items in arrays under `data` such as `x` or `marker.color` etc, these items must either have been added immutably (i.e. the identity of the parent array must have changed) or the value of [`layout.datarevision`](/reference/layout.md#layout-datarevision) must have changed. + + +### Plotly.restyle + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +An efficient means of changing attributes in the `data` array in an existing plot. When restyling, you may choose to have the specified changes affect as many traces as desired. The update is given as a single object and the traces that are affected are given as a list of traces indices. Note, leaving the trace indices unspecified assumes that you want to restyle **all** the traces. + +
+
+Signature + +`Plotly.restyle(graphDiv, update [, traceIndices])` + +`graphDiv` + + DOM node or string id of a DOM node + +`update` + +object, see below for examples +(defaults to `{}`) + +`traceIndices` + +array of integer indices into existing value of `data` +(optional, default behaviour is to apply to all traces) + +
+
+ +

+// restyle a single trace using attribute strings
+var update = {
+    opacity: 0.4,
+    'marker.color': 'red'
+};
+Plotly.restyle(graphDiv, update, 0);
+
+// restyle all traces using attribute strings
+var update = {
+    opacity: 0.4,
+    'marker.color': 'red'
+};
+Plotly.restyle(graphDiv, update);
+
+// restyle two traces using attribute strings
+var update = {
+    opacity: 0.4,
+    'marker.color': 'red'
+};
+Plotly.restyle(graphDiv, update, [1, 2]);
+
+ +

See the Pen Plotly.restyle by plotly (@plotly) on CodePen.

+ + +
+ +The above examples have applied values across single or multiple traces. However, you can also specify arrays of values to apply to traces in turn. + +

+// restyle the first trace's marker color 'red' and the second's 'green'
+var update = {
+    'marker.color': ['red', 'green']
+};
+Plotly.restyle(graphDiv, update, [0, 1])
+
+// alternate between red and green for all traces (note omission of traces)
+var update = {
+    'marker.color': ['red', 'green']
+};
+Plotly.restyle(graphDiv, update)
+
+ +

See the Pen Plotly.restyle Traces in Turn by plotly (@plotly) on CodePen.

+ +

+ +In restyle, arrays are assumed to be used in conjunction with the trace indices provided. Therefore, to apply an array as a value, you need to wrap it in an additional array. For example: + +

+// update the color attribute of the first trace so that the markers within the same trace
+// have different colors
+var update = {
+    'marker.color': [['red', 'green']]
+}
+Plotly.restyle(graphDiv, update, [0])
+
+// update two traces with new z data
+var update = {z: [[[1,2,3], [2,1,2], [1,1,1]], [[0,1,1], [0,2,1], [3,2,1]]]};
+Plotly.restyle(graphDiv, update, [1, 2])
+
+ +

See the Pen Plotly.restyle Arrays by plotly (@plotly) on CodePen.

+ +

+ +The term attribute strings is used above to mean flattened (e.g., {marker: {color: 'red'}} vs. {'marker.color': red}). When you pass an attribute string to restyle inside the update object, it’s assumed to mean update only this attribute. Therefore, if you wish to replace and entire sub-object, you may simply specify one less level of nesting. + +

+// replace the entire marker object with the one provided
+var update = {
+    marker: {color: 'red'}
+};
+Plotly.restyle(graphDiv, update, [0])
+
+ +

See the Pen Plotly.restyle Attribute strings by plotly (@plotly) on CodePen.

+ +

+ +Finally, you may wish to selectively reset or ignore certain properties when restyling. This may be useful when specifying multiple properties for multiple traces so that you can carefully target what is and is not affected. In general `null` resets a property to the default while `undefined` applies no change to the current state. + +

+// Set the first trace's line to red, the second to the default, and ignore the third
+Plotly.restyle(graphDiv, {
+  'line.color': ['red', null, undefined]
+}, [0, 1, 2])
+
+ +

See the Pen null vs. undefined in Plotly.restyle by plotly (@plotly) on CodePen.

+ + +### Plotly.relayout + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +An efficient means of updating the `layout` object of an existing plot. The call signature and arguments for relayout are similar (but simpler) to restyle. Because there are no indices to deal with, arrays need not be wrapped. Also, no argument specifying applicable trace indices is passed in. + +
+
+Signature + +`Plotly.relayout(graphDiv, update)` + +`graphDiv` + +DOM node or string id of a DOM node + +`update` + +object, see below for examples +(defaults to `{}`) + +
+
+ + +

+// update only values within nested objects
+var update = {
+    title: {text: 'some new title'}, // updates the title
+    'xaxis.range': [0, 5],   // updates the xaxis range
+    'yaxis.range[1]': 15     // updates the end of the yaxis range
+};
+Plotly.relayout(graphDiv, update)
+
+ +

See the Pen Plotly.relayout by plotly (@plotly) on CodePen.

+ + +### Plotly.update + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +An efficient means of updating both the `data` array and `layout` object in an existing plot, basically a combination of `Plotly.restyle` and `Plotly.relayout`. + +
+
+Signature + +`Plotly.update(graphDiv, data_update, layout_update, [, traceIndices])` + +`graphDiv` + +DOM node or string id of a DOM node + +`data_update` + +object, see `Plotly.restyle` above +(defaults to `{}`) + +`layout_update` + +object, see `Plotly.relayout` above +(defaults to `{}`) + +`traceIndices` + +array of integer indices into existing value of `data`, see `Plotly.restyle` above +(optional, default behaviour is to apply to all traces) + +
+
+ +

+//update the layout and all the traces
+var layout_update = {
+    title: {text: 'some new title'}, // updates the title
+};
+var data_update = {
+    'marker.color': 'red'
+};
+Plotly.update(graphDiv, data_update, layout_update)
+
+//update the layout and a single trace
+var layout_update = {
+    title: {text: 'some new title'}, // updates the title
+};
+var data_update = {
+    'marker.color': 'red'
+};
+Plotly.update(graphDiv, data_update, layout_update,0)
+
+//update the layout and two specific traces
+var layout_update = {
+    title: {text: 'some new title'}, // updates the title
+};
+var data_update = {
+    'marker.color': 'red'
+};
+Plotly.update(graphDiv, data_update, layout_update, [0,2])
+
+
+ + +

See the Pen Plotly.update by plotly (@plotly) on CodePen.

+ + +### Plotly.validate + +`Plotly.validate` allows users to validate their input `data` array and `layout` object. This can be done on the `data` array and `layout` object passed into `Plotly.newPlot` or on an updated `graphDiv` with `Plotly.validate(graphDiv.data, graphDiv.layout)`. + +
+
+Signature + +`Plotly.validate(data, layout)` + +`data` + +array of objects + +`layout` + +object + +
+
+ +

+var data = [{
+  type: 'bar',
+  y: [2, 1, 3, 2],
+  orientation: 'horizontal'
+}];
+
+var out = Plotly.validate(data, layout);
+console.log(out[0].msg)
+// "In data trace 0, key orientation is set to an invalid value (horizontal)"
+
+ +### Plotly.makeTemplate + +`Plotly.makeTemplate` copies the style information from a figure. It does this by returning a `template` object which can be passed to the `layout.template` attribute of another figure. + +
+
+Signature + +`Plotly.makeTemplate(figure)` + +`figure` or `DOM Node` + +where `figure` is a plot object, with `{data, layout}` members. If a DOM node is used it must be a div element already containing a plot. + +
+
+ +

+var figure = {
+  data: [{
+    type: 'bar',
+    marker: {color: 'red'},
+    y: [2, 1, 3, 2],
+  }],
+  layout:{
+    title: {
+      text: 'Quarterly Earnings'
+    }
+  }
+};
+
+var template = Plotly.makeTemplate(figure);
+
+var newData = [{
+  type:'bar',
+  y:[3,2,5,8]
+}]
+
+var layout = {template:template}
+
+Plotly.newPlot(graphDiv,newData,layout)
+
+
+ +### Plotly.validateTemplate + +`Plotly.validateTemplate` allows users to Test for consistency between the given figure and a template, +either already included in the figure or given separately. Note that not every issue identified here is necessarily +a problem, it depends on what you're using the template for. + +
+
+Signature + +`Plotly.validateTemplate(figure, template)` + +`figure` or `DOM Node` + +where `figure` is a plot object, with `{data, layout}` members. + +`template` + +the template, with its own `{data, layout}`, to test. +If omitted, we will look for a template already attached as +the plot's `layout.template` attribute. + +
+
+ +

+var out = Plotly.validateTemplate(figure, template);
+console.log(out[0].msg)
+// "The template has 1 traces of type bar but there are none in the data."
+
+ +### Plotly.addTraces + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +This allows you to add **new** traces to an existing `graphDiv` at any location in its [data array](#retrieving-data-layout). Every `graphDiv` object has a `data` component which is an array of JSON blobs that each describe one trace. The full list of trace types can be found [in the Full Reference](/reference/index.md). + +

+// add a single trace to an existing graphDiv
+Plotly.addTraces(graphDiv, {y: [2,1,2]});
+
+// add two traces
+Plotly.addTraces(graphDiv, [{y: [2,1,2]}, {y: [4, 5, 7]}]);
+
+// add a trace at the beginning of the data array
+Plotly.addTraces(graphDiv, {y: [1, 5, 7]}, 0);
+
+ +

See the Pen Plotly.addtraces by plotly (@plotly) on CodePen.

+ + +### Plotly.deleteTraces + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +This allows you to remove traces from an existing `graphDiv` by specifying the indices of the traces to be removed. + +

+// remove the first trace
+Plotly.deleteTraces(graphDiv, 0);
+
+// remove the last two traces
+Plotly.deleteTraces(graphDiv, [-2, -1]);
+
+ +

See the Pen Plotly.deleteTraces by plotly (@plotly) on CodePen.

+ + +### Plotly.moveTraces + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +This allows you to reorder traces in an existing `graphDiv`. This will change the ordering of the layering and the legend. + +All traces defined in `graphDiv` are ordered in an array. They are drawn one by one from first to last. Each time a new layer or trace is drawn to the canvas the new trace is drawn directly over the current canvas, replacing the colors of the traces and background. This algorithm to image stacking/drawing is known as the [Painter's Algorithm](https://www.youtube.com/watch?v=oMgOR3PxmDU). As its name implies the Painter's Algorithm is typically the manner in which a painter paints a landscape, starting from objects with the most perspective depth and progressively moving forward and layering over the background objects. + +

+// move the first trace (at index 0) the the end of the data array
+Plotly.moveTraces(graphDiv, 0);
+
+// move selected traces (at indices [0, 3, 5]) to the end of the data array
+Plotly.moveTraces(graphDiv, [0, 3, 5]);
+
+// move last trace (at index -1) to the beginning of the data array (index 0)
+Plotly.moveTraces(graphDiv, -1, 0);
+
+// move selected traces (at indices [1, 4, 5]) to new indices [0, 3, 2]
+Plotly.moveTraces(graphDiv, [1, 4, 5], [0, 3, 2]);
+
+ +

See the Pen Plotly.moveTraces by plotly (@plotly) on CodePen.

+ + +### Plotly.extendTraces + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +This allows you to add data to traces in an existing `graphDiv`. + +

+// extend one trace
+Plotly.extendTraces(graphDiv, {y: [[rand()]]}, [0])
+
+// extend multiple traces
+Plotly.extendTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1])
+
+// extend multiple traces up to a maximum of 10 points per trace
+Plotly.extendTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1], 10)
+
+ +

See the Pen Plotly.extendTraces by plotly (@plotly) on CodePen.

+ + +### Plotly.prependTraces + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +This allows you to prepend data to an existing trace `graphDiv`. + +

+// prepend one trace
+Plotly.prependTraces(graphDiv, {y: [[rand()]]}, [0])
+
+// prepend multiple traces
+Plotly.prependTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1])
+
+// prepend multiple traces up to a maximum of 10 points per trace
+Plotly.prependTraces(graphDiv, {y: [[rand()], [rand()]]}, [0, 1], 10)
+
+ +### Plotly.addFrames + +*This function has comparable performance to [`Plotly.react`](#plotlyreact) and is faster than redrawing the whole plot with [`Plotly.newPlot`](#plotlynewplot).* + +This allows you to add animation frames to a `graphDiv`. The `group` or `name` attribute of a frame can be used by [Plotly.animate](#plotlyanimate) in place of a frame object (or array of frame objects). See [example here](gapminder-example.md). + + +### Plotly.animate + +Add dynamic behaviour to plotly graphs with `Plotly.animate`. + +
+
+Signature + +`Plotly.animate(graphDiv, frameOrGroupNameOrFrameList, animationAttributes)` + +`graphDiv` + +DOM node or string id of a DOM node + +`frameOrGroupNameOrFrameList` + +A frame to be animated or an array of frames to be animated in sequence. Frames added by +[Plotly.addFrames](#plotlyaddframes) which have a +`group` attribute, can be animated by passing their group name here. +Similarly, you can reference frames by an array of strings of frame `name` values. + +`animationAttributes` + +An object, see [documentation](animations.md) for examples. + +
+
+ + +

+Plotly.newPlot('graph', [{
+  x: [1, 2, 3],
+  y: [0, 0.5, 1],
+  line: {simplify: false},
+}]);
+
+function randomize() {
+  Plotly.animate('graph', {
+    data: [{y: [Math.random(), Math.random(), Math.random()]}],
+    traces: [0],
+    layout: {}
+  }, {
+    transition: {
+      duration: 500,
+      easing: 'cubic-in-out'
+    },
+	  frame: {
+		  duration: 500
+	  }
+  })
+}
+
+ +

See the Pen Plotly.animate by plotly (@plotly) on CodePen.

+ + + +### Plotly.purge + +Using `purge` will clear the div, and remove any Plotly plots that have been placed in it. + +

+// purge will be used on the div that you wish clear of Plotly plots
+Plotly.purge(graphDiv);
+
+ +

See the Pen Plotly.purge by plotly (@plotly) on CodePen.

+ + +### Plotly.toImage + +`toImage` will generate a promise to an image of the plot in data URL format. + +

+// Plotly.toImage will turn the plot in the given div into a data URL string
+// toImage takes the div as the first argument and an object specifying image properties as the other
+Plotly.toImage(graphDiv, {format: 'png', width: 800, height: 600}).then(function(dataUrl) {
+    // use the dataUrl
+})
+
+ +

See the Pen Plotly.toImage by plotly (@plotly) on CodePen.

+ + +### Plotly.downloadImage + +`downloadImage` will trigger a request to download the image of a Plotly plot. + +

+// downloadImage will accept the div as the first argument and an object specifying image properties as the other
+Plotly.downloadImage(graphDiv, {format: 'png', width: 800, height: 600, filename: 'newplot'});
+
+ +

See the Pen Plotly.toImage by plotly (@plotly) on CodePen.

+ + +### Using events + +Plots emit events prefixed with plotly_ when clicked or hovered over, and event handlers can be bound to events using the on method that is exposed by the plot div object. For more information and examples of how to use Plotly events see: [https://plotly.com/javascript/plotlyjs-events/](plotlyjs-events.md). diff --git a/pages/polar-chart.md b/pages/polar-chart.md new file mode 100644 index 00000000000..35c2f2bb303 --- /dev/null +++ b/pages/polar-chart.md @@ -0,0 +1,2 @@ +# polar-chart +--8<-- "javascript/polar-chart/index.html" diff --git a/pages/radar-chart.md b/pages/radar-chart.md new file mode 100644 index 00000000000..feb3c0e40b8 --- /dev/null +++ b/pages/radar-chart.md @@ -0,0 +1,2 @@ +# radar-chart +--8<-- "javascript/radar-chart/index.html" diff --git a/pages/range-slider.md b/pages/range-slider.md new file mode 100644 index 00000000000..312404f508e --- /dev/null +++ b/pages/range-slider.md @@ -0,0 +1,2 @@ +# range-slider +--8<-- "javascript/range-slider/index.html" diff --git a/pages/react.md b/pages/react.md new file mode 100644 index 00000000000..5892d8bdd3a --- /dev/null +++ b/pages/react.md @@ -0,0 +1,2 @@ +# react +--8<-- "javascript/react/index.html" diff --git a/pages/reference/bar.md b/pages/reference/bar.md new file mode 100644 index 00000000000..c96c3b54249 --- /dev/null +++ b/pages/reference/bar.md @@ -0,0 +1,2 @@ +# bar +--8<-- "reference/bar/index.html" diff --git a/pages/reference/barpolar.md b/pages/reference/barpolar.md new file mode 100644 index 00000000000..0a5ae637b54 --- /dev/null +++ b/pages/reference/barpolar.md @@ -0,0 +1,2 @@ +# barpolar +--8<-- "reference/barpolar/index.html" diff --git a/pages/reference/box.md b/pages/reference/box.md new file mode 100644 index 00000000000..fbbcacb6eb1 --- /dev/null +++ b/pages/reference/box.md @@ -0,0 +1,2 @@ +# box +--8<-- "reference/box/index.html" diff --git a/pages/reference/candlestick.md b/pages/reference/candlestick.md new file mode 100644 index 00000000000..532a27941c1 --- /dev/null +++ b/pages/reference/candlestick.md @@ -0,0 +1,2 @@ +# candlestick +--8<-- "reference/candlestick/index.html" diff --git a/pages/reference/carpet.md b/pages/reference/carpet.md new file mode 100644 index 00000000000..72ba3589fd5 --- /dev/null +++ b/pages/reference/carpet.md @@ -0,0 +1,2 @@ +# carpet +--8<-- "reference/carpet/index.html" diff --git a/pages/reference/choropleth.md b/pages/reference/choropleth.md new file mode 100644 index 00000000000..afe47d1b106 --- /dev/null +++ b/pages/reference/choropleth.md @@ -0,0 +1,2 @@ +# choropleth +--8<-- "reference/choropleth/index.html" diff --git a/pages/reference/choroplethmap.md b/pages/reference/choroplethmap.md new file mode 100644 index 00000000000..f03e2526626 --- /dev/null +++ b/pages/reference/choroplethmap.md @@ -0,0 +1,2 @@ +# choroplethmap +--8<-- "reference/choroplethmap/index.html" diff --git a/pages/reference/choroplethmapbox.md b/pages/reference/choroplethmapbox.md new file mode 100644 index 00000000000..d29374ec55d --- /dev/null +++ b/pages/reference/choroplethmapbox.md @@ -0,0 +1,2 @@ +# choroplethmapbox +--8<-- "reference/choroplethmapbox/index.html" diff --git a/pages/reference/cone.md b/pages/reference/cone.md new file mode 100644 index 00000000000..04753a94331 --- /dev/null +++ b/pages/reference/cone.md @@ -0,0 +1,2 @@ +# cone +--8<-- "reference/cone/index.html" diff --git a/pages/reference/contour.md b/pages/reference/contour.md new file mode 100644 index 00000000000..56f14909fe2 --- /dev/null +++ b/pages/reference/contour.md @@ -0,0 +1,2 @@ +# contour +--8<-- "reference/contour/index.html" diff --git a/pages/reference/contourcarpet.md b/pages/reference/contourcarpet.md new file mode 100644 index 00000000000..add81800520 --- /dev/null +++ b/pages/reference/contourcarpet.md @@ -0,0 +1,2 @@ +# contourcarpet +--8<-- "reference/contourcarpet/index.html" diff --git a/pages/reference/densitymap.md b/pages/reference/densitymap.md new file mode 100644 index 00000000000..1d9972627a1 --- /dev/null +++ b/pages/reference/densitymap.md @@ -0,0 +1,2 @@ +# densitymap +--8<-- "reference/densitymap/index.html" diff --git a/pages/reference/densitymapbox.md b/pages/reference/densitymapbox.md new file mode 100644 index 00000000000..de7d2042587 --- /dev/null +++ b/pages/reference/densitymapbox.md @@ -0,0 +1,2 @@ +# densitymapbox +--8<-- "reference/densitymapbox/index.html" diff --git a/pages/reference/funnel.md b/pages/reference/funnel.md new file mode 100644 index 00000000000..55e7f464376 --- /dev/null +++ b/pages/reference/funnel.md @@ -0,0 +1,2 @@ +# funnel +--8<-- "reference/funnel/index.html" diff --git a/pages/reference/funnelarea.md b/pages/reference/funnelarea.md new file mode 100644 index 00000000000..64644d30746 --- /dev/null +++ b/pages/reference/funnelarea.md @@ -0,0 +1,2 @@ +# funnelarea +--8<-- "reference/funnelarea/index.html" diff --git a/pages/reference/heatmap.md b/pages/reference/heatmap.md new file mode 100644 index 00000000000..5283ac35c38 --- /dev/null +++ b/pages/reference/heatmap.md @@ -0,0 +1,2 @@ +# heatmap +--8<-- "reference/heatmap/index.html" diff --git a/pages/reference/histogram.md b/pages/reference/histogram.md new file mode 100644 index 00000000000..b57c4ad99fe --- /dev/null +++ b/pages/reference/histogram.md @@ -0,0 +1,2 @@ +# histogram +--8<-- "reference/histogram/index.html" diff --git a/pages/reference/histogram2d.md b/pages/reference/histogram2d.md new file mode 100644 index 00000000000..7936a555435 --- /dev/null +++ b/pages/reference/histogram2d.md @@ -0,0 +1,2 @@ +# histogram2d +--8<-- "reference/histogram2d/index.html" diff --git a/pages/reference/histogram2dcontour.md b/pages/reference/histogram2dcontour.md new file mode 100644 index 00000000000..817aec57052 --- /dev/null +++ b/pages/reference/histogram2dcontour.md @@ -0,0 +1,2 @@ +# histogram2dcontour +--8<-- "reference/histogram2dcontour/index.html" diff --git a/pages/reference/icicle.md b/pages/reference/icicle.md new file mode 100644 index 00000000000..506de166f39 --- /dev/null +++ b/pages/reference/icicle.md @@ -0,0 +1,2 @@ +# icicle +--8<-- "reference/icicle/index.html" diff --git a/pages/reference/image.md b/pages/reference/image.md new file mode 100644 index 00000000000..b0504e69818 --- /dev/null +++ b/pages/reference/image.md @@ -0,0 +1,2 @@ +# image +--8<-- "reference/image/index.html" diff --git a/pages/reference/index.md b/pages/reference/index.md new file mode 100644 index 00000000000..74e79df6a71 --- /dev/null +++ b/pages/reference/index.md @@ -0,0 +1,125 @@ +## Core Objects + +### [Layout](layout.md) + + +## Simple Traces + +### [Bar](bar.md) + +### [Contour](contour.md) + +### [Heatmap](heatmap.md) + +### [Image](image.md) + +### [Pie](pie.md) + +### [Scatter](scatter.md) + +### [Scatter GL](scattergl.md) + +### [Table](table.md) + + +## Distribution Traces + +### [Box](box.md) + +### [Histogram](histogram.md) + +### [Histogram 2D](histogram2d.md) + +### [Histogram 2D Contour](histogram2dcontour.md) + +### [Violin](violin.md) + + + +## Finance Traces + +### [Candlestick](candlestick.md) + +### [Funnel](funnel.md) + +### [Funnel Area](funnelarea.md) + +### [Indicator](indicator.md) + +### [OHLC](ohlc.md) + +### [Waterfall](waterfall.md) + + + +## 3D Traces + +### [Cone](cone.md) + +### [Isosurface](isosurface.md) + +### [Mesh 3D](mesh3d.md) + +### [Scatter 3D](scatter3d.md) + +### [Streamtube](streamtube.md) + +### [Surface](surface.md) + +### [Volume](volume.md) + + +## Map Traces + + +### [Choropleth](choropleth.md) + +### [Choropleth Map](choroplethmap.md) + +### [Choropleth Mapbox](choroplethmapbox.md) + +### [Density Map](densitymap.md) + +### [Density Mapbox](densitymapbox.md) + +### [Scatter Geo](scattergeo.md) + +### [Scatter Map](scattermap.md) + +### [Scatter Mapbox](scattermapbox.md) + + +## Specialized Traces: + +### [Bar Polar](barpolar.md) + +### [Carpet](carpet.md) + +### [Contour Carpet](contourcarpet.md) + +### [Icicle](icicle.md) + +### [Parallel Categories](parcats.md) + +### [Parallel Coordinates](parcoords.md) + +### [Sankey](sankey.md) + +### [Scatter Carpet](scattercarpet.md) + +### [Scatter Polar](scatterpolar.md) + +### [Scatter Polar GL](scatterpolargl.md) + +### [Scatter Smith](scattersmith.md) + +### [Scatter Ternary](scatterternary.md) + +### [SPLOM](splom.md) + +### [Sunburst](sunburst.md) + +### [Treemap](treemap.md) + + + diff --git a/pages/reference/index/index.md b/pages/reference/index/index.md new file mode 100644 index 00000000000..e5971903491 --- /dev/null +++ b/pages/reference/index/index.md @@ -0,0 +1,53 @@ +

JavaScript Figure Reference

+ +

The pages linked in the sidebar together form the exhaustive reference for all of the attributes in the core figure data structure +that the plotly library operates on. They are automatically-generated from the + machine-readable Plotly.js schema reference.

+ +

How are Plotly attributes organized?

+
+

+ plotly.js charts are described declaratively as JSON objects. Every aspect of a plotly chart (the colors, the grids, the data, and so on) has a corresponding JSON attribute. This page contains an extensive list of these attributes.

+ + Plotly's graph description places attributes into two categories: traces (objects that describe a single series of data in a graph) and layout (attributes that apply to the rest of the chart, like the title, xaxis, or annotations). Traces are categorized by chart type (e.g. scatter, heatmap).

+ + Here is a simple example of a plotly chart inlined with links to each attribute's reference section. + +


+data = [
+    {
+        type: 'scatter',  // all "scatter" attributes: https://plotly.com/javascript/reference/#scatter
+        x: [1, 2, 3],     // more about "x": #scatter-x
+        y: [3, 1, 6],     // #scatter-y
+        marker: {         // marker is an object, valid marker keys: #scatter-marker
+            color: 'rgb(16, 32, 77)' // more about "marker.color": #scatter-marker-color
+        }
+    },
+    {
+        type: 'bar',      // all "bar" chart attributes: #bar
+        x: [1, 2, 3],     // more about "x": #bar-x
+        y: [3, 1, 6],     // #bar-y
+        name: 'bar chart example' // #bar-name
+    }
+];
+
+layout = {                     // all "layout" attributes: #layout
+    title: 'simple example',  // more about "layout.title": #layout-title
+    xaxis: {                  // all "layout.xaxis" attributes: #layout-xaxis
+        title: 'time'         // more about "layout.xaxis.title": #layout-xaxis-title
+    },
+    annotations: [            // all "annotation" attributes: #layout-annotations
+        {
+            text: 'simple annotation',    // #layout-annotations-text
+            x: 0,                         // #layout-annotations-x
+            xref: 'paper',                // #layout-annotations-xref
+            y: 0,                         // #layout-annotations-y
+            yref: 'paper'                 // #layout-annotations-yref
+        }
+    ]
+}
+
+ +

+
+
\ No newline at end of file diff --git a/pages/reference/indicator.md b/pages/reference/indicator.md new file mode 100644 index 00000000000..350df47a0a0 --- /dev/null +++ b/pages/reference/indicator.md @@ -0,0 +1,2 @@ +# indicator +--8<-- "reference/indicator/index.html" diff --git a/pages/reference/isosurface.md b/pages/reference/isosurface.md new file mode 100644 index 00000000000..27df50ceb29 --- /dev/null +++ b/pages/reference/isosurface.md @@ -0,0 +1,2 @@ +# isosurface +--8<-- "reference/isosurface/index.html" diff --git a/pages/reference/layout.md b/pages/reference/layout.md new file mode 100644 index 00000000000..7349b120c69 --- /dev/null +++ b/pages/reference/layout.md @@ -0,0 +1,2 @@ +# layout +--8<-- "reference/layout/index.html" diff --git a/pages/reference/mesh3d.md b/pages/reference/mesh3d.md new file mode 100644 index 00000000000..7c9151d3a74 --- /dev/null +++ b/pages/reference/mesh3d.md @@ -0,0 +1,2 @@ +# mesh3d +--8<-- "reference/mesh3d/index.html" diff --git a/pages/reference/ohlc.md b/pages/reference/ohlc.md new file mode 100644 index 00000000000..e1adfe1e146 --- /dev/null +++ b/pages/reference/ohlc.md @@ -0,0 +1,2 @@ +# ohlc +--8<-- "reference/ohlc/index.html" diff --git a/pages/reference/parcats.md b/pages/reference/parcats.md new file mode 100644 index 00000000000..be20c01d95f --- /dev/null +++ b/pages/reference/parcats.md @@ -0,0 +1,2 @@ +# parcats +--8<-- "reference/parcats/index.html" diff --git a/pages/reference/parcoords.md b/pages/reference/parcoords.md new file mode 100644 index 00000000000..c1f97c81357 --- /dev/null +++ b/pages/reference/parcoords.md @@ -0,0 +1,2 @@ +# parcoords +--8<-- "reference/parcoords/index.html" diff --git a/pages/reference/pie.md b/pages/reference/pie.md new file mode 100644 index 00000000000..7aefd2a7b2b --- /dev/null +++ b/pages/reference/pie.md @@ -0,0 +1,2 @@ +# pie +--8<-- "reference/pie/index.html" diff --git a/pages/reference/sankey.md b/pages/reference/sankey.md new file mode 100644 index 00000000000..7118c506bc7 --- /dev/null +++ b/pages/reference/sankey.md @@ -0,0 +1,2 @@ +# sankey +--8<-- "reference/sankey/index.html" diff --git a/pages/reference/scatter.md b/pages/reference/scatter.md new file mode 100644 index 00000000000..815c26a0ceb --- /dev/null +++ b/pages/reference/scatter.md @@ -0,0 +1,2 @@ +# scatter +--8<-- "reference/scatter/index.html" diff --git a/pages/reference/scatter3d.md b/pages/reference/scatter3d.md new file mode 100644 index 00000000000..fe393f50c62 --- /dev/null +++ b/pages/reference/scatter3d.md @@ -0,0 +1,2 @@ +# scatter3d +--8<-- "reference/scatter3d/index.html" diff --git a/pages/reference/scattercarpet.md b/pages/reference/scattercarpet.md new file mode 100644 index 00000000000..61a7c2906ac --- /dev/null +++ b/pages/reference/scattercarpet.md @@ -0,0 +1,2 @@ +# scattercarpet +--8<-- "reference/scattercarpet/index.html" diff --git a/pages/reference/scattergeo.md b/pages/reference/scattergeo.md new file mode 100644 index 00000000000..e0de0a3a938 --- /dev/null +++ b/pages/reference/scattergeo.md @@ -0,0 +1,2 @@ +# scattergeo +--8<-- "reference/scattergeo/index.html" diff --git a/pages/reference/scattergl.md b/pages/reference/scattergl.md new file mode 100644 index 00000000000..e5d9479cc86 --- /dev/null +++ b/pages/reference/scattergl.md @@ -0,0 +1,2 @@ +# scattergl +--8<-- "reference/scattergl/index.html" diff --git a/pages/reference/scattermap.md b/pages/reference/scattermap.md new file mode 100644 index 00000000000..7abf722fdee --- /dev/null +++ b/pages/reference/scattermap.md @@ -0,0 +1,2 @@ +# scattermap +--8<-- "reference/scattermap/index.html" diff --git a/pages/reference/scattermapbox.md b/pages/reference/scattermapbox.md new file mode 100644 index 00000000000..812995b6f74 --- /dev/null +++ b/pages/reference/scattermapbox.md @@ -0,0 +1,2 @@ +# scattermapbox +--8<-- "reference/scattermapbox/index.html" diff --git a/pages/reference/scatterpolar.md b/pages/reference/scatterpolar.md new file mode 100644 index 00000000000..0744d203d8f --- /dev/null +++ b/pages/reference/scatterpolar.md @@ -0,0 +1,2 @@ +# scatterpolar +--8<-- "reference/scatterpolar/index.html" diff --git a/pages/reference/scatterpolargl.md b/pages/reference/scatterpolargl.md new file mode 100644 index 00000000000..c43d630e5ff --- /dev/null +++ b/pages/reference/scatterpolargl.md @@ -0,0 +1,2 @@ +# scatterpolargl +--8<-- "reference/scatterpolargl/index.html" diff --git a/pages/reference/scattersmith.md b/pages/reference/scattersmith.md new file mode 100644 index 00000000000..af63f2ed9cf --- /dev/null +++ b/pages/reference/scattersmith.md @@ -0,0 +1,2 @@ +# scattersmith +--8<-- "reference/scattersmith/index.html" diff --git a/pages/reference/scatterternary.md b/pages/reference/scatterternary.md new file mode 100644 index 00000000000..e514d87aa92 --- /dev/null +++ b/pages/reference/scatterternary.md @@ -0,0 +1,2 @@ +# scatterternary +--8<-- "reference/scatterternary/index.html" diff --git a/pages/reference/splom.md b/pages/reference/splom.md new file mode 100644 index 00000000000..8c7d4b0d479 --- /dev/null +++ b/pages/reference/splom.md @@ -0,0 +1,2 @@ +# splom +--8<-- "reference/splom/index.html" diff --git a/pages/reference/streamtube.md b/pages/reference/streamtube.md new file mode 100644 index 00000000000..faa2d0e688c --- /dev/null +++ b/pages/reference/streamtube.md @@ -0,0 +1,2 @@ +# streamtube +--8<-- "reference/streamtube/index.html" diff --git a/pages/reference/sunburst.md b/pages/reference/sunburst.md new file mode 100644 index 00000000000..f24b23bc180 --- /dev/null +++ b/pages/reference/sunburst.md @@ -0,0 +1,2 @@ +# sunburst +--8<-- "reference/sunburst/index.html" diff --git a/pages/reference/surface.md b/pages/reference/surface.md new file mode 100644 index 00000000000..4a2809db9b5 --- /dev/null +++ b/pages/reference/surface.md @@ -0,0 +1,2 @@ +# surface +--8<-- "reference/surface/index.html" diff --git a/pages/reference/table.md b/pages/reference/table.md new file mode 100644 index 00000000000..54db5265a51 --- /dev/null +++ b/pages/reference/table.md @@ -0,0 +1,2 @@ +# table +--8<-- "reference/table/index.html" diff --git a/pages/reference/treemap.md b/pages/reference/treemap.md new file mode 100644 index 00000000000..7fd5cad3701 --- /dev/null +++ b/pages/reference/treemap.md @@ -0,0 +1,2 @@ +# treemap +--8<-- "reference/treemap/index.html" diff --git a/pages/reference/violin.md b/pages/reference/violin.md new file mode 100644 index 00000000000..8ba4fa6b5b8 --- /dev/null +++ b/pages/reference/violin.md @@ -0,0 +1,2 @@ +# violin +--8<-- "reference/violin/index.html" diff --git a/pages/reference/volume.md b/pages/reference/volume.md new file mode 100644 index 00000000000..dbc8a4612ee --- /dev/null +++ b/pages/reference/volume.md @@ -0,0 +1,2 @@ +# volume +--8<-- "reference/volume/index.html" diff --git a/pages/reference/waterfall.md b/pages/reference/waterfall.md new file mode 100644 index 00000000000..a046627d04e --- /dev/null +++ b/pages/reference/waterfall.md @@ -0,0 +1,2 @@ +# waterfall +--8<-- "reference/waterfall/index.html" diff --git a/pages/remove-trace.md b/pages/remove-trace.md new file mode 100644 index 00000000000..b521a7e7ae5 --- /dev/null +++ b/pages/remove-trace.md @@ -0,0 +1,2 @@ +# remove-trace +--8<-- "javascript/remove-trace/index.html" diff --git a/pages/responsive-fluid-layout.md b/pages/responsive-fluid-layout.md new file mode 100644 index 00000000000..f74f78fc945 --- /dev/null +++ b/pages/responsive-fluid-layout.md @@ -0,0 +1,2 @@ +# responsive-fluid-layout +--8<-- "javascript/responsive-fluid-layout/index.html" diff --git a/pages/ribbon-plots.md b/pages/ribbon-plots.md new file mode 100644 index 00000000000..4ffb9b009d7 --- /dev/null +++ b/pages/ribbon-plots.md @@ -0,0 +1,2 @@ +# ribbon-plots +--8<-- "javascript/ribbon-plots/index.html" diff --git a/pages/sankey-diagram.md b/pages/sankey-diagram.md new file mode 100644 index 00000000000..3978de3b391 --- /dev/null +++ b/pages/sankey-diagram.md @@ -0,0 +1,2 @@ +# sankey-diagram +--8<-- "javascript/sankey-diagram/index.html" diff --git a/pages/scatter-plots-on-maps.md b/pages/scatter-plots-on-maps.md new file mode 100644 index 00000000000..1edd6c82a3d --- /dev/null +++ b/pages/scatter-plots-on-maps.md @@ -0,0 +1,2 @@ +# scatter-plots-on-maps +--8<-- "javascript/scatter-plots-on-maps/index.html" diff --git a/pages/scatter-tile-maps.md b/pages/scatter-tile-maps.md new file mode 100644 index 00000000000..847c7dc25a4 --- /dev/null +++ b/pages/scatter-tile-maps.md @@ -0,0 +1,2 @@ +# scatter-tile-maps +--8<-- "javascript/scatter-tile-maps/index.html" diff --git a/pages/scientific-charts.md b/pages/scientific-charts.md new file mode 100644 index 00000000000..a774ff9e5d7 --- /dev/null +++ b/pages/scientific-charts.md @@ -0,0 +1,75 @@ +## Plotly.js Scientific Charts + +
+ + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/contour.jpg)](contour-plots.md) + + **Contour Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/contour.jpg)](heatmaps.md) + + **Heatmaps** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/ternary-plot.jpg)](ternary-plots.md) + + **Ternary Plots** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/parcoords.jpg)](parallel-coordinates-plot.md) + + **Parallel Coordinates Plot** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/log.jpg)](log-plot.md) + + **Log Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/wind-rose.jpg)](wind-rose-charts.md) + + **Wind Rose and Polar Bar Charts** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/ternary-contour.jpg)](ternary-contour.md) + + **Ternary Contours** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/radar.gif)](radar-chart.md) + + **Radar Charts** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/carpet.jpg)](carpet-plot.md) + + **Carpet Plots** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/scattercarpet.jpg)](carpet-scatter.md) + + **Carpet Scatter Plot** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/contourcarpet.jpg)](carpet-contour.md) + + **Carpet Contour Plot** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/polar.gif)](polar-chart.md) + + **Polar Charts** + + +
\ No newline at end of file diff --git a/pages/setting-graph-size.md b/pages/setting-graph-size.md new file mode 100644 index 00000000000..b434f0b4407 --- /dev/null +++ b/pages/setting-graph-size.md @@ -0,0 +1,2 @@ +# setting-graph-size +--8<-- "javascript/setting-graph-size/index.html" diff --git a/pages/shapes.md b/pages/shapes.md new file mode 100644 index 00000000000..7dfd5d68cb9 --- /dev/null +++ b/pages/shapes.md @@ -0,0 +1,2 @@ +# shapes +--8<-- "javascript/shapes/index.html" diff --git a/pages/sliders.md b/pages/sliders.md new file mode 100644 index 00000000000..a588abcfc8c --- /dev/null +++ b/pages/sliders.md @@ -0,0 +1,2 @@ +# sliders +--8<-- "javascript/sliders/index.html" diff --git a/pages/spc-control-charts.md b/pages/spc-control-charts.md new file mode 100644 index 00000000000..e93a0a75561 --- /dev/null +++ b/pages/spc-control-charts.md @@ -0,0 +1,2 @@ +# spc-control-charts +--8<-- "javascript/spc-control-charts/index.html" diff --git a/pages/splom.md b/pages/splom.md new file mode 100644 index 00000000000..e7ef2d09aee --- /dev/null +++ b/pages/splom.md @@ -0,0 +1,2 @@ +# splom +--8<-- "javascript/splom/index.html" diff --git a/pages/statistical-charts.md b/pages/statistical-charts.md new file mode 100644 index 00000000000..de1568d96e9 --- /dev/null +++ b/pages/statistical-charts.md @@ -0,0 +1,62 @@ +## Plotly.js Statistical Charts + +
+ +- [![](https://images.plot.ly/plotly-documentation/thumbnail/error-bar.jpg)](error-bars.md) + + **Error Bars** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/box.jpg)](box-plots.md) + + **Box Plots** + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/histogram.jpg)](histograms.md) + + **Histograms** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/error-cont.jpg)](continuous-error-bars.md) + + **Continuous Error Bars** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/histogram2d.jpg)](2D-Histogram.md) + + **2D Histograms** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/SPC.jpg)](spc-control-charts.md) + + **SPC Control Charts** + + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/violin.jpg)](violin.md) + + **Violin Plots** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/parcats.jpg)](parallel-categories-diagram.md) + + **Parallel Categories Diagram** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/splom_image.jpg)](splom.md) + + **Scatterplot Matrix** + + + +- [![](https://images.plot.ly/plotly-documentation/thumbnail/hist2dcontour.png)](2d-histogram-contour.md) + + **2D Histogram Contour** + +
diff --git a/pages/streaming.md b/pages/streaming.md new file mode 100644 index 00000000000..ca2f1b8d80b --- /dev/null +++ b/pages/streaming.md @@ -0,0 +1,2 @@ +# streaming +--8<-- "javascript/streaming/index.html" diff --git a/pages/streamtube-plot.md b/pages/streamtube-plot.md new file mode 100644 index 00000000000..f613a0e949a --- /dev/null +++ b/pages/streamtube-plot.md @@ -0,0 +1,2 @@ +# streamtube-plot +--8<-- "javascript/streamtube-plot/index.html" diff --git a/pages/subplots.md b/pages/subplots.md new file mode 100644 index 00000000000..06a42f6ce9a --- /dev/null +++ b/pages/subplots.md @@ -0,0 +1,2 @@ +# subplots +--8<-- "javascript/subplots/index.html" diff --git a/pages/sunburst-charts.md b/pages/sunburst-charts.md new file mode 100644 index 00000000000..37d6ca97ee0 --- /dev/null +++ b/pages/sunburst-charts.md @@ -0,0 +1,2 @@ +# sunburst-charts +--8<-- "javascript/sunburst-charts/index.html" diff --git a/pages/table-subplots.md b/pages/table-subplots.md new file mode 100644 index 00000000000..07a704f2410 --- /dev/null +++ b/pages/table-subplots.md @@ -0,0 +1,2 @@ +# table-subplots +--8<-- "javascript/table-subplots/index.html" diff --git a/pages/table.md b/pages/table.md new file mode 100644 index 00000000000..09834f8b82d --- /dev/null +++ b/pages/table.md @@ -0,0 +1,2 @@ +# table +--8<-- "javascript/table/index.html" diff --git a/pages/ternary-contour.md b/pages/ternary-contour.md new file mode 100644 index 00000000000..93150f07083 --- /dev/null +++ b/pages/ternary-contour.md @@ -0,0 +1,2 @@ +# ternary-contour +--8<-- "javascript/ternary-contour/index.html" diff --git a/pages/ternary-plots.md b/pages/ternary-plots.md new file mode 100644 index 00000000000..c7066eeed41 --- /dev/null +++ b/pages/ternary-plots.md @@ -0,0 +1,2 @@ +# ternary-plots +--8<-- "javascript/ternary-plots/index.html" diff --git a/pages/text-and-annotations.md b/pages/text-and-annotations.md new file mode 100644 index 00000000000..af0e15846ef --- /dev/null +++ b/pages/text-and-annotations.md @@ -0,0 +1,2 @@ +# text-and-annotations +--8<-- "javascript/text-and-annotations/index.html" diff --git a/pages/texttemplate.md b/pages/texttemplate.md new file mode 100644 index 00000000000..6a844a548a1 --- /dev/null +++ b/pages/texttemplate.md @@ -0,0 +1,2 @@ +# texttemplate +--8<-- "javascript/texttemplate/index.html" diff --git a/pages/tick-formatting.md b/pages/tick-formatting.md new file mode 100644 index 00000000000..11923831bc2 --- /dev/null +++ b/pages/tick-formatting.md @@ -0,0 +1,2 @@ +# tick-formatting +--8<-- "javascript/tick-formatting/index.html" diff --git a/pages/tile-county-choropleth.md b/pages/tile-county-choropleth.md new file mode 100644 index 00000000000..95b73968084 --- /dev/null +++ b/pages/tile-county-choropleth.md @@ -0,0 +1,2 @@ +# tile-county-choropleth +--8<-- "javascript/tile-county-choropleth/index.html" diff --git a/pages/tile-density-heatmaps.md b/pages/tile-density-heatmaps.md new file mode 100644 index 00000000000..77d2ade9177 --- /dev/null +++ b/pages/tile-density-heatmaps.md @@ -0,0 +1,2 @@ +# tile-density-heatmaps +--8<-- "javascript/tile-density-heatmaps/index.html" diff --git a/pages/tile-map-layers.md b/pages/tile-map-layers.md new file mode 100644 index 00000000000..703b30f8419 --- /dev/null +++ b/pages/tile-map-layers.md @@ -0,0 +1,2 @@ +# tile-map-layers +--8<-- "javascript/tile-map-layers/index.html" diff --git a/pages/time-series.md b/pages/time-series.md new file mode 100644 index 00000000000..6aa83e6fa00 --- /dev/null +++ b/pages/time-series.md @@ -0,0 +1,2 @@ +# time-series +--8<-- "javascript/time-series/index.html" diff --git a/pages/treemaps.md b/pages/treemaps.md new file mode 100644 index 00000000000..8fd89e14bd1 --- /dev/null +++ b/pages/treemaps.md @@ -0,0 +1,2 @@ +# treemaps +--8<-- "javascript/treemaps/index.html" diff --git a/pages/trisurf.md b/pages/trisurf.md new file mode 100644 index 00000000000..c8d1967c89d --- /dev/null +++ b/pages/trisurf.md @@ -0,0 +1,2 @@ +# trisurf +--8<-- "javascript/trisurf/index.html" diff --git a/pages/uirevision.md b/pages/uirevision.md new file mode 100644 index 00000000000..c26ece8d859 --- /dev/null +++ b/pages/uirevision.md @@ -0,0 +1,2 @@ +# uirevision +--8<-- "javascript/uirevision/index.html" diff --git a/pages/violin.md b/pages/violin.md new file mode 100644 index 00000000000..4d4d5343f5c --- /dev/null +++ b/pages/violin.md @@ -0,0 +1,2 @@ +# violin +--8<-- "javascript/violin/index.html" diff --git a/pages/waterfall-charts.md b/pages/waterfall-charts.md new file mode 100644 index 00000000000..b044ed66a61 --- /dev/null +++ b/pages/waterfall-charts.md @@ -0,0 +1,2 @@ +# waterfall-charts +--8<-- "javascript/waterfall-charts/index.html" diff --git a/pages/webgl-vs-svg.md b/pages/webgl-vs-svg.md new file mode 100644 index 00000000000..d1d91ca138a --- /dev/null +++ b/pages/webgl-vs-svg.md @@ -0,0 +1,2 @@ +# webgl-vs-svg +--8<-- "javascript/webgl-vs-svg/index.html" diff --git a/pages/wind-rose-charts.md b/pages/wind-rose-charts.md new file mode 100644 index 00000000000..749bb75e67b --- /dev/null +++ b/pages/wind-rose-charts.md @@ -0,0 +1,2 @@ +# wind-rose-charts +--8<-- "javascript/wind-rose-charts/index.html" diff --git a/pages/zoom-events.md b/pages/zoom-events.md new file mode 100644 index 00000000000..479354edbcd --- /dev/null +++ b/pages/zoom-events.md @@ -0,0 +1,2 @@ +# zoom-events +--8<-- "javascript/zoom-events/index.html" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..536226a09b3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,21 @@ +[project] +name = "plotly.js" +description = "Plotly JavaScript charting library" +version = "3.1.0" +requires-python = ">=3.12" +dependencies = [ + "markdown", + "python-frontmatter", + "ruff" +] + +[project.optional-dependencies] +docs = [ + "mkdocs", + "mkdocs-material", + "mkdocs-gen-files", + "mkdocs-literate-nav", + "markdown-include", + "mkdocs-macros-plugin", + "mkdocs-redirects", +] \ No newline at end of file diff --git a/test/plot-schema.json b/test/plot-schema.json index fa9a2fff787..7f979d2b287 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -362,7 +362,7 @@ }, "topojsonURL": { "description": "Set the URL to topojson used in geo charts. By default, the topojson files are fetched from cdn.plot.ly. For example, set this option to: /dist/topojson/ to render geographical feature using the topojson files that ship with the plotly.js module.", - "dflt": "https://cdn.plot.ly/un/", + "dflt": "https://cdn.plot.ly/", "noBlank": true, "valType": "string" }, @@ -2546,11 +2546,9 @@ "valType": "enumerated", "values": [ "africa", - "antarctica", "asia", "europe", "north america", - "oceania", "south america", "usa", "world" @@ -3022,13 +3020,7 @@ "min": -1, "valType": "integer" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovermode": { "description": "Determines the mode of hover interactions. If *closest*, a single hoverlabel will appear for the *closest* point within the `hoverdistance`. If *x* (or *y*), multiple hoverlabels will appear for multiple points at the *closest* x- (or y-) coordinate within the `hoverdistance`, with the caveat that no more than one hoverlabel will appear per trace. If *x unified* (or *y unified*), a single hoverlabel will appear multiple points at the closest x- (or y-) coordinate within the `hoverdistance` with the caveat that no more than one hoverlabel will appear per trace. In this mode, spikelines are enabled by default perpendicular to the specified axis. If false, hover interactions are disabled.", @@ -3452,7 +3444,7 @@ "valType": "number" }, "maxheight": { - "description": "Sets the max height (in px) of the legend, or max height ratio (reference height * ratio) if less than or equal to 1. Default value is: 0.5 for horizontal legends; 1 for vertical legends. The minimum allowed height is 30px. For a ratio of 0.5, the legend will take up to 50% of the reference height before displaying a scrollbar. The reference height is the full layout height with the following exception: vertically oriented legends with a `yref` of `\"paper\", located to the side of the plot. In this case, the reference height is the plot height.", + "description": "Sets the max height (in px) of the legend, or max height ratio (reference height * ratio) if less than one. Default value is: 0.5 for horizontal legends; 1 for vertical legends. The minimum allowed height is 30px. For a ratio of 0.5, the legend will take up to 50% of the reference height before displaying a scrollbar. The reference height is the full layout height except for vertically oriented legends with a `yref` of `\"paper\"`, where the reference height is the plot height.", "editType": "legend", "min": 0, "valType": "number" @@ -3653,7 +3645,7 @@ "valType": "number" }, "yanchor": { - "description": "Sets the legend's vertical position anchor. This anchor binds the `y` position to the *top*, *middle* or *bottom* of the legend. Value *auto* anchors legends at their bottom for `y` values less than or equal to 1/3, anchors legends to at their top for `y` values greater than or equal to 2/3 and anchors legends with respect to their middle otherwise.", + "description": "Sets the legend's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the legend. Value *auto* anchors legends at their bottom for `y` values less than or equal to 1/3, anchors legends to at their top for `y` values greater than or equal to 2/3 and anchors legends with respect to their middle otherwise.", "editType": "legend", "valType": "enumerated", "values": [ @@ -5211,17 +5203,6 @@ "min": 0, "valType": "number" }, - "minorloglabels": { - "description": "Determines how minor log labels are displayed. If *small digits*, small digits i.e. 2 or 5 are displayed. If *complete*, complete digits are displayed. If *none*, no labels are displayed.", - "dflt": "small digits", - "editType": "plot", - "valType": "enumerated", - "values": [ - "small digits", - "complete", - "none" - ] - }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, @@ -5920,17 +5901,6 @@ "min": 0, "valType": "number" }, - "minorloglabels": { - "description": "Determines how minor log labels are displayed. If *small digits*, small digits i.e. 2 or 5 are displayed. If *complete*, complete digits are displayed. If *none*, no labels are displayed.", - "dflt": "small digits", - "editType": "plot", - "valType": "enumerated", - "values": [ - "small digits", - "complete", - "none" - ] - }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, @@ -5964,7 +5934,7 @@ "valType": "info_array" }, "rangemode": { - "description": "If *tozero*, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. If *normal*, the range is computed in relation to the extrema of the input data (same behavior as for cartesian axes).", + "description": "If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. If *normal*, the range is computed in relation to the extrema of the input data (same behavior as for cartesian axes).", "dflt": "tozero", "editType": "calc", "valType": "enumerated", @@ -7371,7 +7341,7 @@ "valType": "info_array" }, "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", "dflt": "normal", "editType": "plot", "valType": "enumerated", @@ -8111,7 +8081,7 @@ "valType": "info_array" }, "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", "dflt": "normal", "editType": "plot", "valType": "enumerated", @@ -8851,7 +8821,7 @@ "valType": "info_array" }, "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", "dflt": "normal", "editType": "plot", "valType": "enumerated", @@ -13957,17 +13927,6 @@ "valType": "number" } }, - "minorloglabels": { - "description": "Determines how minor log labels are displayed. If *small digits*, small digits i.e. 2 or 5 are displayed. If *complete*, complete digits are displayed. If *none*, no labels are displayed.", - "dflt": "small digits", - "editType": "calc", - "valType": "enumerated", - "values": [ - "small digits", - "complete", - "none" - ] - }, "mirror": { "description": "Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If *true*, the axis lines are mirrored. If *ticks*, the axis lines and ticks are mirrored. If *false*, mirroring is disable. If *all*, axis lines are mirrored on all shared-axes subplots. If *allticks*, axis lines and ticks are mirrored on all shared-axes subplots.", "dflt": false, @@ -13981,19 +13940,6 @@ "allticks" ] }, - "modebardisable": { - "description": "Disables certain modebar buttons for this axis. *autoscale* disables the autoscale buttons, *zoominout* disables the zoom-in and zoom-out buttons.", - "dflt": "none", - "editType": "modebar", - "extras": [ - "none" - ], - "flags": [ - "autoscale", - "zoominout" - ], - "valType": "flaglist" - }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, @@ -14114,7 +14060,7 @@ "role": "object" }, "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", "dflt": "normal", "editType": "plot", "valType": "enumerated", @@ -15553,17 +15499,6 @@ "valType": "number" } }, - "minorloglabels": { - "description": "Determines how minor log labels are displayed. If *small digits*, small digits i.e. 2 or 5 are displayed. If *complete*, complete digits are displayed. If *none*, no labels are displayed.", - "dflt": "small digits", - "editType": "calc", - "valType": "enumerated", - "values": [ - "small digits", - "complete", - "none" - ] - }, "mirror": { "description": "Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If *true*, the axis lines are mirrored. If *ticks*, the axis lines and ticks are mirrored. If *false*, mirroring is disable. If *all*, axis lines are mirrored on all shared-axes subplots. If *allticks*, axis lines and ticks are mirrored on all shared-axes subplots.", "dflt": false, @@ -15577,19 +15512,6 @@ "allticks" ] }, - "modebardisable": { - "description": "Disables certain modebar buttons for this axis. *autoscale* disables the autoscale buttons, *zoominout* disables the zoom-in and zoom-out buttons.", - "dflt": "none", - "editType": "modebar", - "extras": [ - "none" - ], - "flags": [ - "autoscale", - "zoominout" - ], - "valType": "flaglist" - }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, @@ -15710,7 +15632,7 @@ "role": "object" }, "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data. Applies only to linear axes.", "dflt": "normal", "editType": "plot", "valType": "enumerated", @@ -16816,13 +16738,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -19034,13 +18950,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -20629,13 +20539,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual boxes or sample points or both?", @@ -22179,12 +22083,6 @@ "valType": "string" }, "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - }, "split": { "description": "Show hover information (open, close, high, low) in separate labels.", "dflt": false, @@ -22874,7 +22772,7 @@ "valType": "info_array" }, "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data.", + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data.", "dflt": "normal", "editType": "calc", "valType": "enumerated", @@ -23546,7 +23444,7 @@ "valType": "info_array" }, "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data.", + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data.", "dflt": "normal", "editType": "calc", "valType": "enumerated", @@ -25223,13 +25121,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -25395,7 +25287,7 @@ "valType": "number" }, "locationmode": { - "description": "The library used by the *country names* `locationmode` option is changing in an upcoming version. Country names in existing plots may not work in the new version. Determines the set of locations used to match entries in `locations` to regions on the map. Values *ISO-3*, *USA-states*, *country names* correspond to features on the base map and value *geojson-id* corresponds to features from a custom GeoJSON linked to the `geojson` attribute.", + "description": "Determines the set of locations used to match entries in `locations` to regions on the map. Values *ISO-3*, *USA-states*, *country names* correspond to features on the base map and value *geojson-id* corresponds to features from a custom GeoJSON linked to the `geojson` attribute.", "dflt": "ISO-3", "editType": "calc", "valType": "enumerated", @@ -26517,13 +26409,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -27807,13 +27693,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -29130,13 +29010,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -30704,13 +30578,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoverongaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the `z` data have hover labels associated with them.", @@ -33547,13 +33415,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -34775,13 +34637,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -35452,13 +35308,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -37499,13 +37349,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -39349,13 +39193,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoverongaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the `z` data have hover labels associated with them.", @@ -40528,13 +40366,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -43189,13 +43021,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -44898,13 +44724,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -45842,13 +45662,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -47947,13 +47761,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -50487,13 +50295,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -52041,13 +51843,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -52881,12 +52677,6 @@ "valType": "string" }, "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - }, "split": { "description": "Show hover information (open, close, high, low) in separate labels.", "dflt": false, @@ -56356,13 +56146,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -57804,13 +57588,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "calc", - "valType": "boolean" - } + "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.", @@ -58244,13 +58022,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "calc", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -58621,13 +58393,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "calc", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -59508,13 +59274,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.", @@ -62265,13 +62025,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -64729,13 +64483,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.", @@ -67032,13 +66780,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -67244,7 +66986,7 @@ } }, "locationmode": { - "description": "The library used by the *country names* `locationmode` option is changing in an upcoming version. Country names in existing plots may not work in the new version. Determines the set of locations used to match entries in `locations` to regions on the map. Values *ISO-3*, *USA-states*, *country names* correspond to features on the base map and value *geojson-id* corresponds to features from a custom GeoJSON linked to the `geojson` attribute.", + "description": "Determines the set of locations used to match entries in `locations` to regions on the map. Values *ISO-3*, *USA-states*, *country names* correspond to features on the base map and value *geojson-id* corresponds to features from a custom GeoJSON linked to the `geojson` attribute.", "dflt": "ISO-3", "editType": "calc", "valType": "enumerated", @@ -69493,13 +69235,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -71835,13 +71571,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -73391,13 +73121,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -74892,13 +74616,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.", @@ -77221,13 +76939,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -79384,13 +79096,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.", @@ -81712,13 +81418,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.", @@ -84041,13 +83741,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -86651,13 +86345,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -87474,13 +87162,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -90293,13 +89975,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -91620,13 +91296,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.", @@ -92142,13 +91812,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -94322,13 +93986,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual violins or sample points or the kernel density estimate or any combination of them?", @@ -96449,13 +96107,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, @@ -97412,13 +97064,7 @@ "editType": "none", "valType": "string" }, - "role": "object", - "showarrow": { - "description": "Sets whether or not to show the hover label arrow/triangle pointing to the data point.", - "dflt": true, - "editType": "none", - "valType": "boolean" - } + "role": "object" }, "hovertemplate": { "arrayOk": true, diff --git a/uv.lock b/uv.lock new file mode 100644 index 00000000000..b0240ae3737 --- /dev/null +++ b/uv.lock @@ -0,0 +1,514 @@ +version = 1 +revision = 3 +requires-python = ">=3.12" + +[[package]] +name = "babel" +version = "2.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/6b/d52e42361e1aa00709585ecc30b3f9684b3ab62530771402248b1b1d6240/babel-2.17.0.tar.gz", hash = "sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d", size = 9951852, upload-time = "2025-02-01T15:17:41.026Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/b8/3fe70c75fe32afc4bb507f75563d39bc5642255d1d94f1f23604725780bf/babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2", size = 10182537, upload-time = "2025-02-01T15:17:37.39Z" }, +] + +[[package]] +name = "backrefs" +version = "5.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/eb/a7/312f673df6a79003279e1f55619abbe7daebbb87c17c976ddc0345c04c7b/backrefs-5.9.tar.gz", hash = "sha256:808548cb708d66b82ee231f962cb36faaf4f2baab032f2fbb783e9c2fdddaa59", size = 5765857, upload-time = "2025-06-22T19:34:13.97Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/19/4d/798dc1f30468134906575156c089c492cf79b5a5fd373f07fe26c4d046bf/backrefs-5.9-py310-none-any.whl", hash = "sha256:db8e8ba0e9de81fcd635f440deab5ae5f2591b54ac1ebe0550a2ca063488cd9f", size = 380267, upload-time = "2025-06-22T19:34:05.252Z" }, + { url = "https://files.pythonhosted.org/packages/55/07/f0b3375bf0d06014e9787797e6b7cc02b38ac9ff9726ccfe834d94e9991e/backrefs-5.9-py311-none-any.whl", hash = "sha256:6907635edebbe9b2dc3de3a2befff44d74f30a4562adbb8b36f21252ea19c5cf", size = 392072, upload-time = "2025-06-22T19:34:06.743Z" }, + { url = "https://files.pythonhosted.org/packages/9d/12/4f345407259dd60a0997107758ba3f221cf89a9b5a0f8ed5b961aef97253/backrefs-5.9-py312-none-any.whl", hash = "sha256:7fdf9771f63e6028d7fee7e0c497c81abda597ea45d6b8f89e8ad76994f5befa", size = 397947, upload-time = "2025-06-22T19:34:08.172Z" }, + { url = "https://files.pythonhosted.org/packages/10/bf/fa31834dc27a7f05e5290eae47c82690edc3a7b37d58f7fb35a1bdbf355b/backrefs-5.9-py313-none-any.whl", hash = "sha256:cc37b19fa219e93ff825ed1fed8879e47b4d89aa7a1884860e2db64ccd7c676b", size = 399843, upload-time = "2025-06-22T19:34:09.68Z" }, + { url = "https://files.pythonhosted.org/packages/fc/24/b29af34b2c9c41645a9f4ff117bae860291780d73880f449e0b5d948c070/backrefs-5.9-py314-none-any.whl", hash = "sha256:df5e169836cc8acb5e440ebae9aad4bf9d15e226d3bad049cf3f6a5c20cc8dc9", size = 411762, upload-time = "2025-06-22T19:34:11.037Z" }, + { url = "https://files.pythonhosted.org/packages/41/ff/392bff89415399a979be4a65357a41d92729ae8580a66073d8ec8d810f98/backrefs-5.9-py39-none-any.whl", hash = "sha256:f48ee18f6252b8f5777a22a00a09a85de0ca931658f1dd96d4406a34f3748c60", size = 380265, upload-time = "2025-06-22T19:34:12.405Z" }, +] + +[[package]] +name = "certifi" +version = "2025.8.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/67/960ebe6bf230a96cda2e0abcf73af550ec4f090005363542f0765df162e0/certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", size = 162386, upload-time = "2025-08-03T03:07:47.08Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/48/1549795ba7742c948d2ad169c1c8cdbae65bc450d6cd753d124b17c8cd32/certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5", size = 161216, upload-time = "2025-08-03T03:07:45.777Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/83/2d/5fd176ceb9b2fc619e63405525573493ca23441330fcdaee6bef9460e924/charset_normalizer-3.4.3.tar.gz", hash = "sha256:6fce4b8500244f6fcb71465d4a4930d132ba9ab8e71a7859e6a5d59851068d14", size = 122371, upload-time = "2025-08-09T07:57:28.46Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e9/5e/14c94999e418d9b87682734589404a25854d5f5d0408df68bc15b6ff54bb/charset_normalizer-3.4.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e28e334d3ff134e88989d90ba04b47d84382a828c061d0d1027b1b12a62b39b1", size = 205655, upload-time = "2025-08-09T07:56:08.475Z" }, + { url = "https://files.pythonhosted.org/packages/7d/a8/c6ec5d389672521f644505a257f50544c074cf5fc292d5390331cd6fc9c3/charset_normalizer-3.4.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0cacf8f7297b0c4fcb74227692ca46b4a5852f8f4f24b3c766dd94a1075c4884", size = 146223, upload-time = "2025-08-09T07:56:09.708Z" }, + { url = "https://files.pythonhosted.org/packages/fc/eb/a2ffb08547f4e1e5415fb69eb7db25932c52a52bed371429648db4d84fb1/charset_normalizer-3.4.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c6fd51128a41297f5409deab284fecbe5305ebd7e5a1f959bee1c054622b7018", size = 159366, upload-time = "2025-08-09T07:56:11.326Z" }, + { url = "https://files.pythonhosted.org/packages/82/10/0fd19f20c624b278dddaf83b8464dcddc2456cb4b02bb902a6da126b87a1/charset_normalizer-3.4.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3cfb2aad70f2c6debfbcb717f23b7eb55febc0bb23dcffc0f076009da10c6392", size = 157104, upload-time = "2025-08-09T07:56:13.014Z" }, + { url = "https://files.pythonhosted.org/packages/16/ab/0233c3231af734f5dfcf0844aa9582d5a1466c985bbed6cedab85af9bfe3/charset_normalizer-3.4.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1606f4a55c0fd363d754049cdf400175ee96c992b1f8018b993941f221221c5f", size = 151830, upload-time = "2025-08-09T07:56:14.428Z" }, + { url = "https://files.pythonhosted.org/packages/ae/02/e29e22b4e02839a0e4a06557b1999d0a47db3567e82989b5bb21f3fbbd9f/charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:027b776c26d38b7f15b26a5da1044f376455fb3766df8fc38563b4efbc515154", size = 148854, upload-time = "2025-08-09T07:56:16.051Z" }, + { url = "https://files.pythonhosted.org/packages/05/6b/e2539a0a4be302b481e8cafb5af8792da8093b486885a1ae4d15d452bcec/charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:42e5088973e56e31e4fa58eb6bd709e42fc03799c11c42929592889a2e54c491", size = 160670, upload-time = "2025-08-09T07:56:17.314Z" }, + { url = "https://files.pythonhosted.org/packages/31/e7/883ee5676a2ef217a40ce0bffcc3d0dfbf9e64cbcfbdf822c52981c3304b/charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:cc34f233c9e71701040d772aa7490318673aa7164a0efe3172b2981218c26d93", size = 158501, upload-time = "2025-08-09T07:56:18.641Z" }, + { url = "https://files.pythonhosted.org/packages/c1/35/6525b21aa0db614cf8b5792d232021dca3df7f90a1944db934efa5d20bb1/charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:320e8e66157cc4e247d9ddca8e21f427efc7a04bbd0ac8a9faf56583fa543f9f", size = 153173, upload-time = "2025-08-09T07:56:20.289Z" }, + { url = "https://files.pythonhosted.org/packages/50/ee/f4704bad8201de513fdc8aac1cabc87e38c5818c93857140e06e772b5892/charset_normalizer-3.4.3-cp312-cp312-win32.whl", hash = "sha256:fb6fecfd65564f208cbf0fba07f107fb661bcd1a7c389edbced3f7a493f70e37", size = 99822, upload-time = "2025-08-09T07:56:21.551Z" }, + { url = "https://files.pythonhosted.org/packages/39/f5/3b3836ca6064d0992c58c7561c6b6eee1b3892e9665d650c803bd5614522/charset_normalizer-3.4.3-cp312-cp312-win_amd64.whl", hash = "sha256:86df271bf921c2ee3818f0522e9a5b8092ca2ad8b065ece5d7d9d0e9f4849bcc", size = 107543, upload-time = "2025-08-09T07:56:23.115Z" }, + { url = "https://files.pythonhosted.org/packages/65/ca/2135ac97709b400c7654b4b764daf5c5567c2da45a30cdd20f9eefe2d658/charset_normalizer-3.4.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:14c2a87c65b351109f6abfc424cab3927b3bdece6f706e4d12faaf3d52ee5efe", size = 205326, upload-time = "2025-08-09T07:56:24.721Z" }, + { url = "https://files.pythonhosted.org/packages/71/11/98a04c3c97dd34e49c7d247083af03645ca3730809a5509443f3c37f7c99/charset_normalizer-3.4.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:41d1fc408ff5fdfb910200ec0e74abc40387bccb3252f3f27c0676731df2b2c8", size = 146008, upload-time = "2025-08-09T07:56:26.004Z" }, + { url = "https://files.pythonhosted.org/packages/60/f5/4659a4cb3c4ec146bec80c32d8bb16033752574c20b1252ee842a95d1a1e/charset_normalizer-3.4.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1bb60174149316da1c35fa5233681f7c0f9f514509b8e399ab70fea5f17e45c9", size = 159196, upload-time = "2025-08-09T07:56:27.25Z" }, + { url = "https://files.pythonhosted.org/packages/86/9e/f552f7a00611f168b9a5865a1414179b2c6de8235a4fa40189f6f79a1753/charset_normalizer-3.4.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:30d006f98569de3459c2fc1f2acde170b7b2bd265dc1943e87e1a4efe1b67c31", size = 156819, upload-time = "2025-08-09T07:56:28.515Z" }, + { url = "https://files.pythonhosted.org/packages/7e/95/42aa2156235cbc8fa61208aded06ef46111c4d3f0de233107b3f38631803/charset_normalizer-3.4.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:416175faf02e4b0810f1f38bcb54682878a4af94059a1cd63b8747244420801f", size = 151350, upload-time = "2025-08-09T07:56:29.716Z" }, + { url = "https://files.pythonhosted.org/packages/c2/a9/3865b02c56f300a6f94fc631ef54f0a8a29da74fb45a773dfd3dcd380af7/charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6aab0f181c486f973bc7262a97f5aca3ee7e1437011ef0c2ec04b5a11d16c927", size = 148644, upload-time = "2025-08-09T07:56:30.984Z" }, + { url = "https://files.pythonhosted.org/packages/77/d9/cbcf1a2a5c7d7856f11e7ac2d782aec12bdfea60d104e60e0aa1c97849dc/charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:fdabf8315679312cfa71302f9bd509ded4f2f263fb5b765cf1433b39106c3cc9", size = 160468, upload-time = "2025-08-09T07:56:32.252Z" }, + { url = "https://files.pythonhosted.org/packages/f6/42/6f45efee8697b89fda4d50580f292b8f7f9306cb2971d4b53f8914e4d890/charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:bd28b817ea8c70215401f657edef3a8aa83c29d447fb0b622c35403780ba11d5", size = 158187, upload-time = "2025-08-09T07:56:33.481Z" }, + { url = "https://files.pythonhosted.org/packages/70/99/f1c3bdcfaa9c45b3ce96f70b14f070411366fa19549c1d4832c935d8e2c3/charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:18343b2d246dc6761a249ba1fb13f9ee9a2bcd95decc767319506056ea4ad4dc", size = 152699, upload-time = "2025-08-09T07:56:34.739Z" }, + { url = "https://files.pythonhosted.org/packages/a3/ad/b0081f2f99a4b194bcbb1934ef3b12aa4d9702ced80a37026b7607c72e58/charset_normalizer-3.4.3-cp313-cp313-win32.whl", hash = "sha256:6fb70de56f1859a3f71261cbe41005f56a7842cc348d3aeb26237560bfa5e0ce", size = 99580, upload-time = "2025-08-09T07:56:35.981Z" }, + { url = "https://files.pythonhosted.org/packages/9a/8f/ae790790c7b64f925e5c953b924aaa42a243fb778fed9e41f147b2a5715a/charset_normalizer-3.4.3-cp313-cp313-win_amd64.whl", hash = "sha256:cf1ebb7d78e1ad8ec2a8c4732c7be2e736f6e5123a4146c5b89c9d1f585f8cef", size = 107366, upload-time = "2025-08-09T07:56:37.339Z" }, + { url = "https://files.pythonhosted.org/packages/8e/91/b5a06ad970ddc7a0e513112d40113e834638f4ca1120eb727a249fb2715e/charset_normalizer-3.4.3-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3cd35b7e8aedeb9e34c41385fda4f73ba609e561faedfae0a9e75e44ac558a15", size = 204342, upload-time = "2025-08-09T07:56:38.687Z" }, + { url = "https://files.pythonhosted.org/packages/ce/ec/1edc30a377f0a02689342f214455c3f6c2fbedd896a1d2f856c002fc3062/charset_normalizer-3.4.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b89bc04de1d83006373429975f8ef9e7932534b8cc9ca582e4db7d20d91816db", size = 145995, upload-time = "2025-08-09T07:56:40.048Z" }, + { url = "https://files.pythonhosted.org/packages/17/e5/5e67ab85e6d22b04641acb5399c8684f4d37caf7558a53859f0283a650e9/charset_normalizer-3.4.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2001a39612b241dae17b4687898843f254f8748b796a2e16f1051a17078d991d", size = 158640, upload-time = "2025-08-09T07:56:41.311Z" }, + { url = "https://files.pythonhosted.org/packages/f1/e5/38421987f6c697ee3722981289d554957c4be652f963d71c5e46a262e135/charset_normalizer-3.4.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8dcfc373f888e4fb39a7bc57e93e3b845e7f462dacc008d9749568b1c4ece096", size = 156636, upload-time = "2025-08-09T07:56:43.195Z" }, + { url = "https://files.pythonhosted.org/packages/a0/e4/5a075de8daa3ec0745a9a3b54467e0c2967daaaf2cec04c845f73493e9a1/charset_normalizer-3.4.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:18b97b8404387b96cdbd30ad660f6407799126d26a39ca65729162fd810a99aa", size = 150939, upload-time = "2025-08-09T07:56:44.819Z" }, + { url = "https://files.pythonhosted.org/packages/02/f7/3611b32318b30974131db62b4043f335861d4d9b49adc6d57c1149cc49d4/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ccf600859c183d70eb47e05a44cd80a4ce77394d1ac0f79dbd2dd90a69a3a049", size = 148580, upload-time = "2025-08-09T07:56:46.684Z" }, + { url = "https://files.pythonhosted.org/packages/7e/61/19b36f4bd67f2793ab6a99b979b4e4f3d8fc754cbdffb805335df4337126/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:53cd68b185d98dde4ad8990e56a58dea83a4162161b1ea9272e5c9182ce415e0", size = 159870, upload-time = "2025-08-09T07:56:47.941Z" }, + { url = "https://files.pythonhosted.org/packages/06/57/84722eefdd338c04cf3030ada66889298eaedf3e7a30a624201e0cbe424a/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:30a96e1e1f865f78b030d65241c1ee850cdf422d869e9028e2fc1d5e4db73b92", size = 157797, upload-time = "2025-08-09T07:56:49.756Z" }, + { url = "https://files.pythonhosted.org/packages/72/2a/aff5dd112b2f14bcc3462c312dce5445806bfc8ab3a7328555da95330e4b/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d716a916938e03231e86e43782ca7878fb602a125a91e7acb8b5112e2e96ac16", size = 152224, upload-time = "2025-08-09T07:56:51.369Z" }, + { url = "https://files.pythonhosted.org/packages/b7/8c/9839225320046ed279c6e839d51f028342eb77c91c89b8ef2549f951f3ec/charset_normalizer-3.4.3-cp314-cp314-win32.whl", hash = "sha256:c6dbd0ccdda3a2ba7c2ecd9d77b37f3b5831687d8dc1b6ca5f56a4880cc7b7ce", size = 100086, upload-time = "2025-08-09T07:56:52.722Z" }, + { url = "https://files.pythonhosted.org/packages/ee/7a/36fbcf646e41f710ce0a563c1c9a343c6edf9be80786edeb15b6f62e17db/charset_normalizer-3.4.3-cp314-cp314-win_amd64.whl", hash = "sha256:73dc19b562516fc9bcf6e5d6e596df0b4eb98d87e4f79f3ae71840e6ed21361c", size = 107400, upload-time = "2025-08-09T07:56:55.172Z" }, + { url = "https://files.pythonhosted.org/packages/8a/1f/f041989e93b001bc4e44bb1669ccdcf54d3f00e628229a85b08d330615c5/charset_normalizer-3.4.3-py3-none-any.whl", hash = "sha256:ce571ab16d890d23b5c278547ba694193a45011ff86a9162a71307ed9f86759a", size = 53175, upload-time = "2025-08-09T07:57:26.864Z" }, +] + +[[package]] +name = "click" +version = "8.2.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/60/6c/8ca2efa64cf75a977a0d7fac081354553ebe483345c734fb6b6515d96bbc/click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202", size = 286342, upload-time = "2025-05-20T23:19:49.832Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/85/32/10bb5764d90a8eee674e9dc6f4db6a0ab47c8c4d0d83c27f7c39ac415a4d/click-8.2.1-py3-none-any.whl", hash = "sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b", size = 102215, upload-time = "2025-05-20T23:19:47.796Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "ghp-import" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "python-dateutil" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d9/29/d40217cbe2f6b1359e00c6c307bb3fc876ba74068cbab3dde77f03ca0dc4/ghp-import-2.1.0.tar.gz", hash = "sha256:9c535c4c61193c2df8871222567d7fd7e5014d835f97dc7b7439069e2413d343", size = 10943, upload-time = "2022-05-02T15:47:16.11Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f7/ec/67fbef5d497f86283db54c22eec6f6140243aae73265799baaaa19cd17fb/ghp_import-2.1.0-py3-none-any.whl", hash = "sha256:8337dd7b50877f163d4c0289bc1f1c7f127550241988d568c1db512c4324a619", size = 11034, upload-time = "2022-05-02T15:47:14.552Z" }, +] + +[[package]] +name = "idna" +version = "3.10" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490, upload-time = "2024-09-15T18:07:39.745Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" }, +] + +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + +[[package]] +name = "markdown" +version = "3.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8d/37/02347f6d6d8279247a5837082ebc26fc0d5aaeaf75aa013fcbb433c777ab/markdown-3.9.tar.gz", hash = "sha256:d2900fe1782bd33bdbbd56859defef70c2e78fc46668f8eb9df3128138f2cb6a", size = 364585, upload-time = "2025-09-04T20:25:22.885Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/70/ae/44c4a6a4cbb496d93c6257954260fe3a6e91b7bed2240e5dad2a717f5111/markdown-3.9-py3-none-any.whl", hash = "sha256:9f4d91ed810864ea88a6f32c07ba8bee1346c0cc1f6b1f9f6c822f2a9667d280", size = 107441, upload-time = "2025-09-04T20:25:21.784Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b2/97/5d42485e71dfc078108a86d6de8fa46db44a1a9295e89c5d6d4a06e23a62/markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0", size = 20537, upload-time = "2024-10-18T15:21:54.129Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/09/d1f21434c97fc42f09d290cbb6350d44eb12f09cc62c9476effdb33a18aa/MarkupSafe-3.0.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf", size = 14274, upload-time = "2024-10-18T15:21:13.777Z" }, + { url = "https://files.pythonhosted.org/packages/6b/b0/18f76bba336fa5aecf79d45dcd6c806c280ec44538b3c13671d49099fdd0/MarkupSafe-3.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225", size = 12348, upload-time = "2024-10-18T15:21:14.822Z" }, + { url = "https://files.pythonhosted.org/packages/e0/25/dd5c0f6ac1311e9b40f4af06c78efde0f3b5cbf02502f8ef9501294c425b/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028", size = 24149, upload-time = "2024-10-18T15:21:15.642Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f0/89e7aadfb3749d0f52234a0c8c7867877876e0a20b60e2188e9850794c17/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8", size = 23118, upload-time = "2024-10-18T15:21:17.133Z" }, + { url = "https://files.pythonhosted.org/packages/d5/da/f2eeb64c723f5e3777bc081da884b414671982008c47dcc1873d81f625b6/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c", size = 22993, upload-time = "2024-10-18T15:21:18.064Z" }, + { url = "https://files.pythonhosted.org/packages/da/0e/1f32af846df486dce7c227fe0f2398dc7e2e51d4a370508281f3c1c5cddc/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557", size = 24178, upload-time = "2024-10-18T15:21:18.859Z" }, + { url = "https://files.pythonhosted.org/packages/c4/f6/bb3ca0532de8086cbff5f06d137064c8410d10779c4c127e0e47d17c0b71/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22", size = 23319, upload-time = "2024-10-18T15:21:19.671Z" }, + { url = "https://files.pythonhosted.org/packages/a2/82/8be4c96ffee03c5b4a034e60a31294daf481e12c7c43ab8e34a1453ee48b/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48", size = 23352, upload-time = "2024-10-18T15:21:20.971Z" }, + { url = "https://files.pythonhosted.org/packages/51/ae/97827349d3fcffee7e184bdf7f41cd6b88d9919c80f0263ba7acd1bbcb18/MarkupSafe-3.0.2-cp312-cp312-win32.whl", hash = "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30", size = 15097, upload-time = "2024-10-18T15:21:22.646Z" }, + { url = "https://files.pythonhosted.org/packages/c1/80/a61f99dc3a936413c3ee4e1eecac96c0da5ed07ad56fd975f1a9da5bc630/MarkupSafe-3.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87", size = 15601, upload-time = "2024-10-18T15:21:23.499Z" }, + { url = "https://files.pythonhosted.org/packages/83/0e/67eb10a7ecc77a0c2bbe2b0235765b98d164d81600746914bebada795e97/MarkupSafe-3.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd", size = 14274, upload-time = "2024-10-18T15:21:24.577Z" }, + { url = "https://files.pythonhosted.org/packages/2b/6d/9409f3684d3335375d04e5f05744dfe7e9f120062c9857df4ab490a1031a/MarkupSafe-3.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430", size = 12352, upload-time = "2024-10-18T15:21:25.382Z" }, + { url = "https://files.pythonhosted.org/packages/d2/f5/6eadfcd3885ea85fe2a7c128315cc1bb7241e1987443d78c8fe712d03091/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094", size = 24122, upload-time = "2024-10-18T15:21:26.199Z" }, + { url = "https://files.pythonhosted.org/packages/0c/91/96cf928db8236f1bfab6ce15ad070dfdd02ed88261c2afafd4b43575e9e9/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396", size = 23085, upload-time = "2024-10-18T15:21:27.029Z" }, + { url = "https://files.pythonhosted.org/packages/c2/cf/c9d56af24d56ea04daae7ac0940232d31d5a8354f2b457c6d856b2057d69/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79", size = 22978, upload-time = "2024-10-18T15:21:27.846Z" }, + { url = "https://files.pythonhosted.org/packages/2a/9f/8619835cd6a711d6272d62abb78c033bda638fdc54c4e7f4272cf1c0962b/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a", size = 24208, upload-time = "2024-10-18T15:21:28.744Z" }, + { url = "https://files.pythonhosted.org/packages/f9/bf/176950a1792b2cd2102b8ffeb5133e1ed984547b75db47c25a67d3359f77/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca", size = 23357, upload-time = "2024-10-18T15:21:29.545Z" }, + { url = "https://files.pythonhosted.org/packages/ce/4f/9a02c1d335caabe5c4efb90e1b6e8ee944aa245c1aaaab8e8a618987d816/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c", size = 23344, upload-time = "2024-10-18T15:21:30.366Z" }, + { url = "https://files.pythonhosted.org/packages/ee/55/c271b57db36f748f0e04a759ace9f8f759ccf22b4960c270c78a394f58be/MarkupSafe-3.0.2-cp313-cp313-win32.whl", hash = "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1", size = 15101, upload-time = "2024-10-18T15:21:31.207Z" }, + { url = "https://files.pythonhosted.org/packages/29/88/07df22d2dd4df40aba9f3e402e6dc1b8ee86297dddbad4872bd5e7b0094f/MarkupSafe-3.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f", size = 15603, upload-time = "2024-10-18T15:21:32.032Z" }, + { url = "https://files.pythonhosted.org/packages/62/6a/8b89d24db2d32d433dffcd6a8779159da109842434f1dd2f6e71f32f738c/MarkupSafe-3.0.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c", size = 14510, upload-time = "2024-10-18T15:21:33.625Z" }, + { url = "https://files.pythonhosted.org/packages/7a/06/a10f955f70a2e5a9bf78d11a161029d278eeacbd35ef806c3fd17b13060d/MarkupSafe-3.0.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb", size = 12486, upload-time = "2024-10-18T15:21:34.611Z" }, + { url = "https://files.pythonhosted.org/packages/34/cf/65d4a571869a1a9078198ca28f39fba5fbb910f952f9dbc5220afff9f5e6/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c", size = 25480, upload-time = "2024-10-18T15:21:35.398Z" }, + { url = "https://files.pythonhosted.org/packages/0c/e3/90e9651924c430b885468b56b3d597cabf6d72be4b24a0acd1fa0e12af67/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d", size = 23914, upload-time = "2024-10-18T15:21:36.231Z" }, + { url = "https://files.pythonhosted.org/packages/66/8c/6c7cf61f95d63bb866db39085150df1f2a5bd3335298f14a66b48e92659c/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe", size = 23796, upload-time = "2024-10-18T15:21:37.073Z" }, + { url = "https://files.pythonhosted.org/packages/bb/35/cbe9238ec3f47ac9a7c8b3df7a808e7cb50fe149dc7039f5f454b3fba218/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5", size = 25473, upload-time = "2024-10-18T15:21:37.932Z" }, + { url = "https://files.pythonhosted.org/packages/e6/32/7621a4382488aa283cc05e8984a9c219abad3bca087be9ec77e89939ded9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a", size = 24114, upload-time = "2024-10-18T15:21:39.799Z" }, + { url = "https://files.pythonhosted.org/packages/0d/80/0985960e4b89922cb5a0bac0ed39c5b96cbc1a536a99f30e8c220a996ed9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", size = 24098, upload-time = "2024-10-18T15:21:40.813Z" }, + { url = "https://files.pythonhosted.org/packages/82/78/fedb03c7d5380df2427038ec8d973587e90561b2d90cd472ce9254cf348b/MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", size = 15208, upload-time = "2024-10-18T15:21:41.814Z" }, + { url = "https://files.pythonhosted.org/packages/4f/65/6079a46068dfceaeabb5dcad6d674f5f5c61a6fa5673746f42a9f4c233b3/MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", size = 15739, upload-time = "2024-10-18T15:21:42.784Z" }, +] + +[[package]] +name = "mergedeep" +version = "1.3.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3a/41/580bb4006e3ed0361b8151a01d324fb03f420815446c7def45d02f74c270/mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8", size = 4661, upload-time = "2021-02-05T18:55:30.623Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/19/04f9b178c2d8a15b076c8b5140708fa6ffc5601fb6f1e975537072df5b2a/mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307", size = 6354, upload-time = "2021-02-05T18:55:29.583Z" }, +] + +[[package]] +name = "mkdocs" +version = "1.6.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "ghp-import" }, + { name = "jinja2" }, + { name = "markdown" }, + { name = "markupsafe" }, + { name = "mergedeep" }, + { name = "mkdocs-get-deps" }, + { name = "packaging" }, + { name = "pathspec" }, + { name = "pyyaml" }, + { name = "pyyaml-env-tag" }, + { name = "watchdog" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bc/c6/bbd4f061bd16b378247f12953ffcb04786a618ce5e904b8c5a01a0309061/mkdocs-1.6.1.tar.gz", hash = "sha256:7b432f01d928c084353ab39c57282f29f92136665bdd6abf7c1ec8d822ef86f2", size = 3889159, upload-time = "2024-08-30T12:24:06.899Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/5b/dbc6a8cddc9cfa9c4971d59fb12bb8d42e161b7e7f8cc89e49137c5b279c/mkdocs-1.6.1-py3-none-any.whl", hash = "sha256:db91759624d1647f3f34aa0c3f327dd2601beae39a366d6e064c03468d35c20e", size = 3864451, upload-time = "2024-08-30T12:24:05.054Z" }, +] + +[[package]] +name = "mkdocs-gen-files" +version = "0.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mkdocs" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/48/85/2d634462fd59136197d3126ca431ffb666f412e3db38fd5ce3a60566303e/mkdocs_gen_files-0.5.0.tar.gz", hash = "sha256:4c7cf256b5d67062a788f6b1d035e157fc1a9498c2399be9af5257d4ff4d19bc", size = 7539, upload-time = "2023-04-27T19:48:04.894Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/0f/1e55b3fd490ad2cecb6e7b31892d27cb9fc4218ec1dab780440ba8579e74/mkdocs_gen_files-0.5.0-py3-none-any.whl", hash = "sha256:7ac060096f3f40bd19039e7277dd3050be9a453c8ac578645844d4d91d7978ea", size = 8380, upload-time = "2023-04-27T19:48:07.059Z" }, +] + +[[package]] +name = "mkdocs-get-deps" +version = "0.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mergedeep" }, + { name = "platformdirs" }, + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/98/f5/ed29cd50067784976f25ed0ed6fcd3c2ce9eb90650aa3b2796ddf7b6870b/mkdocs_get_deps-0.2.0.tar.gz", hash = "sha256:162b3d129c7fad9b19abfdcb9c1458a651628e4b1dea628ac68790fb3061c60c", size = 10239, upload-time = "2023-11-20T17:51:09.981Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9f/d4/029f984e8d3f3b6b726bd33cafc473b75e9e44c0f7e80a5b29abc466bdea/mkdocs_get_deps-0.2.0-py3-none-any.whl", hash = "sha256:2bf11d0b133e77a0dd036abeeb06dec8775e46efa526dc70667d8863eefc6134", size = 9521, upload-time = "2023-11-20T17:51:08.587Z" }, +] + +[[package]] +name = "mkdocs-literate-nav" +version = "0.6.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mkdocs" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f6/5f/99aa379b305cd1c2084d42db3d26f6de0ea9bf2cc1d10ed17f61aff35b9a/mkdocs_literate_nav-0.6.2.tar.gz", hash = "sha256:760e1708aa4be86af81a2b56e82c739d5a8388a0eab1517ecfd8e5aa40810a75", size = 17419, upload-time = "2025-03-18T21:53:09.711Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/84/b5b14d2745e4dd1a90115186284e9ee1b4d0863104011ab46abb7355a1c3/mkdocs_literate_nav-0.6.2-py3-none-any.whl", hash = "sha256:0a6489a26ec7598477b56fa112056a5e3a6c15729f0214bea8a4dbc55bd5f630", size = 13261, upload-time = "2025-03-18T21:53:08.1Z" }, +] + +[[package]] +name = "mkdocs-material" +version = "9.6.20" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "babel" }, + { name = "backrefs" }, + { name = "click" }, + { name = "colorama" }, + { name = "jinja2" }, + { name = "markdown" }, + { name = "mkdocs" }, + { name = "mkdocs-material-extensions" }, + { name = "paginate" }, + { name = "pygments" }, + { name = "pymdown-extensions" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ba/ee/6ed7fc739bd7591485c8bec67d5984508d3f2733e708f32714c21593341a/mkdocs_material-9.6.20.tar.gz", hash = "sha256:e1f84d21ec5fb730673c4259b2e0d39f8d32a3fef613e3a8e7094b012d43e790", size = 4037822, upload-time = "2025-09-15T08:48:01.816Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/67/d8/a31dd52e657bf12b20574706d07df8d767e1ab4340f9bfb9ce73950e5e59/mkdocs_material-9.6.20-py3-none-any.whl", hash = "sha256:b8d8c8b0444c7c06dd984b55ba456ce731f0035c5a1533cc86793618eb1e6c82", size = 9193367, upload-time = "2025-09-15T08:47:58.722Z" }, +] + +[[package]] +name = "mkdocs-material-extensions" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/79/9b/9b4c96d6593b2a541e1cb8b34899a6d021d208bb357042823d4d2cabdbe7/mkdocs_material_extensions-1.3.1.tar.gz", hash = "sha256:10c9511cea88f568257f960358a467d12b970e1f7b2c0e5fb2bb48cab1928443", size = 11847, upload-time = "2023-11-22T19:09:45.208Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5b/54/662a4743aa81d9582ee9339d4ffa3c8fd40a4965e033d77b9da9774d3960/mkdocs_material_extensions-1.3.1-py3-none-any.whl", hash = "sha256:adff8b62700b25cb77b53358dad940f3ef973dd6db797907c49e3c2ef3ab4e31", size = 8728, upload-time = "2023-11-22T19:09:43.465Z" }, +] + +[[package]] +name = "packaging" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + +[[package]] +name = "paginate" +version = "0.5.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ec/46/68dde5b6bc00c1296ec6466ab27dddede6aec9af1b99090e1107091b3b84/paginate-0.5.7.tar.gz", hash = "sha256:22bd083ab41e1a8b4f3690544afb2c60c25e5c9a63a30fa2f483f6c60c8e5945", size = 19252, upload-time = "2024-08-25T14:17:24.139Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/90/96/04b8e52da071d28f5e21a805b19cb9390aa17a47462ac87f5e2696b9566d/paginate-0.5.7-py2.py3-none-any.whl", hash = "sha256:b885e2af73abcf01d9559fd5216b57ef722f8c42affbb63942377668e35c7591", size = 13746, upload-time = "2024-08-25T14:17:22.55Z" }, +] + +[[package]] +name = "pathspec" +version = "0.12.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ca/bc/f35b8446f4531a7cb215605d100cd88b7ac6f44ab3fc94870c120ab3adbf/pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712", size = 51043, upload-time = "2023-12-10T22:30:45Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", size = 31191, upload-time = "2023-12-10T22:30:43.14Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/23/e8/21db9c9987b0e728855bd57bff6984f67952bea55d6f75e055c46b5383e8/platformdirs-4.4.0.tar.gz", hash = "sha256:ca753cf4d81dc309bc67b0ea38fd15dc97bc30ce419a7f58d13eb3bf14c4febf", size = 21634, upload-time = "2025-08-26T14:32:04.268Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/40/4b/2028861e724d3bd36227adfa20d3fd24c3fc6d52032f4a93c133be5d17ce/platformdirs-4.4.0-py3-none-any.whl", hash = "sha256:abd01743f24e5287cd7a5db3752faf1a2d65353f38ec26d98e25a6db65958c85", size = 18654, upload-time = "2025-08-26T14:32:02.735Z" }, +] + +[[package]] +name = "plotly-js" +version = "3.1.0" +source = { virtual = "." } +dependencies = [ + { name = "markdown" }, + { name = "python-frontmatter" }, + { name = "ruff" }, +] + +[package.optional-dependencies] +dev-build = [ + { name = "mkdocs" }, + { name = "mkdocs-gen-files" }, + { name = "mkdocs-literate-nav" }, + { name = "mkdocs-material" }, +] + +[package.metadata] +requires-dist = [ + { name = "markdown" }, + { name = "mkdocs", marker = "extra == 'dev-build'" }, + { name = "mkdocs-gen-files", marker = "extra == 'dev-build'" }, + { name = "mkdocs-literate-nav", marker = "extra == 'dev-build'" }, + { name = "mkdocs-material", marker = "extra == 'dev-build'" }, + { name = "python-frontmatter" }, + { name = "ruff" }, +] +provides-extras = ["dev-build"] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "pymdown-extensions" +version = "10.16.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown" }, + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/b3/6d2b3f149bc5413b0a29761c2c5832d8ce904a1d7f621e86616d96f505cc/pymdown_extensions-10.16.1.tar.gz", hash = "sha256:aace82bcccba3efc03e25d584e6a22d27a8e17caa3f4dd9f207e49b787aa9a91", size = 853277, upload-time = "2025-07-28T16:19:34.167Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e4/06/43084e6cbd4b3bc0e80f6be743b2e79fbc6eed8de9ad8c629939fa55d972/pymdown_extensions-10.16.1-py3-none-any.whl", hash = "sha256:d6ba157a6c03146a7fb122b2b9a121300056384eafeec9c9f9e584adfdb2a32d", size = 266178, upload-time = "2025-07-28T16:19:31.401Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "python-frontmatter" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/96/de/910fa208120314a12f9a88ea63e03707261692af782c99283f1a2c8a5e6f/python-frontmatter-1.1.0.tar.gz", hash = "sha256:7118d2bd56af9149625745c58c9b51fb67e8d1294a0c76796dafdc72c36e5f6d", size = 16256, upload-time = "2024-01-16T18:50:04.052Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/87/3c8da047b3ec5f99511d1b4d7a5bc72d4b98751c7e78492d14dc736319c5/python_frontmatter-1.1.0-py3-none-any.whl", hash = "sha256:335465556358d9d0e6c98bbeb69b1c969f2a4a21360587b9873bfc3b213407c1", size = 9834, upload-time = "2024-01-16T18:50:00.911Z" }, +] + +[[package]] +name = "pyyaml" +version = "6.0.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", size = 130631, upload-time = "2024-08-06T20:33:50.674Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/86/0c/c581167fc46d6d6d7ddcfb8c843a4de25bdd27e4466938109ca68492292c/PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab", size = 183873, upload-time = "2024-08-06T20:32:25.131Z" }, + { url = "https://files.pythonhosted.org/packages/a8/0c/38374f5bb272c051e2a69281d71cba6fdb983413e6758b84482905e29a5d/PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725", size = 173302, upload-time = "2024-08-06T20:32:26.511Z" }, + { url = "https://files.pythonhosted.org/packages/c3/93/9916574aa8c00aa06bbac729972eb1071d002b8e158bd0e83a3b9a20a1f7/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5", size = 739154, upload-time = "2024-08-06T20:32:28.363Z" }, + { url = "https://files.pythonhosted.org/packages/95/0f/b8938f1cbd09739c6da569d172531567dbcc9789e0029aa070856f123984/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425", size = 766223, upload-time = "2024-08-06T20:32:30.058Z" }, + { url = "https://files.pythonhosted.org/packages/b9/2b/614b4752f2e127db5cc206abc23a8c19678e92b23c3db30fc86ab731d3bd/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476", size = 767542, upload-time = "2024-08-06T20:32:31.881Z" }, + { url = "https://files.pythonhosted.org/packages/d4/00/dd137d5bcc7efea1836d6264f049359861cf548469d18da90cd8216cf05f/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48", size = 731164, upload-time = "2024-08-06T20:32:37.083Z" }, + { url = "https://files.pythonhosted.org/packages/c9/1f/4f998c900485e5c0ef43838363ba4a9723ac0ad73a9dc42068b12aaba4e4/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b", size = 756611, upload-time = "2024-08-06T20:32:38.898Z" }, + { url = "https://files.pythonhosted.org/packages/df/d1/f5a275fdb252768b7a11ec63585bc38d0e87c9e05668a139fea92b80634c/PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4", size = 140591, upload-time = "2024-08-06T20:32:40.241Z" }, + { url = "https://files.pythonhosted.org/packages/0c/e8/4f648c598b17c3d06e8753d7d13d57542b30d56e6c2dedf9c331ae56312e/PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8", size = 156338, upload-time = "2024-08-06T20:32:41.93Z" }, + { url = "https://files.pythonhosted.org/packages/ef/e3/3af305b830494fa85d95f6d95ef7fa73f2ee1cc8ef5b495c7c3269fb835f/PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", size = 181309, upload-time = "2024-08-06T20:32:43.4Z" }, + { url = "https://files.pythonhosted.org/packages/45/9f/3b1c20a0b7a3200524eb0076cc027a970d320bd3a6592873c85c92a08731/PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", size = 171679, upload-time = "2024-08-06T20:32:44.801Z" }, + { url = "https://files.pythonhosted.org/packages/7c/9a/337322f27005c33bcb656c655fa78325b730324c78620e8328ae28b64d0c/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", size = 733428, upload-time = "2024-08-06T20:32:46.432Z" }, + { url = "https://files.pythonhosted.org/packages/a3/69/864fbe19e6c18ea3cc196cbe5d392175b4cf3d5d0ac1403ec3f2d237ebb5/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", size = 763361, upload-time = "2024-08-06T20:32:51.188Z" }, + { url = "https://files.pythonhosted.org/packages/04/24/b7721e4845c2f162d26f50521b825fb061bc0a5afcf9a386840f23ea19fa/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", size = 759523, upload-time = "2024-08-06T20:32:53.019Z" }, + { url = "https://files.pythonhosted.org/packages/2b/b2/e3234f59ba06559c6ff63c4e10baea10e5e7df868092bf9ab40e5b9c56b6/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", size = 726660, upload-time = "2024-08-06T20:32:54.708Z" }, + { url = "https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size = 751597, upload-time = "2024-08-06T20:32:56.985Z" }, + { url = "https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size = 140527, upload-time = "2024-08-06T20:33:03.001Z" }, + { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446, upload-time = "2024-08-06T20:33:04.33Z" }, +] + +[[package]] +name = "pyyaml-env-tag" +version = "1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/eb/2e/79c822141bfd05a853236b504869ebc6b70159afc570e1d5a20641782eaa/pyyaml_env_tag-1.1.tar.gz", hash = "sha256:2eb38b75a2d21ee0475d6d97ec19c63287a7e140231e4214969d0eac923cd7ff", size = 5737, upload-time = "2025-05-13T15:24:01.64Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/11/432f32f8097b03e3cd5fe57e88efb685d964e2e5178a48ed61e841f7fdce/pyyaml_env_tag-1.1-py3-none-any.whl", hash = "sha256:17109e1a528561e32f026364712fee1264bc2ea6715120891174ed1b980d2e04", size = 4722, upload-time = "2025-05-13T15:23:59.629Z" }, +] + +[[package]] +name = "requests" +version = "2.32.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c9/74/b3ff8e6c8446842c3f5c837e9c3dfcfe2018ea6ecef224c710c85ef728f4/requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf", size = 134517, upload-time = "2025-08-18T20:46:02.573Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", size = 64738, upload-time = "2025-08-18T20:46:00.542Z" }, +] + +[[package]] +name = "ruff" +version = "0.13.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6e/1a/1f4b722862840295bcaba8c9e5261572347509548faaa99b2d57ee7bfe6a/ruff-0.13.0.tar.gz", hash = "sha256:5b4b1ee7eb35afae128ab94459b13b2baaed282b1fb0f472a73c82c996c8ae60", size = 5372863, upload-time = "2025-09-10T16:25:37.917Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ac/fe/6f87b419dbe166fd30a991390221f14c5b68946f389ea07913e1719741e0/ruff-0.13.0-py3-none-linux_armv6l.whl", hash = "sha256:137f3d65d58ee828ae136a12d1dc33d992773d8f7644bc6b82714570f31b2004", size = 12187826, upload-time = "2025-09-10T16:24:39.5Z" }, + { url = "https://files.pythonhosted.org/packages/e4/25/c92296b1fc36d2499e12b74a3fdb230f77af7bdf048fad7b0a62e94ed56a/ruff-0.13.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:21ae48151b66e71fd111b7d79f9ad358814ed58c339631450c66a4be33cc28b9", size = 12933428, upload-time = "2025-09-10T16:24:43.866Z" }, + { url = "https://files.pythonhosted.org/packages/44/cf/40bc7221a949470307d9c35b4ef5810c294e6cfa3caafb57d882731a9f42/ruff-0.13.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:64de45f4ca5441209e41742d527944635a05a6e7c05798904f39c85bafa819e3", size = 12095543, upload-time = "2025-09-10T16:24:46.638Z" }, + { url = "https://files.pythonhosted.org/packages/f1/03/8b5ff2a211efb68c63a1d03d157e924997ada87d01bebffbd13a0f3fcdeb/ruff-0.13.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2b2c653ae9b9d46e0ef62fc6fbf5b979bda20a0b1d2b22f8f7eb0cde9f4963b8", size = 12312489, upload-time = "2025-09-10T16:24:49.556Z" }, + { url = "https://files.pythonhosted.org/packages/37/fc/2336ef6d5e9c8d8ea8305c5f91e767d795cd4fc171a6d97ef38a5302dadc/ruff-0.13.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4cec632534332062bc9eb5884a267b689085a1afea9801bf94e3ba7498a2d207", size = 11991631, upload-time = "2025-09-10T16:24:53.439Z" }, + { url = "https://files.pythonhosted.org/packages/39/7f/f6d574d100fca83d32637d7f5541bea2f5e473c40020bbc7fc4a4d5b7294/ruff-0.13.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dcd628101d9f7d122e120ac7c17e0a0f468b19bc925501dbe03c1cb7f5415b24", size = 13720602, upload-time = "2025-09-10T16:24:56.392Z" }, + { url = "https://files.pythonhosted.org/packages/fd/c8/a8a5b81d8729b5d1f663348d11e2a9d65a7a9bd3c399763b1a51c72be1ce/ruff-0.13.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:afe37db8e1466acb173bb2a39ca92df00570e0fd7c94c72d87b51b21bb63efea", size = 14697751, upload-time = "2025-09-10T16:24:59.89Z" }, + { url = "https://files.pythonhosted.org/packages/57/f5/183ec292272ce7ec5e882aea74937f7288e88ecb500198b832c24debc6d3/ruff-0.13.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0f96a8d90bb258d7d3358b372905fe7333aaacf6c39e2408b9f8ba181f4b6ef2", size = 14095317, upload-time = "2025-09-10T16:25:03.025Z" }, + { url = "https://files.pythonhosted.org/packages/9f/8d/7f9771c971724701af7926c14dab31754e7b303d127b0d3f01116faef456/ruff-0.13.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:94b5e3d883e4f924c5298e3f2ee0f3085819c14f68d1e5b6715597681433f153", size = 13144418, upload-time = "2025-09-10T16:25:06.272Z" }, + { url = "https://files.pythonhosted.org/packages/a8/a6/7985ad1778e60922d4bef546688cd8a25822c58873e9ff30189cfe5dc4ab/ruff-0.13.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03447f3d18479df3d24917a92d768a89f873a7181a064858ea90a804a7538991", size = 13370843, upload-time = "2025-09-10T16:25:09.965Z" }, + { url = "https://files.pythonhosted.org/packages/64/1c/bafdd5a7a05a50cc51d9f5711da704942d8dd62df3d8c70c311e98ce9f8a/ruff-0.13.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:fbc6b1934eb1c0033da427c805e27d164bb713f8e273a024a7e86176d7f462cf", size = 13321891, upload-time = "2025-09-10T16:25:12.969Z" }, + { url = "https://files.pythonhosted.org/packages/bc/3e/7817f989cb9725ef7e8d2cee74186bf90555279e119de50c750c4b7a72fe/ruff-0.13.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a8ab6a3e03665d39d4a25ee199d207a488724f022db0e1fe4002968abdb8001b", size = 12119119, upload-time = "2025-09-10T16:25:16.621Z" }, + { url = "https://files.pythonhosted.org/packages/58/07/9df080742e8d1080e60c426dce6e96a8faf9a371e2ce22eef662e3839c95/ruff-0.13.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d2a5c62f8ccc6dd2fe259917482de7275cecc86141ee10432727c4816235bc41", size = 11961594, upload-time = "2025-09-10T16:25:19.49Z" }, + { url = "https://files.pythonhosted.org/packages/6a/f4/ae1185349197d26a2316840cb4d6c3fba61d4ac36ed728bf0228b222d71f/ruff-0.13.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b7b85ca27aeeb1ab421bc787009831cffe6048faae08ad80867edab9f2760945", size = 12933377, upload-time = "2025-09-10T16:25:22.371Z" }, + { url = "https://files.pythonhosted.org/packages/b6/39/e776c10a3b349fc8209a905bfb327831d7516f6058339a613a8d2aaecacd/ruff-0.13.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:79ea0c44a3032af768cabfd9616e44c24303af49d633b43e3a5096e009ebe823", size = 13418555, upload-time = "2025-09-10T16:25:25.681Z" }, + { url = "https://files.pythonhosted.org/packages/46/09/dca8df3d48e8b3f4202bf20b1658898e74b6442ac835bfe2c1816d926697/ruff-0.13.0-py3-none-win32.whl", hash = "sha256:4e473e8f0e6a04e4113f2e1de12a5039579892329ecc49958424e5568ef4f768", size = 12141613, upload-time = "2025-09-10T16:25:28.664Z" }, + { url = "https://files.pythonhosted.org/packages/61/21/0647eb71ed99b888ad50e44d8ec65d7148babc0e242d531a499a0bbcda5f/ruff-0.13.0-py3-none-win_amd64.whl", hash = "sha256:48e5c25c7a3713eea9ce755995767f4dcd1b0b9599b638b12946e892123d1efb", size = 13258250, upload-time = "2025-09-10T16:25:31.773Z" }, + { url = "https://files.pythonhosted.org/packages/e1/a3/03216a6a86c706df54422612981fb0f9041dbb452c3401501d4a22b942c9/ruff-0.13.0-py3-none-win_arm64.whl", hash = "sha256:ab80525317b1e1d38614addec8ac954f1b3e662de9d59114ecbf771d00cf613e", size = 12312357, upload-time = "2025-09-10T16:25:35.595Z" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "urllib3" +version = "2.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/15/22/9ee70a2574a4f4599c47dd506532914ce044817c7752a79b6a51286319bc/urllib3-2.5.0.tar.gz", hash = "sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760", size = 393185, upload-time = "2025-06-18T14:07:41.644Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a7/c2/fe1e52489ae3122415c51f387e221dd0773709bad6c6cdaa599e8a2c5185/urllib3-2.5.0-py3-none-any.whl", hash = "sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc", size = 129795, upload-time = "2025-06-18T14:07:40.39Z" }, +] + +[[package]] +name = "watchdog" +version = "6.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/db/7d/7f3d619e951c88ed75c6037b246ddcf2d322812ee8ea189be89511721d54/watchdog-6.0.0.tar.gz", hash = "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282", size = 131220, upload-time = "2024-11-01T14:07:13.037Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/39/ea/3930d07dafc9e286ed356a679aa02d777c06e9bfd1164fa7c19c288a5483/watchdog-6.0.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdd4e6f14b8b18c334febb9c4425a878a2ac20efd1e0b231978e7b150f92a948", size = 96471, upload-time = "2024-11-01T14:06:37.745Z" }, + { url = "https://files.pythonhosted.org/packages/12/87/48361531f70b1f87928b045df868a9fd4e253d9ae087fa4cf3f7113be363/watchdog-6.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c7c15dda13c4eb00d6fb6fc508b3c0ed88b9d5d374056b239c4ad1611125c860", size = 88449, upload-time = "2024-11-01T14:06:39.748Z" }, + { url = "https://files.pythonhosted.org/packages/5b/7e/8f322f5e600812e6f9a31b75d242631068ca8f4ef0582dd3ae6e72daecc8/watchdog-6.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f10cb2d5902447c7d0da897e2c6768bca89174d0c6e1e30abec5421af97a5b0", size = 89054, upload-time = "2024-11-01T14:06:41.009Z" }, + { url = "https://files.pythonhosted.org/packages/68/98/b0345cabdce2041a01293ba483333582891a3bd5769b08eceb0d406056ef/watchdog-6.0.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:490ab2ef84f11129844c23fb14ecf30ef3d8a6abafd3754a6f75ca1e6654136c", size = 96480, upload-time = "2024-11-01T14:06:42.952Z" }, + { url = "https://files.pythonhosted.org/packages/85/83/cdf13902c626b28eedef7ec4f10745c52aad8a8fe7eb04ed7b1f111ca20e/watchdog-6.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:76aae96b00ae814b181bb25b1b98076d5fc84e8a53cd8885a318b42b6d3a5134", size = 88451, upload-time = "2024-11-01T14:06:45.084Z" }, + { url = "https://files.pythonhosted.org/packages/fe/c4/225c87bae08c8b9ec99030cd48ae9c4eca050a59bf5c2255853e18c87b50/watchdog-6.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a175f755fc2279e0b7312c0035d52e27211a5bc39719dd529625b1930917345b", size = 89057, upload-time = "2024-11-01T14:06:47.324Z" }, + { url = "https://files.pythonhosted.org/packages/a9/c7/ca4bf3e518cb57a686b2feb4f55a1892fd9a3dd13f470fca14e00f80ea36/watchdog-6.0.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:7607498efa04a3542ae3e05e64da8202e58159aa1fa4acddf7678d34a35d4f13", size = 79079, upload-time = "2024-11-01T14:06:59.472Z" }, + { url = "https://files.pythonhosted.org/packages/5c/51/d46dc9332f9a647593c947b4b88e2381c8dfc0942d15b8edc0310fa4abb1/watchdog-6.0.0-py3-none-manylinux2014_armv7l.whl", hash = "sha256:9041567ee8953024c83343288ccc458fd0a2d811d6a0fd68c4c22609e3490379", size = 79078, upload-time = "2024-11-01T14:07:01.431Z" }, + { url = "https://files.pythonhosted.org/packages/d4/57/04edbf5e169cd318d5f07b4766fee38e825d64b6913ca157ca32d1a42267/watchdog-6.0.0-py3-none-manylinux2014_i686.whl", hash = "sha256:82dc3e3143c7e38ec49d61af98d6558288c415eac98486a5c581726e0737c00e", size = 79076, upload-time = "2024-11-01T14:07:02.568Z" }, + { url = "https://files.pythonhosted.org/packages/ab/cc/da8422b300e13cb187d2203f20b9253e91058aaf7db65b74142013478e66/watchdog-6.0.0-py3-none-manylinux2014_ppc64.whl", hash = "sha256:212ac9b8bf1161dc91bd09c048048a95ca3a4c4f5e5d4a7d1b1a7d5752a7f96f", size = 79077, upload-time = "2024-11-01T14:07:03.893Z" }, + { url = "https://files.pythonhosted.org/packages/2c/3b/b8964e04ae1a025c44ba8e4291f86e97fac443bca31de8bd98d3263d2fcf/watchdog-6.0.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:e3df4cbb9a450c6d49318f6d14f4bbc80d763fa587ba46ec86f99f9e6876bb26", size = 79078, upload-time = "2024-11-01T14:07:05.189Z" }, + { url = "https://files.pythonhosted.org/packages/62/ae/a696eb424bedff7407801c257d4b1afda455fe40821a2be430e173660e81/watchdog-6.0.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:2cce7cfc2008eb51feb6aab51251fd79b85d9894e98ba847408f662b3395ca3c", size = 79077, upload-time = "2024-11-01T14:07:06.376Z" }, + { url = "https://files.pythonhosted.org/packages/b5/e8/dbf020b4d98251a9860752a094d09a65e1b436ad181faf929983f697048f/watchdog-6.0.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:20ffe5b202af80ab4266dcd3e91aae72bf2da48c0d33bdb15c66658e685e94e2", size = 79078, upload-time = "2024-11-01T14:07:07.547Z" }, + { url = "https://files.pythonhosted.org/packages/07/f6/d0e5b343768e8bcb4cda79f0f2f55051bf26177ecd5651f84c07567461cf/watchdog-6.0.0-py3-none-win32.whl", hash = "sha256:07df1fdd701c5d4c8e55ef6cf55b8f0120fe1aef7ef39a1c6fc6bc2e606d517a", size = 79065, upload-time = "2024-11-01T14:07:09.525Z" }, + { url = "https://files.pythonhosted.org/packages/db/d9/c495884c6e548fce18a8f40568ff120bc3a4b7b99813081c8ac0c936fa64/watchdog-6.0.0-py3-none-win_amd64.whl", hash = "sha256:cbafb470cf848d93b5d013e2ecb245d4aa1c8fd0504e863ccefa32445359d680", size = 79070, upload-time = "2024-11-01T14:07:10.686Z" }, + { url = "https://files.pythonhosted.org/packages/33/e8/e40370e6d74ddba47f002a32919d91310d6074130fe4e17dabcafc15cbf1/watchdog-6.0.0-py3-none-win_ia64.whl", hash = "sha256:a1914259fa9e1454315171103c6a30961236f508b9b623eae470268bbcc6a22f", size = 79067, upload-time = "2024-11-01T14:07:11.845Z" }, +]