src/cal-heatmap.js
function expandMarginSetting(value) {
			if (typeof value === "number") {
				value = [value];
			}

			if (!Array.isArray(value)) {
				console.log("Margin only takes an integer or an array of integers");
				value = [0];
			}

			switch(value.length) {
			case 1:
				return [value[0], value[0], value[0], value[0]];
			case 2:
				return [value[0], value[1], value[0], value[1]];
			case 3:
				return [value[0], value[1], value[2], value[1]];
			case 4:
				return value;
			default:
				return value.slice(0, 4);
			}
		}
function expandMarginSetting(value) {
			if (typeof value === "number") {
				value = [value];
			}

			if (!Array.isArray(value)) {
				console.log("Margin only takes an integer or an array of integers");
				value = [0];
			}

			switch(value.length) {
			case 1:
				return [value[0], value[0], value[0], value[0]];
			case 2:
				return [value[0], value[1], value[0], value[1]];
			case 3:
				return [value[0], value[1], value[2], value[1]];
			case 4:
				return value;
			default:
				return value.slice(0, 4);
			}
		}
function expandMarginSetting ( value ) { if ( typeof value === "number" ) { value = [ value ] ; } if ( ! Array . isArray ( value ) ) { console . log ( "Margin only takes an integer or an array of integers" ) ; value = [ 0 ] ; } switch ( value . length ) { case 1 : return [ value [ 0 ] , value [ 0 ] , value [ 0 ] , value [ 0 ] ] ; case 2 : return [ value [ 0 ] , value [ 1 ] , value [ 0 ] , value [ 1 ] ] ; case 3 : return [ value [ 0 ] , value [ 1 ] , value [ 2 ] , value [ 1 ] ] ; case 4 : return value ; default : return value . slice ( 0 , 4 ) ; } }
Expand a number of an array of numbers to an usable 4 values array

@param  {integer|array} value
@return {array}        array
Expand a number of an array of numbers to an usable 4 values array