Skip to content

Commit b30fab4

Browse files
committed
add Scattercarpet.eventData method
- 🔪 its select method and reuse Scatter.select instead which is much DRYer.
1 parent 638d03d commit b30fab4

File tree

3 files changed

+20
-33
lines changed

3 files changed

+20
-33
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Copyright 2012-2017, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
module.exports = function eventData(out, pt, trace, cd, pointNumber) {
12+
var cdi = cd[pointNumber];
13+
14+
out.a = cdi.a;
15+
out.b = cdi.b;
16+
17+
return out;
18+
};

src/traces/scattercarpet/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ ScatterCarpet.calc = require('./calc');
1717
ScatterCarpet.plot = require('./plot');
1818
ScatterCarpet.style = require('./style');
1919
ScatterCarpet.hoverPoints = require('./hover');
20-
ScatterCarpet.selectPoints = require('./select');
20+
ScatterCarpet.selectPoints = require('../scatter/select');
21+
ScatterCarpet.eventData = require('./event_data');
2122

2223
ScatterCarpet.moduleType = 'trace';
2324
ScatterCarpet.name = 'scattercarpet';

src/traces/scattercarpet/select.js

-32
This file was deleted.

0 commit comments

Comments
 (0)