Skip to content

Commit 3b315cb

Browse files
committed
Merge branch 'master' into PR #414
2 parents c5a8d53 + 96887ac commit 3b315cb

File tree

342 files changed

+48210
-14231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+48210
-14231
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ build
44

55
test/jasmine/assets/jquery-1.8.3.min.js
66
src/plots/polar/micropolar.js
7-
src/plots/geo/projections.js

.eslintrc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"root": true,
33
"extends": [
4-
"eslint:recommended",
4+
"eslint:recommended"
55
],
66
"env": {
77
"commonjs": true
88
},
99
"rules": {
1010
"no-trailing-spaces": [2],
11-
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 1}],
11+
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 0}],
1212
"eol-last": [2],
1313
"linebreak-style": [2, "unix"],
1414
"indent": [2, 4, {"SwitchCase": 1}],
1515
"max-len": [0, 80],
1616
"brace-style": [0, "stroustrup", {"allowSingleLine": true}],
1717
"curly": [0, "multi"],
1818
"camelcase": [0, {"properties": "never"}],
19-
"comma-spacing": [0, {"before": false, "after": true}],
19+
"comma-spacing": [2, {"before": false, "after": true}],
2020
"comma-style": [2, "last"],
2121
"semi": [2],
2222
"semi-spacing": [2, {"before": false, "after": true}],
@@ -36,9 +36,9 @@
3636
"no-whitespace-before-property": [2],
3737
"no-unexpected-multiline": [2],
3838
"no-floating-decimal": [2],
39-
"space-infix-ops": [0, {"int32Hint": false}],
39+
"space-infix-ops": [2, {"int32Hint": true}],
4040
"quotes": [2, "single"],
41-
"dot-notation": [2, {"allowKeywords": false}],
41+
"dot-notation": [2],
4242
"operator-linebreak": [2, "after"],
4343
"eqeqeq": [2],
4444
"new-cap": [0],
@@ -50,5 +50,5 @@
5050
"no-loop-func": [2],
5151
"no-console": [0],
5252
"no-unused-labels": [2]
53-
},
53+
}
5454
}

CHANGELOG.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,117 @@ https://github.com/plotly/plotly.js/compare/vX.Y.Z...master
1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

1212

