Skip to content

Commit e8b8624

Browse files
committed
add 'scatter-like' category
- to easily combine logic for scatter* trace types that use scatter/subtypes.js
1 parent 1d0b29e commit e8b8624

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/components/modebar/manage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function getButtonGroups(gd, buttonsToRemove, buttonsToAdd) {
121121
if(((hasCartesian || hasGL2D) && !allAxesFixed) || hasTernary) {
122122
dragModeGroup = ['zoom2d', 'pan2d'];
123123
}
124-
if((hasCartesian || hasTernary || hasGL2D) && isSelectable(fullData)) {
124+
if(isSelectable(fullData)) {
125125
dragModeGroup.push('select2d');
126126
dragModeGroup.push('lasso2d');
127127
}
@@ -173,7 +173,7 @@ function isSelectable(fullData) {
173173

174174
if(!trace._module || !trace._module.selectPoints) continue;
175175

176-
if(trace.type === 'scatter' || trace.type === 'scatterternary' || trace.type === 'scattergl') {
176+
if(Registry.traceIs(trace, 'scatter-like')) {
177177
if(scatterSubTypes.hasMarkers(trace) || scatterSubTypes.hasText(trace)) {
178178
selectable = true;
179179
}

src/traces/scatter/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Scatter.animatable = true;
3434
Scatter.moduleType = 'trace';
3535
Scatter.name = 'scatter';
3636
Scatter.basePlotModule = require('../../plots/cartesian');
37-
Scatter.categories = ['cartesian', 'symbols', 'markerColorscale', 'errorBarsOK', 'showLegend'];
37+
Scatter.categories = ['cartesian', 'symbols', 'markerColorscale', 'errorBarsOK', 'showLegend', 'scatter-like'];
3838
Scatter.meta = {
3939
description: [
4040
'The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.',

src/traces/scattergl/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ScatterGl.selectPoints = require('./select');
2323
ScatterGl.moduleType = 'trace';
2424
ScatterGl.name = 'scattergl';
2525
ScatterGl.basePlotModule = require('../../plots/gl2d');
26-
ScatterGl.categories = ['gl2d', 'symbols', 'errorBarsOK', 'markerColorscale', 'showLegend'];
26+
ScatterGl.categories = ['gl2d', 'symbols', 'errorBarsOK', 'markerColorscale', 'showLegend', 'scatter-like'];
2727
ScatterGl.meta = {
2828
description: [
2929
'The data visualized as scatter point or lines is set in `x` and `y`',

src/traces/scattermapbox/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ScatterMapbox.plot = require('./plot');
2222
ScatterMapbox.moduleType = 'trace';
2323
ScatterMapbox.name = 'scattermapbox';
2424
ScatterMapbox.basePlotModule = require('../../plots/mapbox');
25-
ScatterMapbox.categories = ['mapbox', 'gl', 'symbols', 'markerColorscale', 'showLegend'];
25+
ScatterMapbox.categories = ['mapbox', 'gl', 'symbols', 'markerColorscale', 'showLegend', 'scatterlike'];
2626
ScatterMapbox.meta = {
2727
hrName: 'scatter_mapbox',
2828
description: [

src/traces/scatterternary/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ScatterTernary.selectPoints = require('./select');
2222
ScatterTernary.moduleType = 'trace';
2323
ScatterTernary.name = 'scatterternary';
2424
ScatterTernary.basePlotModule = require('../../plots/ternary');
25-
ScatterTernary.categories = ['ternary', 'symbols', 'markerColorscale', 'showLegend'];
25+
ScatterTernary.categories = ['ternary', 'symbols', 'markerColorscale', 'showLegend', 'scatter-like'];
2626
ScatterTernary.meta = {
2727
hrName: 'scatter_ternary',
2828
description: [

0 commit comments

Comments
 (0)