()
| 431 | } |
| 432 | |
| 433 | draw() { |
| 434 | this.set_ranges(); |
| 435 | // get the visual representation of boxplots, set as state |
| 436 | this.prepareBoxPlots(); |
| 437 | |
| 438 | // Draw the visual elements with data which was bound |
| 439 | this.drawMarkPaths('.boxplot', this.d3el); |
| 440 | // Keep the pixel coordinates of the boxes, for interactions. |
| 441 | this.xPixels = this.model.mark_data.map( |
| 442 | (el) => this.scales.x.scale(el[0]) + this.scales.x.offset |
| 443 | ); |
| 444 | |
| 445 | const width = this.getBoxWidth() / 2; |
| 446 | this.pixelCoords = this.plotData.map((d) => { |
| 447 | return [ |
| 448 | [d.x - width, d.x + width], |
| 449 | [d.boxLower, d.boxUpper], |
| 450 | ]; |
| 451 | }); |
| 452 | } |
| 453 | |
| 454 | private drawMarkPaths(parentClass, selector) { |
| 455 | const color = this.model.get('color'); |
no test coverage detected