Skip to content

Commit dd71b94

Browse files
committed
Guard against infinite values
1 parent f3789e6 commit dd71b94

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/traces/quiver/calc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ module.exports = function calc(gd, trace) {
178178
// Colorscale cmin/cmax computation: prefer provided marker.color, else magnitude
179179
if(trace._hasColorscale) {
180180
var vals = hasMarkerColorArray ? [cMin, cMax] : [normMin, normMax];
181+
// Guard against all-invalid input (no finite values found), which would
182+
// otherwise leave the seeds at +/-Infinity and feed them into the
183+
// colorscale calc. Fall back to a neutral [0, 1] range.
184+
if(!isFinite(vals[0]) || !isFinite(vals[1])) vals = [0, 1];
181185
colorscaleCalc(gd, trace, {
182186
vals: vals,
183187
containerStr: 'marker',

0 commit comments

Comments
 (0)