MCPcopy Index your code
hub / github.com/bqplot/bqplot / draw

Method draw

js/src/GridHeatMap.ts:461–589  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

459 }
460
461 draw() {
462 this.set_ranges();
463
464 const rowScale = this.scales.row;
465 const columnScale = this.scales.column;
466
467 const rowStartAligned = this.model.get('row_align') === 'start';
468 const colStartAligned = this.model.get('column_align') === 'start';
469 let new_domain;
470
471 if (
472 this.model.modes.row !== AxisMode.Middle &&
473 this.model.modes.row !== AxisMode.Boundaries
474 ) {
475 new_domain = this.expandScaleDomain(
476 rowScale,
477 this.model.rows,
478 this.model.modes.row,
479 rowStartAligned
480 );
481 if (
482 d3.min(new_domain) < d3.min(rowScale.model.domain) ||
483 d3.max(new_domain) > d3.max(rowScale.model.domain)
484 ) {
485 // Update domain if domain has changed
486 rowScale.model.computeAndSetDomain(new_domain, rowScale.model.model_id);
487 }
488 }
489
490 if (
491 this.model.modes.column !== AxisMode.Middle &&
492 this.model.modes.column !== AxisMode.Boundaries
493 ) {
494 new_domain = this.expandScaleDomain(
495 columnScale,
496 this.model.columns,
497 this.model.modes.column,
498 colStartAligned
499 );
500 if (
501 d3.min(new_domain) < d3.min(columnScale.model.domain) ||
502 d3.max(new_domain) > d3.max(columnScale.model.domain)
503 ) {
504 // Update domain if domain has changed
505 columnScale.model.computeAndSetDomain(
506 new_domain,
507 columnScale.model.model_id
508 );
509 }
510 }
511
512 const rowPlotData = this.getTilePlottingData(
513 rowScale,
514 this.model.rows,
515 this.model.modes.row,
516 rowStartAligned
517 );
518 const columnPlotData = this.getTilePlottingData(

Callers 3

renderMethod · 0.95
set_positional_scalesMethod · 0.95
relayoutMethod · 0.95

Calls 6

set_rangesMethod · 0.95
expandScaleDomainMethod · 0.95
getTilePlottingDataMethod · 0.95
apply_stylesMethod · 0.95
updateLabelsMethod · 0.95
rangeMethod · 0.80

Tested by

no test coverage detected