From de10c1bef91792395685a32d70a01553b51a14a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 29 Feb 2016 16:41:22 -0500 Subject: [PATCH 1/4] lint in colorscale lit --- src/components/colorscale/scales.js | 184 +++++++++++++++++----------- 1 file changed, 110 insertions(+), 74 deletions(-) diff --git a/src/components/colorscale/scales.js b/src/components/colorscale/scales.js index 93fccc0e314..47fb9b5fb6a 100644 --- a/src/components/colorscale/scales.js +++ b/src/components/colorscale/scales.js @@ -10,84 +10,120 @@ module.exports = { - 'Greys': [[0,'rgb(0,0,0)'],[1,'rgb(255,255,255)']], - - 'YIGnBu': [[0,'rgb(8, 29, 88)'],[0.125,'rgb(37, 52, 148)'], - [0.25,'rgb(34, 94, 168)'],[0.375,'rgb(29, 145, 192)'], - [0.5,'rgb(65, 182, 196)'],[0.625,'rgb(127, 205, 187)'], - [0.75,'rgb(199, 233, 180)'],[0.875,'rgb(237, 248, 217)'], - [1,'rgb(255, 255, 217)']], - - 'Greens': [[0,'rgb(0, 68, 27)'],[0.125,'rgb(0, 109, 44)'], - [0.25,'rgb(35, 139, 69)'],[0.375,'rgb(65, 171, 93)'], - [0.5,'rgb(116, 196, 118)'],[0.625,'rgb(161, 217, 155)'], - [0.75,'rgb(199, 233, 192)'],[0.875,'rgb(229, 245, 224)'], - [1,'rgb(247, 252, 245)']], - - 'YIOrRd': [[0,'rgb(128, 0, 38)'],[0.125,'rgb(189, 0, 38)'], - [0.25,'rgb(227, 26, 28)'],[0.375,'rgb(252, 78, 42)'], - [0.5,'rgb(253, 141, 60)'],[0.625,'rgb(254, 178, 76)'], - [0.75,'rgb(254, 217, 118)'],[0.875,'rgb(255, 237, 160)'], - [1,'rgb(255, 255, 204)']], - - 'Bluered': [[0,'rgb(0,0,255)'],[1,'rgb(255,0,0)']], + 'Greys': [ + [0, 'rgb(0,0,0)'], [1, 'rgb(255,255,255)'] + ], + + 'YIGnBu': [ + [0, 'rgb(8, 29, 88)'], [0.125, 'rgb(37, 52, 148)'], + [0.25, 'rgb(34, 94, 168)'], [0.375, 'rgb(29, 145, 192)'], + [0.5, 'rgb(65, 182, 196)'], [0.625, 'rgb(127, 205, 187)'], + [0.75, 'rgb(199, 233, 180)'], [0.875, 'rgb(237, 248, 217)'], + [1, 'rgb(255, 255, 217)'] + ], + + 'Greens': [ + [0, 'rgb(0, 68, 27)'], [0.125, 'rgb(0, 109, 44)'], + [0.25, 'rgb(35, 139, 69)'], [0.375, 'rgb(65, 171, 93)'], + [0.5, 'rgb(116, 196, 118)'], [0.625, 'rgb(161, 217, 155)'], + [0.75, 'rgb(199, 233, 192)'], [0.875, 'rgb(229, 245, 224)'], + [1, 'rgb(247, 252, 245)'] + ], + + 'YIOrRd': [ + [0, 'rgb(128, 0, 38)'], [0.125, 'rgb(189, 0, 38)'], + [0.25, 'rgb(227, 26, 28)'], [0.375, 'rgb(252, 78, 42)'], + [0.5, 'rgb(253, 141, 60)'], [0.625, 'rgb(254, 178, 76)'], + [0.75, 'rgb(254, 217, 118)'], [0.875, 'rgb(255, 237, 160)'], + [1, 'rgb(255, 255, 204)'] + ], + + 'Bluered': [ + [0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)'] + ], // modified RdBu based on // www.sandia.gov/~kmorel/documents/ColorMaps/ColorMapsExpanded.pdf - 'RdBu': [[0,'rgb(5, 10, 172)'],[0.35,'rgb(106, 137, 247)'], - [0.5,'rgb(190,190,190)'],[0.6,'rgb(220, 170, 132)'], - [0.7,'rgb(230, 145, 90)'],[1,'rgb(178, 10, 28)']], + 'RdBu': [ + [0, 'rgb(5, 10, 172)'], [0.35, 'rgb(106, 137, 247)'], + [0.5, 'rgb(190,190,190)'], [0.6, 'rgb(220, 170, 132)'], + [0.7, 'rgb(230, 145, 90)'], [1, 'rgb(178, 10, 28)'] + ], + // Scale for non-negative numeric values - 'Reds': [[0, 'rgb(220, 220, 220)'], [0.2,'rgb(245, 195, 157)'], - [0.4,'rgb(245, 160, 105)'], [1, 'rgb(178, 10, 28)']], + 'Reds': [ + [0, 'rgb(220, 220, 220)'], [0.2, 'rgb(245, 195, 157)'], + [0.4, 'rgb(245, 160, 105)'], [1, 'rgb(178, 10, 28)'] + ], + // Scale for non-positive numeric values - 'Blues': [[0, 'rgb(5, 10, 172)'], [0.35, 'rgb(40, 60, 190)'], + 'Blues': [ + [0, 'rgb(5, 10, 172)'], [0.35, 'rgb(40, 60, 190)'], [0.5, 'rgb(70, 100, 245)'], [0.6, 'rgb(90, 120, 245)'], - [0.7, 'rgb(106, 137, 247)'], [1, 'rgb(220, 220, 220)']], - - 'Picnic': [[0,'rgb(0,0,255)'],[0.1,'rgb(51,153,255)'], - [0.2,'rgb(102,204,255)'],[0.3,'rgb(153,204,255)'], - [0.4,'rgb(204,204,255)'],[0.5,'rgb(255,255,255)'], - [0.6,'rgb(255,204,255)'],[0.7,'rgb(255,153,255)'], - [0.8,'rgb(255,102,204)'],[0.9,'rgb(255,102,102)'], - [1,'rgb(255,0,0)']], - - 'Rainbow': [[0,'rgb(150,0,90)'],[0.125,'rgb(0, 0, 200)'], - [0.25,'rgb(0, 25, 255)'],[0.375,'rgb(0, 152, 255)'], - [0.5,'rgb(44, 255, 150)'],[0.625,'rgb(151, 255, 0)'], - [0.75,'rgb(255, 234, 0)'],[0.875,'rgb(255, 111, 0)'], - [1,'rgb(255, 0, 0)']], - - 'Portland': [[0,'rgb(12,51,131)'],[0.25,'rgb(10,136,186)'], - [0.5,'rgb(242,211,56)'],[0.75,'rgb(242,143,56)'], - [1,'rgb(217,30,30)']], - - 'Jet': [[0,'rgb(0,0,131)'],[0.125,'rgb(0,60,170)'], - [0.375,'rgb(5,255,255)'],[0.625,'rgb(255,255,0)'], - [0.875,'rgb(250,0,0)'],[1,'rgb(128,0,0)']], - - 'Hot': [[0,'rgb(0,0,0)'],[0.3,'rgb(230,0,0)'], - [0.6,'rgb(255,210,0)'],[1,'rgb(255,255,255)']], - - 'Blackbody': [[0,'rgb(0,0,0)'],[0.2,'rgb(230,0,0)'], - [0.4,'rgb(230,210,0)'],[0.7,'rgb(255,255,255)'], - [1,'rgb(160,200,255)']], - - 'Earth': [[0,'rgb(0,0,130)'],[0.1,'rgb(0,180,180)'], - [0.2,'rgb(40,210,40)'],[0.4,'rgb(230,230,50)'], - [0.6,'rgb(120,70,20)'],[1,'rgb(255,255,255)']], - - 'Electric': [[0,'rgb(0,0,0)'],[0.15,'rgb(30,0,100)'], - [0.4,'rgb(120,0,100)'],[0.6,'rgb(160,90,0)'], - [0.8,'rgb(230,200,0)'],[1,'rgb(255,250,220)']], - - 'Viridis': [[0,'#440154'],[0.06274509803921569,'#48186a'], - [0.12549019607843137,'#472d7b'],[0.18823529411764706,'#424086'], - [0.25098039215686274,'#3b528b'],[0.3137254901960784,'#33638d'], - [0.3764705882352941,'#2c728e'],[0.4392156862745098,'#26828e'], - [0.5019607843137255,'#21918c'],[0.5647058823529412,'#1fa088'], - [0.6274509803921569,'#28ae80'],[0.6901960784313725,'#3fbc73'], - [0.7529411764705882,'#5ec962'],[0.8156862745098039,'#84d44b'], - [0.8784313725490196,'#addc30'],[0.9411764705882353,'#d8e219'], - [1,'#fde725']] + [0.7, 'rgb(106, 137, 247)'], [1, 'rgb(220, 220, 220)'] + ], + + 'Picnic': [ + [0, 'rgb(0,0,255)'], [0.1, 'rgb(51,153,255)'], + [0.2, 'rgb(102,204,255)'], [0.3, 'rgb(153,204,255)'], + [0.4, 'rgb(204,204,255)'], [0.5, 'rgb(255,255,255)'], + [0.6, 'rgb(255,204,255)'], [0.7, 'rgb(255,153,255)'], + [0.8, 'rgb(255,102,204)'], [0.9, 'rgb(255,102,102)'], + [1, 'rgb(255,0,0)'] + ], + + 'Rainbow': [ + [0, 'rgb(150,0,90)'], [0.125, 'rgb(0, 0, 200)'], + [0.25, 'rgb(0, 25, 255)'], [0.375, 'rgb(0, 152, 255)'], + [0.5, 'rgb(44, 255, 150)'], [0.625, 'rgb(151, 255, 0)'], + [0.75, 'rgb(255, 234, 0)'], [0.875, 'rgb(255, 111, 0)'], + [1, 'rgb(255, 0, 0)'] + ], + + 'Portland': [ + [0, 'rgb(12,51,131)'], [0.25, 'rgb(10,136,186)'], + [0.5, 'rgb(242,211,56)'], [0.75, 'rgb(242,143,56)'], + [1, 'rgb(217,30,30)'] + ], + + 'Jet': [ + [0, 'rgb(0,0,131)'], [0.125, 'rgb(0,60,170)'], + [0.375, 'rgb(5,255,255)'], [0.625, 'rgb(255,255,0)'], + [0.875, 'rgb(250,0,0)'], [1, 'rgb(128,0,0)'] + ], + + 'Hot': [ + [0, 'rgb(0,0,0)'], [0.3, 'rgb(230,0,0)'], + [0.6, 'rgb(255,210,0)'], [1, 'rgb(255,255,255)'] + ], + + 'Blackbody': [ + [0, 'rgb(0,0,0)'], [0.2, 'rgb(230,0,0)'], + [0.4, 'rgb(230,210,0)'], [0.7, 'rgb(255,255,255)'], + [1, 'rgb(160,200,255)'] + ], + + 'Earth': [ + [0, 'rgb(0,0,130)'], [0.1, 'rgb(0,180,180)'], + [0.2, 'rgb(40,210,40)'], [0.4, 'rgb(230,230,50)'], + [0.6, 'rgb(120,70,20)'], [1, 'rgb(255,255,255)'] + ], + + 'Electric': [ + [0, 'rgb(0,0,0)'], [0.15, 'rgb(30,0,100)'], + [0.4, 'rgb(120,0,100)'], [0.6, 'rgb(160,90,0)'], + [0.8, 'rgb(230,200,0)'], [1, 'rgb(255,250,220)'] + ], + + 'Viridis': [ + [0, '#440154'], [0.06274509803921569, '#48186a'], + [0.12549019607843137, '#472d7b'], [0.18823529411764706, '#424086'], + [0.25098039215686274, '#3b528b'], [0.3137254901960784, '#33638d'], + [0.3764705882352941, '#2c728e'], [0.4392156862745098, '#26828e'], + [0.5019607843137255, '#21918c'], [0.5647058823529412, '#1fa088'], + [0.6274509803921569, '#28ae80'], [0.6901960784313725, '#3fbc73'], + [0.7529411764705882, '#5ec962'], [0.8156862745098039, '#84d44b'], + [0.8784313725490196, '#addc30'], [0.9411764705882353, '#d8e219'], + [1, '#fde725'] + ] }; From b2e17868a8c927156077c2aaa8cca99a86dd2605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 29 Feb 2016 17:06:53 -0500 Subject: [PATCH 2/4] rename colorscales YIGnBu -> YlGnBu and YIOrRd -> YlOrRd : - add backward compatible clean data step - add cleanData tests --- src/components/colorscale/scales.js | 4 +-- src/plot_api/plot_api.js | 12 +++++++ test/jasmine/tests/plot_api_test.js | 53 +++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/src/components/colorscale/scales.js b/src/components/colorscale/scales.js index 47fb9b5fb6a..a26e7dadbac 100644 --- a/src/components/colorscale/scales.js +++ b/src/components/colorscale/scales.js @@ -14,7 +14,7 @@ module.exports = { [0, 'rgb(0,0,0)'], [1, 'rgb(255,255,255)'] ], - 'YIGnBu': [ + 'YlGnBu': [ [0, 'rgb(8, 29, 88)'], [0.125, 'rgb(37, 52, 148)'], [0.25, 'rgb(34, 94, 168)'], [0.375, 'rgb(29, 145, 192)'], [0.5, 'rgb(65, 182, 196)'], [0.625, 'rgb(127, 205, 187)'], @@ -30,7 +30,7 @@ module.exports = { [1, 'rgb(247, 252, 245)'] ], - 'YIOrRd': [ + 'YlOrRd': [ [0, 'rgb(128, 0, 38)'], [0.125, 'rgb(189, 0, 38)'], [0.25, 'rgb(227, 26, 28)'], [0.375, 'rgb(252, 78, 42)'], [0.5, 'rgb(253, 141, 60)'], [0.625, 'rgb(254, 178, 76)'], diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index e4eda4ca963..fceffae379d 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -670,6 +670,7 @@ function cleanData(data, existingData) { for(var tracei = 0; tracei < data.length; tracei++) { var trace = data[tracei]; + // assign uids to each trace and detect collisions. if(!('uid' in trace) || suids.indexOf(trace.uid) !== -1) { var newUid, i; @@ -750,6 +751,17 @@ function cleanData(data, existingData) { } } + // fix typo in colorscale definition + if(Plots.traceIs(trace, '2dMap')) { + if(trace.colorscale === 'YIGnBu') trace.colorscale = 'YlGnBu'; + if(trace.colorscale === 'YIOrRd') trace.colorscale = 'YlOrRd'; + } + if(Plots.traceIs(trace, 'markerColorscale') && trace.marker) { + var cont = trace.marker; + if(cont.colorscale === 'YIGnBu') cont.colorscale = 'YlGnBu'; + if(cont.colorscale === 'YIOrRd') cont.colorscale = 'YlOrRd'; + } + // prune empty containers made before the new nestedProperty if(emptyContainer(trace, 'line')) delete trace.line; if('marker' in trace) { diff --git a/test/jasmine/tests/plot_api_test.js b/test/jasmine/tests/plot_api_test.js index ef506e0dc42..9e71c4ca288 100644 --- a/test/jasmine/tests/plot_api_test.js +++ b/test/jasmine/tests/plot_api_test.js @@ -7,6 +7,9 @@ var Bar = require('@src/traces/bar'); var Legend = require('@src/components/legend'); var pkg = require('../../../package.json'); +var createGraphDiv = require('../assets/create_graph_div'); +var destroyGraphDiv = require('../assets/destroy_graph_div'); + describe('Test plot api', function() { 'use strict'; @@ -616,4 +619,54 @@ describe('Test plot api', function() { expect(gd.data).toEqual(cachedData); }); }); + + describe('cleanData', function() { + var gd; + + beforeEach(function() { + gd = createGraphDiv(); + }); + + afterEach(destroyGraphDiv); + + it('should rename \'YIGnBu\' colorscales YlGnBu (2dMap case)', function() { + var data = [{ + type: 'heatmap', + colorscale: 'YIGnBu' + }]; + + Plotly.plot(gd, data); + expect(gd.data[0].colorscale).toBe('YlGnBu'); + }); + + it('should rename \'YIGnBu\' colorscales YlGnBu (markerColorscale case)', function() { + var data = [{ + type: 'scattergeo', + marker: { colorscale: 'YIGnBu' } + }]; + + Plotly.plot(gd, data); + expect(gd.data[0].marker.colorscale).toBe('YlGnBu'); + }); + + it('should rename \'YIOrRd\' colorscales YlOrRd (2dMap case)', function() { + var data = [{ + type: 'contour', + colorscale: 'YIOrRd' + }]; + + Plotly.plot(gd, data); + expect(gd.data[0].colorscale).toBe('YlOrRd'); + }); + + it('should rename \'YIOrRd\' colorscales YlOrRd (markerColorscale case)', function() { + var data = [{ + type: 'scattergeo', + marker: { colorscale: 'YIOrRd' } + }]; + + Plotly.plot(gd, data); + expect(gd.data[0].marker.colorscale).toBe('YlOrRd'); + }); + }); }); From da72f7bcd035b69dc6018d11845ede72a289efb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Tue, 1 Mar 2016 09:43:46 -0500 Subject: [PATCH 3/4] lint (rm whitspaces in color strings) --- src/components/colorscale/scales.js | 56 ++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/components/colorscale/scales.js b/src/components/colorscale/scales.js index a26e7dadbac..ced8979181b 100644 --- a/src/components/colorscale/scales.js +++ b/src/components/colorscale/scales.js @@ -15,27 +15,27 @@ module.exports = { ], 'YlGnBu': [ - [0, 'rgb(8, 29, 88)'], [0.125, 'rgb(37, 52, 148)'], - [0.25, 'rgb(34, 94, 168)'], [0.375, 'rgb(29, 145, 192)'], - [0.5, 'rgb(65, 182, 196)'], [0.625, 'rgb(127, 205, 187)'], - [0.75, 'rgb(199, 233, 180)'], [0.875, 'rgb(237, 248, 217)'], - [1, 'rgb(255, 255, 217)'] + [0, 'rgb(8,29,88)'], [0.125, 'rgb(37,52,148)'], + [0.25, 'rgb(34,94,168)'], [0.375, 'rgb(29,145,192)'], + [0.5, 'rgb(65,182,196)'], [0.625, 'rgb(127,205,187)'], + [0.75, 'rgb(199,233,180)'], [0.875, 'rgb(237,248,217)'], + [1, 'rgb(255,255,217)'] ], 'Greens': [ - [0, 'rgb(0, 68, 27)'], [0.125, 'rgb(0, 109, 44)'], - [0.25, 'rgb(35, 139, 69)'], [0.375, 'rgb(65, 171, 93)'], - [0.5, 'rgb(116, 196, 118)'], [0.625, 'rgb(161, 217, 155)'], - [0.75, 'rgb(199, 233, 192)'], [0.875, 'rgb(229, 245, 224)'], - [1, 'rgb(247, 252, 245)'] + [0, 'rgb(0,68,27)'], [0.125, 'rgb(0,109,44)'], + [0.25, 'rgb(35,139,69)'], [0.375, 'rgb(65,171,93)'], + [0.5, 'rgb(116,196,118)'], [0.625, 'rgb(161,217,155)'], + [0.75, 'rgb(199,233,192)'], [0.875, 'rgb(229,245,224)'], + [1, 'rgb(247,252,245)'] ], 'YlOrRd': [ - [0, 'rgb(128, 0, 38)'], [0.125, 'rgb(189, 0, 38)'], - [0.25, 'rgb(227, 26, 28)'], [0.375, 'rgb(252, 78, 42)'], - [0.5, 'rgb(253, 141, 60)'], [0.625, 'rgb(254, 178, 76)'], - [0.75, 'rgb(254, 217, 118)'], [0.875, 'rgb(255, 237, 160)'], - [1, 'rgb(255, 255, 204)'] + [0, 'rgb(128,0,38)'], [0.125, 'rgb(189,0,38)'], + [0.25, 'rgb(227,26,28)'], [0.375, 'rgb(252,78,42)'], + [0.5, 'rgb(253,141,60)'], [0.625, 'rgb(254,178,76)'], + [0.75, 'rgb(254,217,118)'], [0.875, 'rgb(255,237,160)'], + [1, 'rgb(255,255,204)'] ], 'Bluered': [ @@ -45,22 +45,22 @@ module.exports = { // modified RdBu based on // www.sandia.gov/~kmorel/documents/ColorMaps/ColorMapsExpanded.pdf 'RdBu': [ - [0, 'rgb(5, 10, 172)'], [0.35, 'rgb(106, 137, 247)'], - [0.5, 'rgb(190,190,190)'], [0.6, 'rgb(220, 170, 132)'], - [0.7, 'rgb(230, 145, 90)'], [1, 'rgb(178, 10, 28)'] + [0, 'rgb(5,10,172)'], [0.35, 'rgb(106,137,247)'], + [0.5, 'rgb(190,190,190)'], [0.6, 'rgb(220,170,132)'], + [0.7, 'rgb(230,145,90)'], [1, 'rgb(178,10,28)'] ], // Scale for non-negative numeric values 'Reds': [ - [0, 'rgb(220, 220, 220)'], [0.2, 'rgb(245, 195, 157)'], - [0.4, 'rgb(245, 160, 105)'], [1, 'rgb(178, 10, 28)'] + [0, 'rgb(220,220,220)'], [0.2, 'rgb(245,195,157)'], + [0.4, 'rgb(245,160,105)'], [1, 'rgb(178,10,28)'] ], // Scale for non-positive numeric values 'Blues': [ - [0, 'rgb(5, 10, 172)'], [0.35, 'rgb(40, 60, 190)'], - [0.5, 'rgb(70, 100, 245)'], [0.6, 'rgb(90, 120, 245)'], - [0.7, 'rgb(106, 137, 247)'], [1, 'rgb(220, 220, 220)'] + [0, 'rgb(5,10,172)'], [0.35, 'rgb(40,60,190)'], + [0.5, 'rgb(70,100,245)'], [0.6, 'rgb(90,120,245)'], + [0.7, 'rgb(106,137,247)'], [1, 'rgb(220,220,220)'] ], 'Picnic': [ @@ -73,11 +73,11 @@ module.exports = { ], 'Rainbow': [ - [0, 'rgb(150,0,90)'], [0.125, 'rgb(0, 0, 200)'], - [0.25, 'rgb(0, 25, 255)'], [0.375, 'rgb(0, 152, 255)'], - [0.5, 'rgb(44, 255, 150)'], [0.625, 'rgb(151, 255, 0)'], - [0.75, 'rgb(255, 234, 0)'], [0.875, 'rgb(255, 111, 0)'], - [1, 'rgb(255, 0, 0)'] + [0, 'rgb(150,0,90)'], [0.125, 'rgb(0,0,200)'], + [0.25, 'rgb(0,25,255)'], [0.375, 'rgb(0,152,255)'], + [0.5, 'rgb(44,255,150)'], [0.625, 'rgb(151,255,0)'], + [0.75, 'rgb(255,234,0)'], [0.875, 'rgb(255,111,0)'], + [1, 'rgb(255,0,0)'] ], 'Portland': [ From 0d0c297f992076363ec278054dbd9e5b05f41bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Tue, 1 Mar 2016 10:13:53 -0500 Subject: [PATCH 4/4] update colorscale tests, - to reflect spaceless color strings in colorscale definitions. --- test/jasmine/tests/colorscale_test.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/jasmine/tests/colorscale_test.js b/test/jasmine/tests/colorscale_test.js index a53849a2dbe..e09ba95b548 100644 --- a/test/jasmine/tests/colorscale_test.js +++ b/test/jasmine/tests/colorscale_test.js @@ -325,7 +325,7 @@ describe('Test colorscale:', function() { z = [[0, -1.5], [-2, -10]]; calcColorscale(trace, z, '', 'z'); expect(trace.autocolorscale).toBe(true); - expect(trace.colorscale[5]).toEqual([1, 'rgb(220, 220, 220)']); + expect(trace.colorscale[5]).toEqual([1, 'rgb(220,220,220)']); }); it('should be Blues when the only numerical z <= -0.5', function() { @@ -338,7 +338,7 @@ describe('Test colorscale:', function() { z = [[undefined, undefined], [-0.5, undefined]]; calcColorscale(trace, z, '', 'z'); expect(trace.autocolorscale).toBe(true); - expect(trace.colorscale[5]).toEqual([1, 'rgb(220, 220, 220)']); + expect(trace.colorscale[5]).toEqual([1, 'rgb(220,220,220)']); }); it('should be Reds when the only numerical z >= 0.5', function() { @@ -351,7 +351,7 @@ describe('Test colorscale:', function() { z = [[undefined, undefined], [0.5, undefined]]; calcColorscale(trace, z, '', 'z'); expect(trace.autocolorscale).toBe(true); - expect(trace.colorscale[0]).toEqual([0, 'rgb(220, 220, 220)']); + expect(trace.colorscale[0]).toEqual([0, 'rgb(220,220,220)']); }); it('should be reverse the auto scale when reversescale is true', function() { @@ -365,7 +365,8 @@ describe('Test colorscale:', function() { z = [[undefined, undefined], [0.5, undefined]]; calcColorscale(trace, z, '', 'z'); expect(trace.autocolorscale).toBe(true); - expect(trace.colorscale[trace.colorscale.length-1]).toEqual([1, 'rgb(220, 220, 220)']); + expect(trace.colorscale[trace.colorscale.length-1]) + .toEqual([1, 'rgb(220,220,220)']); }); });