diff --git a/.Rbuildignore b/.Rbuildignore
index 68171b6ad..0bb1753af 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -12,7 +12,6 @@ lib/
.prettierrc
.circleci
.github
-.build_cache
# demo folder has special meaning in R
# this should hopefully make it still
diff --git a/.builderrc b/.builderrc
deleted file mode 100644
index 8cf7af30d..000000000
--- a/.builderrc
+++ /dev/null
@@ -1,3 +0,0 @@
----
-archetypes:
- - dash-components-archetype
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 27f89cb69..8960972a9 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,15 +9,15 @@ jobs:
steps:
- run: percy finalize --all
- lint-unit-37: &lint-unit
+ lint-unit-39: &lint-unit
working_directory: ~/project
docker:
- - image: circleci/python:3.7.9-stretch-node-browsers
+ - image: circleci/python:3.9.2-buster-node-browsers
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
environment:
- PYTHON_VERSION: py37
+ PYTHON_VERSION: py39
steps:
- checkout
- run: echo $PYTHON_VERSION > ver.txt
@@ -28,7 +28,7 @@ jobs:
command: |
sudo pip install virtualenv --upgrade
python -m venv venv || virtualenv venv && . venv/bin/activate
- pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dev#egg=dash[dev,testing]
+ pip install --progress-bar off -e git+https://github.com/plotly/dash.git@deps-update-20210628#egg=dash[dev,testing]
pip install --progress-bar off --no-cache-dir -r dev-requirements.txt
- save_cache:
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
@@ -41,16 +41,11 @@ jobs:
set -eo pipefail
npm ci
npm run lint
- - run:
- name: ๐ Unit Tests
- command: |
- set -eo pipefail
- npm run test-unit
lint-unit-36:
<<: *lint-unit
docker:
- - image: circleci/python:3.6.12-stretch-node-browsers
+ - image: circleci/python:3.6.13-stretch-node-browsers
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
@@ -67,15 +62,15 @@ jobs:
environment:
PYTHON_VERSION: py27
- build-dash-37: &build-dash
+ build-dash-39: &build-dash
working_directory: ~/project
docker:
- - image: circleci/python:3.7.9-stretch-node-browsers
+ - image: circleci/python:3.9.2-buster-node-browsers
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
environment:
- PYTHON_VERSION: py37
+ PYTHON_VERSION: py39
steps:
- checkout
- run: echo $PYTHON_VERSION > ver.txt
@@ -115,7 +110,7 @@ jobs:
build-dash-36:
<<: *build-dash
docker:
- - image: circleci/python:3.6.12-stretch-node-browsers
+ - image: circleci/python:3.6.13-stretch-node-browsers
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
@@ -132,16 +127,17 @@ jobs:
environment:
PYTHON_VERSION: py27
- test-37: &test
+ test-39: &test
working_directory: ~/project
docker:
- - image: circleci/python:3.7.9-stretch-node-browsers
+ - image: circleci/python:3.9.2-buster-node-browsers
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
environment:
- PYTHON_VERSION: py37
+ PYTHON_VERSION: py39
PERCY_PARALLEL_TOTAL: -1
+ PERCY_ENABLE: 1
parallelism: 3
steps:
- checkout
@@ -159,6 +155,7 @@ jobs:
find . -name "dash_*.gz" | xargs pip install -I --progress-bar off --no-cache-dir
pip install --no-cache-dir --progress-bar off main.tar.gz[dev,testing]
pip list | grep dash | xargs pip show && cd ..
+ echo $(python -V 2>&1) | grep 3. && python -m unittest tests/test_dash_import.py
TESTFILES=$(circleci tests glob "tests/integration/**/test_*.py" | circleci tests split --split-by=timings)
pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}
- store_artifacts:
@@ -171,7 +168,7 @@ jobs:
test-36:
<<: *test
docker:
- - image: circleci/python:3.6.12-stretch-node-browsers
+ - image: circleci/python:3.6.13-stretch-node-browsers
auth:
username: dashautomation
password: $DASH_PAT_DOCKERHUB
@@ -190,80 +187,18 @@ jobs:
PYTHON_VERSION: py27
PERCY_ENABLE: 0
- test-legacy-37: &test-legacy
- working_directory: ~/project
- docker:
- - image: circleci/python:3.7.9-stretch-node-browsers
- auth:
- username: dashautomation
- password: $DASH_PAT_DOCKERHUB
- environment:
- PYTHON_VERSION: py37
- PERCY_PARALLEL_TOTAL: -1
- parallelism: 2
- steps:
- - checkout
- - run: echo $PYTHON_VERSION > ver.txt
- - restore_cache:
- key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
- - attach_workspace:
- at: ~/project
- - run:
- name: ๐งช Run Legacy Integration Tests
- command: |
- . venv/bin/activate && rm -rf dash_core_components && ls -la
- set -eo pipefail
- cd packages && mv dash-*.tar.gz main.tar.gz && ls -la
- find . -name "dash_*.gz" | xargs pip install -I --progress-bar off --no-cache-dir
- pip install --no-cache-dir --progress-bar off main.tar.gz[dev,testing]
- pip list | grep dash | xargs pip show && cd ..
- echo $(python -V 2>&1) | grep 3. && python -m unittest tests/test_dash_import.py
- TESTFILES=$(circleci tests glob "tests/test_integration_*.py" | circleci tests split --split-by=timings)
- pytest --durations=10 --junitxml=test-reports/junit_legacy.xml ${TESTFILES}
- - store_artifacts:
- path: test-reports
- - store_test_results:
- path: test-reports
- - store_artifacts:
- path: /tmp/dash_artifacts
-
- test-legacy-36:
- <<: *test-legacy
- docker:
- - image: circleci/python:3.6.12-stretch-node-browsers
- auth:
- username: dashautomation
- password: $DASH_PAT_DOCKERHUB
- environment:
- PYTHON_VERSION: py36
- PERCY_ENABLE: 0
- test-legacy-27:
- <<: *test-legacy
- docker:
- - image: circleci/python:2.7.18-stretch-node-browsers
- auth:
- username: dashautomation
- password: $DASH_PAT_DOCKERHUB
- environment:
- PYTHON_VERSION: py27
- PERCY_ENABLE: 0
-
workflows:
version: 2
- python3.7:
+ python3.9:
jobs:
- - lint-unit-37
- - build-dash-37
- - test-37:
- requires:
- - build-dash-37
- - test-legacy-37:
+ - lint-unit-39
+ - build-dash-39
+ - test-39:
requires:
- - build-dash-37
+ - build-dash-39
- percy-finalize:
requires:
- - test-37
- - test-legacy-37
+ - test-39
python3.6:
jobs:
@@ -272,9 +207,6 @@ workflows:
- test-36:
requires:
- build-dash-36
- - test-legacy-36:
- requires:
- - build-dash-36
python2.7:
jobs:
@@ -283,6 +215,3 @@ workflows:
- test-27:
requires:
- build-dash-27
- - test-legacy-27:
- requires:
- - build-dash-27
diff --git a/.eslintrc b/.eslintrc
index b790e292f..552481234 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -21,12 +21,8 @@
"browser": true,
"es6": true,
"jasmine": true,
- "jest": true,
"node": true
},
- "globals": {
- "jest": true
- },
"plugins": [
"react",
"import"
@@ -80,6 +76,7 @@
"no-param-reassign": ["off"],
"no-process-env": ["warn"],
"no-proto": ["error"],
+ "no-prototype-builtins": ["off"],
"no-redeclare": ["error"],
"no-return-assign": ["error"],
"no-script-url": ["error"],
diff --git a/.flake8 b/.flake8
index ee4b8b928..4447108e6 100644
--- a/.flake8
+++ b/.flake8
@@ -1,5 +1,5 @@
[flake8]
-ignore = C901, E203, E266, E501, E731, W503
+ignore = C901, E203, E231, E266, E501, E731, W503
select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 3eaef7dde..590079619 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,5 +24,6 @@ dash_core_components_base/plotly.min.js
/man
/R
/src/*.jl
+/src/jl/
DESCRIPTION
NAMESPACE
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 000000000..3867a0feb
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1 @@
+npm run lint
diff --git a/.huskyrc b/.huskyrc
deleted file mode 100644
index b142df717..000000000
--- a/.huskyrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "hooks": {
- "pre-commit": "npm run lint"
- }
-}
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
index eb81a49a9..2c3837cde 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,4 +1,5 @@
{
+ "arrowParens": "avoid",
"tabWidth": 4,
"singleQuote": true,
"bracketSpacing": false,
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 97a6f92dc..4e6d048cc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,8 +13,29 @@ This project adheres to [Semantic Versioning](http://semver.org/).
It not only fixes the bug where the tooltips were visible when slider was not, but it also reduces the lag in the
tooltip when the slider handles are moved.
+### Updated
+- [#939](https://github.com/plotly/dash-core-components/pull/939) Upgrade Plotly.js to v2.2.1. Note that this is a major version upgrade to Plotly.js, however we are not treating this as a breaking change for DCC as the majority of breaking changes in Plotly.js do not affect the Dash API. The one exception is that several trace types that have long been deprecated are removed entirely.
+ - [Major release 2.0.0](https://github.com/plotly/plotly.js/releases/tag/v2.0.0):
+ - Stop exporting d3 as `Plotly.d3`, and remove many other deep pieces of the public API. This does not affect the `dcc.Graph` component, but if you make use of `Plotly` from the global scope in some other way you may be affected.
+ - Drop the deprecated trace types `contourgl` and `area`, as well as legacy pre-`scatterpolar` polar attributes `bar.r`, `bar.t`, `scatter.r`, `scatter.t`, `layout.radialaxis`, `layout.angularaxis`. Use `scatterpolar`, `barpolar`, and `polar` subplots instead.
+ - `heatmapgl` and `pointcloud` trace types, and the `transform` attribute are deprecated, and will be removed in a future release.
+ - Increase CSP safety by removing function constructors. 3D plots still use function constructors, but if you place one of the non-3D bundles (including the new `strict` bundle) in your `assets` folder you will have no function constructors.
+ - Remove "Aa" text in legends.
+ - Default `hovermode` to "closest".
+ - Default `textposition` to "auto" in `bar` traces. If you previously used the `bar.text` attribute for hover only, you will need to explicitly set `textposition="none"`.
+ - Add `bar.marker.pattern`, `image.zsmooth`, and various other features and bugfixes.
+ - [Feature release 2.1.0](https://github.com/plotly/plotly.js/releases/tag/v2.1.0):
+ - New `icicle` trace type.
+ - New `legendrank` trace attribute.
+ - Several other additions and bug fixes.
+ - [Feature release 2.2.0](https://github.com/plotly/plotly.js/releases/tag/v2.2.0):
+ - Legend group titles
+ - Half-year directive (`%h`) for date formatting
+ - Several other bug fixes and performance improvements
+ - [Patch release 2.2.1](https://github.com/plotly/plotly.js/releases/tag/v2.2.1) containing a security fix.
+
### Added
-- [#932](https://github.com/plotly/dash-core-components/pull/932). Adds a new copy to clipboard component.
+- [#932](https://github.com/plotly/dash-core-components/pull/932) Adds a new copy to clipboard component.
- [#948](https://github.com/plotly/dash-core-components/pull/948)] Adds `disabled_days` prop to `DatePickerRange` and `DatePickerSingle` components. With this prop you can specify days that should be made unselectable in the date picker, in addition to those that fall outside of the range specified by `min_date_allowed` and `max_date_allowed`.
### Changed
diff --git a/MANIFEST.in b/MANIFEST.in
index 576fde457..4087e8352 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,12 +1,7 @@
-include dash_core_components/dash_core_components.min.js
-include dash_core_components/dash_core_components.min.js.map
-include dash_core_components/dash_core_components-shared.js
-include dash_core_components/dash_core_components-shared.js.map
-include dash_core_components/async-*.js
-include dash_core_components/async-*.js.map
+include dash_core_components/*.js
+include dash_core_components/*.js.map
include dash_core_components/metadata.json
include dash_core_components/package-info.json
-include dash_core_components/plotly.min.js
include README.md
include LICENSE.txt
include package.json
diff --git a/README.md b/README.md
index 6231bc9b5..41ca68c19 100644
--- a/README.md
+++ b/README.md
@@ -29,17 +29,6 @@ $ npm i --ignore-scripts && npm run build
$ pip install -e .
```
-### Demo server
-
-You can start up a demo development server to see a demo of the rendered
-components:
-
-```sh
-$ npm start
-```
-
-You have to maintain the list of components in `demo/Demo.react.js`.
-
### Code quality and tests
### To run integration tests (test_integration.py)
@@ -47,10 +36,6 @@ You can run the Selenium integration tests with the
```sh
npm test
```
-command, and the Jest unit tests with the
-```sh
-npm run test-unit
-```
### Testing your components in Dash
1. Run the build watcher by running
@@ -88,4 +73,4 @@ See the [dash-component-boilerplate](https://github.com/plotly/dash-component-bo
## Big Thanks
-Cross-browser Testing Powered by [![image](https://user-images.githubusercontent.com/1394467/64290307-e4c66600-cf33-11e9-85a1-12c82230a597.png)](https://saucelabs.com)
+Cross-browser Testing Powered by [![image](https://user-images.githubusercontent.com/1394467/64290307-e4c66600-cf33-11e9-85a1-12c82230a597.png)](https://saucelabs.com)
diff --git a/babel.config.js b/babel.config.js
index 432308071..b544f8e30 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -4,8 +4,6 @@ const presets = [
];
const plugins = [
- '@babel/plugin-proposal-nullish-coalescing-operator',
- '@babel/plugin-proposal-optional-chaining',
'@babel/plugin-syntax-dynamic-import'
];
diff --git a/dash_core_components_base/__init__.py b/dash_core_components_base/__init__.py
index 54944f6c9..4d5960d70 100644
--- a/dash_core_components_base/__init__.py
+++ b/dash_core_components_base/__init__.py
@@ -14,7 +14,7 @@
__version__ = package["version"]
# Module imports trigger a dash.development import, need to check this first
-if not hasattr(_dash, '__plotly_dash') and not hasattr(_dash, 'development'):
+if not hasattr(_dash, "__plotly_dash") and not hasattr(_dash, "development"):
print(
"Dash was not successfully imported. Make sure you don't have a file "
"named \n'dash.py' in your current directory.",
@@ -24,7 +24,12 @@
from ._imports_ import * # noqa: F401, F403, E402
from ._imports_ import __all__ # noqa: E402
-from .express import send_bytes, send_data_frame, send_file, send_string # noqa: F401, E402
+from .express import ( # noqa: F401, E402
+ send_bytes,
+ send_data_frame,
+ send_file,
+ send_string,
+)
_current_path = _os.path.dirname(_os.path.abspath(__file__))
@@ -76,18 +81,18 @@
_js_dist.extend(
[
{
- "relative_package_path": "{}.min.js".format(__name__),
+ "relative_package_path": "{}.js".format(__name__),
"external_url": (
"https://unpkg.com/dash-core-components@{}"
- "/dash_core_components/dash_core_components.min.js"
+ "/dash_core_components/dash_core_components.js"
).format(__version__),
"namespace": "dash_core_components",
},
{
- "relative_package_path": "{}.min.js.map".format(__name__),
+ "relative_package_path": "{}.js.map".format(__name__),
"external_url": (
"https://unpkg.com/dash-core-components@{}"
- "/dash_core_components/dash_core_components.min.js.map"
+ "/dash_core_components/dash_core_components.js.map"
).format(__version__),
"namespace": "dash_core_components",
"dynamic": True,
diff --git a/dash_core_components_base/express.py b/dash_core_components_base/express.py
index 769c1e43a..cb8a0f123 100644
--- a/dash_core_components_base/express.py
+++ b/dash_core_components_base/express.py
@@ -6,6 +6,7 @@
# Py2 StringIO.StringIO handles unicode but io.StringIO doesn't
try:
from StringIO import StringIO as _StringIO
+
py2 = True
except ImportError:
_StringIO = io.StringIO
diff --git a/demo/Demo.react.js b/demo/Demo.react.js
deleted file mode 100644
index 623e9cbff..000000000
--- a/demo/Demo.react.js
+++ /dev/null
@@ -1,334 +0,0 @@
-import React, {Component} from 'react';
-import ReactDOM from 'react-dom';
-import Playground from 'component-playground';
-import {
- Checklist,
- DatePickerRange,
- Dropdown,
- Graph,
- Input,
- RadioItems,
- RangeSlider,
- Slider,
- Interval,
- Markdown,
- Upload
-} from '../src';
-
-
-const UploadExample = `
-const properties = {};
-
-ReactDOM.render(
{JSON.stringify(this.state, null, 2)}-