src/cal-heatmap.js
function addStyle(element) {
			if (parent.legendScale === null) {
				return false;
			}

			element.attr("fill", function(d) {
				if (d.v === null && (options.hasOwnProperty("considerMissingDataAsZero") && !options.considerMissingDataAsZero)) {
					if (options.legendColors.hasOwnProperty("base")) {
						return options.legendColors.base;
					}
				}

				if (options.legendColors !== null && options.legendColors.hasOwnProperty("empty") &&
					(d.v === 0 || (d.v === null && options.hasOwnProperty("considerMissingDataAsZero") && options.considerMissingDataAsZero))
				) {
					return options.legendColors.empty;
				}

				if (d.v < 0 && options.legend[0] > 0 && options.legendColors !== null && options.legendColors.hasOwnProperty("overflow")) {
					return options.legendColors.overflow;
				}

				return parent.legendScale(Math.min(d.v, options.legend[options.legend.length-1]));
			});
		}
function addStyle(element) {
			if (parent.legendScale === null) {
				return false;
			}

			element.attr("fill", function(d) {
				if (d.v === null && (options.hasOwnProperty("considerMissingDataAsZero") && !options.considerMissingDataAsZero)) {
					if (options.legendColors.hasOwnProperty("base")) {
						return options.legendColors.base;
					}
				}

				if (options.legendColors !== null && options.legendColors.hasOwnProperty("empty") &&
					(d.v === 0 || (d.v === null && options.hasOwnProperty("considerMissingDataAsZero") && options.considerMissingDataAsZero))
				) {
					return options.legendColors.empty;
				}

				if (d.v < 0 && options.legend[0] > 0 && options.legendColors !== null && options.legendColors.hasOwnProperty("overflow")) {
					return options.legendColors.overflow;
				}

				return parent.legendScale(Math.min(d.v, options.legend[options.legend.length-1]));
			});
		}
function addStyle ( element ) { if ( parent . legendScale === null ) { return false ; } element . attr ( "fill" , function ( d ) { if ( d . v === null && ( options . hasOwnProperty ( "considerMissingDataAsZero" ) && ! options . considerMissingDataAsZero ) ) { if ( options . legendColors . hasOwnProperty ( "base" ) ) { return options . legendColors . base ; } } if ( options . legendColors !== null && options . legendColors . hasOwnProperty ( "empty" ) && ( d . v === 0 || ( d . v === null && options . hasOwnProperty ( "considerMissingDataAsZero" ) && options . considerMissingDataAsZero ) ) ) { return options . legendColors . empty ; } if ( d . v < 0 && options . legend [ 0 ] > 0 && options . legendColors !== null && options . legendColors . hasOwnProperty ( "overflow" ) ) { return options . legendColors . overflow ; } return parent . legendScale ( Math . min ( d . v , options . legend [ options . legend . length - 1 ] ) ) ; } ) ; }
Colorize the cell via a style attribute if enabled
Colorize the cell via a style attribute if enabled