Skip to content

Refactor scattergl selection #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 2, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/traces/scattergl/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

'use strict';

var plotAttrs = require('../../plots/attributes');
var scatterAttrs = require('../scatter/attributes');
var colorAttributes = require('../../components/colorscale/color_attributes');
var colorAttrs = require('../../components/colorscale/color_attributes');

var DASHES = require('../../constants/gl2d_dashes');
var extendFlat = require('../../lib/extend').extendFlat;
Expand Down Expand Up @@ -56,7 +57,7 @@ var attrs = module.exports = overrideAll({
description: 'Sets the style of the lines.'
}
},
marker: extendFlat({}, colorAttributes('marker'), {
marker: extendFlat({}, colorAttrs('marker'), {
symbol: scatterMarkerAttrs.symbol,
size: scatterMarkerAttrs.size,
sizeref: scatterMarkerAttrs.sizeref,
Expand All @@ -65,7 +66,7 @@ var attrs = module.exports = overrideAll({
opacity: scatterMarkerAttrs.opacity,
showscale: scatterMarkerAttrs.showscale,
colorbar: scatterMarkerAttrs.colorbar,
line: extendFlat({}, colorAttributes('marker.line'), {
line: extendFlat({}, colorAttrs('marker.line'), {
width: scatterMarkerLineAttrs.width
})
}),
Expand All @@ -82,6 +83,10 @@ var attrs = module.exports = overrideAll({
marker: scatterAttrs.unselected.marker
},

opacity: extendFlat({}, plotAttrs.opacity, {
editType: 'calc'
}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

I think the best way to test this would be to spy on ScatterGl.calc checking that Plotly.relayout(gd, 'opacity', /**/) does invoke it - similar to this suite.


error_y: scatterAttrs.error_y,
error_x: scatterAttrs.error_x
}, 'calc', 'nested');
Expand Down