Sha256: 6734a7d4c7af2b086e9ee5e3f9eab31633ddd0dc6a47d70e736e50f597b2fd6f

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

(function (H) {
	var seriesTypes = H.seriesTypes,
		each = H.each;
	
	seriesTypes.heatmap = H.extendClass(seriesTypes.map, {
		colorKey: 'z',
		useMapGeometry: false,
		pointArrayMap: ['y', 'z'],
		translate: function () {
			var series = this,
				options = series.options,
				dataMin = Number.MAX_VALUE,
				dataMax = Number.MIN_VALUE;

			series.generatePoints();
	
			each(series.data, function (point) {
				var x = point.x,
					y = point.y,
					value = point.z,
					xPad = (options.colsize || 1) / 2,
					yPad = (options.rowsize || 1) / 2;

				point.path = [
					'M', x - xPad, y - yPad,
					'L', x + xPad, y - yPad,
					'L', x + xPad, y + yPad,
					'L', x - xPad, y + yPad,
					'Z'
				];
				
				point.shapeType = 'path';
				point.shapeArgs = {
					d: series.translatePath(point.path)
				};
				
				if (typeof value === 'number') {
					if (value > dataMax) {
						dataMax = value;
					} else if (value < dataMin) {
						dataMin = value;
					}
				}
			});
			
			series.translateColors(dataMin, dataMax);
		},
		
		getBox: function () {},
		getExtremes: H.Series.prototype.getExtremes
			
	});
	
}(Highcharts));

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
highstock_rails-1.3.7.1 vendor/assets/javascripts/highstock/modules/heatmap.js
highstocks-rails-0.0.2 app/assets/javascripts/highstocks/modules/heatmap.src.js
highstocks-rails-0.0.1 app/assets/javascripts/highstocks/modules/heatmap.src.js
highcharts-rails-3.0.7 app/assets/javascripts/highcharts/modules/heatmap.js