Skip to content

Commit 2533b85

Browse files
committed
mousewheel
1 parent 8246109 commit 2533b85

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/traces/table/plot.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ module.exports = function plot(gd, calcdata) {
5454
.classed('tableControlView', true)
5555
.style('box-sizing', 'content-box')
5656
.on('mousemove', function() {tableControlView.call(renderScrollbarKit);})
57+
.on('mousewheel', function(d) {
58+
d3.event.preventDefault();
59+
makeDragRow(gd, tableControlView, null, d.scrollY + d3.event.deltaY)(d);
60+
})
5761
.call(renderScrollbarKit);
5862

5963
tableControlView
@@ -77,6 +81,8 @@ module.exports = function plot(gd, calcdata) {
7781
var movedColumn = d3.select(this);
7882
easeColumn(movedColumn, d, -c.uplift);
7983
raiseToTop(this);
84+
d.calcdata.columnDragInProgress = true;
85+
renderScrollbarKit(tableControlView);
8086
return d;
8187
})
8288
.on('drag', function(d) {
@@ -102,6 +108,7 @@ module.exports = function plot(gd, calcdata) {
102108
var movedColumn = d3.select(this);
103109
var p = d.calcdata;
104110
d.x = d.xScale(d);
111+
d.calcdata.columnDragInProgress = false;
105112
easeColumn(movedColumn, d, 0);
106113
columnMoved(gd, calcdata, p.key, p.columns.map(function(dd) {return dd.xIndex;}));
107114
})
@@ -270,7 +277,7 @@ function renderScrollbarKit(tableControlView) {
270277
.attr('y2', function(d) {
271278
return d.scrollbarState.barLength - c.scrollbarWidth / 2;
272279
})
273-
.attr('stroke-opacity', 0.4);
280+
.attr('stroke-opacity', function(d) {return d.columnDragInProgress ? 0 : 0.4});
274281

275282
// cancel transition: possible pending (also, delayed) transition
276283
scrollbarGlyph

0 commit comments

Comments
 (0)