Skip to content

Commit b0ff48c

Browse files
committed
Add basePlotModule to traces
1 parent 77a5464 commit b0ff48c

File tree

16 files changed

+22
-5
lines changed

16 files changed

+22
-5
lines changed

src/traces/bar/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Bar.hoverPoints = require('./hover');
2525

2626
Bar.moduleType = 'trace';
2727
Bar.name = 'bar';
28+
Bar.basePlotModule = require('../../plots/cartesian');
2829
Bar.categories = ['cartesian', 'bar', 'oriented', 'markerColorscale', 'errorBarsOK', 'showLegend'];
2930
Bar.meta = {
3031
description: [

src/traces/box/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Box.hoverPoints = require('./hover');
2222

2323
Box.moduleType = 'trace';
2424
Box.name = 'box';
25+
Box.basePlotModule = require('../../plots/cartesian');
2526
Box.categories = ['cartesian', 'symbols', 'oriented', 'box', 'showLegend'];
2627
Box.meta = {
2728
description: [

src/traces/choropleth/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Choropleth.plot = require('./plot').plot;
1919

2020
Choropleth.moduleType = 'trace';
2121
Choropleth.name = 'choropleth';
22+
Choropleth.basePlotModule = require('../../plots/geo');
2223
Choropleth.categories = ['geo', 'noOpacity'];
2324
Choropleth.meta = {
2425
description: [

src/traces/contour/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Contour.hoverPoints = require('./hover');
2121

2222
Contour.moduleType = 'trace';
2323
Contour.name = 'contour';
24+
Contour.basePlotModule = require('../../plots/cartesian');
2425
Contour.categories = ['cartesian', '2dMap', 'contour'];
2526
Contour.meta = {
2627
description: [

src/traces/heatmap/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Heatmap.hoverPoints = require('./hover');
2121

2222
Heatmap.moduleType = 'trace';
2323
Heatmap.name = 'heatmap';
24+
Heatmap.basePlotModule = require('../../plots/cartesian');
2425
Heatmap.categories = ['cartesian', '2dMap'];
2526
Heatmap.meta = {
2627
description: [

src/traces/histogram/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Histogram.hoverPoints = require('../bar/hover');
3838

3939
Histogram.moduleType = 'trace';
4040
Histogram.name = 'histogram';
41+
Histogram.basePlotModule = require('../../plots/cartesian');
4142
Histogram.categories = ['cartesian', 'bar', 'histogram', 'oriented', 'errorBarsOK', 'showLegend'];
4243
Histogram.meta = {
4344
description: [

src/traces/histogram2d/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Histogram2D.hoverPoints = require('../heatmap/hover');
2121

2222
Histogram2D.moduleType = 'trace';
2323
Histogram2D.name = 'histogram2d';
24+
Histogram2D.basePlotModule = require('../../plots/cartesian');
2425
Histogram2D.categories = ['cartesian', '2dMap', 'histogram'];
2526
Histogram2D.meta = {
2627
hrName: 'histogram_2d',

src/traces/histogram2dcontour/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Histogram2dContour.hoverPoints = require('../contour/hover');
2121

2222
Histogram2dContour.moduleType = 'trace';
2323
Histogram2dContour.name = 'histogram2dcontour';
24+
Histogram2dContour.basePlotModule = require('../../plots/cartesian');
2425
Histogram2dContour.categories = ['cartesian', '2dMap', 'contour', 'histogram'];
2526
Histogram2dContour.meta = {
2627
hrName: 'histogram_2d_contour',

src/traces/mesh3d/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Mesh3D.plot = require('./convert');
1818

1919
Mesh3D.moduleType = 'trace';
2020
Mesh3D.name = 'mesh3d',
21+
Mesh3D.basePlotModule = require('../../plots/gl3d');
2122
Mesh3D.categories = ['gl3d'];
2223
Mesh3D.meta = {
2324
description: [

src/traces/pie/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Pie.styleOne = require('./style_one');
2121

2222
Pie.moduleType = 'trace';
2323
Pie.name = 'pie';
24+
Pie.basePlotModule = require('../../plots/cartesian');
2425
Pie.categories = ['pie', 'showLegend'];
2526
Pie.meta = {
2627
description: [

src/traces/scatter/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Scatter.selectPoints = require('./select');
3232

3333
Scatter.moduleType = 'trace';
3434
Scatter.name = 'scatter';
35+
Scatter.basePlotModule = require('../../plots/cartesian');
3536
Scatter.categories = ['cartesian', 'symbols', 'markerColorscale', 'errorBarsOK', 'showLegend'];
3637
Scatter.meta = {
3738
description: [

src/traces/scatter3d/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Scatter3D.calc = require('./calc');
1919

2020
Scatter3D.moduleType = 'trace';
2121
Scatter3D.name = 'scatter3d';
22+
Scatter3D.basePlotModule = require('../../plots/gl3d');
2223
Scatter3D.categories = ['gl3d', 'symbols', 'markerColorscale', 'showLegend'];
2324
Scatter3D.meta = {
2425
hrName: 'scatter_3d',

src/traces/scattergeo/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ScatterGeo.plot = require('./plot').plot;
1919

2020
ScatterGeo.moduleType = 'trace';
2121
ScatterGeo.name = 'scattergeo';
22+
ScatterGeo.basePlotModule = require('../../plots/geo');
2223
ScatterGeo.categories = ['geo', 'symbols', 'markerColorscale', 'showLegend'];
2324
ScatterGeo.meta = {
2425
hrName: 'scatter_geo',

src/traces/scattergeo/plot.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99

1010
'use strict';
1111

12-
var Plotly = require('../../plotly');
1312
var d3 = require('d3');
1413

14+
var Fx = require('../../plots/plots');
15+
var Axes = require('../../plots/cartesian/axes');
16+
1517
var getTopojsonFeatures = require('../../lib/topojson_utils').getTopojsonFeatures;
1618
var locationToFeature = require('../../lib/geo_location_utils').locationToFeature;
1719
var arrayToCalcItem = require('../../lib/array_to_calc_item');
@@ -163,7 +165,7 @@ plotScatterGeo.plot = function(geo, scattergeoData) {
163165
var xy = geo.projection([d.lon, d.lat]);
164166
cleanHoverLabelsFunc(d);
165167

166-
Plotly.Fx.loneHover({
168+
Fx.loneHover({
167169
x: xy[0],
168170
y: xy[1],
169171
name: hasNameLabel ? trace.name : undefined,
@@ -181,11 +183,11 @@ plotScatterGeo.plot = function(geo, scattergeoData) {
181183
.attr('class', 'point')
182184
.on('mouseover', handleMouseOver)
183185
.on('mouseout', function() {
184-
Plotly.Fx.loneUnhover(geo.hoverContainer);
186+
Fx.loneUnhover(geo.hoverContainer);
185187
})
186188
.on('mousedown', function() {
187189
// to simulate the 'zoomon' event
188-
Plotly.Fx.loneUnhover(geo.hoverContainer);
190+
Fx.loneUnhover(geo.hoverContainer);
189191
})
190192
.on('mouseup', handleMouseOver); // ~ 'zoomend'
191193
}
@@ -246,7 +248,7 @@ function makeCleanHoverLabelsFunc(geo, trace) {
246248

247249
function formatter(val) {
248250
var axis = geo.mockAxis;
249-
return Plotly.Axes.tickText(axis, axis.c2l(val), 'hover').text + '\u00B0';
251+
return Axes.tickText(axis, axis.c2l(val), 'hover').text + '\u00B0';
250252
}
251253

252254
return function cleanHoverLabelsFunc(d) {

src/traces/scattergl/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ScatterGl.plot = require('./convert');
2020

2121
ScatterGl.moduleType = 'trace';
2222
ScatterGl.name = 'scattergl';
23+
ScatterGl.basePlotModule = require('../../plots/gl2d');
2324
ScatterGl.categories = ['gl2d', 'symbols', 'errorBarsOK', 'markerColorscale', 'showLegend'];
2425
ScatterGl.meta = {
2526
description: [

src/traces/surface/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Surface.plot = require('./convert');
1919

2020
Surface.moduleType = 'trace';
2121
Surface.name = 'surface';
22+
Surface.basePlotModule = require('../../plots/gl3d');
2223
Surface.categories = ['gl3d', 'noOpacity'];
2324
Surface.meta = {
2425
description: [

0 commit comments

Comments
 (0)