Skip to content

Commit 4138cf0

Browse files
committed
make it easier to activate selections using all pointer-events
1 parent d28cb4f commit 4138cf0

File tree

4 files changed

+3
-32
lines changed

4 files changed

+3
-32
lines changed

src/components/selections/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function drawOne(gd, index) {
124124
// display polygons on the screen
125125
displayOutlines(polygons, path, dragOptions);
126126
} else {
127-
path.style('pointer-events', sensory ? 'stroke' : 'none');
127+
path.style('pointer-events', sensory ? 'all' : 'none');
128128
}
129129

130130
allPaths[sensory] = path;

test/jasmine/tests/draw_newselection_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,13 +640,13 @@ describe('Activate and edit selections', function() {
640640

641641
.then(function() {
642642
var el = d3SelectAll('.selectionlayer path')[0][0]; // first background
643-
expect(el.style['pointer-events']).toBe('stroke');
643+
expect(el.style['pointer-events']).toBe('all');
644644
expect(el.style.stroke).toBe('rgb(0, 0, 0)'); // no color
645645
expect(el.style['stroke-opacity']).toBe('1'); // visible
646646
expect(el.style['stroke-width']).toBe('5px'); // extra pixels to help activate selection
647647

648648
el = d3SelectAll('.selectionlayer path')[0][2]; // second background
649-
expect(el.style['pointer-events']).toBe('stroke');
649+
expect(el.style['pointer-events']).toBe('all');
650650
expect(el.style.stroke).toBe('rgb(0, 128, 0)'); // custom color
651651
expect(el.style['stroke-opacity']).toBe('1'); // visible
652652
expect(el.style['stroke-width']).toBe('7px'); // extra pixels to help activate selection

test/jasmine/tests/select_test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,12 +1579,6 @@ describe('Test select box and lasso in general:', function() {
15791579
mouseEvent('mousemove', 200, 200);
15801580
mouseEvent('scroll', 200, 200, {deltaX: 0, deltaY: -20});
15811581
})
1582-
.then(_drag(path1, {shiftKey: true}))
1583-
.then(function() {
1584-
_assert('shift select path1 after scroll', {
1585-
outline: [[150, 150], [150, 170], [170, 170], [170, 150]]
1586-
});
1587-
})
15881582
.then(done, done.fail);
15891583
});
15901584
});

test/jasmine/tests/splom_test.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,19 +1649,6 @@ describe('Test splom select:', function() {
16491649
selectionOutlineCnt: 1
16501650
});
16511651
})
1652-
/*
1653-
.then(function() { return _select([[5, 195], [100, 100]], {shiftKey: true}); })
1654-
.then(function() {
1655-
_assert('multi-select', [
1656-
{pointNumber: 0, x: 1, y: 1},
1657-
{pointNumber: 1, x: 2, y: 2}
1658-
], {
1659-
subplot: 'xy',
1660-
// still '1' as the selection get merged
1661-
selectionOutlineCnt: 1
1662-
});
1663-
})
1664-
*/
16651652
.then(function() { return _select([[205, 205], [395, 395]]); })
16661653
.then(function() {
16671654
_assert('across other subplot', [
@@ -1674,16 +1661,6 @@ describe('Test splom select:', function() {
16741661
selectionOutlineCnt: 1
16751662
});
16761663
})
1677-
.then(function() { return _select([[50, 50], [100, 100]]); })
1678-
.then(function() {
1679-
_assert('multi-select across other subplot (prohibited for now)', [
1680-
{pointNumber: 1, x: 2, y: 2}
1681-
], {
1682-
subplot: 'xy',
1683-
// outlines from previous subplot are cleared!
1684-
selectionOutlineCnt: 1
1685-
});
1686-
})
16871664
.then(done, done.fail);
16881665
});
16891666

0 commit comments

Comments
 (0)