(ax, end)
| 1064 | } |
| 1065 | |
| 1066 | function getEndText(ax, end) { |
| 1067 | var initialVal = ax.range[end]; |
| 1068 | var diff = Math.abs(initialVal - ax.range[1 - end]); |
| 1069 | var dig; |
| 1070 | |
| 1071 | // TODO: this should basically be ax.r2d but we're doing extra |
| 1072 | // rounding here... can we clean up at all? |
| 1073 | if(ax.type === 'date') { |
| 1074 | return initialVal; |
| 1075 | } else if(ax.type === 'log') { |
| 1076 | dig = Math.ceil(Math.max(0, -Math.log(diff) / Math.LN10)) + 3; |
| 1077 | return numberFormat('.' + dig + 'g')(Math.pow(10, initialVal)); |
| 1078 | } else { // linear numeric (or category... but just show numbers here) |
| 1079 | dig = Math.floor(Math.log(Math.abs(initialVal)) / Math.LN10) - |
| 1080 | Math.floor(Math.log(diff) / Math.LN10) + 4; |
| 1081 | return numberFormat('.' + String(dig) + 'g')(initialVal); |
| 1082 | } |
| 1083 | } |
| 1084 | |
| 1085 | function zoomAxRanges(axList, r0Fraction, r1Fraction, updates, linkedAxes) { |
| 1086 | for(var i = 0; i < axList.length; i++) { |
no outgoing calls
no test coverage detected
searching dependent graphs…