| (6 versioni intermedie di uno stesso utente non sono mostrate) | |||
| Riga 89: | Riga 89: | ||
currallMortiTi = []; | currallMortiTi = []; | ||
currallMortiOsp = []; | currallMortiOsp = []; | ||
| + | currNewMorti = []; | ||
//allDay = allDay.split(' ')[0]; | //allDay = allDay.split(' ')[0]; | ||
| Riga 113: | Riga 114: | ||
currallMortiTi = []; | currallMortiTi = []; | ||
currallMortiOsp = []; | currallMortiOsp = []; | ||
| + | currNewMorti = []; | ||
for (var i = 0 ; i < allRegionNames.length ; i++){ | for (var i = 0 ; i < allRegionNames.length ; i++){ | ||
| Riga 130: | Riga 132: | ||
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 144: | Riga 147: | ||
x: currentYear, | x: currentYear, | ||
y: currallRicoverati, | y: currallRicoverati, | ||
| − | + | ||
name: 'Ricoverati con sintomi', | name: 'Ricoverati con sintomi', | ||
mode: 'markers', | mode: 'markers', | ||
| Riga 359: | Riga 362: | ||
width: 2 | width: 2 | ||
} | } | ||
| − | }; | + | }; |
| + | |||
| + | 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 373: | Riga 388: | ||
trace6, | trace6, | ||
trace10, | trace10, | ||
| − | trace13, trace14, trace15, trace16,]; | + | trace13, trace14, trace15, trace16,trace17]; |
var updatemenus=[ | var updatemenus=[ | ||
| Riga 385: | Riga 400: | ||
}, | }, | ||
{ | { | ||
| − | args: [{'yaxis.type':'log' | + | args: [{'yaxis.type':'log'}], |
| − | |||
label:'SemiLog', | label:'SemiLog', | ||
method:'relayout' | method:'relayout' | ||
| Riga 551: | 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 589: | Riga 612: | ||
currallMortiTi = []; | currallMortiTi = []; | ||
currallMortiOsp = []; | currallMortiOsp = []; | ||
| + | currNewMorti = []; | ||
//allDay = allDay.split(' ')[0]; | //allDay = allDay.split(' ')[0]; | ||
| Riga 613: | Riga 637: | ||
currallMortiTi = []; | currallMortiTi = []; | ||
currallMortiOsp = []; | currallMortiOsp = []; | ||
| + | currNewMorti = []; | ||
for (var i = 0 ; i < allRegionNames.length ; i++){ | for (var i = 0 ; i < allRegionNames.length ; i++){ | ||
| Riga 630: | 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 859: | 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 872: | Riga 910: | ||
trace6, | trace6, | ||
trace10, | trace10, | ||
| − | trace13, trace14, trace15, trace16]; | + | trace13, trace14, trace15, trace16, trace17]; |
var updatemenus=[ | var updatemenus=[ | ||
| Riga 884: | Riga 922: | ||
}, | }, | ||
{ | { | ||
| − | args: [{'yaxis.type':'log' | + | args: [{'yaxis.type':'log'}], |
| − | |||
label:'SemiLog', | label:'SemiLog', | ||
method:'relayout' | method:'relayout' | ||
| Riga 1 075: | Riga 1 112: | ||
}, | }, | ||
{ | { | ||
| − | args: [{'yaxis.type':'log' | + | args: [{'yaxis.type':'log'}], |
| − | |||
label:'SemiLog', | label:'SemiLog', | ||
method:'relayout' | method:'relayout' | ||