Skip to content

Instantly share code, notes, and snippets.

@sctfic
Last active January 1, 2016 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sctfic/8105667 to your computer and use it in GitHub Desktop.
Save sctfic/8105667 to your computer and use it in GitHub Desktop.
Infinity zoomable timeChart
/** curve.js
* @package Probe
* @author alban lopez <alban.lopez+gist@gmail.com>
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode CC-by-nc-sa-3.0
* @Model http://bost.ocks.org/mike/chart/
*/
function timeSeriesChart_curves() {
var color=d3.scale.category20();
var data,margin = {top: 5, right: 5, bottom: 28, left: 40},
width = null,
height = 160,
station = null,
sensor = null,
dataheader = null,
dateDomain = [formatDate(new Date(0)), formatDate(new Date())],
ajaxUrl = "/data/curve",
withAxis = true,
nude = false,
trend=false,
onClickAction = function(d) { console.error (d); },
unit = false,
md5 = false,
darkColor = false,
lightColor = false,
toHumanUnit = function(SI){if (!arguments.length) return '';return +SI;},
toHumanDate = function(SI){if (!arguments.length) return '';return +SI;},
timeFormat = d3.time.format("%Y-%m-%dT%H:%M:%S"),
dateParser = function(d) { return timeFormat.parse (d.date); },
val = function(d) { return toHumanUnit(+d.val); },
xPos=0,
yPos=0,
xScale = d3.time.scale().range([0, width]),
yScale = d3.scale.linear().range([height, 0]),
xAxis = d3.svg.axis().scale(xScale).orient("bottom").tickSize(4,6),
yAxis = d3.svg.axis().scale(yScale).orient("left").ticks(4).tickSize(3,5),
line = d3.svg.line().x(X).y(Y);
// circle = d3.svg.circle().
function chart(selection) {
md5 = MD5(station+sensor+(new Date()).getMilliseconds());
if (!darkColor) darkColor=color(md5+'0');
if (!lightColor) lightColor=color(md5+'1');
//selection represente la liste de block ou ecire les donnees
selection.each(function(rawdata) {
// Convert data to standard representation greedily;
// this is needed for nondeterministic accessors.
data = rawdata.map(function(d, i) {
return {
date:dateParser.call(rawdata, d, i),
val:val.call(rawdata, d, i)
};
});
console.log(data);
// Update the x-scale.
xScale
.domain(d3.extent(data, function(d) { return d.date; }))
.range([0, width - margin.left - margin.right]);
// rangeRoundBands
// Update the y-scale.
yScale
.domain(d3.extent(data, function(d) {return +d.val; })) // [toHumanUnit(dataheader.min),toHumanUnit(dataheader.max)]
.range([height - margin.top - margin.bottom, 0]);
// Select the svg element, if it exists.
var svg = d3.select(this).selectAll("svg").data([{date:0,val:yScale.domain()[0]},{date:new Date(),val:yScale.domain()[0]}])
svg = svg.data([data]);
// Otherwise, create the skeletal chart.
var gEnter = svg.enter()
.append("svg")
.attr("viewBox", "0 0 "+width+" "+height)
// // .attr("preserveAspectRatio", "xMinYMin")
.attr("width", function(){return nude ? width : "100%";})
.attr("height", height)
.append("g");
gEnter.append("path")
.attr("class", "line")
.attr("stroke", darkColor);
// Update the inner dimensions.
var g = svg.select("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
g.updateCurve = function(){
yScale.domain(
d3.extent(
data.filter(function(element, index, array){
return (element.date>=xScale.domain()[0] && element.date<=xScale.domain()[1]);
}), function(d) {return d.val; }));
// Update the line path.
this.select(".line")
.attr("d", line(data))
.attr("clip-path", "url(#" + md5 + ")");
return this;
};
gEnter.append("svg:clipPath")
.attr("id", "" + md5)
.append("svg:rect")
.attr('width', width - margin.left - margin.right)
.attr('height', height - margin.top - margin.bottom);
if (!nude) {
gEnter.append('line')
.attr("class", "zero")
// .attr("clip-path", "url(#" + md5 + ")")
.attr("stroke", lightColor)
.attr("x1", xScale.range()[0])
.attr("y1", (0))
.attr("x2", xScale.range()[1])
.attr("y2", (0));
g.drawAxis = function(){
// chose the possition of x-Axis
// if (0<yScale.domain()[0]) {
xPos = yScale.range()[0]+12;
// }
// else if (yScale.domain()[1]<0) {
// xPos = yScale.range()[1];
// }
// else {
// xPos = yScale(0);
// }
if (withAxis) {
// Update the x-axis.
this.select(".x.axis")//.transition().duration(1000)
.attr("transform", "translate(-1," + xPos + ")") // axe tjrs en bas : yScale.range()[0] + ")")
.call(xAxis);
this.select(".zero")//.transition().duration(1000)
.attr("transform", "translate(0," + yScale(0) + ")"); // axe tjrs en bas : yScale.range()[0] + ")")
this.select(".y.axis")
.attr("transform", "translate(-1,0)")
.call(yAxis)
legendSum.text(Infos);
}
return this;
};
var legend = gEnter.append("g")
.attr("class", "legend")
.attr("transform", "translate(0,"+(height - margin.bottom +5)+")")
.attr("fill", darkColor);
var legendTitle = legend.append('text')
.attr("class","title")
.text(dataheader.sensor.SEN_HUMAN_NAME);
var legendXleft = width - margin.left- margin.right-4;
var legendDate = legend.append('text')
.attr("class","date")
.attr('x', legendXleft-(formatVal(dataheader.max).length+2)*6)
.text('Scroll for Zoom');
// console.log(legendDate.getComputedTextLength());
var legendVal = legend.append('text')
.attr("class","val")
.attr('x', legendXleft)
.text(formatVal(data[data.length-1].val));
var Infos = function() {return "Min : "+formatVal(toHumanUnit(dataheader.min), 2)+
" — Average : "+formatVal(toHumanUnit(dataheader.avg), 2)+
" — Max : "+formatVal(toHumanUnit(dataheader.max), 2);},
legendSum = legend.append('text')
.attr("class","Infos")
.attr('x', legendXleft/2)
.text(Infos);
var spotSize = 8;
var spot=gEnter.append("g")
.attr("id", "spot")
.attr("opacity", 0)
.attr("x", 0)
.attr("y", 0);
spot.append('circle')
.attr("class", "Dot")
.attr("stroke", darkColor)
.attr("r", spotSize/2)
.attr("cx", 0)
.attr("cy", 0);
spot.append('circle')
.attr("class", "spotCircle")
.attr("stroke", lightColor)
.attr("r", spotSize)
.attr("cx", 0)
.attr("cy", 0);
var tendance=gEnter.append('line')
.attr("stroke", darkColor);
var Sensitive = gEnter.append("rect")
.attr("class", "sensitive")
.attr('width', width - margin.left - margin.right)
.attr('height', height - margin.top - margin.bottom);
var Y_val=0, timeoutID=null;
Sensitive.on("mousemove", function() {
// http://bl.ocks.org/mbostock/3025699
// var d = offsets[Math.round((xScale.invert(d3.mouse(this)[0]) - startDate) / step)];
// focus.select("circle").attr("transform", "translate(" + xScale(d[0]) + "," + yScale(d[1]) + ")");
var X_px = d3.mouse(this)[0],
X_date = xScale.invert(X_px);
Y_px = yScale(Y_val);
var iSpot;
data.forEach(function(element, index, array) {
if ((index+1 < array.length) && (array[index].date <= X_date) && (array[index+1].date >= X_date)) {
if (X_date-array[index].date < array[index+1].date-X_date) {
iSpot=index;
} else {
iSpot=index+1;
}
Y_val = array[iSpot].val;
X_date = array[iSpot].date;
X_px=Math.round(xScale(X_date));
Y_px=Math.round(yScale(Y_val));
}
});
spot.attr("opacity", 1)
.attr("transform", "translate("+X_px+","+Y_px+")");
if (trend){
var steps = data.filter(function(element, index, array){
return (element.date>data[iSpot-trend].date && element.date<data[iSpot+trend].date);
});
var afine=linearRegression(steps);
tendance
.attr("x1", xScale(steps[0].date))
.attr("y1", yScale(afine.slope*(steps[0].date.getTime()/60000)+afine.middle_intercept))
.attr("x2", xScale(steps[steps.length-1].date))
.attr("y2", yScale(afine.slope*(steps[steps.length-1].date.getTime()/60000)+afine.middle_intercept));
}
legendDate.text(timeFormat(X_date,' '));
legendVal.text(formatVal(Y_val));
});
Sensitive.call(zm=d3.behavior.zoom().x(xScale).scaleExtent([1,1000]).on("zoom", function(){
window.clearTimeout(timeoutID);
timeoutID = window.setTimeout(function(){zoom(g)}, 400);
// Update the line path.
// g.select(".line").transition().duration(1000)
// .attr("d", line(data))
// g.select(".x.axis").transition().duration(1000)
// .attr("transform", "translate(-1," + (xPos+12) + ")") // axe tjrs en bas : yScale.range()[0] + ")")
// .call(xAxis);
g.updateCurve()
.drawAxis ();
}));
gEnter.append("g").attr("class", "x axis");
gEnter.append("g").attr("class", "y axis");
// Update the line path.
g.updateCurve()
.drawAxis ()
.selectAll(".y")
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", ".71em")
.style("text-anchor", "end")
.text(toHumanUnit());
} else { // for nude chart
var path = g.updateCurve(line).select(".line");
var totalLength = path.node().getTotalLength();
path
.attr("stroke-dasharray", totalLength + " " + totalLength)
.attr("stroke-dashoffset", totalLength)
.transition()
.duration(2000)
.ease("linear")
.attr("stroke-dashoffset", 0);
var legend = gEnter.append("g")
.attr("class", "legend")
.attr("transform", "translate("+(width - margin.right+2)+",0)")
// .attr("transform", "translate(0,"+(height - margin.bottom +5)+")")
.attr("fill", darkColor);
var legendmax = legend.append('text')
.attr("class","legend_max")
.attr("y", (6))
.text('↑ '+formatVal(toHumanUnit(dataheader.max), 1))
.append('title')
.text('↑ max:'+formatVal(toHumanUnit(dataheader.max), 2));
var legendavg = legend.append('text')
.attr("class","legend_avg")
.attr("y", (height+6)/2)
.text('↔ '+formatVal(toHumanUnit(dataheader.avg), 1))
.append('title')
.text('↔ Average:'+formatVal(toHumanUnit(dataheader.avg), 2));
var legendmin = legend.append('text')
.attr("class","legend_min")
.attr("y", (height-1))
.text('↓ '+formatVal(toHumanUnit(dataheader.min), 1))
.append('title')
.text('↓ min:'+formatVal(toHumanUnit(dataheader.min), 2));
}
// Update the outer dimensions.
// svg .attr("width", width)
// .attr("height", height);
});
}
function zoom(g) {
var ready = false,
dataTsv = false,
zmDomain=xScale.domain();
// on demande les infos importante au sujet de notre futur tracé
// ces infos permettent de finir le parametrage de notre "Chart"
// on charge les données et on lance le tracage
console.TimeStep('Zoom');
d3.tsv( ajaxUrl + "1.tsv?station="+ station +"&sensor="+ sensor +"&XdisplaySizePxl="+width+"&Since="+formatDate(zmDomain[0],'T')+"&To="+formatDate(zmDomain[1],'T'),
function(data2add) {
console.TimeStep('load Data Zoom');
// console.log(data2add);
data2add = data2add.map(function(d, i) {
return {
date:dateParser.call(data2add, d, i),
val:val.call(data2add, d, i)
};
});
data = data.filter(function(element, index, array){
return (element.date<data2add[0].date || element.date>data2add[data2add.length-1].date);
})
.concat(data2add)
.sort(function (a, b) {
return a.date-b.date;
});
if (ready) {
g.updateCurve()
.drawAxis ();
}
ready = true;
dataTsv = data;
}
);
d3.json( ajaxUrl + "1.json?station="+ station +"&sensor="+ sensor +"&XdisplaySizePxl="+width+"&infos=dataheader"+"&Since="+formatDate(zmDomain[0],'T')+"&To="+formatDate(zmDomain[1],'T'),
function(header) {
console.TimeStep('load Header Zoom');
console.log(header);
chart//.yDomain([header.min, header.max])
.dataheader(header);
if (ready) {
g.updateCurve()
.drawAxis ();
}
ready = true;
}
);
}
// The x-accessor for the path generator; xScale ∘ dateParser.
function X(d) {
return xScale(d.date);
}
// The x-accessor for the path generator; yScale ∘ Speed.
function Y(d) {
return yScale(+d.val);
}
function formatVal(v, decimal) {
if (arguments.length<2)
decimal=2;
//console.log(v, (+v).toPrecision(5));
return (+v).toFixed(decimal) +' '+ toHumanUnit();
}
// calcule la regression lineaire sur une srie de donnee
function linearRegression(lst){
var n = lst.length;
var sum_x = 0;
var sum_y = 0;
var sum_xy = 0;
var sum_xx = 0;
var sum_yy = 0;
lst.forEach ( function(d) {
intDate = d.date.getTime()/(60*1000)
sum_x += intDate;
sum_y += d.val;
sum_xy += (intDate*d.val);
sum_xx += (intDate*intDate);
sum_yy += (d.val*d.val);
}
);
slope = (n * sum_xy - sum_x * sum_y) / (n*sum_xx - sum_x * sum_x);
intercept = (sum_y - slope * sum_x)/n;
// console.log(lst, lst[(lst.length-1)/2]);
middle_intercept = -slope*lst[(lst.length-1)/2].date.getTime()/(60*1000)+lst[(lst.length-1)/2].val;
r2 = Math.pow((n*sum_xy - sum_x*sum_y)/Math.sqrt((n*sum_xx-sum_x*sum_x)*(n*sum_yy-sum_y*sum_y)),2);
return {slope:slope, intercept:intercept, middle_intercept:middle_intercept, r2:r2};
}
// ================= Property of chart =================
chart.loader = function(container, callback) {
var ready = false,
dataTsv = false;
// on demande les infos importante au sujet de notre futur tracé
// ces infos permettent de finir le parametrage de notre "Chart"
// on charge les données et on lance le tracage
d3.tsv( ajaxUrl + "0.tsv?station="+ station +"&sensor="+ sensor +"&XdisplaySizePxl="+(width - margin.left - margin.right)+"&Since="+dateDomain[0]+"&To="+dateDomain[1],
function(data) {
// console.TimeStep('load Data');
// console.log(data);
if (ready) {
d3.select(container)
.datum(data)
.call(chart);
if (typeof callback === "function")
callback(chart);
}
ready = true;
dataTsv = data;
}
);
d3.json( ajaxUrl + "0.json?station="+ station +"&sensor="+ sensor +"&XdisplaySizePxl="+(width - margin.left - margin.right)+"&infos=dataheader"+"&Since="+dateDomain[0]+"&To="+dateDomain[1],
function(data) {
// console.TimeStep('load Header');
// console.log(data);
chart
.dataheader(data)
.toHumanUnit(formulaConverter (data.sensor.SEN_MAGNITUDE, data.sensor.SEN_USER_UNIT));
if (dataheader.sensor.SEN_FUNCTION.length>0)
eval(dataheader.sensor.SEN_FUNCTION );
// chart.val(xx);
if (ready) {
// console.log(data);
d3.select(container)
.datum(dataTsv)
.call(chart);
if (typeof callback === "function")
callback(chart);
}
ready = true;
}
);
return chart;
}
// ================= Accesseurs =====================
chart.nude = function(_) {
if (!arguments.length) return nude;
nude = _;
if (_) {
margin = {top: 1, left: 0, bottom: 1, right: 55};
}
return chart;
};
chart.dateParser = function(_) { // genere la fonction de conversion du champ [string]:date en [date]:date
if (!arguments.length) return dateParser;
if (typeof _ === "string") {
timeFormat = d3.time.format(_);
dateParser = function(d) { return timeFormat.parse (d.date); };
} else dateParser = _;
return chart;
};
chart.Color = function(_) {
if (/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(_)) {
darkColor = _;
lightColor = '#c7c7c7';
} else {
darkColor = color(_+'1');
lightColor = color(_+'2');
}
return chart;
};
chart.dateDomain = function(_) {
if (!arguments.length) return dateDomain;
dateDomain = _;
return chart;
};
chart.withAxis = function(_) {
if (!arguments.length) return withAxis;
withAxis = _;
return chart;
};
chart.trend = function(_) {
if (!arguments.length) return trend;
trend = _;
return chart;
};
chart.margin = function(_) {
if (!arguments.length) return margin;
margin = _;
return chart;
};
chart.width = function(_) {
if (!arguments.length) return width;
width = _;
return chart;
};
chart.height = function(_) {
if (!arguments.length) return height;
height = _;
return chart;
};
chart.val = function(_) {
console.log(_);
if (!arguments.length) return val;
val = _;
return chart;
};
chart.ajaxUrl = function(_) {
if (!arguments.length) return ajaxUrl;
ajaxUrl = _;
return chart;
};
chart.station = function(_) {
if (!arguments.length) return station;
station = _;
return chart;
};
chart.sensor = function(_) {
if (!arguments.length) return sensor;
sensor = _;
return chart;
};
chart.dataheader = function(_) {
if (!arguments.length) return dataheader;
dataheader = _;
return chart;
};
chart.sensor = function(_) {
if (!arguments.length) return sensor;
sensor = _;
return chart;
};
chart.toHumanUnit = function(_) {
if (!arguments.length) return toHumanUnit;
toHumanUnit = _;
return chart;
};
chart.toHumanDate = function(_) {
if (!arguments.length) return toHumanDate;
toHumanDate = _;
return chart;
};
return chart;
}
{
"auto_complete":
{
"selected_items":
[
[
"va",
"valDown"
],
[
"sen",
"sensor_lst"
],
[
"jso",
"json_decode"
],
[
"for",
"foreach foreach …"
],
[
"dat",
"dataHeader"
],
[
"a",
"append"
],
[
"cal",
"callback"
],
[
"date",
"dateDomain"
],
[
"st",
"stationsConf"
],
[
"var_",
"var_export"
],
[
"lengt",
"length-1"
],
[
"y",
"yScale"
],
[
"selec",
"selectAll"
],
[
"hover",
"hoverBox"
],
[
"step",
"stepPointBox"
],
[
"data",
"data2add"
],
[
"du",
"duration"
],
[
"sele",
"selectAll"
],
[
"se",
"selectAll"
],
[
"max",
"maxDate"
],
[
"Real",
"realLag"
],
[
"fun",
"function"
]
]
},
"buffers":
[
],
"build_system": "",
"command_palette":
{
"height": 201.0,
"selected_items":
[
[
"snippet",
"Snippet: for (…) {…} (Improved Native For-Loop)"
]
],
"width": 575.0
},
"console":
{
"height": 0.0,
"history":
[
]
},
"distraction_free":
{
"menu_visible": true,
"show_minimap": false,
"show_open_files": false,
"show_tabs": false,
"side_bar_visible": false,
"status_bar_visible": false
},
"file_history":
[
"/var/www/Gist/8105667/README.md",
"/var/www/Probe/resources/js/libs/THSW.js",
"/var/www/Probe/application/views/d3/curves.php",
"/var/www/Probe/application/views/d3/global.php",
"/var/www/Probe/application/models/dao/dao_data.php",
"/var/www/Probe/application/libraries/Log.php",
"/var/www/Probe/resources/js/libs/suncalc.js",
"/home/sctfic/Downloads/data (16).tsv",
"/var/www/Probe/system/helpers/download_helper.php",
"/home/sctfic/Downloads/data (13).tsv",
"/home/sctfic/Downloads/data (12).tsv",
"/home/sctfic/Downloads/data (11).tsv",
"/home/sctfic/Downloads/data (10).tsv",
"/home/sctfic/Downloads/data (9).tsv",
"/home/sctfic/Downloads/data (8).tsv",
"/home/sctfic/Downloads/data (6).tsv",
"/home/sctfic/Downloads/data (7).tsv",
"/home/sctfic/Downloads/data (5).tsv",
"/var/www/Probe/logs/log-2013-11-22.php",
"/var/www/Probe/resources/js/libs/sunphase.js",
"/var/www/Probe/resources/js/libs/moonPhase.js",
"/var/www/Probe/application/models/sql/histoWind.sql",
"/var/www/Probe/application/models/sql/station.sql",
"/var/www/Probe/resources/js/binders/histoRose.js",
"/var/www/Probe/logs/cron.log",
"/var/www/Probe/resources/js/libs/DewPoint.js",
"/var/www/Probe/resources/js/binders/global.js",
"/var/www/Probe/application/helpers/cli_tools_helper.php",
"/var/www/Probe/resources/js/binders/barChart.js",
"/var/www/Probe/resources/js/ProbeTools.js",
"/home/sctfic/Downloads/data (15).json",
"/home/sctfic/Downloads/data (12).json",
"/home/sctfic/Downloads/data (13).json",
"/home/sctfic/Downloads/data (14).json",
"/home/sctfic/Downloads/data (11).json",
"/home/sctfic/Downloads/data (10).json",
"/home/sctfic/Downloads/data (15).tsv",
"/home/sctfic/Downloads/data (14).tsv",
"/home/sctfic/Downloads/data (9).json",
"/home/sctfic/Downloads/data (8).json",
"/home/sctfic/Downloads/data (7).json",
"/var/www/Probe/logs/log-2013-11-12.php",
"/home/sctfic/Downloads/data (6).json",
"/home/sctfic/Downloads/data (5).json",
"/home/sctfic/Downloads/data (4).tsv",
"/home/sctfic/Downloads/data (2).tsv",
"/home/sctfic/Downloads/data (4).json",
"/home/sctfic/Downloads/data (2).json",
"/var/www/Probe/log-SETTIME-2013-11-07.php",
"/var/www/Probe/logs/log-2013-11-06.php",
"/var/www/Probe/logs/log-2013-11-05.php",
"/var/www/Probe/log-SETTIME-2013-11-05.php",
"/var/www/Probe/application/libraries/I18n.php",
"/var/www/Probe/round_date.php",
"/var/www/Probe/logs/log-2013-11-04.php",
"/var/www/Probe/system/core/Common.php",
"/var/www/Probe/log-SETTIME-2013-11-04.php",
"/var/www/Probe/resources/js/binders/curves.js",
"/var/www/Probe/application/views/d3/histoRose.php",
"/var/www/Probe/application/views/d3/wind.php",
"/var/www/Probe/application/views/d3/histoWind.php",
"/var/www/Probe/resources/js/binders/histoWind.js",
"/var/www/Probe/resources/js/binders/wind.js",
"/var/www/Probe/application/views/d3/barChart.php",
"/var/www/Probe/application/controllers/data.php",
"/var/www/Probe/application/models/vp2/EepromDumpAfter.h.php",
"/var/www/Probe/data/VP2_GTD/LOOP.php",
"/var/www/Probe/data/VP2_GTD/LOOP2.php",
"/var/www/Probe/application/helpers/s.i.converter_helper.php",
"/var/www/Probe/data/VP2_GTD/LOOP.json",
"/var/www/Probe/data/VP2_GTD/LOOP2.json",
"/var/www/Probe/application/controllers/viewer.php",
"/var/www/Probe/application/models/station.php",
"/var/www/Probe/application/controllers/cmd.php",
"/var/www/Probe/system/core/Model.php",
"/var/www/Probe/application/controllers/configuration.php",
"/var/www/Probe/application/views/configuration/list-stations.php",
"/var/www/Probe/application/models/vp2.php",
"/var/www/Probe/application/views/configuration/stations-form.php",
"/var/www/Probe/application/models/sql/wind.sql",
"/var/www/Probe/resources/js/libs/base64.js",
"/var/www/Probe/application/views/d3/bracketChart.php",
"/home/sctfic/Downloads/data (3).json",
"/home/sctfic/Downloads/data (3).tsv",
"/var/www/Probe/logs/log-2013-10-29.php",
"/var/www/Probe/application/libraries/Page_manager.php",
"/var/www/Probe/application/views/templates/js-libs.php",
"/var/www/Probe/logs/log-2013-10-28.php",
"/var/www/Probe/application/views/templates/list-viewer.php",
"/var/www/Probe/application/config/routes.php",
"/home/sctfic/.conkyrc",
"/home/sctfic/.conky/conky_red.lua",
"/home/sctfic/.cache/.fr-oJ5je0/conky-manager-bzr/conky-manager-bzr.install",
"/home/sctfic/.cache/.fr-8b1WjJ/conky-manager-bzr/PKGBUILD",
"/home/sctfic/.conkyrc2",
"/var/www/Probe/application/config/db-default.php",
"/var/www/Probe/application/views/templates/footer.php",
"/var/www/Probe/application/views/d3/windrose.php",
"/var/www/Probe/application/models/db_builder.php",
"/var/www/Probe/application/models/vp2/EepromDumpAfter.json",
"/home/sctfic/Downloads/data.tsv",
"/home/sctfic/Downloads/TR_CONFIG (2).csv",
"/home/sctfic/Downloads/TR_CONFIG.csv",
"/home/sctfic/Downloads/TR_CONFIG (1).csv",
"/var/www/Probe/resources/js/binders/exemple.js",
"/var/www/Probe/resources/js/binders/SmartCurve.js",
"/var/www/Probe/application/config/database.php",
"/var/www/Probe/application/models/vp2/EepromLoop2.h.php",
"/var/www/Probe/application/models/vp2/EepromLoop.h.php",
"/var/www/Probe/application/views/d3/SmartCurve.php",
"/var/www/Probe/application/views/d3/exemple.php",
"/var/www/Probe/resources/css/probe.css",
"/home/sctfic/.config/sublime-text-3/Packages/User/probe-meteo.sublime-snippet",
"/var/www/Probe/application/views/templates/breadcrumb.php",
"/var/www/Probe/application/views/templates/header.php"
],
"find":
{
"height": 35.0
},
"find_in_files":
{
"height": 93.0,
"where_history":
[
""
]
},
"find_state":
{
"case_sensitive": false,
"find_history":
[
"bisector",
"base64",
"line",
"force_download",
"xPos",
"dataheader",
"</path>",
"innerRadius",
"eval",
"C_OFFSET",
"dewPoint",
"C_OFFSET",
"filter",
"str2id(d.SEN_NAME)",
"dataheader",
"forecast",
"yAxis",
"formatVal",
"call",
"axis",
"fsockopen",
"file_put_contents",
"fsockopen",
"conf\\['.*\\:.*\\:.*'\\]",
"conf['.*:.*:.*']",
"conf\\[\\'.*:.*:.*\\'\\]",
"strtolower",
"lower(",
"Time:Archive:Period",
"$confs[$item]",
"SETTIME",
"fetchStationTime",
"VerifAnswersAndCRC",
"CalculateCRC",
"SETTIME",
"_log_path",
"write_log",
"n log_message",
"is_date",
"fetchStationTime",
"VerifAnswersAndCRC",
"is_date",
"open-connexion",
"TA:",
"toHumanUnit",
"dateParser",
".attr(\"class\", \"arrow\")",
"arrowhead",
"stroke",
"nude",
"BarChar",
"Color",
".log(",
"formatV",
"callback",
"dataheader",
"title",
"barChart",
"formatVal",
"range",
"sensitive",
"rect",
"width",
"color(",
"dateDomain",
"color(",
"dataheader",
"formatVal",
"toHumanUnit",
"nude",
"ET_h",
",\"",
"\\\",\\\"",
"someDate",
"val(",
"toHumanUnit",
"margin",
"station->config",
"config(",
"list-stations.php",
"list-station.php",
"list-statio",
"stations-form",
"Base64",
"base64",
",\"",
"\\},\\{",
"},{",
"dao_data",
"SELECT SEN_NAME",
"dateParser",
"loader",
"dataheader",
"$dataBinder",
"list-viewer",
"${goto 90}",
"30,60",
"x=85",
"HDD",
"txt_size=",
"color 32",
"${color }",
"class=\"SmallCurve",
"list-viewser",
"js-libs",
"probeViewer()",
"<td></td>\n </tr>",
" <span class=\"SmallCurve\" style=\"width:100px\">\n",
"<td class=\"tg-center\">",
"tg-center\">",
"meanDate",
"new date",
"yScale.domain",
"stepBarBox",
"updateCurve",
"PetalsBox",
"stepPetalsBox",
"stepPointBox",
"5px",
".domain",
"exten",
"line",
"updateCurve",
"clockSync",
"updateStationTime",
"\\[\\n\\t\\t\\tNULL,\\n\\t\\t\\tNULL\\n\\t\\t\\],",
");\n",
"getComputedTextLength"
],
"highlight": true,
"in_selection": false,
"preserve_case": false,
"regex": false,
"replace_history":
[
"273.15",
"ArrowChart",
"chart",
"ET1000",
",\\t\\n\"",
"\",\\n\"",
"Day_",
",\\n\\t\\t\"",
"\\t\\t,\\n\"",
"},\\n{",
"${color 32}",
"dateParser",
"\"domain\":[\\n\\t\\t\\t-32767,\\n\\t\\t\\t65535\\n\\t\\t],",
"\"domain\":[\\n\\t\\t\\t-32700\\t\\t\\t65535\\n\\t\\t],",
"\"domain\":[\\n\\t\\t\\t$1\\t\\t\\t$2\\n\\t\\t],",
"\"accesors\":{\\n\\t\\t\\t$1\\t$2\\n\\t\\t},",
"\"eeprom\":{\\n\\t\\t\\t$1\\t$2\\n\\t\\t},",
"\"eeprom\":{\\n\\t\\t\\t$1\\t$2\\n},",
"\"eeprom\":{\\n\\t\\t\\t$1},",
"\"eeprom\":{\\t\\t\\t$1},",
"\"",
"\\n\\t\\},\\n",
":",
"':{\\n",
"\\n\\},\\n\\t'",
"\\t\\t",
",\\n\\t\\t'",
",\\n'",
"{\\n\\t\\t$1\\n},\\n",
"{\\n$1\\n},\\n"
],
"reverse": false,
"show_context": true,
"use_buffer2": true,
"whole_word": false,
"wrap": true
},
"groups":
[
{
"sheets":
[
]
}
],
"incremental_find":
{
"height": 21.0
},
"input":
{
"height": 0.0
},
"layout":
{
"cells":
[
[
0,
0,
1,
1
]
],
"cols":
[
0.0,
1.0
],
"rows":
[
0.0,
1.0
]
},
"menu_visible": true,
"project": "curve.sublime-project",
"replace":
{
"height": 40.0
},
"save_all_on_build": true,
"select_file":
{
"height": 0.0,
"selected_items":
[
[
"curve",
"resources/js/binders/curve.js"
],
[
".sql",
"application/models/sql/station.sql"
],
[
"glo",
"resources/js/binders/global.js"
],
[
"sql",
"application/models/sql/histoWind.sql"
],
[
"hist",
"resources/js/binders/histoWind.js"
],
[
"sun",
"resources/js/libs/suncalc.js"
],
[
"log.",
"application/libraries/Log.php"
],
[
"dao",
"application/models/dao/dao_data.php"
],
[
"glob",
"application/views/d3/global.php"
],
[
"moon",
"resources/js/libs/moonPhase.js"
],
[
"curves",
"application/views/d3/curves.php"
],
[
"tool",
"resources/js/ProbeTools.js"
],
[
"histor",
"resources/js/binders/histoRose.js"
],
[
"histo",
"application/views/d3/histoRose.php"
],
[
"data",
"application/controllers/data.php"
],
[
"barc",
"resources/js/binders/barChart.js"
],
[
"cur",
"resources/js/binders/curves.js"
],
[
"eep",
"application/models/vp2/EepromDumpAfter.h.php"
],
[
"wind",
"application/views/d3/wind.php"
],
[
"dao_d",
"application/models/dao/dao_data.php"
],
[
"bar",
"application/views/d3/barChart.php"
],
[
"ee",
"application/models/vp2/EepromDumpAfter.h.php"
],
[
"stat",
"application/models/station.php"
],
[
"model",
"system/core/Model.php"
],
[
"configuration",
"application/controllers/configuration.php"
],
[
"stations-form",
"application/views/configuration/stations-form.php"
],
[
"base64",
"resources/js/libs/base64.js"
],
[
"list",
"application/views/templates/list-viewer.php"
],
[
"page",
"application/libraries/Page_manager.php"
],
[
"js-l",
"application/views/templates/js-libs.php"
],
[
"win",
"resources/js/binders/wind.js"
],
[
"viewer",
"application/controllers/viewer.php"
],
[
"rou",
"application/config/routes.php"
],
[
"db-",
"application/config/db-default.php"
],
[
"footer",
"application/views/templates/footer.php"
],
[
"curv",
"application/views/d3/curves.php"
],
[
"list-v",
"application/views/templates/list-viewer.php"
],
[
"vp2",
"application/models/vp2.php"
],
[
"data.",
"application/controllers/data.php"
],
[
"his",
"resources/js/binders/histoWind.js"
],
[
"histow",
"application/views/d3/histoWind.php"
],
[
"histw",
"resources/js/binders/histoWind.js"
],
[
"tools",
"resources/js/ProbeTools.js"
],
[
"exem",
"resources/js/binders/exemple.js"
],
[
"smart",
"resources/js/binders/SmartCurve.js"
],
[
"wind.p",
"application/views/d3/wind.php"
],
[
"exe",
"resources/js/binders/exemple.js"
],
[
"css",
"resources/css/probe.css"
],
[
"eeprom",
"application/models/vp2/EepromLoop2.h.php"
],
[
"eepr",
"application/models/vp2/EepromDumpAfter.h.php"
],
[
"breadcrumb",
"application/views/templates/breadcrumb.php"
],
[
"js-li",
"application/views/templates/js-libs.php"
],
[
"page_manager",
"application/libraries/Page_manager.php"
],
[
"foo",
"application/views/templates/footer.php"
],
[
"head",
"application/views/templates/header.php"
],
[
"rout",
"application/config/routes.php"
],
[
"s.i.converter_helper.php",
"application/helpers/s.i.converter_helper.php"
]
],
"width": 0.0
},
"select_project":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"select_symbol":
{
"height": 0.0,
"selected_items":
[
],
"width": 0.0
},
"settings":
{
},
"show_minimap": true,
"show_open_files": false,
"show_tabs": true,
"side_bar_visible": true,
"side_bar_width": 70.0,
"status_bar_visible": true,
"template_settings":
{
}
}
{"ISS":{"lat":44.5,"lon":0.3,"alt":73.15,"name":"VP2_GTD","id":0,"wCup":1,"rConv":0.2},"sensor":{"SEN_ID":12,"SEN_NAME":"TA:Arch:Various:Wind:SpeedAvg","SEN_HUMAN_NAME":"HUMAN NAME is more than TA:Arch:Various:Wind:SpeedAvg","SEN_MAGNITUDE":"WindSpeed","SEN_ENGINE_UNIT":"m\/s","SEN_USER_UNIT":"km\/h","SEN_DESCRIPTIF":"DESCRIPT","SEN_MIN_REALISTIC":0,"SEN_MAX_REALISTIC":65000,"SEN_DEF_PLOT":"standard","SEN_MAX_ALARM":32000,"SEN_MIN_ALARM":0,"SEN_LAST_CALIBRATE":"2013-05-09","SEN_CALIBRATE_PERIOD":"P0Y6M0DT0H0M0S"},"step":256.08190709046,"lastValue":1.788,"first":"2013-05-21 03:10:00","last":"2013-10-13 14:25:00","count":41805,"min":0,"max":7.5999999046326,"avg":1.1458968759339,"sum":47904.218898416}
date val
2013-05-21 03:06 0.52
2013-05-21 07:22 1.13
2013-05-21 11:38 1.45
2013-05-21 15:54 1.51
2013-05-21 20:10 2.32
2013-05-22 00:26 2.47
2013-05-22 04:42 2.17
2013-05-22 08:58 2.05
2013-05-22 13:15 3.72
2013-05-22 17:31 3.00
2013-05-22 21:47 1.23
2013-05-23 02:03 2.11
2013-05-23 06:19 0.74
2013-05-23 10:35 4.58
2013-05-23 14:51 5.62
2013-05-23 19:07 3.83
2013-05-23 23:23 1.37
2013-05-24 03:39 0.59
2013-05-24 07:55 1.38
2013-05-24 12:11 2.97
2013-05-24 16:28 4.56
2013-05-24 20:44 2.30
2013-05-25 01:00 2.80
2013-05-25 05:16 1.37
2013-05-25 09:32 4.78
2013-05-25 13:48 5.24
2013-05-25 18:04 3.62
2013-05-25 22:20 0.52
2013-05-26 02:36 0.42
2013-05-26 06:52 0.22
2013-05-26 11:08 1.31
2013-05-26 15:24 1.48
2013-05-26 19:41 0.73
2013-05-26 23:57 0.22
2013-05-27 04:13 0.28
2013-05-27 08:29 0.67
2013-05-27 12:45 0.85
2013-05-27 17:01 0.69
2013-05-27 21:17 0.34
2013-05-28 01:33 0.83
2013-05-28 05:49 0.92
2013-05-28 10:05 1.99
2013-05-28 14:21 3.59
2013-05-28 18:37 3.10
2013-05-28 22:53 0.86
2013-05-29 03:10 0.94
2013-05-29 07:26 1.12
2013-05-29 11:42 1.87
2013-05-29 15:58 1.64
2013-05-29 20:14 1.42
2013-05-30 00:30 0.28
2013-05-30 04:46 0.42
2013-05-30 09:02 2.38
2013-05-30 13:18 3.06
2013-05-30 17:34 3.48
2013-05-30 21:50 2.66
2013-05-31 02:06 2.78
2013-05-31 06:23 3.02
2013-05-31 10:39 4.16
2013-05-31 14:55 4.21
2013-05-31 19:11 3.68
2013-05-31 23:27 2.62
2013-06-01 03:43 3.10
2013-06-01 07:59 2.70
2013-06-01 12:15 3.54
2013-06-01 16:31 4.22
2013-06-01 20:47 2.97
2013-06-02 01:03 1.93
2013-06-02 05:19 1.38
2013-06-02 09:36 1.81
2013-06-02 13:52 3.19
2013-06-02 18:08 3.18
2013-06-02 22:24 0.30
2013-06-03 02:40 0.39
2013-06-03 06:56 0.73
2013-06-03 11:12 2.61
2013-06-03 15:28 2.88
2013-06-03 19:44 1.35
2013-06-04 00:00 0.42
2013-06-04 04:16 0.30
2013-06-04 08:32 1.04
2013-06-04 12:49 2.23
2013-06-04 17:05 0.55
2013-06-04 21:21 0.39
2013-06-05 01:37 0.15
2013-06-05 05:53 0.15
2013-06-05 10:09 1.80
2013-06-05 14:25 1.45
2013-06-05 18:41 0.81
2013-06-05 22:57 0.65
2013-06-06 03:13 1.31
2013-06-06 07:29 1.67
2013-06-06 11:45 2.54
2013-06-06 16:01 1.60
2013-06-06 20:18 0.96
2013-06-07 00:34 0.46
2013-06-07 04:50 0.09
2013-06-07 09:06 1.05
2013-06-07 13:22 1.38
2013-06-07 17:38 0.38
2013-06-07 21:54 1.26
2013-06-08 02:10 1.76
2013-06-08 06:26 0.32
2013-06-08 10:42 0.73
2013-06-08 14:58 1.64
2013-06-08 19:14 1.41
2013-06-08 23:31 1.73
2013-06-09 03:47 1.92
2013-06-09 08:03 1.07
2013-06-09 12:19 1.00
2013-06-09 16:35 0.79
2013-06-09 20:51 0.81
2013-06-10 01:07 0.37
2013-06-10 05:23 1.63
2013-06-10 09:39 2.22
2013-06-10 13:55 2.07
2013-06-10 18:11 1.76
2013-06-10 22:27 0.33
2013-06-11 02:44 0.04
2013-06-11 07:00 0.18
2013-06-11 11:16 0.77
2013-06-11 15:32 1.52
2013-06-11 19:48 1.04
2013-06-12 00:04 0.15
2013-06-12 04:20 0.27
2013-06-12 08:36 0.60
2013-06-12 12:52 1.02
2013-06-12 17:08 0.76
2013-06-12 21:24 0.64
2013-06-13 01:40 0.18
2013-06-13 05:57 0.95
2013-06-13 10:13 4.09
2013-06-13 14:29 2.31
2013-06-13 18:45 0.39
2013-06-13 23:01 0.07
2013-06-14 03:17 0.21
2013-06-14 07:33 0.75
2013-06-14 11:49 0.97
2013-06-14 16:05 1.08
2013-06-14 20:21 0.81
2013-06-15 00:37 1.10
2013-06-15 04:53 0.56
2013-06-15 09:10 0.80
2013-06-15 13:26 1.45
2013-06-15 17:42 1.35
2013-06-15 21:58 0.39
2013-06-16 02:14 0.14
2013-06-16 06:30 0.20
2013-06-16 10:46 0.96
2013-06-16 15:02 1.39
2013-06-16 19:18 0.74
2013-06-16 23:34 0.82
2013-06-17 03:50 1.81
2013-06-17 08:06 1.87
2013-06-17 12:22 1.93
2013-06-17 16:39 1.21
2013-06-17 20:55 2.02
2013-06-18 01:11 1.73
2013-06-18 05:27 1.47
2013-06-18 09:43 0.61
2013-06-18 13:59 0.91
2013-06-18 18:15 0.58
2013-06-18 22:31 0.88
2013-06-19 02:47 0.89
2013-06-19 07:03 1.34
2013-06-19 11:19 1.49
2013-06-19 15:35 1.62
2013-06-19 19:52 1.56
2013-06-20 00:08 0.49
2013-06-20 04:24 1.61
2013-06-20 08:40 2.33
2013-06-20 12:56 2.51
2013-06-20 17:12 2.79
2013-06-20 21:28 0.93
2013-06-21 01:44 0.95
2013-06-21 06:00 0.66
2013-06-21 10:16 0.99
2013-06-21 14:32 1.51
2013-06-21 18:48 1.70
2013-06-21 23:05 0.48
2013-06-22 03:21 0.39
2013-06-22 07:37 0.71
2013-06-22 11:53 1.53
2013-06-22 16:09 2.32
2013-06-22 20:25 1.70
2013-06-23 00:41 1.62
2013-06-23 04:57 1.18
2013-06-23 09:13 2.36
2013-06-23 13:29 4.05
2013-06-23 17:45 4.19
2013-06-23 22:01 0.85
2013-06-24 02:18 0.16
2013-06-24 06:34 0.25
2013-06-24 10:50 1.97
2013-06-24 15:06 2.22
2013-06-24 19:22 1.05
2013-06-24 23:38 0.46
2013-06-25 03:54 0.20
2013-06-25 08:10 1.10
2013-06-25 12:26 1.68
2013-06-25 16:42 1.97
2013-06-25 20:58 0.64
2013-06-26 01:14 0.43
2013-06-26 05:31 0.24
2013-06-26 09:47 1.56
2013-06-26 14:03 1.92
2013-06-26 18:19 2.04
2013-06-26 22:35 0.25
2013-06-27 02:51 0.32
2013-06-27 07:07 0.70
2013-06-27 11:23 2.02
2013-06-27 15:39 2.85
2013-06-27 19:55 1.40
2013-06-28 00:11 0.88
2013-06-28 04:27 0.28
2013-06-28 08:43 1.95
2013-06-28 13:00 3.72
2013-06-28 17:16 3.55
2013-06-28 21:32 2.59
2013-06-29 01:48 2.02
2013-06-29 06:04 1.44
2013-06-29 10:20 2.66
2013-06-29 14:36 3.69
2013-06-29 18:52 3.33
2013-06-29 23:08 1.24
2013-06-30 03:24 0.67
2013-06-30 07:40 0.32
2013-06-30 11:56 1.00
2013-06-30 16:13 1.58
2013-06-30 20:29 0.55
2013-07-01 00:45 0.49
2013-07-01 05:01 0.05
2013-07-01 09:17 0.68
2013-07-01 13:33 1.08
2013-07-01 17:49 1.10
2013-07-01 22:05 0.33
2013-07-02 02:21 0.28
2013-07-02 06:37 0.99
2013-07-02 10:53 1.22
2013-07-02 15:09 1.16
2013-07-02 19:26 3.02
2013-07-02 23:42 1.53
2013-07-03 03:58 0.54
2013-07-03 08:14 1.13
2013-07-03 12:30 2.76
2013-07-03 16:46 2.76
2013-07-03 21:02 2.04
2013-07-04 01:18 1.61
2013-07-04 05:34 0.47
2013-07-04 09:50 1.22
2013-07-04 14:06 1.70
2013-07-04 18:22 1.75
2013-07-04 22:39 0.21
2013-07-05 02:55 0.21
2013-07-05 07:11 0.53
2013-07-05 11:27 1.47
2013-07-05 15:43 1.94
2013-07-05 19:59 1.06
2013-07-06 00:15 0.48
2013-07-06 04:31 0.04
2013-07-06 08:47 0.64
2013-07-06 13:03 1.70
2013-07-06 17:19 1.59
2013-07-06 21:35 0.53
2013-07-07 01:52 0.37
2013-07-07 06:08 0.42
2013-07-07 10:24 1.09
2013-07-07 14:40 1.61
2013-07-07 18:56 0.79
2013-07-07 23:12 0.28
2013-07-08 03:28 0.17
2013-07-08 07:44 0.26
2013-07-08 12:00 0.73
2013-07-08 16:16 1.00
2013-07-08 20:32 0.51
2013-07-09 00:48 0.36
2013-07-09 05:04 0.11
2013-07-09 09:21 1.31
2013-07-09 13:37 0.95
2013-07-09 17:53 0.59
2013-07-09 22:09 0.47
2013-07-10 02:25 0.42
2013-07-10 06:41 0.35
2013-07-10 10:57 0.80
2013-07-10 15:13 1.05
2013-07-10 19:29 0.78
2013-07-10 23:45 0.36
2013-07-11 04:01 0.37
2013-07-11 08:17 0.64
2013-07-11 12:34 1.12
2013-07-11 16:50 1.61
2013-07-11 21:06 0.40
2013-07-12 01:22 0.45
2013-07-12 05:38 0.48
2013-07-12 09:54 0.70
2013-07-12 14:10 1.14
2013-07-12 18:26 1.04
2013-07-12 22:42 0.43
2013-07-13 02:58 0.18
2013-07-13 07:14 0.63
2013-07-13 11:30 1.21
2013-07-13 15:47 2.30
2013-07-13 20:03 1.42
2013-07-14 00:19 0.28
2013-07-14 04:35 0.13
2013-07-14 08:51 0.67
2013-07-14 13:07 1.05
2013-07-14 17:23 1.04
2013-07-14 21:39 0.38
2013-07-15 01:55 0.32
2013-07-15 06:11 0.30
2013-07-15 10:27 0.83
2013-07-15 14:43 1.20
2013-07-15 19:00 1.00
2013-07-15 23:16 0.52
2013-07-16 03:32 0.20
2013-07-16 07:48 0.45
2013-07-16 12:04 1.03
2013-07-16 16:20 1.45
2013-07-16 20:36 0.57
2013-07-17 00:52 0.53
2013-07-17 05:08 0.50
2013-07-17 09:24 1.17
2013-07-17 13:40 1.38
2013-07-17 17:56 0.74
2013-07-17 22:13 0.24
2013-07-18 02:29 0.14
2013-07-18 06:45 0.71
2013-07-18 11:01 1.32
2013-07-18 15:17 1.61
2013-07-18 19:33 0.48
2013-07-18 23:49 0.31
2013-07-19 04:05 0.12
2013-07-19 08:21 0.42
2013-07-19 12:37 1.07
2013-07-19 16:53 1.09
2013-07-19 21:09 0.24
2013-07-20 01:25 0.31
2013-07-20 05:42 0.95
2013-07-20 09:58 1.67
2013-07-20 14:14 1.69
2013-07-20 18:30 0.67
2013-07-20 22:46 0.56
2013-07-21 03:02 0.99
2013-07-21 07:18 0.91
2013-07-21 11:34 1.88
2013-07-21 15:50 1.44
2013-07-21 20:06 0.85
2013-07-22 00:22 0.74
2013-07-22 04:38 1.04
2013-07-22 08:55 0.71
2013-07-22 13:11 1.03
2013-07-22 17:27 0.53
2013-07-22 21:43 0.37
2013-07-23 01:59 0.32
2013-07-23 06:15 0.66
2013-07-23 10:31 0.85
2013-07-23 14:47 2.15
2013-07-23 19:03 2.44
2013-07-23 23:19 0.97
2013-07-24 03:35 0.30
2013-07-24 07:51 0.33
2013-07-24 12:08 0.95
2013-07-24 16:24 0.96
2013-07-24 20:40 0.33
2013-07-25 00:56 0.17
2013-07-25 05:12 0.00
2013-07-25 09:28 0.07
2013-07-25 13:44 1.17
2013-07-25 18:00 0.85
2013-07-25 22:16 0.55
2013-07-26 02:32 1.93
2013-07-26 06:48 0.51
2013-07-26 11:04 1.03
2013-07-26 15:21 1.47
2013-07-26 19:37 0.63
2013-07-26 23:53 1.03
2013-07-27 04:09 0.51
2013-07-27 08:25 1.17
2013-07-27 12:41 2.36
2013-07-27 16:57 3.58
2013-07-27 21:13 1.03
2013-07-28 01:29 0.25
2013-07-28 05:45 0.11
2013-07-28 10:01 0.97
2013-07-28 14:17 1.99
2013-07-28 18:33 2.57
2013-07-28 22:50 0.89
2013-07-29 03:06 0.61
2013-07-29 07:22 0.51
2013-07-29 11:38 1.62
2013-07-29 15:54 3.29
2013-07-29 20:10 2.47
2013-07-30 00:26 0.33
2013-07-30 04:42 0.15
2013-07-30 08:58 0.70
2013-07-30 13:14 1.19
2013-07-30 17:30 1.37
2013-07-30 21:46 0.61
2013-07-31 02:03 0.56
2013-07-31 06:19 0.17
2013-07-31 10:35 2.08
2013-07-31 14:51 1.99
2013-07-31 19:07 1.40
2013-07-31 23:23 1.49
2013-08-01 03:39 1.46
2013-08-01 07:55 2.68
2013-08-01 12:11 2.65
2013-08-01 16:27 2.67
2013-08-01 20:43 1.97
2013-08-02 00:59 2.66
2013-08-02 05:16 0.89
2013-08-02 09:32 0.75
2013-08-02 13:48 1.10
2013-08-02 18:04 1.02
2013-08-02 22:20 2.90
2013-08-03 02:36 1.88
2013-08-03 06:52 0.64
2013-08-03 11:08 2.41
2013-08-03 15:24 2.44
2013-08-03 19:40 3.13
2013-08-03 23:56 0.96
2013-08-04 04:12 0.71
2013-08-04 08:29 0.85
2013-08-04 12:45 1.70
2013-08-04 17:01 1.88
2013-08-04 21:17 0.95
2013-08-05 01:33 0.32
2013-08-05 05:49 0.34
2013-08-05 10:05 0.89
2013-08-05 14:21 3.62
2013-08-05 18:37 3.77
2013-08-05 22:53 1.09
2013-08-06 03:09 0.73
2013-08-06 07:25 1.40
2013-08-06 11:42 2.11
2013-08-06 15:58 2.20
2013-08-06 20:14 2.03
2013-08-07 00:30 1.32
2013-08-07 04:46 0.20
2013-08-07 09:02 0.52
2013-08-07 13:18 0.51
2013-08-07 17:34 2.50
2013-08-07 21:50 0.46
2013-08-08 02:06 0.11
2013-08-08 06:22 0.21
2013-08-08 10:38 0.99
2013-08-08 14:54 2.79
2013-08-08 19:11 2.18
2013-08-08 23:27 0.09
2013-08-09 03:43 0.25
2013-08-09 07:59 0.35
2013-08-09 12:15 1.58
2013-08-09 16:31 2.93
2013-08-09 20:47 1.59
2013-08-10 01:03 0.14
2013-08-10 05:19 0.09
2013-08-10 09:35 0.60
2013-08-10 13:51 1.76
2013-08-10 18:07 2.11
2013-08-10 22:24 0.43
2013-08-11 02:40 0.18
2013-08-11 06:56 0.00
2013-08-11 11:12 0.89
2013-08-11 15:28 1.38
2013-08-11 19:44 0.91
2013-08-12 00:00 0.52
2013-08-12 04:16 0.24
2013-08-12 08:32 0.38
2013-08-12 12:48 1.36
2013-08-12 17:04 2.91
2013-08-12 21:20 1.24
2013-08-13 01:37 0.40
2013-08-13 05:53 0.47
2013-08-13 10:09 1.49
2013-08-13 14:25 2.78
2013-08-13 18:41 3.04
2013-08-13 22:57 0.44
2013-08-14 03:13 0.24
2013-08-14 07:29 0.36
2013-08-14 11:45 1.45
2013-08-14 16:01 1.96
2013-08-14 20:17 1.38
2013-08-15 00:33 0.14
2013-08-15 04:50 0.28
2013-08-15 09:06 0.57
2013-08-15 13:22 1.35
2013-08-15 17:38 0.56
2013-08-15 21:54 0.47
2013-08-16 02:10 0.18
2013-08-16 06:26 0.00
2013-08-16 10:42 0.52
2013-08-16 14:58 1.46
2013-08-16 19:14 1.79
2013-08-16 23:30 1.26
2013-08-17 03:46 0.24
2013-08-17 08:03 0.47
2013-08-17 12:19 1.19
2013-08-17 16:35 1.57
2013-08-17 20:51 0.83
2013-08-18 01:07 0.31
2013-08-18 05:23 0.04
2013-08-18 09:39 0.44
2013-08-18 13:55 1.16
2013-08-18 18:11 1.81
2013-08-18 22:27 1.01
2013-08-19 02:43 0.30
2013-08-19 06:59 0.58
2013-08-19 11:15 1.85
2013-08-19 15:32 2.67
2013-08-19 19:48 1.86
2013-08-20 00:04 0.21
2013-08-20 04:20 0.17
2013-08-20 08:36 0.46
2013-08-20 12:52 1.75
2013-08-20 17:08 1.88
2013-08-20 21:24 0.67
2013-08-21 01:40 0.09
2013-08-21 05:56 0.13
2013-08-21 10:12 0.76
2013-08-21 14:28 1.22
2013-08-21 18:45 0.80
2013-08-21 23:01 0.45
2013-08-22 03:17 0.03
2013-08-22 07:33 0.07
2013-08-22 11:49 1.64
2013-08-22 16:05 1.14
2013-08-22 20:21 0.58
2013-08-23 00:37 0.92
2013-08-23 04:53 0.96
2013-08-23 09:09 0.81
2013-08-23 13:25 0.98
2013-08-23 17:41 0.74
2013-08-23 21:58 0.33
2013-08-24 02:14 0.88
2013-08-24 06:30 0.19
2013-08-24 10:46 2.59
2013-08-24 15:02 4.81
2013-08-24 19:18 3.59
2013-08-24 23:34 0.78
2013-08-25 03:50 0.09
2013-08-25 08:06 0.20
2013-08-25 12:22 1.42
2013-08-25 16:38 1.14
2013-08-25 20:54 0.80
2013-08-26 01:11 0.55
2013-08-26 05:27 0.19
2013-08-26 09:43 0.55
2013-08-26 13:59 1.26
2013-08-26 18:15 0.89
2013-08-26 22:31 0.36
2013-08-27 02:47 0.22
2013-08-27 07:03 0.15
2013-08-27 11:19 1.01
2013-08-27 15:35 2.66
2013-08-27 19:51 2.14
2013-08-28 00:07 0.27
2013-08-28 04:24 0.07
2013-08-28 08:40 0.18
2013-08-28 12:56 1.78
2013-08-28 17:12 2.22
2013-08-28 21:28 0.39
2013-08-29 01:44 0.23
2013-08-29 06:00 0.06
2013-08-29 10:16 0.68
2013-08-29 14:32 1.82
2013-08-29 18:48 1.86
2013-08-29 23:04 0.43
2013-08-30 03:20 0.44
2013-08-30 07:36 0.35
2013-08-30 11:53 1.03
2013-08-30 16:09 2.45
2013-08-30 20:25 1.24
2013-08-31 00:41 0.32
2013-08-31 04:57 0.35
2013-08-31 09:13 0.80
2013-08-31 13:29 1.70
2013-08-31 17:45 2.70
2013-08-31 22:01 0.96
2013-09-01 02:17 0.15
2013-09-01 06:33 0.02
2013-09-01 10:49 0.92
2013-09-01 15:06 2.05
2013-09-01 19:22 2.17
2013-09-01 23:38 0.53
2013-09-02 03:54 0.23
2013-09-02 08:10 0.33
2013-09-02 12:26 1.43
2013-09-02 16:42 1.39
2013-09-02 20:58 0.58
2013-09-03 01:14 0.14
2013-09-03 05:30 0.35
2013-09-03 09:46 0.53
2013-09-03 14:02 1.12
2013-09-03 18:19 0.55
2013-09-03 22:35 0.38
2013-09-04 02:51 0.08
2013-09-04 07:07 0.15
2013-09-04 11:23 1.67
2013-09-04 15:39 1.88
2013-09-04 19:55 0.87
2013-09-05 00:11 1.03
2013-09-05 04:27 0.52
2013-09-05 08:43 1.17
2013-09-05 12:59 1.30
2013-09-05 17:15 1.37
2013-09-05 21:32 0.53
2013-09-06 01:48 0.33
2013-09-06 06:04 0.62
2013-09-06 10:20 1.01
2013-09-06 14:36 1.53
2013-09-06 18:52 2.42
2013-09-06 23:08 1.71
2013-09-07 03:24 0.33
2013-09-07 07:40 0.19
2013-09-07 11:56 1.00
2013-09-07 16:12 1.21
2013-09-07 20:28 0.78
2013-09-08 00:44 0.20
2013-09-08 05:01 0.06
2013-09-08 09:17 1.20
2013-09-08 13:33 1.33
2013-09-08 17:49 1.37
2013-09-08 22:05 0.46
2013-09-09 02:21 0.64
2013-09-09 06:37 0.44
2013-09-09 10:53 1.23
2013-09-09 15:09 1.74
2013-09-09 19:25 1.40
2013-09-09 23:41 0.68
2013-09-10 03:57 0.34
2013-09-10 08:14 0.57
2013-09-10 12:30 2.32
2013-09-10 16:46 3.02
2013-09-10 21:02 1.01
2013-09-11 01:18 0.04
2013-09-11 05:34 0.02
2013-09-11 09:50 0.62
2013-09-11 14:06 2.46
2013-09-11 18:22 2.30
2013-09-11 22:38 0.17
2013-09-12 02:54 0.11
2013-09-12 07:10 0.55
2013-09-12 11:27 1.30
2013-09-12 15:43 1.77
2013-09-12 19:59 0.53
2013-09-13 00:15 0.43
2013-09-13 04:31 0.46
2013-09-13 08:47 0.09
2013-09-13 13:03 0.70
2013-09-13 17:19 1.08
2013-09-13 21:35 0.25
2013-09-14 01:51 0.03
2013-09-14 06:07 0.13
2013-09-14 10:23 0.62
2013-09-14 14:40 1.06
2013-09-14 18:56 0.45
2013-09-14 23:12 2.72
2013-09-15 03:28 2.31
2013-09-15 07:44 0.32
2013-09-15 12:00 1.62
2013-09-15 16:16 1.98
2013-09-15 20:32 0.45
2013-09-16 00:48 0.39
2013-09-16 05:04 0.98
2013-09-16 09:20 1.44
2013-09-16 13:36 2.00
2013-09-16 17:53 2.39
2013-09-16 22:09 0.39
2013-09-17 02:25 0.13
2013-09-17 06:41 0.22
2013-09-17 10:57 1.01
2013-09-17 15:13 2.20
2013-09-17 19:29 1.51
2013-09-17 23:45 0.83
2013-09-18 04:01 0.81
2013-09-18 08:17 0.74
2013-09-18 12:33 2.67
2013-09-18 16:49 2.64
2013-09-18 21:05 2.53
2013-09-19 01:22 0.90
2013-09-19 05:38 0.03
2013-09-19 09:54 1.03
2013-09-19 14:10 2.41
2013-09-19 18:26 1.03
2013-09-19 22:42 0.09
2013-09-20 02:58 0.75
2013-09-20 07:14 0.40
2013-09-20 11:30 1.25
2013-09-20 15:46 2.66
2013-09-20 20:02 1.20
2013-09-21 00:18 0.10
2013-09-21 04:35 0.08
2013-09-21 08:51 0.09
2013-09-21 13:07 0.55
2013-09-21 17:23 0.52
2013-09-21 21:39 0.17
2013-09-22 01:55 0.00
2013-09-22 06:11 0.00
2013-09-22 10:27 0.35
2013-09-22 14:43 0.64
2013-09-22 18:59 0.37
2013-09-22 23:15 0.16
2013-09-23 03:31 0.21
2013-09-23 07:48 0.90
2013-09-23 12:04 1.26
2013-09-23 16:20 1.26
2013-09-23 20:36 0.57
2013-09-24 00:52 0.64
2013-09-24 05:08 0.11
2013-09-24 09:24 1.52
2013-09-24 13:40 0.88
2013-09-24 17:56 0.41
2013-09-24 22:12 0.03
2013-09-25 02:28 0.00
2013-09-25 06:44 0.68
2013-09-25 11:01 1.56
2013-09-25 15:17 0.83
2013-09-25 19:33 0.24
2013-09-25 23:49 0.49
2013-09-26 04:05 0.87
2013-09-26 08:21 1.62
2013-09-26 12:37 1.73
2013-09-26 16:53 0.67
2013-09-26 21:09 1.39
2013-09-27 01:25 1.00
2013-09-27 05:41 0.58
2013-09-27 09:57 1.15
2013-09-27 14:14 0.60
2013-09-27 18:30 0.46
2013-09-27 22:46 1.21
2013-09-28 03:02 1.87
2013-09-28 07:18 1.60
2013-09-28 11:34 2.62
2013-09-28 15:50 1.84
2013-09-28 20:06 1.85
2013-09-29 00:22 0.54
2013-09-29 04:38 0.53
2013-09-29 08:54 1.00
2013-09-29 13:10 1.54
2013-09-29 17:26 0.81
2013-09-29 21:43 0.67
2013-09-30 01:59 0.68
2013-09-30 06:15 0.26
2013-09-30 10:31 0.33
2013-09-30 14:47 0.51
2013-09-30 19:03 0.23
2013-09-30 23:19 0.25
2013-10-01 03:35 0.02
2013-10-01 07:51 0.67
2013-10-01 12:07 1.47
2013-10-01 16:23 1.21
2013-10-01 20:39 0.28
2013-10-02 00:56 0.82
2013-10-02 05:12 0.19
2013-10-02 09:28 0.27
2013-10-02 13:44 0.60
2013-10-02 18:00 0.84
2013-10-02 22:16 1.53
2013-10-03 02:32 3.01
2013-10-03 06:48 3.48
2013-10-03 11:04 2.84
2013-10-03 15:20 3.39
2013-10-03 19:36 3.03
2013-10-03 23:52 1.39
2013-10-04 04:09 2.00
2013-10-04 08:25 0.89
2013-10-04 12:41 1.21
2013-10-04 16:57 1.04
2013-10-04 21:13 1.10
2013-10-05 01:29 1.17
2013-10-05 05:45 0.23
2013-10-05 10:01 0.79
2013-10-05 14:17 1.33
2013-10-05 18:33 0.41
2013-10-05 22:49 0.21
2013-10-06 03:05 0.09
2013-10-06 07:22 0.11
2013-10-06 11:38 0.59
2013-10-06 15:54 2.30
2013-10-06 20:10 0.59
2013-10-07 00:26 0.28
2013-10-07 04:42 0.03
2013-10-07 08:58 0.18
2013-10-07 13:14 1.17
2013-10-07 17:30 1.31
2013-10-07 21:46 0.36
2013-10-08 02:02 0.14
2013-10-08 06:18 0.05
2013-10-08 10:35 0.80
2013-10-08 14:51 2.00
2013-10-08 19:07 0.52
2013-10-08 23:23 0.11
2013-10-09 03:39 0.14
2013-10-09 07:55 0.76
2013-10-09 12:11 1.53
2013-10-09 16:27 0.88
2013-10-09 20:43 0.11
2013-10-10 00:59 0.43
2013-10-10 05:15 0.54
2013-10-10 09:31 2.76
2013-10-10 13:47 3.55
2013-10-10 18:04 1.39
2013-10-10 22:20 0.36
2013-10-11 02:36 0.27
2013-10-11 06:52 0.38
2013-10-11 11:08 1.46
2013-10-11 15:24 1.74
2013-10-11 19:40 0.46
2013-10-11 23:56 1.32
2013-10-12 04:12 1.58
2013-10-12 08:28 1.89
2013-10-12 12:44 1.36
2013-10-12 17:00 0.66
2013-10-12 21:17 0.05
2013-10-13 01:33 0.03
2013-10-13 05:49 0.07
2013-10-13 10:05 0.82
2013-10-13 14:21 1.49
<!--
/** histoWind.php
* D3 binder to visualize <dataset> data
*
* @category D3Binder
* @package Probe
* @author alban lopez <alban.lopez+probe@gmail.com>
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode CC-by-nc-sa-3.0
* @link http://probe.com/doc
*/
-->
<html><head></head><body>
<div id="resizable" class="ui-widget-content">
<h4 class="ui-widget-header">Average Curve Historical Chart</h4>
<p>Today <span id="TodayBarChar">
<!-- d3 content should be -dynamically- placed here -->
</span> graph</p>
<div id="barSvgArea">
<!-- d3 content should be -dynamically- placed here -->
</div>
</div>
<style>
svg {
font-size: 10px;
}
.spot {
fill: none;
stroke-width: 1px;
}
.Dot {
fill: none;
stroke-width: 1px;
}
.spotCircle {
fill: none;
stroke-opacity: .3;
stroke-width: 6px;
}
.legend text {
text-shadow: 0 1px 0 #f0f, 1px 0 0 #f0f, 0 -1px 0 #f0f, -1px 0 0 #f0f;
}
.legend .val, .legend .date {
text-anchor:end;
}
.legend .Infos {
text-anchor:middle;
}
.legend .legend_min, .legend .legend_avg, .legend .legend_max {
font-size: 8px;
}
.sensitive {
opacity: 0;
}
.line {
fill: none;
stroke-width: 1px;
}
.axis line,.axis path {
fill: none;
stroke: #000;
stroke-width: 1px;
shape-rendering: crispEdges;
}
</style>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script src="ProbeTools.js" type="text/javascript"></script>
<script src="curve.js" type="text/javascript"></script>
<script>
var station='station', sensor='sensor';
var Day_1 = new Date();
Day_1.setDate(Day_1.getDate() -1);
var Day_365 = new Date();
Day_365.setDate(Day_365.getDate() -365);
var chartD = timeSeriesChart_curves()
.width(24*4+50)
.height(40)
.ajaxUrl('data')
.dateParser("%Y-%m-%d %H:%M")
.dateDomain([formatDate(Day_1), formatDate(new Date())])
.station(station)
.sensor(sensor)
.toHumanDate(formulaConverter ('strDate', 'ISO'))
.Color()
.nude(true);
chartD.loader("#TodayBarChar");
var chartZoom = timeSeriesChart_curves()
.width($('#barSvgArea').width()-16)
.height(200)
.ajaxUrl('data')
.dateParser("%Y-%m-%d %H:%M")
.dateDomain([formatDate(Day_365), formatDate(new Date())])
.station(station)
.sensor(sensor)
.toHumanDate(formulaConverter ('strDate', 'ISO'))
.Color()
.nude(false);
chartZoom.loader("#barSvgArea");
</script>
</body>
</html>
/** ProbeTools.js
* D3 binder to visualize <dataset> data
*
* @category Tools
* @package Probe
* @author alban lopez <alban.lopez+probe@gmail.com>
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode CC-by-nc-sa-3.0
* @link http://probe.com/doc
*/
function formatDate(value, separator)
{
//toDateString()
if(typeof(separator)==='undefined') separator = 'T';
var dd = value.getDate();
var mm = value.getMonth()+1;//January is 0!
var yyyy = value.getFullYear();
var H = value.getHours();
var m = value.getMinutes()
if(dd<10) dd='0'+dd ;
if(mm<10) mm='0'+mm ;
if(H<10) H='0'+H ;
if(m<10) m='0'+m ;
return yyyy + "-" + mm + "-" + dd + separator + H + ":" + m + ":00";
}
(function() {
var previousStep = Date.now();
// console.debug('[0.000 sec]', 'Initialize( console.TimeStep )');
console.TimeStep = function(msg) {
var step = Date.now()-previousStep;
previousStep = Date.now();
console.debug('['+(step/1000)+' sec]', msg);
}
})();
/**
retourne la fonction de convertion pour obtenir l'unitée souhaitee
* @ Si aucun parametre formulaConverter() retourne la liste des grandeur connue
* @ Si seulement la Grandeur est fournie alors formulaConverter() retourne la liste des unitees possible pour cette grandeur
* @param inputObj:{Type_De_Grandeur, Unité_SI}
* @param
* @exemple: console.log(formulaConverter());
* @exemple: console.log(formulaConverter('Temperature'));
* @exemple: console.log(formulaConverter('Temperature','K'));
*/
function formulaConverter (grandeur, outputUnit)
{
var units = {
WindSpeed:{
// ref: 'http://en.wikipedia.org/wiki/Speed'
'm/s': { name: 'Metres per second', symbol: 'm/s', formula: function(SI){if (!arguments.length) return 'm/s'; return +SI;}}, // ok
'm.s¹': { name: 'Metres per second', symbol: 'm.s¹', formula: function(SI){if (!arguments.length) return 'm.s¹'; return +SI;}}, // ok
'km/h': { name: 'kilometres per hour', symbol: 'km/h', formula: function(SI){if (!arguments.length) return 'km/h'; return 3.6*SI;}}, // ok
'mph': { name: 'miles per hour', symbol: 'mph', formula: function(SI){if (!arguments.length) return 'mph'; return 2.236936*SI;}}, // ok
'mi/h': { name: 'miles per hour', symbol: 'mi/h', formula: function(SI){if (!arguments.length) return 'mi/h'; return 2.236936*SI;}}, // ok
'fps': { name: 'feet per second', symbol: 'fps', formula: function(SI){if (!arguments.length) return 'fps'; return 3.280840*SI;}}, // ok
'ft/s': { name: 'feet per second', symbol: 'ft/s', formula: function(SI){if (!arguments.length) return 'ft/s'; return 3.280840*SI;}}, // ok
'knot': { name: 'Nautical mile', symbol: 'knot', formula: function(SI){if (!arguments.length) return 'knot'; return 1.943844*SI;}}, // ok
'kn': { name: 'Nautical mile', symbol: 'kn', formula: function(SI){if (!arguments.length) return 'kn'; return 1.943844*SI;}}, // ok
'kt': { name: 'Nautical mile', symbol: 'kt', formula: function(SI){if (!arguments.length) return 'kt'; return 1.943844*SI;}}, // ok
},
Temperature:{
// ref:'http://en.wikipedia.org/wiki/Temperature_conversion_formulas',
'K': { name: 'Kelvin', symbol: 'K', formula: function(SI){if (!arguments.length) return 'K'; return +SI;}}, // ok
'°C': { name: 'Celsius', symbol: '°C', formula: function(SI){if (!arguments.length) return '°C'; return SI-273.15;}}, // ok
'°F': { name: 'Fahrenheit', symbol: '°F', formula: function(SI){if (!arguments.length) return '°F'; return SI*9/5-459.67;}}, // ok
'°R': { name: 'Rankine', symbol: '°R', formula: function(SI){if (!arguments.length) return '°R'; return SI*9/5;}}, // ok
'°De': { name: 'Delisle', symbol: '°De', formula: function(SI){if (!arguments.length) return '°De'; return (273.15-SI)*3/2;}}, // ok
'°N': { name: 'Newton', symbol: '°N', formula: function(SI){if (!arguments.length) return '°N'; return (SI-273.15)*33/100;}}, // ok
'°Ré': { name: 'Réaumur', symbol: '°Ré', formula: function(SI){if (!arguments.length) return '°Ré'; return (SI-273.15)*4/5;}}, // ok
'°Rø': { name: 'Rømer', symbol: '°Rø', formula: function(SI){if (!arguments.length) return '°Rø'; return (SI-273.15)*21/40+7.5;}}, // ok
},
Rain:{
'mm': { name: 'Millimeters per hour', symbol: 'mm', formula: function(SI){if (!arguments.length) return 'mm'; return SI;}}, // ok
'l/m²': { name: 'Litre per square metre per hour', symbol: 'l/m²', formula: function(SI){if (!arguments.length) return 'l/m²'; return SI;}}, // ok
'in': { name: 'inch per hour', symbol: 'in', formula: function(SI){if (!arguments.length) return 'in'; return SI/25.4;}}, // ok
},
RainSpeed:{
'mm/h': { name: 'Millimeters per hour', symbol: 'mm/h', formula: function(SI){if (!arguments.length) return 'mm/h'; return +SI;}}, // ok
'l/m²/h': { name: 'Litre per square metre per hour', symbol: 'l/m²/h', formula: function(SI){if (!arguments.length) return 'l/m²/h'; return +SI;}}, // ok
'l/m²/min':{ name: 'Litre per square metre per minute', symbol: 'l/m²/min', formula: function(SI){if (!arguments.length) return 'l/m²/min'; return SI/60;}}, // ok
'mm/min': { name: 'Millimeters per ', symbol: 'mm/min', formula: function(SI){if (!arguments.length) return 'mm/min'; return SI/60;}}, // ok
'in/h': { name: 'inch per hour', symbol: 'in/h', formula: function(SI){if (!arguments.length) return 'in/h'; return SI/25.4;}}, // ok
'in/min': { name: 'inch per minut', symbol: 'in/min', formula: function(SI){if (!arguments.length) return 'in/min'; return SI/25.4/60;}}, // ok
},
Percent:{
'%': { name: 'amount of water vapor', symbol: '%', formula: function(SI){if (!arguments.length) return '%'; return +SI;}}, // ok
},
Pressure:{
// ref: 'http://en.wikipedia.org/wiki/Pressure'
// ref: 'http://www.sensorsone.co.uk/pressure-measurement-glossary/pa-pascal-pressure-unit.html'
'Pa': { name: 'Pascal', symbol: 'Pa', formula: function(SI){if (!arguments.length) return 'Pa'; return +SI;}},
'hPa': { name: 'Hecto Pascal', symbol: 'hPa', formula: function(SI){if (!arguments.length) return 'hPa'; return SI/100;}}, // ok
'bar': { name: 'Bar', symbol: 'bar', formula: function(SI){if (!arguments.length) return 'bar'; return SI/100000;}}, // ok
'mbar': { name: 'milliBar', symbol: 'mbar', formula: function(SI){if (!arguments.length) return 'mbar'; return SI/100;}}, // ok
'at': { name: 'Technical atmosphere', symbol: 'at', formula: function(SI){if (!arguments.length) return 'at'; return 0.0000101972*SI;}}, // ok
'atm': { name: 'Standard atmosphere', symbol: 'atm', formula: function(SI){if (!arguments.length) return 'atm'; return 0.00000986923*SI;}}, // ok
'Torr': { name: 'Torr', symbol: 'Torr', formula: function(SI){if (!arguments.length) return 'Torr'; return 0.00750062*SI;}}, // ok
'psi': { name: 'Pounds per square inch', symbol: 'psi', formula: function(SI){if (!arguments.length) return 'psi'; return 0.0001450377*SI;}}, // ok
'N/m2': { name: 'Newtons per square metre', symbol: 'N/m2', formula: function(SI){if (!arguments.length) return 'N/m2'; return +SI;}}, // ok
'mmHg': { name: 'Millimeters of Mercury', symbol: 'mmHg', formula: function(SI){if (!arguments.length) return 'mmHg'; return 0.00750062*SI;}}, // ok
'mmH2O': { name: 'Millimeters of Wather', symbol: 'mmH2O', formula: function(SI){if (!arguments.length) return 'mmH2O'; return 0.000101972*SI;}}, // ok
},
Evapotranspiration:{
// ref: 'http://en.wikipedia.org/wiki/Evapotranspiration'
'mm': { name: 'Evapo Transpiration', symbol: 'mm', formula: function(SI){if (!arguments.length) return 'mm'; return +SI;}}, // ok
},
angle:{
// ref: 'http://en.wikipedia.org/wiki/Evapotranspiration'
'°': { name: 'Degrees', symbol: '°', formula: function(SI){if (!arguments.length) return '°'; return +SI;}}, // ok
'Rad': { name: 'Radians', symbol: 'Rad', formula: function(SI){if (!arguments.length) return 'Rad'; return SI*(Math.pi()/180);}}, // ok
'tr': { name: 'Turns', symbol: 'tr', formula: function(SI){if (!arguments.length) return 'tr'; return SI/360;}}, // ok
'CarDir': { name: 'Cardinal directions', symbol: '', formula: function(SI){if (!arguments.length) return ''; // ok
var windDir = ['N', 'NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW'];
return windDir[Math.round(SI/22.5)%16]; // ok
}
},
},
UV: {
'Idx': { name: 'UV index', symbol: '', formula: function(SI){if (!arguments.length) return ''; return +SI;}}, // ok
},
Solar: {
'w/m²': { name: 'Solar radiation', symbol: 'w/m²', formula: function(SI){if (!arguments.length) return 'w/m²'; return +SI;}}, // ok
},
strDate: {
'Auto': { name: 'Auto', symbol: 'Browser display', formula: function(d){if (!arguments.length) return ''; return d;}}, // ok
'ISO': { name: 'ISO-8601', symbol: 'yyyy-mm-dd hh:mm:ss', formula: function(d){if (!arguments.length) return ''; return formatDate(d, ' ');} }, // ok
}
};
// si on as pas d'argument demandé
if (!arguments.length) return d3.keys(units); // return units
// si on demande une grandeur sans lunite de conversion
if (arguments.length==1) return d3.keys( units[grandeur] ); // return units[grandeur]
// units.foreach(logArrayElements);
if (units[grandeur] && units[grandeur][outputUnit]) {
// console.log(grandeur, outputUnit);
return units[grandeur][outputUnit].formula;
}
return function(SI){if (!arguments.length) return '';return +SI;};
}
function logArrayElements(element, index, array) {
console.log("a[" + index + "] = " + element);
}
/**
*
* MD5 (Message-Digest Algorithm)
* http://www.webtoolkit.info/
*
**/
var MD5 = function (string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
}
function AddUnsigned(lX,lY) {
var lX4,lY4,lX8,lY8,lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
lX4 = (lX & 0x40000000);
lY4 = (lY & 0x40000000);
lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);
if (lX4 & lY4) {
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
}
if (lX4 | lY4) {
if (lResult & 0x40000000) {
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
} else {
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
}
} else {
return (lResult ^ lX8 ^ lY8);
}
}
function F(x,y,z) { return (x & y) | ((~x) & z); }
function G(x,y,z) { return (x & z) | (y & (~z)); }
function H(x,y,z) { return (x ^ y ^ z); }
function I(x,y,z) { return (y ^ (x | (~z))); }
function FF(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function GG(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function HH(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function II(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
function ConvertToWordArray(string) {
var lWordCount;
var lMessageLength = string.length;
var lNumberOfWords_temp1=lMessageLength + 8;
var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;
var lNumberOfWords = (lNumberOfWords_temp2+1)*16;
var lWordArray=Array(lNumberOfWords-1);
var lBytePosition = 0;
var lByteCount = 0;
while ( lByteCount < lMessageLength ) {
lWordCount = (lByteCount-(lByteCount % 4))/4;
lBytePosition = (lByteCount % 4)*8;
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition));
lByteCount++;
}
lWordCount = (lByteCount-(lByteCount % 4))/4;
lBytePosition = (lByteCount % 4)*8;
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);
lWordArray[lNumberOfWords-2] = lMessageLength<<3;
lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
return lWordArray;
};
function WordToHex(lValue) {
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
for (lCount = 0;lCount<=3;lCount++) {
lByte = (lValue>>>(lCount*8)) & 255;
WordToHexValue_temp = "0" + lByte.toString(16);
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
}
return WordToHexValue;
};
function Utf8Encode(string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
}
else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
}
else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
};
var x=Array();
var k,AA,BB,CC,DD,a,b,c,d;
var S11=7, S12=12, S13=17, S14=22;
var S21=5, S22=9 , S23=14, S24=20;
var S31=4, S32=11, S33=16, S34=23;
var S41=6, S42=10, S43=15, S44=21;
string = Utf8Encode(string);
x = ConvertToWordArray(string);
a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;
for (k=0;k<x.length;k+=16) {
AA=a; BB=b; CC=c; DD=d;
a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
c=FF(c,d,a,b,x[k+2], S13,0x242070DB);
b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);
a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);
d=FF(d,a,b,c,x[k+5], S12,0x4787C62A);
c=FF(c,d,a,b,x[k+6], S13,0xA8304613);
b=FF(b,c,d,a,x[k+7], S14,0xFD469501);
a=FF(a,b,c,d,x[k+8], S11,0x698098D8);
d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);
c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
a=GG(a,b,c,d,x[k+1], S21,0xF61E2562);
d=GG(d,a,b,c,x[k+6], S22,0xC040B340);
c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);
a=GG(a,b,c,d,x[k+5], S21,0xD62F105D);
d=GG(d,a,b,c,x[k+10],S22,0x2441453);
c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);
a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);
d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87);
b=GG(b,c,d,a,x[k+8], S24,0x455A14ED);
a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);
c=GG(c,d,a,b,x[k+7], S23,0x676F02D9);
b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
d=HH(d,a,b,c,x[k+8], S32,0x8771F681);
c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);
d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);
c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);
b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA);
c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085);
b=HH(b,c,d,a,x[k+6], S34,0x4881D05);
a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039);
d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665);
a=II(a,b,c,d,x[k+0], S41,0xF4292244);
d=II(d,a,b,c,x[k+7], S42,0x432AFF97);
c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
b=II(b,c,d,a,x[k+5], S44,0xFC93A039);
a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92);
c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
b=II(b,c,d,a,x[k+1], S44,0x85845DD1);
a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F);
d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
c=II(c,d,a,b,x[k+6], S43,0xA3014314);
b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
a=II(a,b,c,d,x[k+4], S41,0xF7537E82);
d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);
b=II(b,c,d,a,x[k+9], S44,0xEB86D391);
a=AddUnsigned(a,AA);
b=AddUnsigned(b,BB);
c=AddUnsigned(c,CC);
d=AddUnsigned(d,DD);
}
var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
return temp.toLowerCase();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment