diff --git a/src/traces/bar/defaults.js b/src/traces/bar/defaults.js index 35bab93533b..61e7f637887 100644 --- a/src/traces/bar/defaults.js +++ b/src/traces/bar/defaults.js @@ -70,10 +70,13 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout); + var lineColor = (traceOut.marker.line || {}).color; + var markerColor = (traceOut.marker || {}).color; + // override defaultColor for error bars with defaultLine var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults'); - errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'y'}); - errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'x', inherit: 'y'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || Color.defaultLine, {axis: 'y'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || Color.defaultLine, {axis: 'x', inherit: 'y'}); Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; diff --git a/src/traces/histogram/defaults.js b/src/traces/histogram/defaults.js index a52d54b1d8a..541ed7ef107 100644 --- a/src/traces/histogram/defaults.js +++ b/src/traces/histogram/defaults.js @@ -62,10 +62,13 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout); + Lib.coerceSelectionMarkerOpacity(traceOut, coerce); + + var lineColor = (traceOut.marker.line || {}).color; + var markerColor = (traceOut.marker || {}).color; + // override defaultColor for error bars with defaultLine var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults'); - errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'y'}); - errorBarsSupplyDefaults(traceIn, traceOut, Color.defaultLine, {axis: 'x', inherit: 'y'}); - - Lib.coerceSelectionMarkerOpacity(traceOut, coerce); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || Color.defaultLine, {axis: 'y'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || Color.defaultLine, {axis: 'x', inherit: 'y'}); }; diff --git a/src/traces/scatter/defaults.js b/src/traces/scatter/defaults.js index 4be3606fba8..3ff337d0e57 100644 --- a/src/traces/scatter/defaults.js +++ b/src/traces/scatter/defaults.js @@ -71,14 +71,17 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout if(!subTypes.hasLines(traceOut)) handleLineShapeDefaults(traceIn, traceOut, coerce); } + var lineColor = (traceOut.line || {}).color; + var markerColor = (traceOut.marker || {}).color; + if(traceOut.fill === 'tonext' || traceOut.fill === 'toself') { dfltHoverOn.push('fills'); } coerce('hoveron', dfltHoverOn.join('+') || 'points'); if(traceOut.hoveron !== 'fills') coerce('hovertemplate'); var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults'); - errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y'}); - errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'y'}); Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; diff --git a/src/traces/scatter3d/defaults.js b/src/traces/scatter3d/defaults.js index 86c17b191de..acf3345ea82 100644 --- a/src/traces/scatter3d/defaults.js +++ b/src/traces/scatter3d/defaults.js @@ -62,9 +62,9 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults'); - errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'z'}); - errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y', inherit: 'z'}); - errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'z'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'z'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y', inherit: 'z'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'z'}); }; function handleXYZDefaults(traceIn, traceOut, coerce, layout) { diff --git a/src/traces/scattergl/defaults.js b/src/traces/scattergl/defaults.js index d223a61f5e8..82a05c4e52f 100644 --- a/src/traces/scattergl/defaults.js +++ b/src/traces/scattergl/defaults.js @@ -55,14 +55,17 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout handleTextDefaults(traceIn, traceOut, layout, coerce); } + var lineColor = (traceOut.line || {}).color; + var markerColor = (traceOut.marker || {}).color; + coerce('fill'); if(traceOut.fill !== 'none') { handleFillColorDefaults(traceIn, traceOut, defaultColor, coerce); } var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults'); - errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y'}); - errorBarsSupplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'y'}); + errorBarsSupplyDefaults(traceIn, traceOut, lineColor || markerColor || defaultColor, {axis: 'x', inherit: 'y'}); Lib.coerceSelectionMarkerOpacity(traceOut, coerce); }; diff --git a/test/image/baselines/bar_errorbars_inherit_color.png b/test/image/baselines/bar_errorbars_inherit_color.png new file mode 100644 index 00000000000..c1fc4e49f00 Binary files /dev/null and b/test/image/baselines/bar_errorbars_inherit_color.png differ diff --git a/test/image/baselines/benchmarks.png b/test/image/baselines/benchmarks.png index f5e1747aecd..05c1413045d 100644 Binary files a/test/image/baselines/benchmarks.png and b/test/image/baselines/benchmarks.png differ diff --git a/test/image/baselines/error_bar_bar_ids.png b/test/image/baselines/error_bar_bar_ids.png index 1ca6a60d491..910fb032246 100644 Binary files a/test/image/baselines/error_bar_bar_ids.png and b/test/image/baselines/error_bar_bar_ids.png differ diff --git a/test/image/baselines/gl2d_errorbars-inherit_color-bar.png b/test/image/baselines/gl2d_errorbars-inherit_color-bar.png new file mode 100644 index 00000000000..c1fc4e49f00 Binary files /dev/null and b/test/image/baselines/gl2d_errorbars-inherit_color-bar.png differ diff --git a/test/image/baselines/gl2d_errorbars-inherit_color-histogram.png b/test/image/baselines/gl2d_errorbars-inherit_color-histogram.png new file mode 100644 index 00000000000..bbabc022d42 Binary files /dev/null and b/test/image/baselines/gl2d_errorbars-inherit_color-histogram.png differ diff --git a/test/image/baselines/gl2d_errorbars-inherit_color-scatter.png b/test/image/baselines/gl2d_errorbars-inherit_color-scatter.png new file mode 100644 index 00000000000..5367f1e2f85 Binary files /dev/null and b/test/image/baselines/gl2d_errorbars-inherit_color-scatter.png differ diff --git a/test/image/baselines/gl2d_errorbars-inherit_color-scattergl.png b/test/image/baselines/gl2d_errorbars-inherit_color-scattergl.png new file mode 100644 index 00000000000..e543f5dfe69 Binary files /dev/null and b/test/image/baselines/gl2d_errorbars-inherit_color-scattergl.png differ diff --git a/test/image/baselines/gl2d_errorbars_inherit_color_bar.png b/test/image/baselines/gl2d_errorbars_inherit_color_bar.png new file mode 100644 index 00000000000..c1fc4e49f00 Binary files /dev/null and b/test/image/baselines/gl2d_errorbars_inherit_color_bar.png differ diff --git a/test/image/baselines/gl2d_scattergl_errorbars_inherit_color.png b/test/image/baselines/gl2d_scattergl_errorbars_inherit_color.png new file mode 100644 index 00000000000..e543f5dfe69 Binary files /dev/null and b/test/image/baselines/gl2d_scattergl_errorbars_inherit_color.png differ diff --git a/test/image/baselines/gl3d_errorbars-inherit_color-scatter3d.png b/test/image/baselines/gl3d_errorbars-inherit_color-scatter3d.png new file mode 100644 index 00000000000..a9c7927ca86 Binary files /dev/null and b/test/image/baselines/gl3d_errorbars-inherit_color-scatter3d.png differ diff --git a/test/image/baselines/gl3d_scatter3d_errorbars_inherit_color.png b/test/image/baselines/gl3d_scatter3d_errorbars_inherit_color.png new file mode 100644 index 00000000000..a9c7927ca86 Binary files /dev/null and b/test/image/baselines/gl3d_scatter3d_errorbars_inherit_color.png differ diff --git a/test/image/baselines/histogram_errorbars_inherit_color.png b/test/image/baselines/histogram_errorbars_inherit_color.png new file mode 100644 index 00000000000..bbabc022d42 Binary files /dev/null and b/test/image/baselines/histogram_errorbars_inherit_color.png differ diff --git a/test/image/baselines/scatter_errorbars_inherit_color.png b/test/image/baselines/scatter_errorbars_inherit_color.png new file mode 100644 index 00000000000..5367f1e2f85 Binary files /dev/null and b/test/image/baselines/scatter_errorbars_inherit_color.png differ diff --git a/test/image/mocks/bar_errorbars_inherit_color.json b/test/image/mocks/bar_errorbars_inherit_color.json new file mode 100644 index 00000000000..5c6cd8e4f2a --- /dev/null +++ b/test/image/mocks/bar_errorbars_inherit_color.json @@ -0,0 +1,76 @@ +{ + "data": [ + { + "x": [0, 1, 2, 3, 4], + "y": [0, 100, 500, 600, 0], + "type": "bar", + "barmode": "group", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [100, 200, 600, 700, 100], + "type": "bar", + "barmode": "group", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [200, 300, 700, 800, 200], + "type": "bar", + "barmode": "group", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [300, 400, 800, 900, 300], + "type": "bar", + "barmode": "group", + "marker": { + "line": { + "color": "green" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [400, 500, 900, 1000, 400], + "type": "bar", + "barmode": "group", + "marker": { + "line": { + "color": "blue" + }, + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Bar chart error bars inherit color from marker.line or marker" + } + } +} diff --git a/test/image/mocks/gl2d_errorbars-inherit_color-histogram.json b/test/image/mocks/gl2d_errorbars-inherit_color-histogram.json new file mode 100644 index 00000000000..f3f9974ea3f --- /dev/null +++ b/test/image/mocks/gl2d_errorbars-inherit_color-histogram.json @@ -0,0 +1,71 @@ +{ + "data": [ + { + "x": [0, 1, 5, 6, 0], + "type": "histogram", + "barmode": "stack", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [1, 2, 6, 7, 1], + "type": "histogram", + "barmode": "stack", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [2, 3, 7, 8, 2], + "type": "histogram", + "barmode": "stack", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [3, 4, 8, 9, 3], + "type": "histogram", + "barmode": "stack", + "marker": { + "line": { + "color": "green" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [4, 5, 9, 10, 4], + "type": "histogram", + "barmode": "stack", + "marker": { + "line": { + "color": "blue" + }, + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Histogram error bars inherit color from marker.line or marker" + } + } +} diff --git a/test/image/mocks/gl2d_errorbars-inherit_color-scatter.json b/test/image/mocks/gl2d_errorbars-inherit_color-scatter.json new file mode 100644 index 00000000000..02039c09ee7 --- /dev/null +++ b/test/image/mocks/gl2d_errorbars-inherit_color-scatter.json @@ -0,0 +1,74 @@ +{ + "data": [ + { + "x": [0, 1, 2, 3, 4], + "y": [0, 100, 500, 600, 0], + "type": "scatter", + "mode": "markers+lines", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [100, 200, 600, 700, 100], + "type": "scatter", + "mode": "markers+lines", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [200, 300, 700, 800, 200], + "type": "scatter", + "mode": "markers+lines", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [300, 400, 800, 900, 300], + "type": "scatter", + "mode": "markers+lines", + "line": { + "color": "green" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [400, 500, 900, 1000, 400], + "type": "scatter", + "mode": "markers+lines", + "line": { + "color": "blue" + }, + "marker": { + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Scatter error bars inherit color from line or marker" + } + } +} diff --git a/test/image/mocks/gl2d_errorbars-inherit_color-scattergl.json b/test/image/mocks/gl2d_errorbars-inherit_color-scattergl.json new file mode 100644 index 00000000000..9a2642ecd3f --- /dev/null +++ b/test/image/mocks/gl2d_errorbars-inherit_color-scattergl.json @@ -0,0 +1,74 @@ +{ + "data": [ + { + "x": [0, 1, 2, 3, 4], + "y": [0, 100, 500, 600, 0], + "type": "scattergl", + "mode": "markers+lines", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [100, 200, 600, 700, 100], + "type": "scattergl", + "mode": "markers+lines", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [200, 300, 700, 800, 200], + "type": "scattergl", + "mode": "markers+lines", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [300, 400, 800, 900, 300], + "type": "scattergl", + "mode": "markers+lines", + "line": { + "color": "green" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [400, 500, 900, 1000, 400], + "type": "scattergl", + "mode": "markers+lines", + "line": { + "color": "blue" + }, + "marker": { + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Scatter-gl error bars inherit color from line or marker" + } + } +} diff --git a/test/image/mocks/gl2d_errorbars_inherit_color_bar.json b/test/image/mocks/gl2d_errorbars_inherit_color_bar.json new file mode 100644 index 00000000000..5c6cd8e4f2a --- /dev/null +++ b/test/image/mocks/gl2d_errorbars_inherit_color_bar.json @@ -0,0 +1,76 @@ +{ + "data": [ + { + "x": [0, 1, 2, 3, 4], + "y": [0, 100, 500, 600, 0], + "type": "bar", + "barmode": "group", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [100, 200, 600, 700, 100], + "type": "bar", + "barmode": "group", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [200, 300, 700, 800, 200], + "type": "bar", + "barmode": "group", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [300, 400, 800, 900, 300], + "type": "bar", + "barmode": "group", + "marker": { + "line": { + "color": "green" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [400, 500, 900, 1000, 400], + "type": "bar", + "barmode": "group", + "marker": { + "line": { + "color": "blue" + }, + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Bar chart error bars inherit color from marker.line or marker" + } + } +} diff --git a/test/image/mocks/gl2d_scattergl_errorbars_inherit_color.json b/test/image/mocks/gl2d_scattergl_errorbars_inherit_color.json new file mode 100644 index 00000000000..9a2642ecd3f --- /dev/null +++ b/test/image/mocks/gl2d_scattergl_errorbars_inherit_color.json @@ -0,0 +1,74 @@ +{ + "data": [ + { + "x": [0, 1, 2, 3, 4], + "y": [0, 100, 500, 600, 0], + "type": "scattergl", + "mode": "markers+lines", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [100, 200, 600, 700, 100], + "type": "scattergl", + "mode": "markers+lines", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [200, 300, 700, 800, 200], + "type": "scattergl", + "mode": "markers+lines", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [300, 400, 800, 900, 300], + "type": "scattergl", + "mode": "markers+lines", + "line": { + "color": "green" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [400, 500, 900, 1000, 400], + "type": "scattergl", + "mode": "markers+lines", + "line": { + "color": "blue" + }, + "marker": { + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Scatter-gl error bars inherit color from line or marker" + } + } +} diff --git a/test/image/mocks/gl3d_errorbars-inherit_color-scatter3d.json b/test/image/mocks/gl3d_errorbars-inherit_color-scatter3d.json new file mode 100644 index 00000000000..4f3dad76f31 --- /dev/null +++ b/test/image/mocks/gl3d_errorbars-inherit_color-scatter3d.json @@ -0,0 +1,79 @@ +{ + "data": [ + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [0, 0, 0, 0, 0], + "type": "scatter3d", + "mode": "markers+lines", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [1, 1, 1, 1, 1], + "type": "scatter3d", + "mode": "markers+lines", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [2, 2, 2, 2, 2], + "type": "scatter3d", + "mode": "markers+lines", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [3, 3, 3, 3, 3], + "type": "scatter3d", + "mode": "markers+lines", + "line": { + "color": "green" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [4, 4, 4, 4, 4], + "type": "scatter3d", + "mode": "markers+lines", + "line": { + "color": "blue" + }, + "marker": { + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Scatter3d error bars inherit color from line or marker" + } + } +} diff --git a/test/image/mocks/gl3d_scatter3d_errorbars_inherit_color.json b/test/image/mocks/gl3d_scatter3d_errorbars_inherit_color.json new file mode 100644 index 00000000000..4f3dad76f31 --- /dev/null +++ b/test/image/mocks/gl3d_scatter3d_errorbars_inherit_color.json @@ -0,0 +1,79 @@ +{ + "data": [ + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [0, 0, 0, 0, 0], + "type": "scatter3d", + "mode": "markers+lines", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [1, 1, 1, 1, 1], + "type": "scatter3d", + "mode": "markers+lines", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [2, 2, 2, 2, 2], + "type": "scatter3d", + "mode": "markers+lines", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [3, 3, 3, 3, 3], + "type": "scatter3d", + "mode": "markers+lines", + "line": { + "color": "green" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [-5, -10, -30, -35, -5], + "z": [4, 4, 4, 4, 4], + "type": "scatter3d", + "mode": "markers+lines", + "line": { + "color": "blue" + }, + "marker": { + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Scatter3d error bars inherit color from line or marker" + } + } +} diff --git a/test/image/mocks/histogram_errorbars_inherit_color.json b/test/image/mocks/histogram_errorbars_inherit_color.json new file mode 100644 index 00000000000..f3f9974ea3f --- /dev/null +++ b/test/image/mocks/histogram_errorbars_inherit_color.json @@ -0,0 +1,71 @@ +{ + "data": [ + { + "x": [0, 1, 5, 6, 0], + "type": "histogram", + "barmode": "stack", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [1, 2, 6, 7, 1], + "type": "histogram", + "barmode": "stack", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [2, 3, 7, 8, 2], + "type": "histogram", + "barmode": "stack", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [3, 4, 8, 9, 3], + "type": "histogram", + "barmode": "stack", + "marker": { + "line": { + "color": "green" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [4, 5, 9, 10, 4], + "type": "histogram", + "barmode": "stack", + "marker": { + "line": { + "color": "blue" + }, + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Histogram error bars inherit color from marker.line or marker" + } + } +} diff --git a/test/image/mocks/scatter_errorbars_inherit_color.json b/test/image/mocks/scatter_errorbars_inherit_color.json new file mode 100644 index 00000000000..02039c09ee7 --- /dev/null +++ b/test/image/mocks/scatter_errorbars_inherit_color.json @@ -0,0 +1,74 @@ +{ + "data": [ + { + "x": [0, 1, 2, 3, 4], + "y": [0, 100, 500, 600, 0], + "type": "scatter", + "mode": "markers+lines", + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [100, 200, 600, 700, 100], + "type": "scatter", + "mode": "markers+lines", + "marker": { + "line": { + "width": 2, + "color": "gray" + } + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [200, 300, 700, 800, 200], + "type": "scatter", + "mode": "markers+lines", + "marker": { + "color": "red" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [300, 400, 800, 900, 300], + "type": "scatter", + "mode": "markers+lines", + "line": { + "color": "green" + }, + "error_y": { + "type": "sqrt" + } + }, + { + "x": [0, 1, 2, 3, 4], + "y": [400, 500, 900, 1000, 400], + "type": "scatter", + "mode": "markers+lines", + "line": { + "color": "blue" + }, + "marker": { + "color": "black" + }, + "error_y": { + "type": "sqrt" + } + } + ], + "layout": { + "width": 600, + "heigh": 600, + "title": { + "text": "Scatter error bars inherit color from line or marker" + } + } +}