diff --git a/src/traces/histogram/calc.js b/src/traces/histogram/calc.js index 9b079438b98..95f97930e72 100644 --- a/src/traces/histogram/calc.js +++ b/src/traces/histogram/calc.js @@ -14,6 +14,7 @@ var isNumeric = require('fast-isnumeric'); var Lib = require('../../lib'); var Axes = require('../../plots/cartesian/axes'); +var arraysToCalcdata = require('../bar/arrays_to_calcdata'); var binFunctions = require('./bin_functions'); var normFunctions = require('./norm_functions'); var doAvg = require('./average'); @@ -168,6 +169,8 @@ module.exports = function calc(gd, trace) { } } + arraysToCalcdata(cd, trace); + return cd; }; diff --git a/test/image/baselines/histogram_colorscale.png b/test/image/baselines/histogram_colorscale.png new file mode 100644 index 00000000000..c83af4bd5e2 Binary files /dev/null and b/test/image/baselines/histogram_colorscale.png differ diff --git a/test/image/mocks/histogram_colorscale.json b/test/image/mocks/histogram_colorscale.json new file mode 100644 index 00000000000..2bec28f0766 --- /dev/null +++ b/test/image/mocks/histogram_colorscale.json @@ -0,0 +1,23 @@ +{ + "data": [ + { + "xbins": { + "start": -1.5, + "end": 4.5, + "size": 1 + }, + "marker": { + "cmin": 0, + "colorscale": "Earth", + "color": [ 0, 1, 2, 3, 4, 5 ], + "cmax": 5 + }, + "x": [ 0, 1, 1, 2, 2, 2, 3, 3, 4 ], + "type": "histogram" + } + ], + "layout": { + "height": 500, + "width": 700 + } +}