Skip to content

Commit 468119e

Browse files
committed
speed up dragbox
- replace indexOf with hash objects lookups - add 'svg' and 'draggedPts' trace module categories - speed up updateSubplots (called on pan and scroll) by splitting it into splom, scattergl, svg and draggedPts blocks, (draggedPts is very slow, svg can be slow at 50x50) - ... some scope variable clean up
1 parent d07ae70 commit 468119e

File tree

17 files changed

+270
-200
lines changed

17 files changed

+270
-200
lines changed

src/plot_api/subroutines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ exports.lsInner = function(gd) {
179179
.append('rect');
180180
});
181181

182-
plotClip.select('rect').attr({
182+
plotinfo.clipRect = plotClip.select('rect').attr({
183183
width: xa._length,
184184
height: ya._length
185185
});

src/plots/cartesian/dragbox.js

Lines changed: 254 additions & 184 deletions
Large diffs are not rendered by default.

src/plots/cartesian/transition_axes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ module.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCo
233233
var plotDx = xa2._offset - fracDx,
234234
plotDy = ya2._offset - fracDy;
235235

236-
fullLayout._defs.select('#' + subplot.clipId + '> rect')
236+
subplot.clipRect
237237
.call(Drawing.setTranslate, clipDx, clipDy)
238238
.call(Drawing.setScale, 1 / xScaleFactor, 1 / yScaleFactor);
239239

src/traces/bar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Bar.selectPoints = require('./select');
2727
Bar.moduleType = 'trace';
2828
Bar.name = 'bar';
2929
Bar.basePlotModule = require('../../plots/cartesian');
30-
Bar.categories = ['cartesian', 'bar', 'oriented', 'markerColorscale', 'errorBarsOK', 'showLegend'];
30+
Bar.categories = ['cartesian', 'svg', 'bar', 'oriented', 'markerColorscale', 'errorBarsOK', 'showLegend', 'draggedPts'];
3131
Bar.meta = {
3232
description: [
3333
'The data visualized by the span of the bars is set in `y`',

src/traces/box/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Box.selectPoints = require('./select');
2424
Box.moduleType = 'trace';
2525
Box.name = 'box';
2626
Box.basePlotModule = require('../../plots/cartesian');
27-
Box.categories = ['cartesian', 'symbols', 'oriented', 'box-violin', 'showLegend'];
27+
Box.categories = ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'draggedPts'];
2828
Box.meta = {
2929
description: [
3030
'In vertical (horizontal) box plots,',

src/traces/candlestick/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
moduleType: 'trace',
1515
name: 'candlestick',
1616
basePlotModule: require('../../plots/cartesian'),
17-
categories: ['cartesian', 'showLegend', 'candlestick'],
17+
categories: ['cartesian', 'svg', 'showLegend', 'candlestick'],
1818
meta: {
1919
description: [
2020
'The candlestick is a style of financial chart describing',

src/traces/carpet/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Carpet.animatable = true;
2020
Carpet.moduleType = 'trace';
2121
Carpet.name = 'carpet';
2222
Carpet.basePlotModule = require('../../plots/cartesian');
23-
Carpet.categories = ['cartesian', 'carpet', 'carpetAxis', 'notLegendIsolatable'];
23+
Carpet.categories = ['cartesian', 'svg', 'carpet', 'carpetAxis', 'notLegendIsolatable'];
2424
Carpet.meta = {
2525
description: [
2626
'The data describing carpet axis layout is set in `y` and (optionally)',

src/traces/contour/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Contour.hoverPoints = require('./hover');
2222
Contour.moduleType = 'trace';
2323
Contour.name = 'contour';
2424
Contour.basePlotModule = require('../../plots/cartesian');
25-
Contour.categories = ['cartesian', '2dMap', 'contour', 'showLegend'];
25+
Contour.categories = ['cartesian', 'svg', '2dMap', 'contour', 'showLegend'];
2626
Contour.meta = {
2727
description: [
2828
'The data from which contour lines are computed is set in `z`.',

src/traces/contourcarpet/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ContourCarpet.style = require('../contour/style');
2020
ContourCarpet.moduleType = 'trace';
2121
ContourCarpet.name = 'contourcarpet';
2222
ContourCarpet.basePlotModule = require('../../plots/cartesian');
23-
ContourCarpet.categories = ['cartesian', 'carpet', 'contour', 'symbols', 'showLegend', 'hasLines', 'carpetDependent'];
23+
ContourCarpet.categories = ['cartesian', 'svg', 'carpet', 'contour', 'symbols', 'showLegend', 'hasLines', 'carpetDependent'];
2424
ContourCarpet.meta = {
2525
hrName: 'contour_carpet',
2626
description: [

src/traces/heatmap/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Heatmap.hoverPoints = require('./hover');
2222
Heatmap.moduleType = 'trace';
2323
Heatmap.name = 'heatmap';
2424
Heatmap.basePlotModule = require('../../plots/cartesian');
25-
Heatmap.categories = ['cartesian', '2dMap'];
25+
Heatmap.categories = ['cartesian', 'svg', '2dMap'];
2626
Heatmap.meta = {
2727
description: [
2828
'The data that describes the heatmap value-to-color mapping',

0 commit comments

Comments
 (0)