(3 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 400: | Riga 400: | ||
}, | }, | ||
{ | { | ||
− | args: [{'yaxis.type':'log' | + | args: [{'yaxis.type':'log'}], |
− | |||
label:'SemiLog', | label:'SemiLog', | ||
method:'relayout' | method:'relayout' | ||
Riga 566: | Riga 565: | ||
<script> | <script> | ||
+ | function get_diff(vect){ | ||
+ | var vdiff = []; | ||
+ | vdiff.push(0); | ||
+ | for (var i=1;i<vect.length;i++){ | ||
+ | vdiff.push(vect[i]-vect[i-1]); | ||
+ | } | ||
+ | |||
+ | return vdiff; | ||
+ | } | ||
// ITA | // ITA | ||
Plotly.d3.csv('https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-andamento-nazionale/dpc-covid19-ita-andamento-nazionale.csv', function(err, rows){ | Plotly.d3.csv('https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-andamento-nazionale/dpc-covid19-ita-andamento-nazionale.csv', function(err, rows){ | ||
Riga 604: | Riga 612: | ||
currallMortiTi = []; | currallMortiTi = []; | ||
currallMortiOsp = []; | currallMortiOsp = []; | ||
+ | currNewMorti = []; | ||
//allDay = allDay.split(' ')[0]; | //allDay = allDay.split(' ')[0]; | ||
Riga 628: | Riga 637: | ||
currallMortiTi = []; | currallMortiTi = []; | ||
currallMortiOsp = []; | currallMortiOsp = []; | ||
+ | currNewMorti = []; | ||
for (var i = 0 ; i < allRegionNames.length ; i++){ | for (var i = 0 ; i < allRegionNames.length ; i++){ | ||
Riga 645: | Riga 655: | ||
currallMortiTi.push(parseInt(allTi[i])+parseInt(allMorti[i])); | currallMortiTi.push(parseInt(allTi[i])+parseInt(allMorti[i])); | ||
currallMortiOsp.push(parseInt(allTo[i])+parseInt(allMorti[i])); | currallMortiOsp.push(parseInt(allTo[i])+parseInt(allMorti[i])); | ||
+ | currNewMorti = get_diff(currallMorti); | ||
} | } | ||
} | } | ||
Riga 874: | Riga 885: | ||
} | } | ||
}; | }; | ||
+ | |||
+ | var trace17 = { | ||
+ | x: currentYear, | ||
+ | y: currNewMorti, | ||
+ | mode: 'markers', | ||
+ | name: 'Incremento morti', | ||
+ | marker: { | ||
+ | size: 6, | ||
+ | opacity: 1, | ||
+ | symbol: 'cross' | ||
+ | } | ||
+ | }; | ||
var data = [trace8, | var data = [trace8, | ||
Riga 887: | Riga 910: | ||
trace6, | trace6, | ||
trace10, | trace10, | ||
− | trace13, trace14, trace15, trace16]; | + | trace13, trace14, trace15, trace16, trace17]; |
var updatemenus=[ | var updatemenus=[ | ||
Riga 899: | Riga 922: | ||
}, | }, | ||
{ | { | ||
− | args: [{'yaxis.type':'log' | + | args: [{'yaxis.type':'log'}], |
− | |||
label:'SemiLog', | label:'SemiLog', | ||
method:'relayout' | method:'relayout' | ||
Riga 1 090: | Riga 1 112: | ||
}, | }, | ||
{ | { | ||
− | args: [{'yaxis.type':'log' | + | args: [{'yaxis.type':'log'}], |
− | |||
label:'SemiLog', | label:'SemiLog', | ||
method:'relayout' | method:'relayout' |