diff --git a/LICENSE b/LICENSE index 1196ce96313..13ffac3c942 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2021 Plotly, Inc +Copyright (c) 2016-2024 Plotly Technologies Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/draftlogs/7164_fix.md b/draftlogs/7164_fix.md new file mode 100644 index 00000000000..b7e77ede0fa --- /dev/null +++ b/draftlogs/7164_fix.md @@ -0,0 +1 @@ +- Allow null or broken selection objects without throwing an error [[#7164](https://github.com/plotly/plotly.js/pull/7164)] diff --git a/draftlogs/7167_fix.md b/draftlogs/7167_fix.md new file mode 100644 index 00000000000..28059a439eb --- /dev/null +++ b/draftlogs/7167_fix.md @@ -0,0 +1 @@ +- Render scatterternary traces correctly if they have the `ids` attribute [[#7164](https://github.com/plotly/plotly.js/pull/7164)] diff --git a/draftlogs/7199_fix.md b/draftlogs/7199_fix.md new file mode 100644 index 00000000000..c0d57b45198 --- /dev/null +++ b/draftlogs/7199_fix.md @@ -0,0 +1 @@ +- Do not convert url-sourced layout images to data uri unless we're in staticPlot mode, to improve interactivity when images are changed with zoom/pan [[#7199](https://github.com/plotly/plotly.js/pull/7199)] diff --git a/draftlogs/7204_fix.md b/draftlogs/7204_fix.md new file mode 100644 index 00000000000..101a7f2016b --- /dev/null +++ b/draftlogs/7204_fix.md @@ -0,0 +1 @@ + - Fix mablibre source map [[#7204](https://github.com/plotly/plotly.js/pull/7204)] diff --git a/draftlogs/7205_fix.md b/draftlogs/7205_fix.md new file mode 100644 index 00000000000..0c3f2e82b82 --- /dev/null +++ b/draftlogs/7205_fix.md @@ -0,0 +1 @@ + - Fix years in license [[#7205](https://github.com/plotly/plotly.js/pull/7205)] diff --git a/src/components/images/draw.js b/src/components/images/draw.js index cd6dfeb698b..0a87992fc87 100644 --- a/src/components/images/draw.js +++ b/src/components/images/draw.js @@ -73,7 +73,7 @@ module.exports = function draw(gd) { thisImage.attr('xmlns', xmlnsNamespaces.svg); - if(d.source && d.source.slice(0, 5) === 'data:') { + if(!gd._context.staticPlot || (d.source && d.source.slice(0, 5) === 'data:')) { thisImage.attr('xlink:href', d.source); this._imgSrc = d.source; } else { diff --git a/src/components/selections/select.js b/src/components/selections/select.js index 3ca0fe724cf..985a79b090a 100644 --- a/src/components/selections/select.js +++ b/src/components/selections/select.js @@ -182,6 +182,7 @@ function prepSelect(evt, startX, startY, dragOptions, mode) { for(var q = 0; q < selections.length; q++) { var s = fullLayout.selections[q]; if( + !s || s.xref !== xRef || s.yref !== yRef ) { diff --git a/src/plots/cartesian/index.js b/src/plots/cartesian/index.js index b8f28c6ba6f..36f1db2384b 100644 --- a/src/plots/cartesian/index.js +++ b/src/plots/cartesian/index.js @@ -568,7 +568,10 @@ function makeSubplotLayer(gd, plotinfo) { var yLayer = constants.layerValue2layerClass[plotinfo.yaxis.layer]; var hasOnlyLargeSploms = fullLayout._hasOnlyLargeSploms; - if(!plotinfo.mainplot || fullLayout._zindices.length > 1) { + var hasMultipleZ = fullLayout._zindices.length > 1; + var mainplotinfo = plotinfo.mainplotinfo; + + if(!plotinfo.mainplot || hasMultipleZ) { if(hasOnlyLargeSploms) { // TODO could do even better // - we don't need plot (but we would have to mock it in lsInner @@ -585,9 +588,15 @@ function makeSubplotLayer(gd, plotinfo) { plotinfo.shapelayer = ensureSingle(backLayer, 'g', 'shapelayer'); plotinfo.imagelayer = ensureSingle(backLayer, 'g', 'imagelayer'); - plotinfo.minorGridlayer = ensureSingle(plotgroup, 'g', 'minor-gridlayer'); - plotinfo.gridlayer = ensureSingle(plotgroup, 'g', 'gridlayer'); - plotinfo.zerolinelayer = ensureSingle(plotgroup, 'g', 'zerolinelayer'); + if(mainplotinfo && hasMultipleZ) { + plotinfo.minorGridlayer = mainplotinfo.minorGridlayer; + plotinfo.gridlayer = mainplotinfo.gridlayer; + plotinfo.zerolinelayer = mainplotinfo.zerolinelayer; + } else { + plotinfo.minorGridlayer = ensureSingle(plotgroup, 'g', 'minor-gridlayer'); + plotinfo.gridlayer = ensureSingle(plotgroup, 'g', 'gridlayer'); + plotinfo.zerolinelayer = ensureSingle(plotgroup, 'g', 'zerolinelayer'); + } var betweenLayer = ensureSingle(plotgroup, 'g', 'layer-between'); plotinfo.shapelayerBetween = ensureSingle(betweenLayer, 'g', 'shapelayer'); @@ -622,7 +631,6 @@ function makeSubplotLayer(gd, plotinfo) { } } } else { - var mainplotinfo = plotinfo.mainplotinfo; var mainplotgroup = mainplotinfo.plotgroup; var xId = id + '-x'; var yId = id + '-y'; diff --git a/src/plots/map/map.js b/src/plots/map/map.js index 92b47b28213..9a397743482 100644 --- a/src/plots/map/map.js +++ b/src/plots/map/map.js @@ -1,6 +1,6 @@ 'use strict'; -var maplibregl = require('maplibre-gl/dist/maplibre-gl-unminified'); +var maplibregl = require('maplibre-gl'); var Lib = require('../../lib'); var geoUtils = require('../../lib/geo_location_utils'); diff --git a/src/traces/scatterternary/calc.js b/src/traces/scatterternary/calc.js index c41bcde6584..88ba05212b3 100644 --- a/src/traces/scatterternary/calc.js +++ b/src/traces/scatterternary/calc.js @@ -15,6 +15,7 @@ module.exports = function calc(gd, trace) { var displaySum = ternary.sum; var normSum = trace.sum || displaySum; var arrays = {a: trace.a, b: trace.b, c: trace.c}; + var ids = trace.ids; var i, j, dataArray, newArray, fillArray1, fillArray2; @@ -58,6 +59,9 @@ module.exports = function calc(gd, trace) { y = a; x = c - b; cd[i] = {x: x, y: y, a: a, b: b, c: c}; + if (ids) { + cd[i].id = ids[i]; + } } else cd[i] = {x: false, y: false}; } diff --git a/test/image/baselines/map_0.png b/test/image/baselines/map_0.png index b0bc870e61b..6f84941427f 100644 Binary files a/test/image/baselines/map_0.png and b/test/image/baselines/map_0.png differ diff --git a/test/image/baselines/map_angles.png b/test/image/baselines/map_angles.png index af4b4c19dc1..ca7d068fee1 100644 Binary files a/test/image/baselines/map_angles.png and b/test/image/baselines/map_angles.png differ diff --git a/test/image/baselines/map_bubbles-text.png b/test/image/baselines/map_bubbles-text.png index 4a78bc70f51..a8c9b488077 100644 Binary files a/test/image/baselines/map_bubbles-text.png and b/test/image/baselines/map_bubbles-text.png differ diff --git a/test/image/baselines/map_bubbles.png b/test/image/baselines/map_bubbles.png index 9713c5358b4..aaac888edb0 100644 Binary files a/test/image/baselines/map_bubbles.png and b/test/image/baselines/map_bubbles.png differ diff --git a/test/image/baselines/map_carto-style.png b/test/image/baselines/map_carto-style.png index f05a18062fe..dfc48abc333 100644 Binary files a/test/image/baselines/map_carto-style.png and b/test/image/baselines/map_carto-style.png differ diff --git a/test/image/baselines/map_carto-text.png b/test/image/baselines/map_carto-text.png index b2db2139043..def93631926 100644 Binary files a/test/image/baselines/map_carto-text.png and b/test/image/baselines/map_carto-text.png differ diff --git a/test/image/baselines/map_choropleth-multiple.png b/test/image/baselines/map_choropleth-multiple.png index d7b69f29833..81912b9dd44 100644 Binary files a/test/image/baselines/map_choropleth-multiple.png and b/test/image/baselines/map_choropleth-multiple.png differ diff --git a/test/image/baselines/map_choropleth-raw-geojson.png b/test/image/baselines/map_choropleth-raw-geojson.png index 1ae599519ee..d0fb5ba2fbb 100644 Binary files a/test/image/baselines/map_choropleth-raw-geojson.png and b/test/image/baselines/map_choropleth-raw-geojson.png differ diff --git a/test/image/baselines/map_choropleth0-legend.png b/test/image/baselines/map_choropleth0-legend.png index b035657b04e..a8467c4f741 100644 Binary files a/test/image/baselines/map_choropleth0-legend.png and b/test/image/baselines/map_choropleth0-legend.png differ diff --git a/test/image/baselines/map_choropleth0.png b/test/image/baselines/map_choropleth0.png index d62b97547f8..1301d5ea9fd 100644 Binary files a/test/image/baselines/map_choropleth0.png and b/test/image/baselines/map_choropleth0.png differ diff --git a/test/image/baselines/map_connectgaps.png b/test/image/baselines/map_connectgaps.png index 9eca6b08bf1..bfa8f81446e 100644 Binary files a/test/image/baselines/map_connectgaps.png and b/test/image/baselines/map_connectgaps.png differ diff --git a/test/image/baselines/map_density-multiple.png b/test/image/baselines/map_density-multiple.png index 9c87b495438..b2676fbb542 100644 Binary files a/test/image/baselines/map_density-multiple.png and b/test/image/baselines/map_density-multiple.png differ diff --git a/test/image/baselines/map_density-multiple_legend.png b/test/image/baselines/map_density-multiple_legend.png index d82ec065671..efcb0e904a0 100644 Binary files a/test/image/baselines/map_density-multiple_legend.png and b/test/image/baselines/map_density-multiple_legend.png differ diff --git a/test/image/baselines/map_density0.png b/test/image/baselines/map_density0.png index 1f25cdc9693..3a2cf572b75 100644 Binary files a/test/image/baselines/map_density0.png and b/test/image/baselines/map_density0.png differ diff --git a/test/image/baselines/map_fill.png b/test/image/baselines/map_fill.png index cd52700e54b..bc1f9d19378 100644 Binary files a/test/image/baselines/map_fill.png and b/test/image/baselines/map_fill.png differ diff --git a/test/image/baselines/map_fonts-supported-metropolis-italic.png b/test/image/baselines/map_fonts-supported-metropolis-italic.png index 5e09dca5ffe..6aff42e0278 100644 Binary files a/test/image/baselines/map_fonts-supported-metropolis-italic.png and b/test/image/baselines/map_fonts-supported-metropolis-italic.png differ diff --git a/test/image/baselines/map_fonts-supported-metropolis-weight.png b/test/image/baselines/map_fonts-supported-metropolis-weight.png index d6c24847cc5..91925ddfefb 100644 Binary files a/test/image/baselines/map_fonts-supported-metropolis-weight.png and b/test/image/baselines/map_fonts-supported-metropolis-weight.png differ diff --git a/test/image/baselines/map_fonts-supported-metropolis.png b/test/image/baselines/map_fonts-supported-metropolis.png index d6c24847cc5..91925ddfefb 100644 Binary files a/test/image/baselines/map_fonts-supported-metropolis.png and b/test/image/baselines/map_fonts-supported-metropolis.png differ diff --git a/test/image/baselines/map_fonts-supported-open-sans-weight.png b/test/image/baselines/map_fonts-supported-open-sans-weight.png index f91e19454c4..90c4b293ef5 100644 Binary files a/test/image/baselines/map_fonts-supported-open-sans-weight.png and b/test/image/baselines/map_fonts-supported-open-sans-weight.png differ diff --git a/test/image/baselines/map_fonts-supported-open-sans.png b/test/image/baselines/map_fonts-supported-open-sans.png index f91e19454c4..90c4b293ef5 100644 Binary files a/test/image/baselines/map_fonts-supported-open-sans.png and b/test/image/baselines/map_fonts-supported-open-sans.png differ diff --git a/test/image/baselines/map_geojson-attributes.png b/test/image/baselines/map_geojson-attributes.png index 9796e85cfa6..9584687d84c 100644 Binary files a/test/image/baselines/map_geojson-attributes.png and b/test/image/baselines/map_geojson-attributes.png differ diff --git a/test/image/baselines/map_layers.png b/test/image/baselines/map_layers.png index ab43f1ea799..f49b75ca990 100644 Binary files a/test/image/baselines/map_layers.png and b/test/image/baselines/map_layers.png differ diff --git a/test/image/baselines/map_scattercluster.png b/test/image/baselines/map_scattercluster.png index 25ae8a8b8d0..cf30007d028 100644 Binary files a/test/image/baselines/map_scattercluster.png and b/test/image/baselines/map_scattercluster.png differ diff --git a/test/image/baselines/map_symbol-text.png b/test/image/baselines/map_symbol-text.png index 6a423f72ad3..c3af17ac8cd 100644 Binary files a/test/image/baselines/map_symbol-text.png and b/test/image/baselines/map_symbol-text.png differ diff --git a/test/image/baselines/map_texttemplate.png b/test/image/baselines/map_texttemplate.png index 2ac0c8df02b..8668efb677e 100644 Binary files a/test/image/baselines/map_texttemplate.png and b/test/image/baselines/map_texttemplate.png differ diff --git a/test/image/baselines/mapbox_angles.png b/test/image/baselines/mapbox_angles.png index 5e6bbb5355b..a02f2c95d6f 100644 Binary files a/test/image/baselines/mapbox_angles.png and b/test/image/baselines/mapbox_angles.png differ diff --git a/test/image/baselines/mapbox_carto-style.png b/test/image/baselines/mapbox_carto-style.png index 5c3266e87c2..ac2fac08ddd 100644 Binary files a/test/image/baselines/mapbox_carto-style.png and b/test/image/baselines/mapbox_carto-style.png differ diff --git a/test/image/baselines/mapbox_carto-text.png b/test/image/baselines/mapbox_carto-text.png index 490029437c4..92765d2eed1 100644 Binary files a/test/image/baselines/mapbox_carto-text.png and b/test/image/baselines/mapbox_carto-text.png differ diff --git a/test/image/baselines/mapbox_fonts-supported-metropolis-italic.png b/test/image/baselines/mapbox_fonts-supported-metropolis-italic.png index 378be30d784..2d3d79a7ba6 100644 Binary files a/test/image/baselines/mapbox_fonts-supported-metropolis-italic.png and b/test/image/baselines/mapbox_fonts-supported-metropolis-italic.png differ diff --git a/test/image/baselines/mapbox_fonts-supported-metropolis-weight.png b/test/image/baselines/mapbox_fonts-supported-metropolis-weight.png index 21643f6ecb3..9db2fb3ba05 100644 Binary files a/test/image/baselines/mapbox_fonts-supported-metropolis-weight.png and b/test/image/baselines/mapbox_fonts-supported-metropolis-weight.png differ diff --git a/test/image/baselines/mapbox_fonts-supported-metropolis.png b/test/image/baselines/mapbox_fonts-supported-metropolis.png index 21643f6ecb3..9db2fb3ba05 100644 Binary files a/test/image/baselines/mapbox_fonts-supported-metropolis.png and b/test/image/baselines/mapbox_fonts-supported-metropolis.png differ diff --git a/test/image/baselines/mapbox_geojson-attributes.png b/test/image/baselines/mapbox_geojson-attributes.png index 54452862087..02bea56988a 100644 Binary files a/test/image/baselines/mapbox_geojson-attributes.png and b/test/image/baselines/mapbox_geojson-attributes.png differ diff --git a/test/image/baselines/mapbox_layers.png b/test/image/baselines/mapbox_layers.png index 4d982f243b3..517b1bade81 100644 Binary files a/test/image/baselines/mapbox_layers.png and b/test/image/baselines/mapbox_layers.png differ diff --git a/test/image/baselines/mapbox_predefined-styles1.png b/test/image/baselines/mapbox_predefined-styles1.png index fbd3e779b3c..091bbce393d 100644 Binary files a/test/image/baselines/mapbox_predefined-styles1.png and b/test/image/baselines/mapbox_predefined-styles1.png differ diff --git a/test/image/baselines/mapbox_predefined-styles2.png b/test/image/baselines/mapbox_predefined-styles2.png index a4ad4b6b3cc..d90e3d069d2 100644 Binary files a/test/image/baselines/mapbox_predefined-styles2.png and b/test/image/baselines/mapbox_predefined-styles2.png differ diff --git a/test/image/baselines/mapbox_symbol-text.png b/test/image/baselines/mapbox_symbol-text.png index 3dd8292f383..e7b44619511 100644 Binary files a/test/image/baselines/mapbox_symbol-text.png and b/test/image/baselines/mapbox_symbol-text.png differ diff --git a/test/image/baselines/mapbox_texttemplate.png b/test/image/baselines/mapbox_texttemplate.png index 2d8ec42649b..e7a373c7228 100644 Binary files a/test/image/baselines/mapbox_texttemplate.png and b/test/image/baselines/mapbox_texttemplate.png differ diff --git a/test/image/baselines/zorder-overlayed-subplots-multiple-traces-main-subplot.png b/test/image/baselines/zorder-overlayed-subplots-multiple-traces-main-subplot.png index 5cb4ebb5b11..388bd44ec30 100644 Binary files a/test/image/baselines/zorder-overlayed-subplots-multiple-traces-main-subplot.png and b/test/image/baselines/zorder-overlayed-subplots-multiple-traces-main-subplot.png differ diff --git a/test/image/mocks/ternary_simple.json b/test/image/mocks/ternary_simple.json index 21920c2c186..5683b92458f 100644 --- a/test/image/mocks/ternary_simple.json +++ b/test/image/mocks/ternary_simple.json @@ -4,6 +4,7 @@ "a": [2, 1, 1], "b": [1, 2, 1], "c": [1, 1, 2.12345], + "ids": ["first ID", "second ID", "third ID"], "type": "scatterternary" } ], diff --git a/test/jasmine/tests/layout_images_test.js b/test/jasmine/tests/layout_images_test.js index b4bd40b4cbc..a5166349ecb 100644 --- a/test/jasmine/tests/layout_images_test.js +++ b/test/jasmine/tests/layout_images_test.js @@ -319,9 +319,8 @@ describe('Layout images', function() { var gd; var data = [{ x: [1, 2, 3], y: [1, 2, 3] }]; - beforeEach(function(done) { - gd = createGraphDiv(); - Plotly.newPlot(gd, data, { + var layoutFn = function() { + return { images: [{ source: jsLogo, x: 2, @@ -331,12 +330,17 @@ describe('Layout images', function() { }], width: 500, height: 400 - }).then(done); + }; + } + + beforeEach(function(done) { + gd = createGraphDiv(); + Plotly.newPlot(gd, data, layoutFn()).then(done); }); afterEach(destroyGraphDiv); - it('should only create canvas if url image', function(done) { + it('should only create canvas if url image and staticPlot', function(done) { var originalCreateElement = document.createElement; var newCanvasElement; spyOn(document, 'createElement').and.callFake(function(elementType) { @@ -350,7 +354,21 @@ describe('Layout images', function() { Plotly.relayout(gd, 'images[0].source', dataUriImage) .then(function() { - expect(newCanvasElement).toBeUndefined(); + expect(newCanvasElement).withContext('non-static data uri').toBeUndefined(); + + return Plotly.relayout(gd, 'images[0].source', jsLogo); + }) + .then(function() { + expect(newCanvasElement).withContext('non-static url').toBeUndefined(); + + return Plotly.newPlot(gd, data, layoutFn(), {staticPlot: true}); + }) + .then(function() { + newCanvasElement = undefined; + return Plotly.relayout(gd, 'images[0].source', dataUriImage); + }) + .then(function() { + expect(newCanvasElement).withContext('static data uri').toBeUndefined(); return Plotly.relayout(gd, 'images[0].source', jsLogo); }) @@ -392,11 +410,21 @@ describe('Layout images', function() { .then(done, done.fail); }); - it('should remove the image tag if an invalid source', function(done) { + it('should remove the image tag if an invalid source and staticPlot', function(done) { var selection = d3Select('image'); expect(selection.size()).toBe(1); Plotly.relayout(gd, 'images[0].source', 'invalidUrl') + .then(function() { + var newSelection = d3Select('image'); + expect(newSelection.size()).toBe(1); + }) + .then(function() { + return Plotly.newPlot(gd, data, layoutFn(), {staticPlot: true}); + }) + .then(function() { + return Plotly.relayout(gd, 'images[0].source', 'invalidUrl'); + }) .then(function() { var newSelection = d3Select('image'); expect(newSelection.size()).toBe(0); diff --git a/test/jasmine/tests/select_test.js b/test/jasmine/tests/select_test.js index aef24d22ae2..12a4aecf67e 100644 --- a/test/jasmine/tests/select_test.js +++ b/test/jasmine/tests/select_test.js @@ -75,7 +75,7 @@ function assertSelectionNodes(cornerCnt, outlineCnt, _msg) { } var selectingCnt, selectingData, selectedCnt, selectedData, deselectCnt, doubleClickData; -var selectedPromise, deselectPromise, clickedPromise; +var selectedPromise, deselectPromise, clickedPromise, relayoutPromise; function resetEvents(gd) { selectingCnt = 0; @@ -125,6 +125,12 @@ function resetEvents(gd) { resolve(); }); }); + + relayoutPromise = new Promise(function(resolve) { + gd.on('plotly_relayout', function() { + resolve(); + }); + }); } function assertEventCounts(selecting, selected, deselect, msg) { @@ -1035,6 +1041,100 @@ describe('Test select box and lasso in general:', function() { }); }); + describe('select / deselect with fake selections', function() { + var gd; + beforeEach(function(done) { + gd = createGraphDiv(); + + var mockCopy = Lib.extendDeep({}, mock); + mockCopy.layout.dragmode = 'select'; + mockCopy.layout.hovermode = 'closest'; + mockCopy.layout.selections = [null]; + addInvisible(mockCopy); + + _newPlot(gd, mockCopy.data, mockCopy.layout) + .then(done); + }); + + it('should trigger selecting/selected/deselect events', function(done) { + resetEvents(gd); + + drag(selectPath); + + selectedPromise.then(function() { + expect(selectedCnt).toBe(1, 'with the correct selected count'); + assertEventData(selectedData.points, [{ + curveNumber: 0, + pointNumber: 0, + pointIndex: 0, + x: 0.002, + y: 16.25 + }, { + curveNumber: 0, + pointNumber: 1, + pointIndex: 1, + x: 0.004, + y: 12.5 + }], 'with the correct selected points (2)'); + assertRange(selectedData.range, { + x: [0.002000, 0.0046236], + y: [0.10209191961595454, 24.512223978291406] + }, 'with the correct selected range'); + + return doubleClick(250, 200); + }) + .then(deselectPromise) + .then(function() { + expect(doubleClickData).toBe(null, 'with the correct deselect data'); + }) + .then(done, done.fail); + }); + + it('should handle add/sub selection', function(done) { + resetEvents(gd); + expect(gd.layout.selections.length).toBe(1); + + drag([[193, 193], [213, 193]], {shiftKey: true}) + + selectedPromise.then(function() { + expect(selectedCnt).toBe(1, 'with the correct selected count'); + assertEventData(selectedData.points, [{ + curveNumber: 0, + pointNumber: 4, + pointIndex: 4, + x: 0.013, + y: 6.875 + }], 'with the correct selected points (1)'); + }) + .then(function() { + // this is not working here, but it works in the test dashboard, not sure why + // but at least this test shows us that no errors are thrown. + // expect(gd.layout.selections.length).toBe(2, 'fake selection is still there'); + + resetEvents(gd); + + return doubleClick(250, 200); + }) + .then(relayoutPromise) + .then(function() { + expect(gd.layout.selections.length).toBe(0, 'fake selection is cleared'); + expect(doubleClickData).toBe(null, 'with the correct deselect data'); + }) + .then(done, done.fail); + }); + + it('should clear fake selections on doubleclick', function(done) { + resetEvents(gd); + + doubleClick(250, 200); + + relayoutPromise.then(function() { + expect(gd.layout.selections.length).toBe(0, 'fake selections are cleared'); + }) + .then(done, done.fail); + }); + }); + describe('lasso events', function() { var mockCopy = Lib.extendDeep({}, mock); mockCopy.layout.dragmode = 'lasso'; @@ -1979,6 +2079,7 @@ describe('Test select box and lasso per trace:', function() { function() { assertPoints([[0.5, 0.25, 0.25]]); assertSelectedPoints({0: [0]}); + expect(selectedData.points[0].id).toBe("first ID") }, [380, 180], BOXEVENTS, 'scatterternary select' diff --git a/test/jasmine/tests/ternary_test.js b/test/jasmine/tests/ternary_test.js index 05777a80d5c..c36049f8d92 100644 --- a/test/jasmine/tests/ternary_test.js +++ b/test/jasmine/tests/ternary_test.js @@ -21,7 +21,7 @@ var assertHoverLabelContent = customAssertions.assertHoverLabelContent; var SORTED_EVENT_KEYS = [ 'data', 'fullData', 'curveNumber', 'pointNumber', 'pointIndex', - 'xaxis', 'yaxis', 'a', 'b', 'c', + 'xaxis', 'yaxis', 'a', 'b', 'c', 'id', 'bbox' ].sort();