Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Symro/Theplacetoubib
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexg10 committed Jun 13, 2014
2 parents d388972 + aa992ef commit cadaf54
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 34 deletions.
15 changes: 6 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,13 @@ <h1>04.</h1>

<script src="js/app.js"></script>


<script src="//localhost:35729/livereload.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
// (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
// function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
// e=o.createElement(i);r=o.getElementsByTagName(i)[0];
// e.src='//www.google-analytics.com/analytics.js';
// r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
// ga('create','UA-51415785-1', 'theplacetoubib.fr');ga('send','pageview');
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-51415785-1', 'theplacetoubib.fr');ga('send','pageview');
</script>
</body>
</html>
68 changes: 43 additions & 25 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ $(document).ready(function() {
.find('.tutoFirstStep').removeClass('hidden').addClass('animated fadeIn').end()
.fadeIn();

console.log("Affichage Tuto ");
// console.log("Affichage Tuto ");
});

App.router.on("route:filtre", function(filtre, dept) {
Expand Down Expand Up @@ -173,7 +173,7 @@ $(document).ready(function() {

// Affiche les infos d'un departement
App.displayInfoDept = function(num_Departement) {
console.log("_-_-_-_-_-_- App.displayInfoDept _-_-_-_-_-_- ");
// console.log("_-_-_-_-_-_- App.displayInfoDept _-_-_-_-_-_- ");
num_Departement = (num_Departement == "2A" || num_Departement == "2B") ? num_Departement : parseInt(num_Departement);

var info_dept = App.getInfo(num_Departement);
Expand Down Expand Up @@ -231,7 +231,7 @@ $(document).ready(function() {

if (parseInt(chiffre_fra) > parseInt(chiffre_dept)) {

console.log('inférieur');
// console.log('inférieur');
$("#chiffreDept h3 img").attr("src", "img/fleche_inf.png");

} else if (parseInt(chiffre_fra) < parseInt(chiffre_dept)) {
Expand Down Expand Up @@ -314,7 +314,7 @@ $(document).ready(function() {

App.checkHash = function() {

//console.log("HASH ACTUEL : " + window.location.hash);
// console.log("HASH ACTUEL : " + window.location.hash);

var hash = window.location.hash;
// analyse du hash actuel
Expand All @@ -331,7 +331,7 @@ $(document).ready(function() {
// > Affichage du filtre et dept de l'URL

if (customRegExp) {
console.log('on a un filtre : ' + customRegExp[1]);
// console.log('on a un filtre : ' + customRegExp[1]);

App.router.navigate("#/filtre/" + customRegExp[1] + "/dept_" + App.dept, {
trigger: true
Expand All @@ -352,7 +352,7 @@ $(document).ready(function() {

if (customRegExp[3]) {

console.log(" on a un depart. : " + customRegExp[3]);
// console.log(" on a un depart. : " + customRegExp[3]);
//App.dept = customRegExp[3];

}
Expand Down Expand Up @@ -605,7 +605,7 @@ $(document).ready(function() {

if (i == 2) {

console.log(i);
// console.log(i);

var item = $("<div class='text2'>" + parseInt(dataGraph[2]) + "<span>%</span></div>").hide().fadeIn(250);
$("#pieChart").append(item);
Expand All @@ -630,7 +630,7 @@ $(document).ready(function() {

} else if (i == 1) {

console.log(i);
// console.log(i);

var item = $("<div class='text2'>" + parseInt(dataGraph[1]) + "<span>%</span></div>").hide().fadeIn(250);
$("#pieChart").append(item);
Expand All @@ -655,7 +655,7 @@ $(document).ready(function() {

} else {

console.log(i);
// console.log(i);

var item = $("<div class='text2'>" + parseInt(dataGraph[0]) + "<span>%</span></div>").hide().fadeIn(250);
$("#pieChart").append(item);
Expand Down Expand Up @@ -810,6 +810,7 @@ $(document).ready(function() {
App.hideBarChart();
App.hideGaugeChart();
App.hideGaugeChartMultiple();
$('#pieChart').hide();

// Gestion Line Chart -- Exception car JSON à lire différent donc n'est pas dans la condition if(data)
if (App.filtre == "Nb_hab_par_medecin") {
Expand Down Expand Up @@ -1131,7 +1132,11 @@ $(document).ready(function() {
}

})
.on('mouseover', tip.show)
.on('mouseover', function(){
tip.show;
// Analytics
ga('send', 'event', 'graph', 'mouseover', 'barchart');
})
.on('mouseout', tip.hide);

// ajout les triangles sous chaque bar
Expand Down Expand Up @@ -1343,7 +1348,7 @@ $(document).ready(function() {
.attr("r", 60)
.style("fill", "#282828");

console.log(data.length);
//console.log(data.length);

if (data.length == 2) {

Expand Down Expand Up @@ -1379,7 +1384,7 @@ $(document).ready(function() {

if (typeof legend === 'undefined') {

console.log("correction buuuuug");
// console.log("correction buuuuug");
// Création du SVG pour la légende
var legend = d3.select("#pieChart .pieChartLegend").append("svg")
.attr('width', 200)
Expand Down Expand Up @@ -1838,7 +1843,7 @@ $(document).ready(function() {


if ($(container).length == 0) {
console.log("/!\ Ce container (" + container + ") n'existe pas dans le DOM..");
// console.log("/!\ Ce container (" + container + ") n'existe pas dans le DOM..");
return false;
}

Expand All @@ -1847,7 +1852,7 @@ $(document).ready(function() {
.outerRadius(110)
.startAngle(0);

console.log(pourcentage);
// console.log(pourcentage);

d3.select(container + " .progressionPourcentage").transition()
.duration(750)
Expand Down Expand Up @@ -1909,7 +1914,7 @@ $(document).ready(function() {
dataNombre = data.length;

if (App.screenWidth < 1600) {
console.log("$(container).width() " + $("#rightSide").width());
// console.log("$(container).width() " + $("#rightSide").width());
height = 300;
cercleWidth = 250;
}
Expand All @@ -1927,7 +1932,7 @@ $(document).ready(function() {
.startAngle(0);

if (App.screenWidth < 1600) {
console.log("SCREEN : < 1600")
// console.log("SCREEN : < 1600")
cercleMarge = (dataNombre > 3) ? 20 : 25;

circleInnerRadius = 55,
Expand Down Expand Up @@ -2042,6 +2047,9 @@ $(document).ready(function() {
.transition().duration(250)
.style("opacity", "1");

// Analytics
ga('send', 'event', 'graph', 'mouseover', 'gaugechartmultiple', i);

})
.on("mouseout", function(d, i) {
var that = d3.select(this);
Expand Down Expand Up @@ -2126,7 +2134,7 @@ $(document).ready(function() {
$(container).show();

if ($(container).length == 0) {
console.log("/!\ Ce container (" + container + ") n'existe pas dans le DOM..");
// console.log("/!\ Ce container (" + container + ") n'existe pas dans le DOM..");
return false;
}
var circleInnerRadius = 65,
Expand All @@ -2137,7 +2145,7 @@ $(document).ready(function() {
cercleWidth = 310; // Diamètre externe du dernier cercle

if (App.screenWidth < 1600) {
console.log("SCREEN : < 1600")
// console.log("SCREEN : < 1600")
cercleMarge = (dataNombre > 3) ? 20 : 25;
circleInnerRadius = 55,
circleOuterRadius = 72;
Expand Down Expand Up @@ -2184,6 +2192,9 @@ $(document).ready(function() {
return nbFinal;
});

// Analytics
ga('send', 'event', 'graph', 'mouseover', 'gaugechartmultiple', i);

});

}
Expand All @@ -2208,7 +2219,7 @@ $(document).ready(function() {
// - 1 number OU string entre 0 et 100 > pourcentage
App.displayLineChart = function(data, dataMin, dataMax) {
$('#chartLine').fadeIn();
console.log(dataMin, dataMax);
// console.log(dataMin, dataMax);
var width = ($("#rightSide").width() - 80);
var height = 400;
var padding = {
Expand All @@ -2227,7 +2238,7 @@ $(document).ready(function() {
height = 300;
}

console.log("LineChart Width : " + width);
// console.log("LineChart Width : " + width);

App.lineChart = c3.generate({
bindto: '#chartLine',
Expand Down Expand Up @@ -2383,6 +2394,8 @@ $(document).ready(function() {
App.router.navigate(url, {
trigger: true
});
// Analytics
ga('send', 'event', 'menu', 'click', 'filtre', App.filtre);
}

});
Expand All @@ -2405,6 +2418,8 @@ $(document).ready(function() {
App.router.navigate(url, {
trigger: true
});
// Analytics
ga('send', 'event', 'menu', 'click', 'filtre', App.filtre);

});

Expand Down Expand Up @@ -2479,7 +2494,7 @@ $(document).ready(function() {

$('body').on("click", ".credits", function(e) {
e.preventDefault();
console.log(e);
// console.log(e);

if (e.target.className == "name_credits") {
window.open(e.target.parentElement.href, '_blank');
Expand Down Expand Up @@ -2586,7 +2601,7 @@ $(document).ready(function() {

if (screenWidth < 1620) {

console.log('width inférieure a : ' + screenWidth);
// console.log('width inférieure a : ' + screenWidth);
this.params.width = 650;
this.params.height = 800;
this.params.center = {
Expand All @@ -2612,7 +2627,7 @@ $(document).ready(function() {

if (screenWidth < 1380) {

console.log('width inférieure a : ' + screenWidth);
// console.log('width inférieure a : ' + screenWidth);


this.params.width = 580;
Expand Down Expand Up @@ -2799,6 +2814,9 @@ $(document).ready(function() {
});
App.checkHash();
/* _____________ FIN AJOUT FLORENT - A GARDER _____________________________________ */
// Analytics
ga('send', 'event', 'map', 'click', 'dept', App.dept);

},

zoomParis: function() {
Expand Down Expand Up @@ -2827,7 +2845,7 @@ $(document).ready(function() {

rendered: function() {

console.log('map rendered');
// console.log('map rendered');

// var hash = window.location.hash;
// // analyse du hash actuel
Expand All @@ -2846,7 +2864,7 @@ $(document).ready(function() {
},

zoomed: function() {
console.log('Zoom sur paris');
// console.log('Zoom sur paris');
}

});
Expand Down

0 comments on commit cadaf54

Please sign in to comment.