Skip to content

Commit 0b62e45

Browse files
committed
Merge branch 'master' into transform-plugins
- https://github.com/plotly/plotly.js/pull/491/files#diff-ad4f76ccd6044ed16514297078e13b84R455 for more detail on the conflict
2 parents a06441a + 29019ba commit 0b62e45

File tree

356 files changed

+119581
-88715
lines changed

Some content is hidden

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

356 files changed

+119581
-88715
lines changed

.eslintignore

-1
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"root": true,
33
"extends": [
4-
"eslint:recommended",
4+
"eslint:recommended"
55
],
66
"env": {
77
"commonjs": true
@@ -16,7 +16,7 @@
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

+149
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,155 @@ 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.14.1] -- 2016-06-28
14+
15+
### Fixed
16+
- Fix colorscale restyle calls on heatmap traces (bug introduced in 1.14.0)
17+
[#694]
18+
- Hover after zoom / pan is now functional again in ternary plots (bug
19+
introduced in 1.14.0) [#688]
20+
- Fix mapbox layer relayout starting from invisible layer [#693]
21+
- Hover labels when `hoveron: 'fills'` are now constrained to the viewports
22+
[#688]
23+
- Fix `surface` countours description [#696]
24+
- Fix `mapbox.layers.line` description [#690]
25+
26+
27+
## [1.14.0] -- 2016-06-22
28+
29+
### Added
30+
- Attribute `line.color` in `scatter3d` traces now support color scales [#617]
31+
- Annotations tail positions can now be set in data coordinates via the new
32+
`axref` and `ayref` attributes [#610]
33+
- Attribute `hoveron` is added for `scatter` and `scatterternary` traces which
34+
adds the option to show hover labels about fill regions (instead of simply of
35+
about data points) [#673]
36+
- Layout shapes can now be moved and resized (except for 'path' shapes) in
37+
editable contexts [#660]
38+
39+
### Changed
40+
- Numerous additions and changes where made to the mapbox layout layers
41+
attributes (introduced in 1.13.0). Namely, `circle` and `symbol` layer type
42+
where added. Note that some style attributes have been renamed to match the
43+
mapbox-gl API more closely. [#681]
44+
45+
### Fixed
46+
- Off-screen heatmap traces are properly deleted (bug introduced in 1.5.1)
47+
[#655]
48+
- Hover labels for multi-heatmap subplot is functional again (bug introduced in
49+
1.4.0) [#655]
50+
- Heatmap x/y brick generation is now functional for 0 and 1 item columns [#651]
51+
- Multiple layout images can now shared the same image source [#672]
52+
- Updating legend border and bgcolor attribute now works via `Plotly.relayout`
53+
[#652]
54+
- Dragmode 'select' and 'lasso' no longer throw exception when selecting
55+
`legendonly` traces [#644]
56+
- Ternary plots now respect the `staticPlot` config option [#645]
57+
- Descriptions for axes `nticks` and contour traces `ncountours`now properly
58+
describe their behavior [#662]
59+
60+
61+
## [1.13.0] -- 2016-06-13
62+
63+
### Added
64+
- Beta version of the `scattermapbox` trace type - which allows users to create
65+
`mapbox-gl` maps using the plotly.js API. Note that `scattermapbox` is only
66+
available through custom bundling in this release [#626]
67+
- Configurable log levels. All plotly.js logging is now turned off by default.
68+
Use `Plotly.setPlotConfig({ logging: /* 1 or 2 */ })` to (1) display warnings
69+
only or (2) all logs [#590]
70+
- Thorough `mesh3d` attribute descriptions [#593]
71+
72+
### Changed
73+
- Generalize hover picking routine (to make more easily re-usable for other plot
74+
types) [#575, #631]
75+
76+
### Fixed
77+
- Fix `Plotly.toImage` and `Plotly.downloadImage` bug specific to Chrome 51 on
78+
OSX [#604]
79+
- Fix `Plotly.downloadImage` for `svg` types [#604]
80+
- Fix `scattergl` opacity and connectgaps for `'lines'` mode [#589]
81+
- Make legend scroll bar keep its position after redraws [#584]
82+
- Properly handle axis-reference shapes on overlaid axes [#612]
83+
- Fix `Plotly.relayout` calls for `layout.images` in `{ astr: val }` notation
84+
[#624]
85+
- Bring back correct default value for `lightposition` in surface traces (bug
86+
introduced in 1.12.0) [#571]
87+
- Fix typos in contours descriptions in contour traces [#583]
88+
- Fix typos in `axis.ticktext` description [#607]
89+
- Fix ambiguities in histogram `nbin` descriptions [#623]
90+
91+
92+
## [1.12.0] -- 2016-05-26
93+
94+
### Added
95+
- Light positions, face normal epsilon and vertex normal epsilon are now
96+
configurable in `mesh3d` traces [#556]
97+
- Light position is now configurable in `surface` traces [#556]
98+
- `surface` and `mesh3d` lighting attributes are now accompanied with
99+
comprehensive descriptions. [#556]
100+
101+
### Changed
102+
- Plot modules are now allowed to have their own `toSVG` method for
103+
subplot-specific to-svg logic [#554]
104+
105+
### Fixed
106+
- gl2d plots are now functional in `core-js` environments (e.g. in babel es6
107+
presets) [#569]
108+
- gl2d replot calls from a blank plot are now functional [#570]
109+
- SVG graph config argument `scrollZoom` is now again functional (bug introduced
110+
in v1.10.0) [#564]
111+
- `layout.separators` is now honored in pie text labels [#547]
112+
- Heatmap `zsmooth` value `'fast'` is now functional for arbitrary layout widths
113+
[#548]
114+
- Range sliders now respond to all axis range relayout calls [#568]
115+
116+
117+
## [1.11.0] -- 2016-05-17
118+
119+
### Added
120+
- Add top-level methods `Plotly.toImage` to convert a plotly graph to an image
121+
data URL (svg, png, jpg, and webp are supported) and `Plotly.downloadImage` to
122+
download a plotly graph as an image [#446]
123+
- Add the ability to add arbitrary images loaded from a url to a plot's layout
124+
[#525]
125+
- Add the option of making legend span horizontally [#535]
126+
- Add `connectgaps` attribute to `scattergl` traces [#449]
127+
- Add new 'relative' bar mode which stacks on top of one another with negative
128+
values below the axis, positive values above [#517]
129+
- Add support for the 'winkel tripel' projection in geo subplots [#492]
130+
- Event `plotly_relayout` is now emitted on gl2d subplot drag/pan/zoom
131+
interactions [#466]
132+
- Add support for fill coloring in `contourgl` traces [#522, #543]
133+
134+
### Changed
135+
- Cartesian on-hover routine is now uses a 50ms interval between search calls
136+
instead of 100ms for smoother displaying hover labels [#514]
137+
- [Internal change] fullLayout `_has` fields are replaced by a `_has` method
138+
which checks if a particular plot type is present on a graph [#491]
139+
140+
### Fixed
141+
- Bar widths of traces with null coordinates are now correctly computed [#542]
142+
- Error bar spans on bar traces with null coordinates are now correctly computed
143+
[#542]
144+
- All promises spawn in `Plotly.plot` are now guaranteed to be resolved before
145+
the final resolve [#521]
146+
- Restyling `scatterternary` data attributes is now working [#540]
147+
- Error bar of 0 length in log axes are not included in hover labels (instead of
148+
showing `NaN`s) [#533]
149+
150+
151+
## [1.10.2] -- 2016-05-05
152+
153+
### Fixed
154+
- Subplot and range slider clip paths are now functional in AngularJS [#509]
155+
- `relayout` call involving axis `categoryorder` and `categoryarray` are now
156+
working [#510]
157+
- Annotation drag interactions in `editable: true` mode are now functional (bug
158+
introduced in 1.10.0)[#505]
159+
- Improved attribute description for shape `xref` and `yref` [#506]
160+
161+
13162
## [1.10.1] -- 2016-05-02
14163

15164
### Fixed

CONTRIBUTING.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ We use the following [labels](https://github.com/plotly/plotly.js/labels) to tra
4747
| `type: feature` | planned feature additions |
4848
| `type: performance` | performance related tasks |
4949
| `type: maintenace` | source code cleanup resulting in no enhancement for users |
50+
| `type: documentation` | API doc or attribute description improvements |
5051
| `type: community` | issue left open for community input and pull requests |
5152
| `type: duplicate` | *self-explanatory* |
5253
| `type: wontfix` | *self-explanatory* |
@@ -72,7 +73,18 @@ cd plotly.js
7273
npm install
7374
```
7475

75-
#### Step 2: Start the test dashboard
76+
#### Step 2: Setup Mapbox access token
77+
78+
As of `v1.13.0`, plotly.js includes a [`mapbox-gl`](https://github.com/mapbox/mapbox-gl-js) integration. Creating `mapbox-gl` graphs requires an
79+
[`accessToken`](https://www.mapbox.com/help/define-access-token/). To make sure
80+
that the plotly.js test suites and devtools work properly, locate your Mapbox access
81+
token and run:
82+
83+
```bash
84+
export MAPBOX_ACCESS_TOKEN="<your access token>" && npm run pretest
85+
```
86+
87+
#### Step 3: Start the test dashboard
7688

7789
```
7890
npm start
@@ -84,7 +96,7 @@ This command bundles up the source files with source maps using
8496
dev plotly.js bundle update every time a source file is saved) and opens up a
8597
tab in your browser.
8698

87-
#### Step 3: Open up the console and start developing
99+
#### Step 4: Open up the console and start developing
88100

89101
A typical workflow is to make some modifications to the source, update the
90102
test dashboard, inspect and debug the changes, then repeat. The test dashboard

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<a href="https://plot.ly/javascript/"><img src="http://images.plot.ly/logo/[email protected]" height="70"></a>
22

33
[![npm version](https://badge.fury.io/js/plotly.js.svg)](https://badge.fury.io/js/plotly.js)
4-
54
[![circle ci](https://circleci.com/gh/plotly/plotly.js.png?&style=shield&circle-token=1f42a03b242bd969756fc3e53ede204af9b507c0)](https://circleci.com/gh/plotly/plotly.js)
6-
[![Dependency Status](https://david-dm.org/plotly/plotly.js.svg?style=flat-square)](https://david-dm.org/plotly/plotly.js)
7-
[![devDependency Status](https://david-dm.org/plotly/plotly.js/dev-status.svg?style=flat-square)](https://david-dm.org/plotly/plotly.js#info=devDependencies)
85

96
Built on top of [d3.js](http://d3js.org/) and [stack.gl](http://stack.gl/),
107
plotly.js is a high-level, declarative charting library. plotly.js ships with 20
@@ -25,6 +22,11 @@ chart types, including 3D charts, statistical graphs, and SVG maps.
2522

2623
## Quick start options
2724

25+
**It is important to note that logging is turned off by default in v1.13.0 onwards.**
26+
To turn logging on for development, you will want to run
27+
`Plotly.setPlotConfig({ logging: 2 })` before any plotting.
28+
See [this file](https://github.com/plotly/plotly.js/blob/master/src/lib/loggers.js) for more details.
29+
2830
#### Download the latest release
2931
[Latest Release on Github](https://github.com/plotly/plotly.js/releases/)
3032

@@ -51,6 +53,9 @@ and use the plotly.js `dist` file(s) or require plotly.js using CommonJS as `var
5153

5254
<!-- OR use a specific plotly.js release (e.g. version 1.5.0) -->
5355
<script type="text/javascript" src="https://cdn.plot.ly/plotly-1.5.0.min.js"></script>
56+
57+
<!-- OR an un-minified version is also available -->
58+
<script type="text/javascript" src="https://cdn.plot.ly/plotly-latest.js"></script>
5459
```
5560

5661
and use the `Plotly` object in the window scope.

circle.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ dependencies:
1515
- docker pull plotly/testbed:latest
1616
post:
1717
- npm run cibuild
18+
- npm run pretest
1819
- docker run -d --name mytestbed -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/testbed:latest
20+
- sudo ./tasks/run_in_testbed.sh mytestbed "cp -f test/image/index.html ../server_app/index.html"
1921
- wget --server-response --spider --tries=8 --retry-connrefused http://localhost:9010/ping
2022
test:
2123
override:
22-
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/compare_pixels_test.js"
23-
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/export_test.js"
24+
- sudo ./tasks/run_in_testbed.sh mytestbed "export CIRCLECI=1 && node test/image/compare_pixels_test.js"
25+
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/export_test.js"
2426
- npm run citest-jasmine
2527
- npm run test-bundle
2628
- npm run test-syntax

devtools/image_viewer/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
</head>
44
<body>
55
<div id="plot-list" style="overflow:auto; height:100px;"></div>
6+
<div id="plot-toggles"></div>
67
<div id="plot-images"></div>
7-
<div id="plot-mock"></div>
8+
<pre id="plot-mock"></pre>
89

910
<script type="text/javascript" src="../../build/image_viewer-bundle.js"></script>
1011
</body>

devtools/image_viewer/viewer.js

+55-20
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,22 @@ var path = require('path');
44
var d3 = require('d3');
55

66
var $plotlist = document.getElementById('plot-list'),
7+
$toggles = document.getElementById('plot-toggles'),
78
$images = document.getElementById('plot-images'),
8-
$mock = document.getElementById('plot-mock');
9+
$mock = document.getElementById('plot-mock'),
10+
$toggleBaseline = document.createElement('button'),
11+
$toggleTest = document.createElement('button'),
12+
$toggleDiff = document.createElement('button'),
13+
$imgBaseline = document.createElement('img'),
14+
$imgTest = document.createElement('img'),
15+
$imgDiff = document.createElement('img');
16+
17+
$toggles.style.display = 'none';
18+
$images.style.display = 'none';
19+
20+
setupToggle($toggleBaseline, $imgBaseline, 'Baseline');
21+
setupToggle($toggleTest, $imgTest, 'Test');
22+
setupToggle($toggleDiff, $imgDiff, 'Diff');
923

1024
var pathToRoot = path.join(__dirname, '../../'),
1125
pathToImageTest = path.join(pathToRoot, 'test/image'),
@@ -33,37 +47,58 @@ imageNames.forEach(function(imageName) {
3347
function createButton(imageName) {
3448
var button = document.createElement('button');
3549
button.style.cssFloat = 'left';
36-
button.style.width = '100px';
3750
button.style.height = '40px';
3851
button.innerHTML = imageName;
52+
button.style.padding = '0.5em';
53+
button.style.border = '0';
54+
button.style.margin = '1px';
55+
button.style.cursor = 'pointer';
3956

4057
button.addEventListener('click', function() {
41-
var imgBaseline = createImg(dirBaseline, imageName),
42-
imgTest = createImg(dirTest, imageName),
43-
imgDiff = createImg(dirDiff, 'diff-' + imageName);
44-
4558
d3.json(dirMocks + imageName + '.json', function(err, mock) {
46-
$images.innerHTML = '';
47-
$images.appendChild(imgBaseline);
48-
$images.appendChild(imgTest);
49-
$images.appendChild(imgDiff);
59+
$toggles.style.display = 'block';
5060

51-
$mock.innerHTML = '';
52-
$mock.appendChild(createJSONview(mock));
61+
$images.style.display = 'block';
62+
$imgBaseline.src = dirBaseline + imageName + '.png';
63+
$imgTest.src = dirTest + imageName + '.png';
64+
$imgDiff.src = dirDiff + 'diff-' + imageName + '.png';
65+
66+
$mock.innerHTML = JSON.stringify(mock, null, 2);
5367
});
5468
});
5569

5670
return button;
5771
}
5872

59-
function createImg(dir, name) {
60-
var img = new Image();
61-
img.src = dir + name + '.png';
62-
return img;
73+
function setupToggle(toggle, img, title) {
74+
img.title = title;
75+
toggle.innerHTML = title;
76+
toggle.style.padding = '0.5em';
77+
toggle.style.border = '0';
78+
toggle.style.margin = '1px';
79+
toggle.style.cursor = 'pointer';
80+
81+
checkToggle(toggle, img);
82+
83+
toggle.addEventListener('click', function() {
84+
if(toggle.value === 'checked') uncheckToggle(toggle, img);
85+
else checkToggle(toggle, img);
86+
});
87+
88+
$toggles.appendChild(toggle);
89+
$images.appendChild(img);
90+
}
91+
92+
function checkToggle(toggle, img) {
93+
toggle.value = 'checked';
94+
toggle.style.color = '#4c4c4c';
95+
toggle.style.backgroundColor = '#f2f1f0';
96+
img.style.display = 'inline';
6397
}
6498

65-
function createJSONview(mock) {
66-
var jsonView = document.createElement('pre');
67-
jsonView.innerHTML = JSON.stringify(mock, null, 2);
68-
return jsonView;
99+
function uncheckToggle(toggle, img) {
100+
toggle.value = 'unchecked';
101+
toggle.style.color = '#f2f1f0';
102+
toggle.style.backgroundColor = '#4c4c4c';
103+
img.style.display = 'none';
69104
}

0 commit comments

Comments
 (0)