(svg: SVGSVGElement, ensureNoAnimation: boolean)
| 204 | } |
| 205 | |
| 206 | private render(svg: SVGSVGElement, ensureNoAnimation: boolean) { |
| 207 | let config = this._config; |
| 208 | if (ensureNoAnimation) { |
| 209 | config = JSON.parse(JSON.stringify(this._config)); |
| 210 | config.animate = false; |
| 211 | } |
| 212 | const rects = this.rects(); |
| 213 | let totalWidth = 0; |
| 214 | rects.forEach((rect) => totalWidth += rect.w); |
| 215 | const totalDuration = (config.animationDuration || DEFAULT_ANIMATION_DURATION); |
| 216 | let delay = 0; |
| 217 | for (let i = 0; i < rects.length; i++) { |
| 218 | const rect = rects[i]; |
| 219 | const ad = totalDuration * (rect.w / totalWidth); |
| 220 | renderAnnotation(svg, rects[i], config, delay + this._animationDelay, ad, this._seed); |
| 221 | delay += ad; |
| 222 | } |
| 223 | this._lastSizes = rects; |
| 224 | this._state = 'showing'; |
| 225 | } |
| 226 | |
| 227 | private rects(): Rect[] { |
| 228 | const ret: Rect[] = []; |
no test coverage detected