<commit_before><% content_once_for :head do %>
	<%= javascript_include_tag 'http://www.google.com/jsapi' %>
  
	<script type='text/javascript'>
		google.load('visualization', '1.1', {'packages':['annotationchart']});
		google.setOnLoadCallback(drawTimelines);
		function drawTimelines() {
			var options = {
				displayAnnotations: true,
			};
			for (var i = 0; i < device_timelines.length; i++) {
				var timeline = device_timelines[i];
				var data = new google.visualization.DataTable();
				data.addColumn('date', 'Date');
				data.addColumn('number', 'Temperature');
				data.addRows(timeline.data);
				
				var chart = new google.visualization.AnnotationChart(document.getElementById(timeline.id));
				chart.draw(data, options);
			}
		}
		var device_timelines = new Array();
	</script>
<% end %>

<div id="sensor-<%= sensor.id %>">
	<h3>Probe <%= sensor.sensor_index + 1 %></h3>
	<div>Currently controlling: both outputs <%= link_to '(change)' %></div>
	<div>Using temperature profile: 'Saison' <%= link_to '(change)' %></div>
	<script type='text/javascript'>
		device_timelines.push({
			id: 'sensor-<%= sensor.id %>-timeline',
			data: [
				<% sensor.readings.each do |reading| %>
				[new Date(<%= reading.created_at.to_i * 1000 %>), <%= reading.value %>],
				<% end %>
			]
		});
	</script>
	<div id="sensor-<%= sensor.id %>-timeline" style='width: 900px; height: 200px;'></div>
</div>
<commit_msg>Switch from google visualization to dygraphs.<commit_after><% content_once_for :head do %>
	<%= javascript_include_tag 'http://www.google.com/jsapi' %>
  
	<script type='text/javascript'>
   $(document).ready(function () {
			for (var i = 0; i < device_timelines.length; i++) {
				var timeline = device_timelines[i];
				
    		g = new Dygraph(
          document.getElementById(timeline.id),
          timeline.data,
          {
            showRoller: true,
            labels: ['Time', 'Temperature']
          }
        );
			}
		});
		var device_timelines = new Array();
	</script>
<% end %>

<div id="sensor-<%= sensor.id %>" class="sensor">
	<h4>Sensor <%= sensor.sensor_index + 1 %></h4>
	<div>Currently controlling: both outputs <%= link_to '(change)' %></div>
	<div>Using temperature profile: 'Saison' <%= link_to '(change)' %></div>
	<script type='text/javascript'>
		device_timelines.push({
			id: 'sensor-<%= sensor.id %>-timeline',
			data: [
				<% sensor.readings.each do |reading| %>
				[new Date(<%= reading.created_at.to_i * 1000 %>), <%= reading.value %>],
				<% end %>
			]
		});
	</script>
	<div class="col-md-12">
    <div id="sensor-<%= sensor.id %>-timeline" class="sensor-plot"></div>
	</div>
	<div class="clearfix"></div>
</div>

{'fraction_non_alphanumeric': 0.19640852974186307, 'fraction_numerical': 0.009726898615787506, 'mean_word_length': 3.5945017182130585, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1069858', 'n_tokens_mistral': 1077, 'n_tokens_neox': 902, 'n_words': 188}