Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into confirmationModal
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	test/test_integration.py
  • Loading branch information
T4rk1n committed Jul 18, 2018
2 parents ac90a45 + 3fc5312 commit 93ed6a7
Show file tree
Hide file tree
Showing 14 changed files with 108,223 additions and 198 deletions.
47 changes: 44 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,57 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- `ConfirmDialog` and `ConfirmDialogProvider` components [#211](https://github.com/plotly/dash-core-components/pull/211)

## [0.23.0] - UNRELEASED
## [0.24.1]
### Fixed
- Improved DatePickerRange, fixing issues [#209](https://github.com/plotly/dash-core-components/issues/209) and [#152](https://github.com/plotly/dash-core-components/issues/152)
- Link component now is a proper <a> tag so you can right click on it, and will scroll back to top. Fixes [#99](https://github.com/plotly/dash-core-components/issues/99), implemented in [#215](https://github.com/plotly/dash-core-components/pull/215)
- Added `max_interval` prop to `Interval` component, fixing issue [#222](https://github.com/plotly/dash-core-components/issues/222)


## [0.24.0]
### Added
- Upgraded Plotly.js, the underlying library behind the
`dash_core_components.Graph` component, to [version 1.38.0](https://github.com/plotly/plotly.js/releases/tag/v1.38.0).
See https://github.com/plotly/plotly.js/releases/tag/v1.38.0 for the official notes.
`dash_core_components.Graph` component, to [version 1.39.1](https://github.com/plotly/plotly.js/releases/tag/v1.39.1).
See https://github.com/plotly/plotly.js/releases/tag/v1.39.1 for the official notes.

Many of these features were funded directly by companies that rely on this library.
If your organization or company would like to sponsor particular features or
bug fixes in these open source libraries, please reach out: http://plot.ly/products/consulting-and-oem

As part of plotly.js release:
- Add support for on-graph text in scattergl traces [#2737](https://github.com/plotly/plotly.js/pull/2737), [#2783](https://github.com/plotly/plotly.js/pull/2783)
- Add gridshape attribute to polar subplots with values 'circular' (the default) and 'linear' (to draw polygon grids) [#2739](https://github.com/plotly/plotly.js/pull/2739)
- Add support for colorbar linked to marker.color values for splom,
scatterpolar and scatterpolargl traces [#2681](https://github.com/plotly/plotly.js/pull/2681)
- Revamp icon settings in custom mode bar buttons, allowing users to specify their own dimensions and SVG transforms [#2762](https://github.com/plotly/plotly.js/pull/2762)
- Add plotlyServerURL config option [#2760](https://github.com/plotly/plotly.js/pull/2760)
- Added no-WebGL warnings for graphs with scattergl, scatterpolargl, splom and parcoords traces [#2697](https://github.com/plotly/plotly.js/pull/2697)

### Fixed
As part of plotly.js release:
- Fix Plotly.react's handling of changing auto-margins [#2681](https://github.com/plotly/plotly.js/pull/2681)
- Make plotting/updating WebGL-based traces fail gracefully when WebGL isn't
supported [#2697](https://github.com/plotly/plotly.js/pull/2697)
- Fix mapbox layout layer updates [#2734](https://github.com/plotly/plotly.js/pull/2734)
- Fix mapbox event inconsistencies [#2766](https://github.com/plotly/plotly.js/pull/2766)
- Correctly emit plotly_relayout at end of scroll on mapbox subplots [#2709](https://github.com/plotly/plotly.js/pull/2709)
- Fix scatter3d scalar hovertext handling [#2698](https://github.com/plotly/plotly.js/pull/2698)
- Fix line decimation for segments crossing the viewport [#2705](https://github.com/plotly/plotly.js/pull/2705)
- Fix surface trace contours when first level has length zero [#2712](https://github.com/plotly/plotly.js/pull/2712)
- Fix contour(x|y|z).highlight partial settings [#2712](https://github.com/plotly/plotly.js/pull/2712)
- Fix old date timezone precision in Chrome 67+ [#2747](https://github.com/plotly/plotly.js/pull/2747)
- Fix x-only zoom moves when xaxis.fixedrange: true[#2776](https://github.com/plotly/plotly.js/pull/2776)
- Fix colorbar edits for parcoords and histogram traces [#2681](https://github.com/plotly/plotly.js/pull/2681)
- Fix bandwidth for single-value violins [#2775](https://github.com/plotly/plotly.js/pull/2775)
- Make Plots.resize work when layout attribute is gone from graph div [#2710](https://github.com/plotly/plotly.js/pull/2710)
- Fix colorscale attribute descriptions [#2658](https://github.com/plotly/plotly.js/pull/2658)

## [0.23.0]
### Added
- Upgraded Plotly.js, the underlying library behind the
`dash_core_components.Graph` component, to [version 1.38.0](https://github.com/plotly/plotly.js/releases/tag/v1.38.0).
See https://github.com/plotly/plotly.js/releases/tag/v1.38.0 for the official notes.

- Add 3D `cone` traces to visualize vector fields [#2641](https://github.com/plotly/plotly.js/pull/2641), [#2647](https://github.com/plotly/plotly.js/pull/2647)
- Add ability to interactively change length and rotate line shapes [#2594](https://github.com/plotly/plotly.js/pull/2594)
- Add `toImageButtonOptions` config object to override to-image mode bar button options [#2607](https://github.com/plotly/plotly.js/pull/2607)
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include dash_core_components/bundle.js.map
include dash_core_components/metadata.json
include dash_core_components/[email protected]
include dash_core_components/[email protected]
include dash_core_components/plotly-1.38.0.min.js
include dash_core_components/plotly-1.39.1.min.js
include dash_core_components/[email protected]
include dash_core_components/[email protected]
include dash_core_components/[email protected]
Expand Down
62 changes: 15 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,42 +59,18 @@ You have to maintain the list of components in `demo/Demo.react.js`.

### Code quality and tests

#### To run lint and unit tests:
### To run integration tests (test_integration.py)
We run our integration tests on CircleCI with help from Tox. There’s a tox.ini file which holds the configuration, refer to [tox's documentation](http://tox.readthedocs.io/en/latest/index.html) for help. You may need to set environment variables in your terminal, like `TOX_PYTHON_27` to my version of python that I wanted tox to use. So running:

```sh
$ npm test
export TOX_PYTHON_27=python2
```

#### To run unit tests and watch for changes:
set the `TOX_PYTHON_27` env variable to point to `python2`, which is Python 2.7 running on my machine.
You could also look in `tox.ini` and see which tests it runs, and run those commands yourself:

```sh
$ npm run test-watch
```

#### To debug unit tests in a browser (Chrome):

```sh
$ npm run test-debug
```

1. Wait until Chrome launches.
2. Click the "DEBUG" button in the top right corner.
3. Open up Chrome Devtools (`Cmd+opt+i`).
4. Click the "Sources" tab.
5. Find source files
- Navigate to `webpack:// -> . -> spec/components` to find your test source files.
- Navigate to `webpack:// -> [your/repo/path]] -> dash-core-components -> src` to find your component source files.
6. Now you can set breakpoints and reload the page to hit them.
7. The test output is available in the "Console" tab, or in any tab by pressing "Esc".

#### To run a specific test

In your test, append `.only` to a `describe` or `it` statement:

```javascript
describe.only('Foo component', () => {
// ...
});
python -m unittest test.test_integration
```

### Testing your components in Dash
Expand Down Expand Up @@ -142,26 +118,18 @@ publishing steps into one workflow.

Ask @chriddyp to get NPM / PyPi package publishing access.

1. Preparing to publish to NPM

# Bump the package version
$ npm version major|minor|patch

# Push branch and tags to repo
$ git push --follow-tags

2. Preparing to publish to PyPi
1 - Update `version.py`, we're using [semantic versioning](https://semver.org/)!

# Bump the PyPi package to the same version
$ vi setup.py
2 - Update `package.json`

# Commit to github
$ git add setup.py
$ git commit -m "Bump pypi package version to vx.x.x"

3. Publish to npm and PyPi
4 - Publish: `npm run publish-all` (Make sure you have access to NPM and PyPI)
4b - If the `publish-all` script fails on the `twine` command, try running
```sh
twine upload dist/dash_core_components-X.X.X.tar.gz # where xx.x.x is the version number
```

$ npm run publish-all
If you want to publish a prerelease package, change `version.py` to X.X.XrcX (0.23.1rc1 for example) and
`package.json` to X.X.X-rcX (notice how the rc syntax is different between node and python. npm requires a - between the version number and the prerelease tag while python's pip just has 0.23.1rc1)


## Builder / Archetype
Expand Down
6 changes: 3 additions & 3 deletions dash_core_components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@

_js_dist = [
{
'external_url': 'https://cdn.plot.ly/plotly-1.38.0.min.js',
'relative_package_path': 'plotly-1.38.0.min.js',
'external_url': 'https://cdn.plot.ly/plotly-1.39.1.min.js',
'relative_package_path': 'plotly-1.39.1.min.js',
'namespace': 'dash_core_components'
},
{
'relative_package_path': 'bundle.js',
'external_url': (
'https://unpkg.com/dash-core-components@{}'
'/dash_core_components/bundle.js'
).format(__version__),
).format('0.23.1-rc1'),
'namespace': 'dash_core_components'
}
]
Expand Down
107,960 changes: 107,932 additions & 28 deletions dash_core_components/bundle.js

Large diffs are not rendered by default.

106 changes: 38 additions & 68 deletions dash_core_components/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,73 +139,6 @@
}
}
},
"src/components/Confirm.react.js": {
"description": "Confirm wraps window.confirm",
"displayName": "Confirm",
"methods": [],
"props": {
"id": {
"type": {
"name": "string"
},
"required": false,
"description": ""
},
"message": {
"type": {
"name": "string"
},
"required": false,
"description": ""
},
"init": {
"type": {
"name": "shape",
"value": {
"value": {
"name": "any",
"required": false
},
"ask": {
"name": "bool",
"required": false
}
}
},
"required": false,
"description": ""
},
"result": {
"type": {
"name": "shape",
"value": {
"timestamp": {
"name": "custom",
"raw": "PropTypes.integer",
"required": false
},
"value": {
"name": "any",
"required": false
}
}
},
"required": false,
"description": "",
"defaultValue": {
"value": "{\n timestamp: -1\n}",
"computed": false
}
},
"setProps": {
"type": {
"name": "func"
},
"required": false,
"description": "Dash-assigned callback that gets fired when the value changes."
}
}
},
"src/components/DatePickerRange.react.js": {
"description": "DatePickerRange is a tailor made component designed for selecting\ntimespan across multiple days off of a calendar.\n\nThe DatePicker integrates well with the Python datetime module with the\nstartDate and endDate being returned in a string format suitable for\ncreating datetime objects.\n\nThis component is based off of Airbnb's react-dates react component\nwhich can be found here: https://github.com/airbnb/react-dates",
"displayName": "DatePickerRange",
Expand Down Expand Up @@ -512,6 +445,27 @@
},
"required": false,
"description": "Dash-assigned callback that gets fired when the value changes."
},
"updatemode": {
"type": {
"name": "enum",
"value": [
{
"value": "'singledate'",
"computed": false
},
{
"value": "'bothdates'",
"computed": false
}
]
},
"required": false,
"description": "Determines when the component should update\nits value. If `bothdates`, then the DatePicker \nwill only trigger its value when the user has\nfinished picking both dates. If `singledate`, then\nthe DatePicker will update its value \nas one date is picked.",
"defaultValue": {
"value": "'singledate'",
"computed": false
}
}
}
},
Expand Down Expand Up @@ -1687,6 +1641,17 @@
"computed": false
}
},
"max_intervals": {
"type": {
"name": "number"
},
"required": false,
"description": "Number of times the interval will be fired. If -1, then the interval has no limit (the default) and if 0 then the interval stops running.",
"defaultValue": {
"value": "-1",
"computed": false
}
},
"fireEvent": {
"type": {
"name": "func"
Expand Down Expand Up @@ -1724,7 +1689,12 @@
"name": "updateLocation",
"docblock": null,
"modifiers": [],
"params": [],
"params": [
{
"name": "e",
"type": null
}
],
"returns": null
}
],
Expand Down
7 changes: 0 additions & 7 deletions dash_core_components/plotly-1.38.0.min.js

This file was deleted.

7 changes: 7 additions & 0 deletions dash_core_components/plotly-1.39.1.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_core_components/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.23.0'
__version__ = '0.24.1'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-core-components",
"version": "0.23.0",
"version": "0.24.1",
"description": "Core component suite for Dash",
"repository": {
"type": "git",
Expand Down
44 changes: 31 additions & 13 deletions src/components/DatePickerRange.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,28 @@ export default class DatePickerRange extends Component {
componentWillMount() {
this.propsToState(this.props);
}

onDatesChange({startDate: start_date, endDate: end_date}) {
const {setProps, fireEvent} = this.props;
const {setProps, fireEvent, updatemode} = this.props;
const old_start_date = this.state.start_date
const old_end_date = this.state.end_date
const newState = {};
if (setProps && start_date !== null) {
setProps({start_date: start_date.format('YYYY-MM-DD')});
} else {
newState.start_date = start_date;
}
if (setProps && start_date !== null && start_date !== old_start_date) {
if(updatemode === 'singledate') {
setProps({start_date: start_date.format('YYYY-MM-DD')});
}
}

if (setProps && end_date !== null) {
setProps({end_date: end_date.format('YYYY-MM-DD')});
} else {
newState.end_date = end_date;
newState.start_date = start_date;

if (setProps && end_date !== null && end_date !== old_end_date) {
if(updatemode === 'singledate') {
setProps({end_date: end_date.format('YYYY-MM-DD')});
}
else if (updatemode === 'bothdates') {
setProps({start_date: start_date.format('YYYY-MM-DD'), end_date: end_date.format('YYYY-MM-DD')});
}
}
newState.end_date = end_date;

if (fireEvent) {
fireEvent('change');
Expand Down Expand Up @@ -313,7 +320,17 @@ DatePickerRange.propTypes = {
/**
* Dash-assigned callback that gets fired when the value changes.
*/
dashEvents: PropTypes.oneOf(['change'])
dashEvents: PropTypes.oneOf(['change']),

/**
* Determines when the component should update
* its value. If `bothdates`, then the DatePicker
* will only trigger its value when the user has
* finished picking both dates. If `singledate`, then
* the DatePicker will update its value
* as one date is picked.
*/
updatemode: PropTypes.oneOf(['singledate', 'bothdates'])
};

DatePickerRange.defaultProps = {
Expand All @@ -327,5 +344,6 @@ DatePickerRange.defaultProps = {
stay_open_on_select: false,
reopen_calendar_on_clear: false,
clearable: false,
disabled: false
disabled: false,
updatemode: 'singledate'
};
Loading

0 comments on commit 93ed6a7

Please sign in to comment.