Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4ba239b

Browse filesBrowse files
committed
🔪 unimplemented 'showscale' & 'colorbar' from scatter3d line attrs
1 parent 0aacf62 commit 4ba239b
Copy full SHA for 4ba239b

File tree

3 files changed

+27
-21
lines changed
Filter options

3 files changed

+27
-21
lines changed

‎src/components/colorscale/defaults.js

Copy file name to clipboardExpand all lines: src/components/colorscale/defaults.js
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ module.exports = function colorScaleDefaults(traceIn, traceOut, layout, coerce,
5252
// ... until Scatter.colorbar can handle marker line colorbars
5353
if(prefix === 'marker.line.') return;
5454

55-
// handle both the trace case where the dflt is listed in attributes and
56-
// the marker case where the dflt is determined by hasColorbar
57-
var showScaleDftl;
58-
if(prefix) showScaleDftl = hasColorbar(containerIn);
59-
var showScale = coerce(prefix + 'showscale', showScaleDftl);
55+
if(!opts.noScale) {
56+
// handle both the trace case where the dflt is listed in attributes and
57+
// the marker case where the dflt is determined by hasColorbar
58+
var showScaleDftl;
59+
if(prefix) showScaleDftl = hasColorbar(containerIn);
6060

61-
if(showScale) colorbarDefaults(containerIn, containerOut, layout);
61+
var showScale = coerce(prefix + 'showscale', showScaleDftl);
62+
if(showScale) colorbarDefaults(containerIn, containerOut, layout);
63+
}
6264
};

‎src/traces/scatter/line_defaults.js

Copy file name to clipboardExpand all lines: src/traces/scatter/line_defaults.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ module.exports = function lineDefaults(traceIn, traceOut, defaultColor, layout,
1818
coerce('line.color', defaultColor);
1919

2020
if(hasColorscale(traceIn, 'line')) {
21-
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c'});
22-
}
23-
else {
21+
colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'line.', cLetter: 'c', noScale: true});
22+
} else {
2423
var lineColorDflt = (isArrayOrTypedArray(markerColor) ? false : markerColor) || defaultColor;
2524
coerce('line.color', lineColorDflt);
2625
}

‎src/traces/scatter3d/attributes.js

Copy file name to clipboardExpand all lines: src/traces/scatter3d/attributes.js
+17-12Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ var scatterLineAttrs = scatterAttrs.line;
2121
var scatterMarkerAttrs = scatterAttrs.marker;
2222
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;
2323

24+
var lineAttrs = extendFlat({
25+
width: scatterLineAttrs.width,
26+
dash: {
27+
valType: 'enumerated',
28+
values: Object.keys(DASHES),
29+
dflt: 'solid',
30+
role: 'style',
31+
description: 'Sets the dash style of the lines.'
32+
}
33+
}, colorAttributes('line'));
34+
// not yet implemented
35+
delete lineAttrs.showscale;
36+
delete lineAttrs.colorbar;
37+
2438
function makeProjectionAttr(axLetter) {
2539
return {
2640
show: {
@@ -107,19 +121,10 @@ var attrs = module.exports = overrideAll({
107121
y: makeProjectionAttr('y'),
108122
z: makeProjectionAttr('z')
109123
},
124+
110125
connectgaps: scatterAttrs.connectgaps,
111-
line: extendFlat({
112-
width: scatterLineAttrs.width,
113-
dash: {
114-
valType: 'enumerated',
115-
values: Object.keys(DASHES),
116-
dflt: 'solid',
117-
role: 'style',
118-
description: 'Sets the dash style of the lines.'
119-
}
120-
},
121-
colorAttributes('line')
122-
),
126+
line: lineAttrs,
127+
123128
marker: extendFlat({ // Parity with scatter.js?
124129
symbol: {
125130
valType: 'enumerated',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.