<commit_before>dojo.provide("dojox.widget._Gauge");

dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dijit._Container");
dojo.require("dijit.Tooltip");
dojo.require("dojo.fx.easing");
dojo.require("dojox.gfx");

dojo.experimental("dojox.widgets._Gauge");

dojo.declare("dojox.widget._Gauge",[dijit._Widget, dijit._Templated, dijit._Container],{
	// summary:
	//		a gauge built using the dojox.gfx package.
	//
	// description:
	//		using dojo.gfx (and thus either SVG or VML based on what is supported), this widget
	//		builds a gauge component, used to display numerical data in a familiar format 
	//
	// usage:
	//		this widget is not to be used alone. it is meant to be subclassed, such as
	//		dojox.widget.BarGauge or dojox.widget.AnalogGauge

	// width: Number
	// the width of the gauge (default is 300)
	width: 0,

	// height: Number
	// the height of the gauge (default is 200)
	height: 0,

	// gaugeBackground: Object|String
	// background color.  if this parameter is an object, it is
	// interpreted as a 'fill' object to set a gradient on the background.
	gaugeBackground: '#e0e0e0',

	// min: Number
	// minimum value displayed by gauge (default is lowest range value)
	min: 0,

	// max: Number
	// maximum value displayed by gauge (default is largest range value)
	max: 0,

	// image: String
	// background image for gauge (default is no image)
	image: '',

	// imageX: Number
	// position of background image x coordinate (default is 0)
	imageX: -1,

	// imageY: Number
	// position of background image y coordinate (default is 0)
	imageY: -1,

	// imageWidth: Number
	// width of background image (default is gauge width)
	imageWidth: 0,

	// imageHeight: Number
	// height of background image (default is gauge width)
	imageHeight: 0,

	// imageOverlay: Boolean
	// indicates background image is overlay (default is false)
	imageOverlay: false,

	// useRangeStyles: Number
	// indicates whether to use given css classes (dojoxGaugeRangeXX)
	// to determine the color (and other style attributes?) of the ranges
	// this value should be the number of dojoxGaugeRange classes that are 
	// defined, starting at dojoxGaugeRange1 (0 indicates falling to default
	// hardcoded colors)
	useRangeStyles: 0,

	// useTooltip: Boolean
	// indicates whether tooltips should be displayed for ranges, indicators, etc.
	useTooltip: true,
	
	majorTicks: {},
	minorTicks: {},
//	image: {},

	// internal data
	gaugeContent: undefined,
	templatePath: dojo.moduleUrl("dojox.widget", "Gauge/_Gauge.html"),

	defaultColors: [[0x00,0x54,0xAA,1],
					[0x44,0x77,0xBB,1],
					[0x66,0x99,0xCC,1],
					[0x99,0xBB,0xEE,1],
					[0x99,0xCC,0xFF,1],
					[0xCC,0xEE,0xFF,1],
					[0xDD,0xEE,0xFF,1]],
	min: null,
	max: null,
	surface: null,
	rangeData: null,
	indicatorData: null,
	drag: null,
	img: null,
	overOverlay: false,
	lastHover: '',

	startup: function(){
		// handle settings from HTML by making sure all the options are
		// converted correctly to numbers and that we calculate defaults
		// for cx, cy and radius
		/*this.width = Number(this.width);
		this.height = Number(this.height);
		if(this.min){this.min = Number(this.min)};
		if(this.max){this.max = Number(this.max)};

		if(this.imageX != -1){this.imageX = Number(this.imageX)};
		if(this.imageY != -1){this.imageY = Number(this.imageY)};
		if(this.imageWidth){this.imageWidth = Number(this.imageWidth)};
		if(this.imageHeight){this.imageHeight = Number(this.imageHeight)};*/

		this.connect(this.gaugeContent, 'onmousemove', this.handleMouseMove);
		this.connect(this.gaugeContent, 'onmouseover', this.handleMouseOver);
		this.connect(this.gaugeContent, 'onmouseout', this.handleMouseOut);
		this.connect(this.gaugeContent, 'onmouseup', this.handleMouseUp);

		if(!dojo.isArray(this.ranges)){ this.ranges = []; }
		if(!dojo.isArray(this.indicators)){ this.indicators = []; }
		var ranges = [], indicators = [];
		var i;
		if(this.hasChildren()){
			var children = this.getChildren();
			for(i=0; i<children.length; i++){
				if(/dojox\.widget\..*Indicator/.test(children[i].declaredClass)){
					indicators.push(children[i]);
					//this.addIndicator(children[i]);
					continue;
				}
				switch(children[i].declaredClass){
					case "dojox.widget.Range":
						ranges.push(children[i]);
						/*this.addRange(children[i]);*/<commit_msg>Fixed a minor declarative instantiation bug in the analog gauge, etc.  refs: 8064<commit_after>dojo.provide("dojox.widget._Gauge");

dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dijit._Container");
dojo.require("dijit.Tooltip");
dojo.require("dojo.fx.easing");
dojo.require("dojox.gfx");

dojo.experimental("dojox.widgets._Gauge");

dojo.declare("dojox.widget._Gauge",[dijit._Widget, dijit._Templated, dijit._Container],{
	// summary:
	//		a gauge built using the dojox.gfx package.
	//
	// description:
	//		using dojo.gfx (and thus either SVG or VML based on what is supported), this widget
	//		builds a gauge component, used to display numerical data in a familiar format 
	//
	// usage:
	//		this widget is not to be used alone. it is meant to be subclassed, such as
	//		dojox.widget.BarGauge or dojox.widget.AnalogGauge

	// width: Number
	// the width of the gauge (default is 300)
	width: 0,

	// height: Number
	// the height of the gauge (default is 200)
	height: 0,

	// gaugeBackground: Object|String
	// background color.  if this parameter is an object, it is
	// interpreted as a 'fill' object to set a gradient on the background.
	gaugeBackground: '#e0e0e0',

	// min: Number
	// minimum value displayed by gauge (default is lowest range value)
	min: 0,

	// max: Number
	// maximum value displayed by gauge (default is largest range value)
	max: 0,

	// image: String
	// background image for gauge (default is no image)
	image: null,

	// imageX: Number
	// position of background image x coordinate (default is 0)
	imageX: -1,

	// imageY: Number
	// position of background image y coordinate (default is 0)
	imageY: -1,

	// imageWidth: Number
	// width of background image (default is gauge width)
	imageWidth: 0,

	// imageHeight: Number
	// height of background image (default is gauge width)
	imageHeight: 0,

	// imageOverlay: Boolean
	// indicates background image is overlay (default is false)
	imageOverlay: false,

	// useRangeStyles: Number
	// indicates whether to use given css classes (dojoxGaugeRangeXX)
	// to determine the color (and other style attributes?) of the ranges
	// this value should be the number of dojoxGaugeRange classes that are 
	// defined, starting at dojoxGaugeRange1 (0 indicates falling to default
	// hardcoded colors)
	useRangeStyles: 0,

	// useTooltip: Boolean
	// indicates whether tooltips should be displayed for ranges, indicators, etc.
	useTooltip: true,
	
	majorTicks: {},
	minorTicks: {},
//	image: {},

	// internal data
	gaugeContent: undefined,
	templatePath: dojo.moduleUrl("dojox.widget", "Gauge/_Gauge.html"),

	defaultColors: [[0x00,0x54,0xAA,1],
					[0x44,0x77,0xBB,1],
					[0x66,0x99,0xCC,1],
					[0x99,0xBB,0xEE,1],
					[0x99,0xCC,0xFF,1],
					[0xCC,0xEE,0xFF,1],
					[0xDD,0xEE,0xFF,1]],
	min: null,
	max: null,
	surface: null,
	rangeData: null,
	indicatorData: null,
	drag: null,
	img: null,
	overOverlay: false,
	lastHover: '',

	startup: function(){
		// handle settings from HTML by making sure all the options are
		// converted correctly to numbers and that we calculate defaults
		// for cx, cy and radius
		/*this.width = Number(this.width);
		this.height = Number(this.height);
		if(this.min){this.min = Number(this.min)};
		if(this.max){this.max = Number(this.max)};

		if(this.imageX != -1){this.imageX = Number(this.imageX)};
		if(this.imageY != -1){this.imageY = Number(this.imageY)};
		if(this.imageWidth){this.imageWidth = Number(this.imageWidth)};
		if(this.imageHeight){this.imageHeight = Number(this.imageHeight)};*/
		if(this.image === null){
			this.image={};
		}

		this.connect(this.gaugeContent, 'onmousemove', this.handleMouseMove);
		this.connect(this.gaugeContent, 'onmouseover', this.handleMouseOver);
		this.connect(this.gaugeContent, 'onmouseout', this.handleMouseOut);
		this.connect(this.gaugeContent, 'onmouseup', this.handleMouseUp);

		if(!dojo.isArray(this.ranges)){ this.ranges = []; }
		if(!dojo.isArray(this.indicators)){ this.indicators = []; }
		var ranges = [], indicators = [];
		var i;
		if(this.hasChildren()){
			var children = this.getChildren();
			for(i=0; i<children.length; i++){
				if(/dojox\.widget\..*Indicator/.test(children[i].declaredClass)){
					indicators.push(children[i]);
					//this.addIndicator(children[i]);
					continue;
				}
				switch(children[i].declaredClass){
					case "dojox.widget.Range":
						ranges.push(children[i]);
						/*this.addRange(children[i]);*/
{'fraction_non_alphanumeric': 0.14079381326054816, 'fraction_numerical': 0.016149209598544295, 'mean_word_length': 3.861249309010503, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7011126', 'n_tokens_mistral': 3261, 'n_tokens_neox': 2992, 'n_words': 805}