diff --git a/package-lock.json b/package-lock.json index b24da60fab4..9c0c407a671 100644 --- a/package-lock.json +++ b/package-lock.json @@ -524,6 +524,11 @@ "resolved": "https://registry.npmjs.org/array-range/-/array-range-1.0.1.tgz", "integrity": "sha1-9W5GWRhDYRxqVvd+8C7afFAIm/w=" }, + "array-rearrange": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/array-rearrange/-/array-rearrange-2.2.2.tgz", + "integrity": "sha512-UfobP5N12Qm4Qu4fwLDIi2v6+wZsSf6snYSxAMeKhrh37YGnNWZPRmVEKc/2wfms53TLQnzfpG8wCx2Y/6NG1w==" + }, "array-reduce": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", @@ -6123,6 +6128,11 @@ "kind-of": "3.2.2" } }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", @@ -6865,11 +6875,6 @@ "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-1.0.1.tgz", "integrity": "sha1-PL0D6d6tnA9vZszblkUOXOzGQOA=" }, - "kdgrass": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/kdgrass/-/kdgrass-1.0.1.tgz", - "integrity": "sha512-2sfleTaNfu4AQdL9Om42i7D+NnnIwTd+MJYkbCdyv1DvFtHkLLBc8ZwrM2nD1zp4AuSBzCfoDSWcba4c7iHodQ==" - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -7599,6 +7604,11 @@ "gl-mat4": "1.1.4" } }, + "math-log2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-log2/-/math-log2-1.0.1.tgz", + "integrity": "sha1-+4lBvl9evol55xjmJzsXjlhpRWU=" + }, "matrix-camera-controller": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/matrix-camera-controller/-/matrix-camera-controller-2.1.3.tgz", @@ -8959,9 +8969,9 @@ "dev": true }, "parse-rect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/parse-rect/-/parse-rect-1.1.1.tgz", - "integrity": "sha512-SjynuO1UNvW9EvQJa5arv5edLkdf6lzTVTBmTW+FPACLaYahRCam8jJeICoOyLv27e3lY7Mo6m3qh6ASxxfR1A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parse-rect/-/parse-rect-1.2.0.tgz", + "integrity": "sha512-4QZ6KYbnE6RTwg9E0HpLchUM9EZt6DnDxajFZZDSV4p/12ZJEvPO702DZpGvRYEPo00yKDys7jASi+/w7aO8LA==", "requires": { "pick-by-alias": "1.2.0" } @@ -9188,6 +9198,30 @@ "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", "dev": true }, + "point-cluster": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/point-cluster/-/point-cluster-3.1.2.tgz", + "integrity": "sha512-LmjEyihXXjGSgPkrjM29MMmNroNB6PIGCCeMQPcINHEZyI4tiTPaC1BGrCHNJfeDgvsh1X3qKaxwcZZ92Apz1w==", + "requires": { + "array-bounds": "1.0.1", + "array-normalize": "1.1.3", + "binary-search-bounds": "2.0.4", + "bubleify": "1.1.0", + "clamp": "1.0.1", + "dtype": "2.0.0", + "flatten-vertex-data": "1.0.0", + "is-obj": "1.0.1", + "math-log2": "1.0.1", + "parse-rect": "1.2.0" + }, + "dependencies": { + "binary-search-bounds": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/binary-search-bounds/-/binary-search-bounds-2.0.4.tgz", + "integrity": "sha512-2hg5kgdKql5ClF2ErBcSx0U5bnl5hgS4v7wMnLFodyR47yMtj2w+UAZB+0CiqyHct2q543i7Bi4/aMIegorCCg==" + } + } + }, "point-in-big-polygon": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/point-in-big-polygon/-/point-in-big-polygon-2.0.0.tgz", @@ -9986,12 +10020,12 @@ } }, "regl-scatter2d": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/regl-scatter2d/-/regl-scatter2d-2.1.17.tgz", - "integrity": "sha512-G0/VFuXVHgYp1/F3GkY+7+28OIBOhd/bmVCmUw43tsnb0h3N8p2hJz5xyrD4mLaAF+cG06Ko/Gn2FEbxwC58AA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regl-scatter2d/-/regl-scatter2d-3.0.0.tgz", + "integrity": "sha512-ylsZ/TZ4XB/qFncCTLLAFhXt503VE4m4/u699OwLMgncePenBl2K/9SvJ5GuNjuaJ4CY3Zj9q+zPGYChdDsDUw==", "requires": { "array-range": "1.0.1", - "binary-search-bounds": "2.0.4", + "array-rearrange": "2.2.2", "bubleify": "1.1.0", "clamp": "1.0.1", "color-id": "1.1.0", @@ -10000,18 +10034,11 @@ "glslify": "6.1.1", "is-iexplorer": "1.0.0", "object-assign": "4.1.1", - "parse-rect": "1.1.1", + "parse-rect": "1.2.0", "pick-by-alias": "1.2.0", - "snap-points-2d": "3.2.0", + "point-cluster": "3.1.2", "to-float32": "1.0.0", "update-diff": "1.1.0" - }, - "dependencies": { - "binary-search-bounds": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/binary-search-bounds/-/binary-search-bounds-2.0.4.tgz", - "integrity": "sha512-2hg5kgdKql5ClF2ErBcSx0U5bnl5hgS4v7wMnLFodyR47yMtj2w+UAZB+0CiqyHct2q543i7Bi4/aMIegorCCg==" - } } }, "remove-trailing-separator": { @@ -10760,14 +10787,6 @@ "nodemailer-shared": "1.1.0" } }, - "snap-points-2d": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/snap-points-2d/-/snap-points-2d-3.2.0.tgz", - "integrity": "sha1-DhniKjoOlrziHN9cfx1+1blnRfA=", - "requires": { - "array-bounds": "1.0.1" - } - }, "sntp": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", diff --git a/package.json b/package.json index 1813e41c5b5..6c79f20635e 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ "glslify": "^6.1.1", "has-hover": "^1.0.1", "has-passive-events": "^1.0.0", - "kdgrass": "^1.0.1", "mapbox-gl": "0.44.1", "matrix-camera-controller": "^2.1.3", "mouse-change": "^1.4.0", @@ -96,11 +95,12 @@ "ndarray-fill": "^1.0.2", "ndarray-homography": "^1.0.0", "ndarray-ops": "^1.2.2", + "point-cluster": "^3.1.2", "polybooljs": "^1.2.0", "regl": "^1.3.1", "regl-error2d": "^2.0.3", "regl-line2d": "^2.1.5", - "regl-scatter2d": "^2.1.17", + "regl-scatter2d": "^3.0.0", "right-now": "^1.0.0", "robust-orientation": "^1.1.3", "sane-topojson": "^2.0.0", diff --git a/src/traces/scattergl/convert.js b/src/traces/scattergl/convert.js index d05beb344ac..e1c405b938a 100644 --- a/src/traces/scattergl/convert.js +++ b/src/traces/scattergl/convert.js @@ -21,6 +21,7 @@ var subTypes = require('../scatter/subtypes'); var makeBubbleSizeFn = require('../scatter/make_bubble_size_func'); var constants = require('./constants'); +var DESELECTDIM = require('../../constants/interactions').DESELECTDIM; function convertStyle(gd, trace) { var i; @@ -41,6 +42,14 @@ function convertStyle(gd, trace) { opts.marker = convertMarkerStyle(trace); opts.selected = convertMarkerSelection(trace, trace.selected); opts.unselected = convertMarkerSelection(trace, trace.unselected); + + if(!trace.unselected && Array.isArray(trace.marker.opacity)) { + var mo = trace.marker.opacity; + opts.unselected.opacity = new Array(mo.length); + for(i = 0; i < mo.length; i++) { + opts.unselected.opacity[i] = DESELECTDIM * mo[i]; + } + } } if(subTypes.hasLines(trace)) { diff --git a/src/traces/scattergl/index.js b/src/traces/scattergl/index.js index 315242c9ec5..0ff5fe9c942 100644 --- a/src/traces/scattergl/index.js +++ b/src/traces/scattergl/index.js @@ -12,7 +12,7 @@ var createRegl = require('regl'); var createScatter = require('regl-scatter2d'); var createLine = require('regl-line2d'); var createError = require('regl-error2d'); -var kdtree = require('kdgrass'); +var cluster = require('point-cluster'); var arrayRange = require('array-range'); var Registry = require('../../registry'); @@ -72,7 +72,7 @@ function calc(gd, trace) { // and it is also if(xa.type !== 'log' && ya.type !== 'log') { // FIXME: delegate this to webworker - stash.tree = kdtree(positions, 512); + stash.tree = cluster(positions); } else { var ids = stash.ids = new Array(count); for(i = 0; i < count; i++) { @@ -104,6 +104,12 @@ function calc(gd, trace) { if(opts.line && !scene.line2d) scene.line2d = true; if((opts.errorX || opts.errorY) && !scene.error2d) scene.error2d = true; + // FIXME: organize it in a more appropriate manner, probably in sceneOptions + // put point-cluster instance for optimized regl calc + if(opts.marker && count >= TOO_MANY_POINTS) { + opts.marker.cluster = stash.tree; + } + // save scene opts batch scene.lineOptions.push(opts.line); scene.errorXOptions.push(opts.errorX); @@ -547,10 +553,7 @@ function plot(gd, subplot, cdata) { // create select2d if(!scene.select2d) { // create scatter instance by cloning scatter2d - scene.select2d = createScatter( - fullLayout._glcanvas.data()[1].regl, - {clone: scene.scatter2d} - ); + scene.select2d = createScatter(fullLayout._glcanvas.data()[1].regl); } if(scene.scatter2d && scene.selectBatch && scene.selectBatch.length) { diff --git a/src/traces/scatterpolargl/index.js b/src/traces/scatterpolargl/index.js index 8bd78e52393..34871fb5eb7 100644 --- a/src/traces/scatterpolargl/index.js +++ b/src/traces/scatterpolargl/index.js @@ -8,7 +8,7 @@ 'use strict'; -var kdtree = require('kdgrass'); +var cluster = require('point-cluster'); var isNumeric = require('fast-isnumeric'); var ScatterGl = require('../scattergl'); @@ -17,6 +17,8 @@ var Axes = require('../../plots/cartesian/axes'); var makeHoverPointText = require('../scatterpolar/hover').makeHoverPointText; var subTypes = require('../scatter/subtypes'); +var TOO_MANY_POINTS = require('../scattergl/constants').TOO_MANY_POINTS; + function calc(container, trace) { var layout = container._fullLayout; var subplotId = trace.subplot; @@ -106,6 +108,13 @@ function plot(container, subplot, cdata) { if(options.line && !scene.line2d) scene.line2d = true; if((options.errorX || options.errorY) && !scene.error2d) scene.error2d = true; + stash.tree = cluster(positions); + + // FIXME: see scattergl.js#109 + if(options.marker && count >= TOO_MANY_POINTS) { + options.marker.cluster = stash.tree; + } + // bring positions to selected/unselected options if(subTypes.hasMarkers(trace)) { options.selected.positions = options.unselected.positions = options.marker.positions; @@ -132,7 +141,6 @@ function plot(container, subplot, cdata) { stash.theta = thetaArray; stash.positions = positions; stash.count = count; - stash.tree = kdtree(positions, 512); }); return ScatterGl.plot(container, subplot, cdata); diff --git a/tasks/test_syntax.js b/tasks/test_syntax.js index 1b61286f14b..bb94efc3faa 100644 --- a/tasks/test_syntax.js +++ b/tasks/test_syntax.js @@ -282,7 +282,7 @@ function assertES5() { }); var files = constants.partialBundlePaths.map(function(f) { return f.dist; }); - files.unshift(constants.pathToPlotlyDist); + files.unshift(constants.pathToPlotlyBuild, constants.pathToPlotlyDist); var report = cli.executeOnFiles(files); var formatter = cli.getFormatter(); diff --git a/test/image/baselines/gl2d_14.png b/test/image/baselines/gl2d_14.png index d90ff1e2468..3b31687e969 100644 Binary files a/test/image/baselines/gl2d_14.png and b/test/image/baselines/gl2d_14.png differ diff --git a/test/image/baselines/gl2d_17.png b/test/image/baselines/gl2d_17.png index 7eeb7dea3a8..7e4c8d41fa2 100644 Binary files a/test/image/baselines/gl2d_17.png and b/test/image/baselines/gl2d_17.png differ diff --git a/test/image/baselines/gl2d_annotations.png b/test/image/baselines/gl2d_annotations.png index 7fc9eeae93a..8700ec20796 100644 Binary files a/test/image/baselines/gl2d_annotations.png and b/test/image/baselines/gl2d_annotations.png differ diff --git a/test/image/baselines/gl2d_axes_booleans.png b/test/image/baselines/gl2d_axes_booleans.png index e6e72b6b9b2..99ae8531d00 100644 Binary files a/test/image/baselines/gl2d_axes_booleans.png and b/test/image/baselines/gl2d_axes_booleans.png differ diff --git a/test/image/baselines/gl2d_axes_labels.png b/test/image/baselines/gl2d_axes_labels.png index 302d41630e8..de5a0db3a4b 100644 Binary files a/test/image/baselines/gl2d_axes_labels.png and b/test/image/baselines/gl2d_axes_labels.png differ diff --git a/test/image/baselines/gl2d_axes_labels2.png b/test/image/baselines/gl2d_axes_labels2.png index 0df05344ea9..41408c7bc2b 100644 Binary files a/test/image/baselines/gl2d_axes_labels2.png and b/test/image/baselines/gl2d_axes_labels2.png differ diff --git a/test/image/baselines/gl2d_axes_lines.png b/test/image/baselines/gl2d_axes_lines.png index 5804eba3781..c29322d35d1 100644 Binary files a/test/image/baselines/gl2d_axes_lines.png and b/test/image/baselines/gl2d_axes_lines.png differ diff --git a/test/image/baselines/gl2d_axes_range_manual.png b/test/image/baselines/gl2d_axes_range_manual.png index 0f9047db8fa..9043299b823 100644 Binary files a/test/image/baselines/gl2d_axes_range_manual.png and b/test/image/baselines/gl2d_axes_range_manual.png differ diff --git a/test/image/baselines/gl2d_axes_range_mode.png b/test/image/baselines/gl2d_axes_range_mode.png index 98eca06f700..0076fb99f3c 100644 Binary files a/test/image/baselines/gl2d_axes_range_mode.png and b/test/image/baselines/gl2d_axes_range_mode.png differ diff --git a/test/image/baselines/gl2d_axes_range_type.png b/test/image/baselines/gl2d_axes_range_type.png index e9a6474b843..094efb6b855 100644 Binary files a/test/image/baselines/gl2d_axes_range_type.png and b/test/image/baselines/gl2d_axes_range_type.png differ diff --git a/test/image/baselines/gl2d_clean-number.png b/test/image/baselines/gl2d_clean-number.png index 4143c7c7dce..c667316952b 100644 Binary files a/test/image/baselines/gl2d_clean-number.png and b/test/image/baselines/gl2d_clean-number.png differ diff --git a/test/image/baselines/gl2d_date_axes.png b/test/image/baselines/gl2d_date_axes.png index 072cbe9d151..58819220d69 100644 Binary files a/test/image/baselines/gl2d_date_axes.png and b/test/image/baselines/gl2d_date_axes.png differ diff --git a/test/image/baselines/gl2d_error_bars.png b/test/image/baselines/gl2d_error_bars.png index 9a84c77630a..b48fcb35bba 100644 Binary files a/test/image/baselines/gl2d_error_bars.png and b/test/image/baselines/gl2d_error_bars.png differ diff --git a/test/image/baselines/gl2d_fonts.png b/test/image/baselines/gl2d_fonts.png index 6465d9087c6..f71fd65374b 100644 Binary files a/test/image/baselines/gl2d_fonts.png and b/test/image/baselines/gl2d_fonts.png differ diff --git a/test/image/baselines/gl2d_layout_image.png b/test/image/baselines/gl2d_layout_image.png index 2c3850c52a7..14a21a818f5 100644 Binary files a/test/image/baselines/gl2d_layout_image.png and b/test/image/baselines/gl2d_layout_image.png differ diff --git a/test/image/baselines/gl2d_line_aligned.png b/test/image/baselines/gl2d_line_aligned.png index 84913b81e0f..c6bf4ee8d3b 100644 Binary files a/test/image/baselines/gl2d_line_aligned.png and b/test/image/baselines/gl2d_line_aligned.png differ diff --git a/test/image/baselines/gl2d_line_dash.png b/test/image/baselines/gl2d_line_dash.png index 1b73c3f0907..91d2c7d7051 100644 Binary files a/test/image/baselines/gl2d_line_dash.png and b/test/image/baselines/gl2d_line_dash.png differ diff --git a/test/image/baselines/gl2d_multiple-traces-axes-labels.png b/test/image/baselines/gl2d_multiple-traces-axes-labels.png index deff530274c..d23f9db1664 100644 Binary files a/test/image/baselines/gl2d_multiple-traces-axes-labels.png and b/test/image/baselines/gl2d_multiple-traces-axes-labels.png differ diff --git a/test/image/baselines/gl2d_multiple-traces-axes.png b/test/image/baselines/gl2d_multiple-traces-axes.png index 5c44cfc442d..348920d37ef 100644 Binary files a/test/image/baselines/gl2d_multiple-traces-axes.png and b/test/image/baselines/gl2d_multiple-traces-axes.png differ diff --git a/test/image/baselines/gl2d_multiple_subplots.png b/test/image/baselines/gl2d_multiple_subplots.png index cd55920d1df..71f1520007e 100644 Binary files a/test/image/baselines/gl2d_multiple_subplots.png and b/test/image/baselines/gl2d_multiple_subplots.png differ diff --git a/test/image/baselines/gl2d_scatter-color-clustering.png b/test/image/baselines/gl2d_scatter-color-clustering.png index 98e1e811832..8e31d1b25ec 100644 Binary files a/test/image/baselines/gl2d_scatter-color-clustering.png and b/test/image/baselines/gl2d_scatter-color-clustering.png differ diff --git a/test/image/baselines/gl2d_scatter-colorscale-colorbar.png b/test/image/baselines/gl2d_scatter-colorscale-colorbar.png index aab8a01c961..999a5bf0848 100644 Binary files a/test/image/baselines/gl2d_scatter-colorscale-colorbar.png and b/test/image/baselines/gl2d_scatter-colorscale-colorbar.png differ diff --git a/test/image/baselines/gl2d_scatter-colorscale-points.png b/test/image/baselines/gl2d_scatter-colorscale-points.png index 2aea7fb1d79..fcf0124e714 100644 Binary files a/test/image/baselines/gl2d_scatter-colorscale-points.png and b/test/image/baselines/gl2d_scatter-colorscale-points.png differ diff --git a/test/image/baselines/gl2d_scatter-subplot-panel.png b/test/image/baselines/gl2d_scatter-subplot-panel.png index e65cdfc48ed..b09f97c49fa 100644 Binary files a/test/image/baselines/gl2d_scatter-subplot-panel.png and b/test/image/baselines/gl2d_scatter-subplot-panel.png differ diff --git a/test/image/baselines/gl2d_scatter_fill_self_next.png b/test/image/baselines/gl2d_scatter_fill_self_next.png index b6a3ffab794..9ba9dd84185 100644 Binary files a/test/image/baselines/gl2d_scatter_fill_self_next.png and b/test/image/baselines/gl2d_scatter_fill_self_next.png differ diff --git a/test/image/baselines/gl2d_selectedpoints.png b/test/image/baselines/gl2d_selectedpoints.png new file mode 100644 index 00000000000..00f8f43aede Binary files /dev/null and b/test/image/baselines/gl2d_selectedpoints.png differ diff --git a/test/image/baselines/gl2d_shapes_below_traces.png b/test/image/baselines/gl2d_shapes_below_traces.png index 8c8a17c86c8..2f7be675d32 100644 Binary files a/test/image/baselines/gl2d_shapes_below_traces.png and b/test/image/baselines/gl2d_shapes_below_traces.png differ diff --git a/test/image/baselines/gl2d_simple_inset.png b/test/image/baselines/gl2d_simple_inset.png index 7cddf9095a9..616b1c37656 100644 Binary files a/test/image/baselines/gl2d_simple_inset.png and b/test/image/baselines/gl2d_simple_inset.png differ diff --git a/test/image/baselines/gl2d_size_margins.png b/test/image/baselines/gl2d_size_margins.png index 20d53998065..75d4abfc5c8 100644 Binary files a/test/image/baselines/gl2d_size_margins.png and b/test/image/baselines/gl2d_size_margins.png differ diff --git a/test/image/baselines/gl2d_stacked_coupled_subplots.png b/test/image/baselines/gl2d_stacked_coupled_subplots.png index a43f92cdba6..503308a69d7 100644 Binary files a/test/image/baselines/gl2d_stacked_coupled_subplots.png and b/test/image/baselines/gl2d_stacked_coupled_subplots.png differ diff --git a/test/image/baselines/gl2d_stacked_subplots.png b/test/image/baselines/gl2d_stacked_subplots.png index 14727b64ff7..c5953a8fd31 100644 Binary files a/test/image/baselines/gl2d_stacked_subplots.png and b/test/image/baselines/gl2d_stacked_subplots.png differ diff --git a/test/image/baselines/gl2d_tick-labels.png b/test/image/baselines/gl2d_tick-labels.png index 759baf31cfa..90dd0b73832 100644 Binary files a/test/image/baselines/gl2d_tick-labels.png and b/test/image/baselines/gl2d_tick-labels.png differ diff --git a/test/image/baselines/glpolar_scatter.png b/test/image/baselines/glpolar_scatter.png index 71c4841359d..d278a1bd29e 100644 Binary files a/test/image/baselines/glpolar_scatter.png and b/test/image/baselines/glpolar_scatter.png differ diff --git a/test/image/baselines/glpolar_style.png b/test/image/baselines/glpolar_style.png index 35f91a65b18..ed27de1ca04 100644 Binary files a/test/image/baselines/glpolar_style.png and b/test/image/baselines/glpolar_style.png differ diff --git a/test/image/mocks/gl2d_selectedpoints.json b/test/image/mocks/gl2d_selectedpoints.json new file mode 100644 index 00000000000..923c2e2bbd9 --- /dev/null +++ b/test/image/mocks/gl2d_selectedpoints.json @@ -0,0 +1,33 @@ +{ + "data": [{ + "name": "array marker opacity edge case", + "type": "scattergl", + "mode": "markers", + "x": [1, 2, 3, 4, 5, 6], + "y": [1, 3, 2, 4, 5, 7], + "marker": { + "size": 20, + "opacity": [0.9, 0.8, 0.7, 1, 0.6, 0.8] + }, + "selectedpoints": [1, 4, 2] + }, { + "name": "array marker opacity + set unselected.marker.opacity", + "type": "scattergl", + "mode": "markers", + "x": [1, 2, 3, 4, 5, 6], + "y": [3, 5, 4, 6, 7, 9], + "marker": { + "size": 20, + "opacity": [0.9, 0.8, 0.7, 1, 0.6, 0.8] + }, + "unselected": { + "marker": { + "opacity": 0 + } + }, + "selectedpoints": [1, 4, 2] + }], + "layout": { + "showlegend": false + } +} diff --git a/test/jasmine/tests/gl2d_click_test.js b/test/jasmine/tests/gl2d_click_test.js index 23512108888..3a6f5635fa8 100644 --- a/test/jasmine/tests/gl2d_click_test.js +++ b/test/jasmine/tests/gl2d_click_test.js @@ -64,7 +64,7 @@ var mock4 = { layout: {} }; -describe('@gl Test hover and click interactions', function() { +describe('@gl @flaky Test hover and click interactions', function() { var gd; function makeHoverFn(gd, x, y) { diff --git a/test/jasmine/tests/gl2d_plot_interact_test.js b/test/jasmine/tests/gl2d_plot_interact_test.js index e8b666ff9e9..7463a51d28e 100644 --- a/test/jasmine/tests/gl2d_plot_interact_test.js +++ b/test/jasmine/tests/gl2d_plot_interact_test.js @@ -518,7 +518,7 @@ describe('@gl Test gl2d plots', function() { .then(done); }); - it('supports 1D and 2D Zoom', function(done) { + it('@flaky supports 1D and 2D Zoom', function(done) { var centerX; var centerY; @@ -571,7 +571,7 @@ describe('@gl Test gl2d plots', function() { .then(done); }); - it('supports axis constraints with zoom', function(done) { + it('@flaky supports axis constraints with zoom', function(done) { var centerX; var centerY; @@ -638,7 +638,7 @@ describe('@gl Test gl2d plots', function() { .then(done); }); - it('should change plot type with incomplete data', function(done) { + it('@flaky should change plot type with incomplete data', function(done) { Plotly.plot(gd, [{}]); expect(function() { Plotly.restyle(gd, {type: 'scattergl', x: [[1]]}, 0); @@ -651,7 +651,7 @@ describe('@gl Test gl2d plots', function() { done(); }); - it('data-referenced annotations should update on drag', function(done) { + it('@flaky data-referenced annotations should update on drag', function(done) { function assertAnnotation(xy) { var ann = d3.select('g.annotation-text-g').select('g'); var translate = Drawing.getTranslate(ann); @@ -694,7 +694,7 @@ describe('@gl Test gl2d plots', function() { .then(done); }); - it('should not scroll document while panning', function(done) { + it('@flaky should not scroll document while panning', function(done) { var mock = { data: [ { type: 'scattergl', y: [1, 2, 3], x: [1, 2, 3] } @@ -856,7 +856,7 @@ describe('@gl Test gl2d plots', function() { .then(done); }); - it('should remove fill2d', function(done) { + it('@flaky should remove fill2d', function(done) { var mock = require('@mocks/gl2d_axes_labels2.json'); Plotly.plot(gd, mock.data, mock.layout)