Skip to content

Commit f9bb22e

Browse files
committed
Merge branch 'master' into ternary
- Fx.unhover is now part of dragelement - emit 'plotly_unhover' directly from pie/plot.js # Conflicts: # src/plots/cartesian/graph_interact.js
2 parents 3974d11 + f67212e commit f9bb22e

Some content is hidden

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

58 files changed

+7496
-1498
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ https://github.com/plotly/plotly.js/compare/vX.Y.Z...master
99

1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

12+
13+
## [1.8.0] -- 2016-04-04
14+
15+
### Added
16+
- Range slider functionality for scatter traces [#336, #368, #377]
17+
- Range selector functionality for cartesian and gl2d plot types [#373]
18+
- Support for connectgaps in scatter3d traces [#361]
19+
20+
### Fixed
21+
- gl2d toImage mode bar button is now again functional (bug introduced in 1.7.0) [#369]
22+
- IE / Edge handling of getComputedTextLength is now functional [#376]
23+
- improved marker color attribute description [#366]
24+
25+
1226
## [1.7.1] -- 2016-03-30
1327

1428
### Fixed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ We use the following [labels](https://github.com/plotly/plotly.js/labels) to tra
2626
| `type: maintenace` | source code cleanup resulting in no enhancement for users |
2727
| `type: duplicate` | *self-explanatory* |
2828
| `type: wontfix` | *self-explanatory* |
29+
| `status: discussion needed` | Issue or PR that required discussion among maintaners before moving forward |
2930
| `status: in progress` | PRs that required some intial feedback but not ready to merge |
3031
| `status: reviewable` | PRs that are completed from the author's perspective |
3132
| `status: on hold` | PRs that are put on hold |

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ If you would like to reduce the bundle size of plotly.js, you can create a *cust
5555

5656
```javascript
5757
// in custom-plotly.js
58-
var plotlyCore = require('plotly.js/lib/core');
58+
var Plotly = require('plotly.js/lib/core');
5959

6060
// Load in the trace types for pie, and choropleth
61-
plotlyCore.register([
61+
Plotly.register([
6262
require('plotly.js/lib/pie'),
6363
require('plotly.js/lib/choropleth')
6464
]);
6565

66-
module.exports = plotlyCore;
66+
module.exports = Plotly;
6767
```
6868

6969
Then elsewhere in your code:

devtools/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"env": {
44
"node": true,
55
"browser": true
6+
},
7+
"globals": {
8+
"Promise": true
69
}
710
}

devtools/test_dashboard/buttons.js

Lines changed: 0 additions & 158 deletions
This file was deleted.
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
var Fuse = require('fuse.js');
2+
var mocks = require('../../build/test_dashboard_mocks.json');
3+
4+
5+
// Our gracious testing object
6+
var Tabs = {
7+
8+
// Return the specified plot container (or default one)
9+
getGraph: function(id) {
10+
id = id || 'graph';
11+
return document.getElementById(id);
12+
},
13+
14+
// Create a new plot container
15+
fresh: function(id) {
16+
id = id || 'graph';
17+
18+
var graphDiv = Tabs.getGraph(id);
19+
20+
if(graphDiv) {
21+
graphDiv.remove();
22+
}
23+
24+
graphDiv = document.createElement('div');
25+
graphDiv.className = 'dashboard-plot';
26+
graphDiv.id = id;
27+
28+
var plotArea = document.getElementById('plots');
29+
plotArea.appendChild(graphDiv);
30+
31+
return graphDiv;
32+
},
33+
34+
// Plot a mock by name (without .json) to the default or specified container
35+
plotMock: function(mockName, id) {
36+
var mockURL = '/test/image/mocks/' + mockName + '.json';
37+
38+
window.Plotly.d3.json(mockURL, function(err, fig) {
39+
window.Plotly.plot(Tabs.fresh(id), fig.data, fig.layout);
40+
41+
console.warn('Plotting:', mockURL);
42+
});
43+
},
44+
45+
// Save a png snapshot and display it below the plot
46+
snapshot: function(id) {
47+
var gd = Tabs.getGraph(id);
48+
49+
if(!gd._fullLayout || !gd._fullData) {
50+
return;
51+
}
52+
53+
var image = new Image();
54+
55+
window.Plotly.Snapshot.toImage(gd, { format: 'png' }).on('success', function(img) {
56+
image.src = img;
57+
58+
var imageDiv = document.getElementById('snapshot');
59+
imageDiv.appendChild(image);
60+
61+
console.warn('Snapshot complete!');
62+
});
63+
},
64+
65+
// Remove all plots and snapshots from the page
66+
purge: function() {
67+
var plots = document.getElementsByClassName('dashboard-plot');
68+
var images = document.getElementById('snapshot');
69+
70+
while(images.firstChild) {
71+
images.removeChild(images.firstChild);
72+
}
73+
74+
for(var i = 0; i < plots.length; i++) {
75+
window.Plotly.purge(plots[i]);
76+
}
77+
},
78+
79+
// Specify what to do after each plotly.js script reload
80+
onReload: function() {
81+
return;
82+
},
83+
84+
// Refreshes the plotly.js source without needing to refresh the page
85+
reload: function() {
86+
var source = document.getElementById('source');
87+
var reloaded = document.getElementById('reload-time');
88+
89+
source.remove();
90+
91+
window.Plotly = null;
92+
93+
source = document.createElement('script');
94+
source.id = 'source';
95+
source.src = '../../build/plotly.js';
96+
97+
document.body.appendChild(source);
98+
99+
var reloadTime = new Date().toLocaleTimeString();
100+
console.warn('plotly.js reloaded at ' + reloadTime);
101+
reloaded.textContent = 'last reload at ' + reloadTime;
102+
103+
Tabs.onReload();
104+
}
105+
};
106+
107+
108+
// Bind things to the window
109+
window.Tabs = Tabs;
110+
setInterval(function() {
111+
window.gd = Tabs.getGraph() || Tabs.fresh();
112+
window.fullLayout = window.gd._fullLayout;
113+
window.fullData = window.gd._fullData;
114+
}, 1000);
115+
116+
117+
// Mocks search and plotting
118+
var f = new Fuse(mocks, {
119+
keys: [{
120+
name: 'name',
121+
weight: 0.7
122+
}, {
123+
name: 'keywords',
124+
weight: 0.3
125+
}]
126+
});
127+
128+
var searchBar = document.getElementById('mocks-search');
129+
var mocksList = document.getElementById('mocks-list');
130+
var plotArea = document.getElementById('plots');
131+
132+
searchBar.addEventListener('keyup', function(e) {
133+
134+
// Clear results.
135+
while(mocksList.firstChild) {
136+
mocksList.removeChild(mocksList.firstChild);
137+
}
138+
139+
140+
var results = f.search(e.target.value);
141+
142+
results.forEach(function(r) {
143+
var result = document.createElement('span');
144+
result.className = 'search-result';
145+
result.innerText = r.name;
146+
147+
result.addEventListener('click', function() {
148+
149+
// Clear plots and plot selected.
150+
Tabs.purge();
151+
Tabs.plotMock(r.file.slice(0, -5));
152+
});
153+
154+
mocksList.appendChild(result);
155+
156+
var listWidth = mocksList.getBoundingClientRect().width;
157+
var plotAreaWidth = Math.floor(window.innerWidth - listWidth);
158+
plotArea.setAttribute('style', 'width: ' + plotAreaWidth + 'px;');
159+
});
160+
});

0 commit comments

Comments
 (0)