13+
## [1.11.0] -- 2016-05-17
14+
15+
### Added
16+
- Add top-level methods `Plotly.toImage` to convert a plotly graph to an image
17+
data URL (svg, png, jpg, and webp are supported) and `Plotly.downloadImage` to
18+
download a plotly graph as an image [#446]
19+
- Add the ability to add arbitrary images loaded from a url to a plot's layout
20+
[#525]
21+
- Add the option of making legend span horizontally [#535]
22+
- Add `connectgaps` attribute to `scattergl` traces [#449]
23+
- Add new 'relative' bar mode which stacks on top of one another with negative
24+
values below the axis, positive values above [#517]
25+
- Add support for the 'winkel tripel' projection in geo subplots [#492]
26+
- Event `plotly_relayout` is now emitted on gl2d subplot drag/pan/zoom
27+
interactions [#466]
28+
- Add support for fill coloring in `contourgl` traces [#522, #543]
29+
30+
### Changed
31+
- Cartesian on-hover routine is now uses a 50ms interval between search calls
32+
instead of 100ms for smoother displaying hover labels [#514]
33+
- [Internal change] fullLayout `_has` fields are replaced by a `_has` method
34+
which checks if a particular plot type is present on a graph [#491]
35+
36+
### Fixed
37+
- Bar widths of traces with null coordinates are now correctly computed [#542]
38+
- Error bar spans on bar traces with null coordinates are now correctly computed
39+
[#542]
40+
- All promises spawn in `Plotly.plot` are now guaranteed to be resolved before
41+
the final resolve [#521]
42+
- Restyling `scatterternary` data attributes is now working [#540]
43+
- Error bar of 0 length in log axes are not included in hover labels (instead of
44+
showing `NaN`s) [#533]
45+
46+
47+
## [1.10.2] -- 2016-05-05
48+
49+
### Fixed
50+
- Subplot and range slider clip paths are now functional in AngularJS [#509]
51+
- `relayout` call involving axis `categoryorder` and `categoryarray` are now
52+
working [#510]
53+
- Annotation drag interactions in `editable: true` mode are now functional (bug
54+
introduced in 1.10.0)[#505]
55+
- Improved attribute description for shape `xref` and `yref` [#506]
56+
57+
58+
## [1.10.1] -- 2016-05-02
59+
60+
### Fixed
61+
- Resizing a graph (e.g. via `Plotly.relayout` or Plotly.Plots.resize)
62+
properly updates the plot area clip paths (bug introduced in 1.10.0) [#490]
63+
- `Plotly.Snapshot.toSVG` is now functional again in IE11 and old version of
64+
Chrome and FF (bug introduced in 1.10.0) [#489]
65+
- Hover labels of superimposed traces when 'hovermode' is set to 'closest' are
66+
properly displayed (bug introduced in 1.10.0) [#495]
67+
- Surface contour highlights are toggleable [#459]
68+
- Surface contour highlights style attributes are lower cased [#459]
69+
- Zoom overlay are drawn over shapes [#448]
70+
- Legend are draggable in `editable: true` contexts (bug introduced in 1.6.0)
71+
[#487]
72+
- Legend scroll box are drawn outside the legend [#478]
73+
74+
75+
## [1.10.0] -- 2016-04-12
76+
77+
### Added
78+
- Beta version of two new 2D WebGL trace types: `heatmapgl` and `contourgl`
79+
[#427, #434]
80+
- Two new `scatter` line `fill` modes: `'toself'` and `'tonext'` [#462]
81+
- Fills for `scatterternary` traces are now supported [#462]
82+
- Configurable axis category ordering with `categoryorder` and an optional
83+
`categoryarray` axis attributes [#419]
84+
- Configurable shapes layer position with shape attribute `layer` [#439]
85+
- Configurable range slider range (so that the initial xaxis range can differ
86+
from the range slider range) [#473]
87+
88+
### Changed
89+
- Nested SVG elements in SVG image exports are removed, making the to-image mode
90+
bar button work in RStudio and SVG export compatible with Adobe Illustrator
91+
[#415, #454, #442]
92+
- Use `country-regex` npm package instead of hard-coded file of ISO-3 code to
93+
country regular expressions [#461]
94+
95+
### Fixed
96+
- Legend positioning does not break on negative `x` and `y` settings (bug
97+
introduced in 1.6.0) [#417]
98+
- Shapes are properly deleted when clearing all of them at once (bug introduced
99+
in 1.9.0) [#465]
100+
- Promise are return after first render in gl3d and gl2d plots [#421]
101+
- Click and hover events are properly triggered when trace `hoverinfo` is set to
102+
`'none'` [#438]
103+
- `plotly_unhover` events is now properly triggered on geo trace types [#429]
104+
- `plotly_relayout` event is now properly triggered on gl3d set camera [#458]
105+
- RGBA colors are now supported in `scatter` and `bar` custom color scales
106+
[#422]
107+
- Range slider is now functional with `x0`/`dx` data [#441]
108+
- Range slider is now compatible with mode bar axis range buttons and double
109+
click [#471]
110+
111+
112+
## [1.9.0] -- 2016-04-12
113+
114+
### Added
115+
- Ternary plots with support for scatter traces (trace type `scatterternary`) [#390]
116+
117+
### Fixed
118+
- Toggling the visibility of `scatter3d` traces with `surfaceaxis` now works [#405]
119+
- `scatter3d` traces with `surfaceaxis` turned now feature real 3D opacity [#408]
120+
- `plotly_unhover` is now properly triggered over `pie` traces [#407]
121+
- Better grammar in `scatter` attribute descriptions [#406]
122+
123+
13124
## [1.8.0] -- 2016-04-04
14125

15126
### Added

CONTRIBUTING.md

Lines changed: 76 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to plotly.js
22

3-
### Opening issues
3+
## Opening issues
44

55
Search for existing and closed issues. If your problem or idea is not addressed
66
yet, [please open a new issue](https://github.com/plotly/plotly.js/issues/new).
@@ -10,48 +10,72 @@ Bug reports must be accompanied with a reproducible example. We recommend using
1010
[jsbin](https://jsbin.com) to share your example.
1111

1212
Note that GitHub issues are reserved for bug reports and feature requests only.
13-
Implementation questions should be asked on Stack Overflow (tagged
14-
[`plotly`](https://stackoverflow.com/questions/tagged/plotly)) or on
15-
community.plot.ly (tagged [`plotly-js`](http://community.plot.ly/c/plotly-js)).
13+
Implementation questions should be asked on
14+
community.plot.ly (tagged [`plotly-js`](http://community.plot.ly/c/plotly-js)) or on Stack Overflow (tagged
15+
[`plotly`](https://stackoverflow.com/questions/tagged/plotly)).
1616

17-
### Issue labels
17+
Comments on GitHub issues or pull requests should add content to the discussions.
18+
Approbation comments such as *+1* or *I would like this feature to be implemented as well*
19+
will be deleted by the maintainers. Please use
20+
[GitHub reactions](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments)
21+
instead.
1822

19-
We use the following [labels](https://github.com/plotly/plotly.js/labels) to track issues:
23+
## Making pull requests
24+
25+
Developers are strongly encouraged to first make a PR to their own plotly.js
26+
fork and ask one of the maintainers to review the modifications there. Once the
27+
pull request is deemed satisfactory, the developer will be asked to make a pull
28+
request to the main plotly.js repo and may be asked to squash some commits
29+
before doing so.
30+
31+
Developers should `git rebase` their local branch off the latest `master` before
32+
opening a pull request.
33+
34+
Note that it is forbidden to force push (i.e. `git push -f`) to remote branches
35+
associated with opened pull requests. Force pushes make it hard for maintainers
36+
to keep track of updates. Therefore, if required, please
37+
`git merge master` into your PR branch instead of `git rebase master`.
38+
39+
40+
## GitHub labels
41+
42+
We use the following [labels](https://github.com/plotly/plotly.js/labels) to track issues and PRs:
2043

2144
| Label | Purpose |
2245
|--------|---------|
2346
| `type: bug` | bug report confirmed by a plotly team member |
24-
| `type: enhancement` | planned feature or task |
47+
| `type: feature` | planned feature additions |
48+
| `type: performance` | performance related tasks |
49+
| `type: maintenace` | source code cleanup resulting in no enhancement for users |
2550
| `type: community` | issue left open for community input and pull requests |
26-
| `type: maintenace` | source code cleanup resulting in no enhancement for users |
2751
| `type: duplicate` | *self-explanatory* |
2852
| `type: wontfix` | *self-explanatory* |
2953
| `status: discussion needed` | Issue or PR that required discussion among maintaners before moving forward |
3054
| `status: in progress` | PRs that required some intial feedback but not ready to merge |
3155
| `status: reviewable` | PRs that are completed from the author's perspective |
32-
| `status: on hold` | PRs that are put on hold |
56+
| `status: on hold` | PRs that are put on hold |
3357

34-
### Development
58+
## Development
3559

36-
**Prerequisites**:
60+
#### Perequisites
3761

3862
- git
3963
- [node.js](https://nodejs.org/en/). We recommend using node.js 4.2.x (LTS).
4064
Upgrading and managing node versions can be easily done using
4165
[`nvm`](https://github.com/creationix/nvm) or its Windows alternatives.
4266

43-
**Step 1** Clone the plotly.js repo and install its dependencies
67+
#### Step 1: Clone the plotly.js repo and install its dependencies
4468

4569
```
4670
git clone https://github.com/plotly/plotly.js.git
4771
cd plotly.js
4872
npm install
4973
```
5074

51-
**Step 2** Start the test dashboard
75+
#### Step 2: Start the test dashboard
5276

5377
```
54-
npm run start-test_dashboard
78+
npm start
5579
```
5680

5781
This command bundles up the source files with source maps using
@@ -60,26 +84,43 @@ This command bundles up the source files with source maps using
6084
dev plotly.js bundle update every time a source file is saved) and opens up a
6185
tab in your browser.
6286

63-
**Step 3** Open up the console and start developing
87+
#### Step 3: Open up the console and start developing
6488

65-
Make some modifications to the source, refresh the page and check the results
66-
by for example pasting in the console:
89+
A typical workflow is to make some modifications to the source, update the
90+
test dashboard, inspect and debug the changes, then repeat. The test dashboard
91+
comes bundled with some useful tools while developing - all bundled under the
92+
`Tabs` object:
6793

68-
```js
69-
Plotly.plot(Tabs.fresh(), [{x:[1,2,3], y:[2,1,2]}]);
70-
```
7194

72-
- `Tabs.fresh()` creates a fresh graph div and return it and
73-
- `Tabs.getGraph()` returns the current graph div.
95+
| Method/Property | Description |
96+
|------------------------|-------------|
97+
| `Tabs.fresh([id])` | Creates a fresh graph div and returns it (default id of `graph`). |
98+
| `Tabs.getGraph([id])` | Returns the default or specified graph div. |
99+
| `Tabs.plotMock(mock, [id])` | Plots the specified mock (`.json` extension is not required). |
100+
| `Tabs.snapshot([id])` | Creates a png snapshot of the plot and places it below. |
101+
| `Tabs.reload()` | Reloads the plotly.js script and will execute `Tabs.onReload` once completed. |
102+
| `Tabs.onReload()` | By default, set to `noop` but you may set `Tabs.onReload` to any function you wish. This is useful for replotting a mock or test every time you reload the plotly.js script. |
103+
| `Tabs.purge()` | Destroys all plots. |
104+
105+
View [the source](https://github.com/plotly/plotly.js/blob/master/devtools/test_dashboard/devtools.js) for more info.
106+
107+
Three additional helpers exist that are refreshed every second:
74108

75-
**Other npm scripts**:
109+
* `gd` - this is the default plot div
110+
* `fullData` - shortcut to `gd._fullData`
111+
* `fullLayout` - shortcut to `gd._fullLayout`
112+
113+
There is also a search bar in the top right of the dashboard. This fuzzy-searches
114+
image mocks based on their file name and trace type.
115+
116+
#### Other npm scripts
76117

77118
- `npm run preprocess`: pre-processes the css and svg source file in js. This
78119
script must be run manually when updating the css and svg source files.
79120
- `npm run watch`: starts a watchify file watcher just like the test dashboard but
80121
without booting up a server.
81122

82-
### Testing
123+
## Testing
83124

84125
Both jasmine and image tests are run on
85126
[CircleCI](https://circleci.com/gh/plotly/plotly.js) on every push to this
@@ -92,6 +133,15 @@ Jasmine tests are run in a browser using
92133
npm run test-jasmine
93134
```
94135

136+
To run a specific suite, use:
137+
138+
```
139+
npm run test-jasmine -- tests/<suite>.js
140+
```
141+
142+
where the `<suite>` corresponds to the suite's file name as found in [`test/jasmine/tests/`](https://github.com/plotly/plotly.js/tree/master/test/jasmine/tests).
143+
144+
95145
Image pixel comparison tests are run in a docker container. For more
96146
information on how to run them locally, please refer to [image test
97147
README](https://github.com/plotly/plotly.js/blob/master/test/image/README.md).
@@ -108,7 +158,7 @@ which shows the baseline image, the generated image, the diff and the json mocks
108158
To view the results of a run on CircleCI, download the `build/test_images/` and `build/test_images_diff/` artifacts into your local repo and then run `npm run start-image_viewer`.
109159

110160

111-
### Repo organization
161+
## Repo organization
112162

113163
- Distributed files are in `dist/`
114164
- CommonJS require-able modules are in `lib/`
@@ -120,7 +170,7 @@ To view the results of a run on CircleCI, download the `build/test_images/` and
120170
- Non-distributed, built files are in `build/` (most files in here are git-ignored, the css and font built files are exceptions)
121171

122172

123-
### Coding style
173+
## Coding style
124174

125175
Check if ok, with `npm run lint`
126176

0 commit comments

Comments
 (0)