[{"id":"dbd67270.54ad78","type":"tab","label":"Examples","disabled":false,"info":""},{"id":"710028ab.f231e8","type":"inject","z":"dbd67270.54ad78","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":100,"wires":[["8746876a.369c1"]]},{"id":"8746876a.369c1","type":"debug","z":"dbd67270.54ad78","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":310,"y":100,"wires":[]},{"id":"111f0295.f93615","type":"inject","z":"dbd67270.54ad78","name":"Inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":520,"wires":[["ab3768f4.30482"]]},{"id":"ab3768f4.30482","type":"function","z":"dbd67270.54ad78","name":"Writing data","func":"//Set headers\nvar data = \"car\" + \",\" + \"bus\" + \",\" + \"train\\n\";\n\n//Set content\ndata += \"12\" + \",\" + \"22\" + \",\" + \"8\";\n\nmsg.payload = data;\n\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":520,"wires":[["e32012bf.b2a0f8","b06afeca.65765"]]},{"id":"e32012bf.b2a0f8","type":"file","z":"dbd67270.54ad78","name":"","filename":"Data_test.csv","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":520,"y":560,"wires":[[]]},{"id":"b06afeca.65765","type":"debug","z":"dbd67270.54ad78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":510,"y":500,"wires":[]},{"id":"ac4b6baf.476918","type":"comment","z":"dbd67270.54ad78","name":"Write content into local file","info":"","x":130,"y":460,"wires":[]},{"id":"d6d46e5e.316e8","type":"file in","z":"dbd67270.54ad78","name":"Read File","filename":"Test.csv","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":260,"y":380,"wires":[["1802bbe2.fd7234"]]},{"id":"1f371a87.06c5b5","type":"inject","z":"dbd67270.54ad78","name":"Inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":380,"wires":[["d6d46e5e.316e8"]]},{"id":"1802bbe2.fd7234","type":"csv","z":"dbd67270.54ad78","name":"","sep":";","hdrin":true,"hdrout":false,"multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"x":410,"y":380,"wires":[["b739b1ab.0a7d58"]]},{"id":"b739b1ab.0a7d58","type":"debug","z":"dbd67270.54ad78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":380,"wires":[]},{"id":"8fbcddff.b9a17","type":"comment","z":"dbd67270.54ad78","name":"Parse CSV input - https://cookbook.nodered.org/basic/parse-csv","info":"","x":250,"y":180,"wires":[]},{"id":"a3e78088.ad6c48","type":"comment","z":"dbd67270.54ad78","name":"Print the timestamp","info":"","x":110,"y":40,"wires":[]},{"id":"f564c2e7.8d95","type":"inject","z":"dbd67270.54ad78","name":"Inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":240,"wires":[["d86d3a6c.4e6418"]]},{"id":"62240280.09d584","type":"csv","z":"dbd67270.54ad78","name":"","sep":",","hdrin":false,"hdrout":false,"multi":"mult","ret":"\\n","temp":"","skip":"1","strings":true,"x":410,"y":240,"wires":[["fb311b75.52bd5"]]},{"id":"fb311b75.52bd5","type":"debug","z":"dbd67270.54ad78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":240,"wires":[]},{"id":"d86d3a6c.4e6418","type":"template","z":"dbd67270.54ad78","name":"CSV data","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"# Some random data\na,b,c\n80,18,2\n52,36,10\n91,18,61\n32,47,65","output":"str","x":260,"y":240,"wires":[["62240280.09d584"]]},{"id":"c5a3e35b.70a728","type":"inject","z":"dbd67270.54ad78","name":"Inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":680,"wires":[["380d04f1.8ff70c"]]},{"id":"380d04f1.8ff70c","type":"http request","z":"dbd67270.54ad78","name":"Get COVID data","method":"GET","ret":"txt","paytoqs":false,"url":"https://covid.ourworldindata.org/data/total_cases.csv","tls":"","persist":false,"proxy":"","authType":"","x":300,"y":680,"wires":[["d83c1aea.105e7"]]},{"id":"d83c1aea.105e7","type":"csv","z":"dbd67270.54ad78","name":"","sep":",","hdrin":true,"hdrout":false,"multi":"mult","ret":"\\n","temp":"","skip":"0","strings":false,"x":470,"y":680,"wires":[["c508e3fd.5c3f4","7a4573d8.b0e364","e6af9b94.663628","d6c213a0.0a774"]]},{"id":"a25f570.f136fa8","type":"comment","z":"dbd67270.54ad78","name":"Read from CSV file","info":"","x":110,"y":320,"wires":[]},{"id":"3d0d35b2.ab113a","type":"comment","z":"dbd67270.54ad78","name":"Read from external file","info":"","x":120,"y":620,"wires":[]},{"id":"c508e3fd.5c3f4","type":"change","z":"dbd67270.54ad78","name":"Select Italy","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t {\t \"key\": \"date\",\t \"values\": msg.payload.[date, Italy] \t } \t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":640,"wires":[["2cc367ea.0edb1"]]},{"id":"2cc367ea.0edb1","type":"ui_chart","z":"dbd67270.54ad78","name":"Graph","group":"17eef91a.df9b27","order":5,"width":"12","height":"6","label":"COVID data in Italy","chartType":"line","legend":"false","xformat":"D/M","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"3","removeOlderPoints":"5","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":810,"y":640,"wires":[[]]},{"id":"7a4573d8.b0e364","type":"change","z":"dbd67270.54ad78","name":"Select China","rules":[{"t":"set","p":"payload","pt":"msg","to":"[ { \"key\": \"date\", \"values\": msg.payload.[date, China] } ]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":680,"wires":[["20690ebe.8f4dfa"]]},{"id":"20690ebe.8f4dfa","type":"ui_chart","z":"dbd67270.54ad78","name":"Graph","group":"17eef91a.df9b27","order":5,"width":"12","height":"6","label":"COVID data in China","chartType":"line","legend":"false","xformat":"D/M","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"3","removeOlderPoints":"5","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":810,"y":680,"wires":[[]]},{"id":"e6af9b94.663628","type":"change","z":"dbd67270.54ad78","name":"Select Japan","rules":[{"t":"set","p":"payload","pt":"msg","to":"[ { \"key\": \"date\", \"values\": msg.payload.[date, Japan] } ]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":720,"wires":[["1e747045.4f4d9"]]},{"id":"1e747045.4f4d9","type":"ui_chart","z":"dbd67270.54ad78","name":"Graph","group":"17eef91a.df9b27","order":5,"width":"12","height":"6","label":"COVID data in Japan","chartType":"line","legend":"false","xformat":"D/M","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"3","removeOlderPoints":"5","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":810,"y":720,"wires":[[]]},{"id":"6b48e77d.9e4458","type":"ui_chart","z":"dbd67270.54ad78","name":"Graph","group":"17eef91a.df9b27","order":5,"width":"12","height":"10","label":"COVID data","chartType":"line","legend":"true","xformat":"D/M","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"90000","removeOlder":"3","removeOlderPoints":"5","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":810,"y":780,"wires":[[]]},{"id":"d6c213a0.0a774","type":"change","z":"dbd67270.54ad78","name":"Multiple nations","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t {\t \"key\": \"Italy\",\t \"values\": msg.payload.[date, Italy] \t },\t {\t \"key\": \"China\",\t \"values\": msg.payload.[date, China] \t },\t {\t \"key\": \"Japan\",\t \"values\": msg.payload.[date, Japan] \t } \t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":780,"wires":[["6b48e77d.9e4458"]]},{"id":"572584d6.f6b334","type":"switch","z":"dbd67270.54ad78","name":"Country","property":"country","propertyType":"flow","rules":[{"t":"eq","v":"China","vt":"str"},{"t":"eq","v":"Italy","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":80,"y":960,"wires":[["87eb0c59.9c41c8"],["963d7a1c.8a8568"]]},{"id":"87eb0c59.9c41c8","type":"ui_button","z":"dbd67270.54ad78","name":"","group":"240c38fb.2cdfd","order":1,"width":"3","height":"1","passthru":true,"label":"China","tooltip":"","color":"black","bgcolor":"#D7D7A0","icon":"fa-line-chart","payload":"China","payloadType":"str","topic":"","x":250,"y":880,"wires":[["e2d4afcc.1af6c8","7d40e198.9874d"]]},{"id":"963d7a1c.8a8568","type":"ui_button","z":"dbd67270.54ad78","name":"","group":"240c38fb.2cdfd","order":1,"width":"3","height":"1","passthru":true,"label":"Italy","tooltip":"","color":"black","bgcolor":"#D7D7A0","icon":"fa-line-chart","payload":"Italy","payloadType":"str","topic":"","x":250,"y":1040,"wires":[["e2d4afcc.1af6c8","810e7e96.217fa8"]]},{"id":"e2d4afcc.1af6c8","type":"ui_text","z":"dbd67270.54ad78","group":"240c38fb.2cdfd","order":4,"width":0,"height":0,"name":"Show Country","label":"Selected country:","format":"{{msg.payload}}","layout":"row-left","x":440,"y":960,"wires":[]},{"id":"7d40e198.9874d","type":"function","z":"dbd67270.54ad78","name":"Select China","func":"flow.set(\"Country\", \"China\");\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":880,"wires":[["39550e61.003bfa"]]},{"id":"810e7e96.217fa8","type":"function","z":"dbd67270.54ad78","name":"Select Italy","func":"flow.set(\"Country\", \"Italy\");\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":1040,"wires":[["39550e61.003bfa"]]},{"id":"39550e61.003bfa","type":"http request","z":"dbd67270.54ad78","name":"Get COVID data","method":"GET","ret":"txt","paytoqs":false,"url":"https://covid.ourworldindata.org/data/total_cases.csv","tls":"","persist":false,"proxy":"","authType":"","x":660,"y":960,"wires":[["715fe623.72c758"]]},{"id":"6e866c6d.11c0c4","type":"switch","z":"dbd67270.54ad78","name":"Type","property":"Country","propertyType":"flow","rules":[{"t":"eq","v":"Italy","vt":"str"},{"t":"eq","v":"China","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":990,"y":960,"wires":[["32d08904.83c366"],["67451835.edf358"]]},{"id":"67451835.edf358","type":"change","z":"dbd67270.54ad78","name":"Select China","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t {\t \"key\": \"date\",\t \"values\": msg.payload.[date, China] \t } \t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":1000,"wires":[["2a715e0b.b78532"]]},{"id":"32d08904.83c366","type":"change","z":"dbd67270.54ad78","name":"Select Italy","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t {\t \"key\": \"date\",\t \"values\": msg.payload.[date, Italy] \t } \t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":920,"wires":[["2a715e0b.b78532"]]},{"id":"2a715e0b.b78532","type":"ui_chart","z":"dbd67270.54ad78","name":"Graph","group":"240c38fb.2cdfd","order":5,"width":"6","height":"6","label":"","chartType":"line","legend":"false","xformat":"D/M","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"90000","removeOlder":"3","removeOlderPoints":"5","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1310,"y":960,"wires":[[]]},{"id":"715fe623.72c758","type":"csv","z":"dbd67270.54ad78","name":"","sep":",","hdrin":true,"hdrout":false,"multi":"mult","ret":"\\n","temp":"","skip":"0","strings":false,"x":830,"y":960,"wires":[["6e866c6d.11c0c4"]]},{"id":"3f241e0b.87c14a","type":"comment","z":"dbd67270.54ad78","name":"Interface example","info":"","x":110,"y":820,"wires":[]},{"id":"17eef91a.df9b27","type":"ui_group","z":"","name":"COVID data","tab":"2ac16dac.009a8a","order":1,"disp":true,"width":"12","collapse":false},{"id":"240c38fb.2cdfd","type":"ui_group","z":"","name":"Filter","tab":"761e0e79.b7f34","order":1,"disp":false,"width":"6","collapse":false},{"id":"2ac16dac.009a8a","type":"ui_tab","z":"","name":"Graphs","icon":"dashboard","disabled":false,"hidden":false},{"id":"761e0e79.b7f34","type":"ui_tab","z":"","name":"Interface","icon":"dashboard","disabled":false,"hidden":false}]