<commit_before>/*
---

script: HueChart.Box.js

description: Defines HueChart.Box, which builds on HueChart and serves as a base class to build charts which are rectangular in nature, having x and y axes.

license: MIT-style license

authors:
- <NAME>

requires:
- protovis/Protovis
- More/Date
- Core/Events
- Core/Options
- /Number.Files
- /HueChart

provides: [ HueChart.Box ]
...
*/
(function() {
var getXValueFn = function(field) {
		return function(data) {
				if (field) return data[field];
				else return data;
		};
};

HueChart.Box = new Class({

		Extends: HueChart,

		 options: {
				xProperty: 'x', //the field in the data table which should be used for determining where points are on the xAxis
				dates: {x: false, y: false}, //is the data in an axis a date ? 
				dateSpans:{x: null}, //if an axis is a date, what time span should the tick marks for that axis be shown in
				positionIndicator: false, //should the position indicator be shown ?
				ticks: {x: false, y: false}, //should tick marks be shown ?
				showLabels: false, //should axis labels be shown ?
				tickColor: "#555", //the color of the tick marks
				tickDateFormats: {
					'ms': "%I:%M:%z %p",
					'second': "%I:%M %p",
					'minute': "%I:%M %p",
					'hour': "%H %p",
					'day': "%m %D",
					'month': "%m",
					'year': "%Y"
				},
				dateFormat: "%b %d", //the format that should be used when displaying dates
				verticalTickSpacing: 35, //the distance between vertical ticks
				xTickHeight: 10, //the height of the xTick marks.
				labels:{x:"X", y: "Y"}, //the labels that should be used for each axis
				selectBarColor: "rgba(0, 0, 0, .2)", //the color that should be used to fill selections in this chart
				selectBarBorderColor: "rgba(0, 0, 0, 1)", //the color that should be used as a border for selections in this chart
				selectedIndicatorColor: "black", //color that should be used to show the position of the selected index, when using the position indicator
				highlightedIndicatorColor: "rgba(255, 255, 255, .5)",
				yType: 'string', //the type of value that is being graphed on the y-axis,
				showPointValue: false, //show the value at the point when moused over
				selectable: false, //make the chart selectable
				//initialSelectValue: {left: 0, right: 0}, //the initial chart selection, must be same type as x values 
				draggable: false, //make the chart selection draggable,
				fireSelectOnDrag: true //fires the select event on completion of a drag
				/*
				onPointMouseOut: function that should be run when the mouse is moved out of the chart
				onPointMouseOver: function that should be run when the mouse is moved over a datapoint, takes the dataPoint and index as arguments
				onPointClick: function that should be run when the mouse is clicked on a datapoint, takes the dataPoint and index as arguments
				onSeriesMouseOver: function that should be run when the mouse is moved over a dataSeries, takes an object containing the seriesName and value at that point as argument.
				onSeriesClick: function that should be run when the mouse is clicked on a data series, takes an object containing the seriesName and value at that as an argument.
				onSpanSelect: function that should be run when a segment of the chart is selected.  Takes a left object and a right object as arguments, each of which contains the corresponding index and data object. 
				*/
		},
		
		initialize: function(element, options) {
				this.parent(element, options);
				this.selected_index = -1;
				this.highlighted_index = -1;
				//Build initial list of data series
				//Initialize data object
				if (this.hasData()) this.initializeData();
				//Create tip to show if showPointValue is true.
				if (this.options.showPointValue) {
						this.tip = new DynamicTips(this.element, {
								className: 'huechart tip-wrap',
								title: $lambda("Title"),
								text: $lambda("Text"),
								showOnEnter: false
						});<commit_msg>HUE-402.  Fix DynamicTips reference in HueChart<commit_after>/*
---

script: HueChart.Box.js

description: Defines HueChart.Box, which builds on HueChart and serves as a base class to build charts which are rectangular in nature, having x and y axes.

license: MIT-style license

authors:
- <NAME>

requires:
- protovis/Protovis
- More/Date
- More/Tips
- Core/Events
- Core/Options
- /Number.Files
- /HueChart

provides: [ HueChart.Box ]
...
*/
(function() {
var getXValueFn = function(field) {
		return function(data) {
				if (field) return data[field];
				else return data;
		};
};

HueChart.Box = new Class({

		Extends: HueChart,

		 options: {
				xProperty: 'x', //the field in the data table which should be used for determining where points are on the xAxis
				dates: {x: false, y: false}, //is the data in an axis a date ? 
				dateSpans:{x: null}, //if an axis is a date, what time span should the tick marks for that axis be shown in
				positionIndicator: false, //should the position indicator be shown ?
				ticks: {x: false, y: false}, //should tick marks be shown ?
				showLabels: false, //should axis labels be shown ?
				tickColor: "#555", //the color of the tick marks
				tickDateFormats: {
					'ms': "%I:%M:%z %p",
					'second': "%I:%M %p",
					'minute': "%I:%M %p",
					'hour': "%H %p",
					'day': "%m %D",
					'month': "%m",
					'year': "%Y"
				},
				dateFormat: "%b %d", //the format that should be used when displaying dates
				verticalTickSpacing: 35, //the distance between vertical ticks
				xTickHeight: 10, //the height of the xTick marks.
				labels:{x:"X", y: "Y"}, //the labels that should be used for each axis
				selectBarColor: "rgba(0, 0, 0, .2)", //the color that should be used to fill selections in this chart
				selectBarBorderColor: "rgba(0, 0, 0, 1)", //the color that should be used as a border for selections in this chart
				selectedIndicatorColor: "black", //color that should be used to show the position of the selected index, when using the position indicator
				highlightedIndicatorColor: "rgba(255, 255, 255, .5)",
				yType: 'string', //the type of value that is being graphed on the y-axis,
				showPointValue: false, //show the value at the point when moused over
				selectable: false, //make the chart selectable
				//initialSelectValue: {left: 0, right: 0}, //the initial chart selection, must be same type as x values 
				draggable: false, //make the chart selection draggable,
				fireSelectOnDrag: true //fires the select event on completion of a drag
				/*
				onPointMouseOut: function that should be run when the mouse is moved out of the chart
				onPointMouseOver: function that should be run when the mouse is moved over a datapoint, takes the dataPoint and index as arguments
				onPointClick: function that should be run when the mouse is clicked on a datapoint, takes the dataPoint and index as arguments
				onSeriesMouseOver: function that should be run when the mouse is moved over a dataSeries, takes an object containing the seriesName and value at that point as argument.
				onSeriesClick: function that should be run when the mouse is clicked on a data series, takes an object containing the seriesName and value at that as an argument.
				onSpanSelect: function that should be run when a segment of the chart is selected.  Takes a left object and a right object as arguments, each of which contains the corresponding index and data object. 
				*/
		},
		
		initialize: function(element, options) {
				this.parent(element, options);
				this.selected_index = -1;
				this.highlighted_index = -1;
				//Build initial list of data series
				//Initialize data object
				if (this.hasData()) this.initializeData();
				//Create tip to show if showPointValue is true.
				if (this.options.showPointValue) {
						this.tip = new Tips(this.element, {
								className: 'huechart tip-wrap',
								title: $lambda("Title"),
								text: $lambda("Text"),
								showOnEnter: false
						});
{'fraction_non_alphanumeric': 0.09751795388685902, 'fraction_numerical': 0.007685523497543152, 'mean_word_length': 3.2426509887760555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2760754', 'n_tokens_mistral': 2715, 'n_tokens_neox': 2260, 'n_words': 1050}