File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1010
1111var c = require ( './constants' ) ;
1212var extendFlat = require ( '../../lib/extend' ) . extendFlat ;
13+ var isNumeric = require ( 'fast-isnumeric' ) ;
1314
1415// pure functions, don't alter but passes on `gd` and parts of `trace` without deep copying
1516module . exports = function calc ( gd , trace ) {
@@ -32,9 +33,10 @@ module.exports = function calc(gd, trace) {
3233 var uniqueKeys = { } ;
3334 var columnOrder = trace . _fullInput . columnorder ;
3435 var columnWidths = headerValues . map ( function ( d , i ) {
35- return Array . isArray ( trace . columnwidth ) ?
36- Number ( trace . columnwidth [ Math . min ( i , trace . columnwidth . length - 1 ) ] ) :
37- trace . columnwidth !== null && isFinite ( Number ( trace . columnwidth ) ) ? Number ( trace . columnwidth ) : 1 ;
36+ var value = Array . isArray ( trace . columnwidth ) ?
37+ trace . columnwidth [ Math . min ( i , trace . columnwidth . length - 1 ) ] :
38+ trace . columnwidth ;
39+ return isNumeric ( value ) ? Number ( value ) : 1 ;
3840 } ) ;
3941 var totalColumnWidths = columnWidths . reduce ( function ( p , n ) { return p + n ; } , 0 ) ;
4042
You can’t perform that action at this time.
0 commit comments