@@ -35,9 +35,11 @@ function get_domrect(METRIC) {
35
35
value = zLIE
36
36
// analyse noise
37
37
let oDiffs = { } , aProps = [ ] , max = 0
38
+ let isNegative = false , isPositive = false
38
39
let test = oDomRect [ k ] [ 'data' ]
39
40
for ( const p of Object . keys ( test ) ) {
40
41
let diff = control [ p ] - test [ p ]
42
+ if ( diff > 0 ) { isPositive = true } else { isNegative = true }
41
43
if ( Math . abs ( diff ) > max ) { max = Math . abs ( diff ) }
42
44
if ( 0 !== diff ) {
43
45
aProps . push ( p )
@@ -49,14 +51,18 @@ function get_domrect(METRIC) {
49
51
if ( oDiffs [ m ] . length > 1 ) { multiples . push ( oDiffs [ m ] . join ( ' + ' ) ) }
50
52
}
51
53
console . log ( k , oDiffs , multiples , max )
52
- if ( max > 0.1 ) { max = '> ±0.1'
54
+ // sign: chamelon seems to always be -, CB seems to always be ±
55
+ let sign = ''
56
+ if ( isNegative && isPositive ) { sign = '±' } else {
57
+ sign = isNegative ? '-' : '+'
58
+ }
59
+ if ( max > 0.1 ) { max = '> ' + sign + '0.1'
53
60
} else {
54
61
// note max is always positive
55
62
var z = - Math . floor ( Math . log10 ( max ) + 1 ) // leading zeros
56
- // chameleon varies from 6 to 9 in a few tests
57
- // cap at 5
63
+ // cap at 5: chameleon varies from 6 to 9 in a few tests
58
64
z = z > 5 ? 5 : z
59
- max = '< ± 0.' + '0' . repeat ( z - 1 ) + '1'
65
+ max = '< ' + sign + ' 0.' + '0' . repeat ( z - 1 ) + '1'
60
66
}
61
67
value = {
62
68
'properties' : aProps . length == 8 ? 'all' : aProps . join ( ', ' ) ,
0 commit comments