| 115 | } |
| 116 | |
| 117 | function parseFloatBar(entry, item, vScale, i) { |
| 118 | const startValue = vScale.parse(entry[0], i); |
| 119 | const endValue = vScale.parse(entry[1], i); |
| 120 | const min = Math.min(startValue, endValue); |
| 121 | const max = Math.max(startValue, endValue); |
| 122 | let barStart = min; |
| 123 | let barEnd = max; |
| 124 | |
| 125 | if (Math.abs(min) > Math.abs(max)) { |
| 126 | barStart = max; |
| 127 | barEnd = min; |
| 128 | } |
| 129 | |
| 130 | class="cm">// Store `barEnd` (furthest away from origin) as parsed value, |
| 131 | class="cm">// to make stacking straight forward |
| 132 | item[vScale.axis] = barEnd; |
| 133 | |
| 134 | item._custom = { |
| 135 | barStart, |
| 136 | barEnd, |
| 137 | start: startValue, |
| 138 | end: endValue, |
| 139 | min, |
| 140 | max |
| 141 | }; |
| 142 | } |
| 143 | |
| 144 | function parseValue(entry, item, vScale, i) { |
| 145 | if (isArray(entry)) { |