Skip to content

Scatter3d attributes fixups #2879

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 3 commits into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
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
14 changes: 8 additions & 6 deletions src/components/colorscale/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ module.exports = function colorScaleDefaults(traceIn, traceOut, layout, coerce,
// ... until Scatter.colorbar can handle marker line colorbars
if(prefix === 'marker.line.') return;

// handle both the trace case where the dflt is listed in attributes and
// the marker case where the dflt is determined by hasColorbar
var showScaleDftl;
if(prefix) showScaleDftl = hasColorbar(containerIn);
var showScale = coerce(prefix + 'showscale', showScaleDftl);
if(!opts.noScale) {
// handle both the trace case where the dflt is listed in attributes and
// the marker case where the dflt is determined by hasColorbar
var showScaleDftl;
Copy link
Collaborator

Choose a reason for hiding this comment

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

you want to fix this typo while you're at it? 😄

if(prefix) showScaleDftl = hasColorbar(containerIn);

if(showScale) colorbarDefaults(containerIn, containerOut, layout);
var showScale = coerce(prefix + 'showscale', showScaleDftl);
if(showScale) colorbarDefaults(containerIn, containerOut, layout);
}
};
5 changes: 2 additions & 3 deletions src/traces/scatter/line_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout,
coerce('line.color', defaultColor);

if(hasColorscale(traceIn, 'line')) {
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'});
}
else {
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c', noScale: true});
} else {
var lineColorDflt = (isArrayOrTypedArray(markerColor) ? false : markerColor) || defaultColor;
coerce('line.color', lineColorDflt);
}
Expand Down
29 changes: 17 additions & 12 deletions src/traces/scatter3d/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ var scatterLineAttrs = scatterAttrs.line;
var scatterMarkerAttrs = scatterAttrs.marker;
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;

var lineAttrs = extendFlat({
width: scatterLineAttrs.width,
dash: {
valType: 'enumerated',
values: Object.keys(DASHES),
dflt: 'solid',
role: 'style',
description: 'Sets the dash style of the lines.'
}
}, colorAttributes('line'));
// not yet implemented
delete lineAttrs.showscale;
delete lineAttrs.colorbar;

function makeProjectionAttr(axLetter) {
return {
show: {
Expand Down Expand Up @@ -107,19 +121,10 @@ var attrs = module.exports = overrideAll({
y: makeProjectionAttr('y'),
z: makeProjectionAttr('z')
},

connectgaps: scatterAttrs.connectgaps,
line: extendFlat({
width: scatterLineAttrs.width,
dash: {
valType: 'enumerated',
values: Object.keys(DASHES),
dflt: 'solid',
role: 'style',
description: 'Sets the dash style of the lines.'
}
},
colorAttributes('line')
),
line: lineAttrs,

marker: extendFlat({ // Parity with scatter.js?
symbol: {
valType: 'enumerated',
Expand Down