import { Column , IDataRow , isMissingValue } from '../model' ; import { CANVAS_HEIGHT , DASH , cssClass } from '../styles' ; export function renderMissingValue ( ctx , width , height , x = 0 , y = 0 ) { const dashX = Math . max ( 0 , x + ( width - DASH . width ) / 2 ) ; const dashY = Math . max ( 0 , y + ( height - DASH . height ) / 2 ) ; ctx . fillStyle = DASH . color ; ctx . fillRect ( dashX , dashY , Math . min ( width , DASH . width ) , Math . min ( height , DASH . height ) ) ; } export function renderMissingDOM ( node , col , d ) { const missing = isMissingValue ( col . getValue ( d ) ) ; node . classList . toggle ( cssClass ( 'missing' ) , missing ) ; return missing ; } export function renderMissingCanvas ( ctx , col , d , width , x = 0 , y = 0 ) { const missing = isMissingValue ( col . getValue ( d ) ) ; if ( missing ) { renderMissingValue ( ctx , width , CANVAS_HEIGHT , x , y ) ; } return missing ; }