Skip to content

Commit 514aef4

Browse files
committed
set plotlyServerUrl default to blank string
1 parent 7c67896 commit 514aef4

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

src/plot_api/plot_config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var configAttributes = {
3232

3333
plotlyServerURL: {
3434
valType: 'string',
35-
dflt: 'https://plot.ly',
35+
dflt: '',
3636
description: [
3737
'Sets base URL for the \'Edit in Chart Studio\' (aka sendDataToCloud) mode bar button',
3838
'and the showLink/sendData on-graph link'
@@ -261,10 +261,10 @@ var configAttributes = {
261261
dflt: false,
262262
description: [
263263
'Should we include a ModeBar button, labeled "Edit in Chart Studio",',
264-
'that sends this chart to plot.ly or another plotly server as specified',
265-
'by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0',
264+
'that sends this chart to plotly.com (formerly plot.ly) or another plotly server',
265+
'as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0',
266266
'this button was included by default, now it is opt-in using this flag.',
267-
'Note that this button can (depending on `plotlyServerURL`) send your data',
267+
'Note that this button can (depending on `plotlyServerURL` being set) send your data',
268268
'to an external server. However that server does not persist your data',
269269
'until you arrive at the Chart Studio and explicitly click "Save".'
270270
].join(' ')

test/jasmine/tests/config_test.js

+20-3
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,30 @@ describe('config argument', function() {
501501

502502
afterEach(destroyGraphDiv);
503503

504-
it('should default to plotly cloud', function(done) {
504+
it('should not default to an external plotly cloud', function(done) {
505505
Plotly.plot(gd, [], {})
506506
.then(function() {
507-
expect(gd._context.plotlyServerURL).toBe('https://plot.ly');
507+
expect(gd._context.plotlyServerURL).not.toBe('https://plot.ly');
508+
expect(gd._context.plotlyServerURL).not.toBe('https://plotly.com');
509+
expect(gd._context.plotlyServerURL).toBe('');
508510

509511
Plotly.Plots.sendDataToCloud(gd);
510-
expect(form.action).toBe('https://plot.ly/external');
512+
expect(form.action.substring(0, 17)).toBe('http://localhost:');
513+
expect(form.method).toBe('post');
514+
})
515+
.catch(failTest)
516+
.then(done);
517+
});
518+
519+
it('should be able to connect to plotly cloud when set to https://plotly.com', function(done) {
520+
Plotly.plot(gd, [], {}, {
521+
plotlyServerURL: 'https://plotly.com'
522+
})
523+
.then(function() {
524+
expect(gd._context.plotlyServerURL).toBe('https://plotly.com');
525+
526+
Plotly.Plots.sendDataToCloud(gd);
527+
expect(form.action).toBe('https://plotly.com/external');
511528
expect(form.method).toBe('post');
512529
})
513530
.catch(failTest)

0 commit comments

Comments
 (0)