Dashticz Coronavirus - Features, Fixes & Updates

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

I am hoping we won't need this block much longer. But it was updated today in the latest beta to help with monitoring.
  • Left and right Y axes are now used and labelled "Total" and "Day"
  • User can choose what data to show in the graph using "mode" on the corona block:

Code: Select all

mode: 0   // both total and day is shown (default)
mode: 1   // only total is shown
mode: 2   // only day is shown 
Mode 0 will show the accumalitive total figures as stacked bars (left) and the daily increases as a line (right)

Image

Mode 1

Image

Mode 2

Image
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Scotty
Posts: 35
Joined: Wednesday 28 November 2018 16:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Scotty »

Struggling with this block.

I get the error:

Code: Select all

unknown string block  - js/blocks.js:497
{type: "corona", c: 5, key: "corona", $mountPoint: jQuery.fn.init(1), mountPoint: "#block_24", …}
type: "corona"
c: 5
key: "corona"
$mountPoint: jQuery.fn.init [div#block_24]
mountPoint: "#block_24"
entry: "block_24"
width: 12
__proto__: Object
When using the code copied from this post:

Code: Select all

blocks['corona'] = {
	type: 'corona',
	countryCode: 'NL',
	startDate: '01/03/2020',
	graph: 'bar',
	stacked: true,
	height: '500px',
	zoom: 'x'
}
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

Are you using the latest beta?

Code: Select all

blocks['coronavirus_graph_nl'] = {
	type: 'corona',
	title: 'Coronavirus',
	countryCode:'NL',
	startDate: '01/03/2020',
	graph: 'bar',	
	stacked: true,
	tooltiptotal: ['Confirmed (Total)', 'Deaths (Total)'],
	height: '380px',
	width: 6,
	zoom: 'x'
} 
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Scotty
Posts: 35
Joined: Wednesday 28 November 2018 16:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Scotty »

I am indeed. I updated last night when I seen the announcement.

Copied and pasted your code and get:

Code: Select all

unknown string block  
{type: "coronavirus_graph_nl", c: 5, key: "coronavirus_graph_nl", $mountPoint: jQuery.fn.init(1), mountPoint: "#block_24", …}
type: "coronavirus_graph_nl"
c: 5
key: "coronavirus_graph_nl"
$mountPoint: jQuery.fn.init [div#block_24]
mountPoint: "#block_24"
entry: "block_24"
width: 12
__proto__: Object
blocks['coronavirus_graph_nl'] = {
type: 'corona',
title: 'Coronavirus',
countryCode:'NL',
startDate: '01/03/2020',
graph: 'bar',
stacked: true,
tooltiptotal: ['Confirmed (Total)', 'Deaths (Total)'],
height: '380px',
width: 6,
zoom: 'x'
}
columns[5] = {}
columns[5]['blocks'] = ['coronavirus_graph_nl'],
columns[5]['width'] = 4;
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

OK, I will have a look whats going on.

Update: I have just deleted my Dashticz folder, and installed the latest beta. I have no issues. All corona graphs show fine, and there are no errors in DevTools. What is going on :?

I have see a similar issue from another user with the calendar block. It may be related, it might not. I will need to investigate further.
https://www.domoticz.com/forum/viewtopi ... 20#p244135
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Scotty
Posts: 35
Joined: Wednesday 28 November 2018 16:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Scotty »

Changed below
Last edited by Scotty on Sunday 19 April 2020 16:10, edited 1 time in total.
Scotty
Posts: 35
Joined: Wednesday 28 November 2018 16:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Scotty »

Wow. I'm so stoopid.

Where I was rushing to copy your code into my config, I pasted it above the line

Code: Select all

var blocks = {}
I've moved it now and all working great.

Perhaps this will help you with your calendar issue?
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

Thanks for letting me know. I'll see if this cures the other issue too.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Vomera »

Hi! :) I'm only interested in the daily new cases, is there an option to show it like a report ?

for example ?

Code: Select all

blocks['coronavirus_nl_doubling'] = {	
countryCode:'NL',
type: 'corona',
report: 'Doubling',   <-- daily comfirms???
width: 6
} 
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

Vomera wrote: Friday 31 July 2020 9:58 Hi! :) I'm only interested in the daily new cases, is there an option to show it like a report ?
Yes, use "mode" ... shown 8 posts above this one: https://www.domoticz.com/forum/viewtopi ... 20#p244233

Code: Select all

mode: 0   // show all datasets (default)
mode: 1   // show totals datasets
mode: 2   // show daily datasets
Hope that helps ;)
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Vomera »

Tnx for that!! :D

When i set start date i get the following. The first day shows a lot of numbers (i think because of the calulation)

Image

I was thinking to set a max of 1000 in the graph, so the graph will not start at 60k

Code: Select all

blocks['coronanl'] = {
	type: 'corona',
	mode: 2,
	countryCode: 'NL',
	startDate: '1/07/2020',
	stacked: false,
	height: '225px',
	    options: {
        scales: {
            yAxes: [{
                ticks: {
                    min: 0,
                    max: 1000
                }
            }, {
                ticks: {
                    min: 0,
                    max: 31
                }
            }]
        }
		}
	}
But the option doesnt work.
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

Vomera wrote: Saturday 01 August 2020 15:53 When i set start date i get the following. The first day shows a lot of numbers (i think because of the calulation)
Image
Hmmm. So do I :shock:

I found out why. Basically, when you use a start date, like 01/07/2020, with Mode 2 (daily growth), it has no previous data to calculate the growth between 01/07/2020 and the day before. I have updated the code to start one day before the start date, so it can calculate the difference between the two days. In your case, this is 30/06/2020. But this date is not plotted on the graph, it is only used to calculate the growth for 01/07/2020. Hope that makes sense - it does in my head ;)

It now looks like this:

Image

I also tweaked the code so it only formats 1000 to K for the Total, not the day. As you can see above, it is now just showing the unformatted value.

I have submitted a PR for this change. I will hopefully be merged soon in the latest beta.

By the way - the actual graphs are a little scary. I think people are relaxing too quickly, as daily cases have more than tripled in 2 weeks :!:
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Vomera »

Thanks for your response, yeah something like that was also in my head, i am not a programma, i can just tweak some script and implement it.
I hope the next beta will be released soon, so i can use the data you showed in your post.
Yeah the second wave is coming like this :O, today 431, but i see its not plotted into the graphic jet, is there 1 day delay ?
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

The data via the api isn't updated until the end of each day by John Hopkins University, USA. We can't do anything about this unfortunately.
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

The fix has now been made available in the latest beta today.

Sent from my HD1913 using Tapatalk

"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Vomera »

Okay i test it and it works :D Thank you for that.

Can i reduce the information? I would like only to see the last infections (latest data) like the view in the image ?

Image
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

Vomera wrote: Monday 03 August 2020 21:00 Okay i test it and it works :D Thank you for that.
Great to hear it's working ;)
Vomera wrote: Monday 03 August 2020 21:00 Can i reduce the information? I would like only to see the last infections (latest data) like the view in the image ?
I have included new capability this evening to allow users to choose what information they want to display in the header. This is controlled by a new block parameter called "header" on the corona block. The param takes an array of numbers, which correspond to:

1 = Total confirmed
2 = Total deaths
3 = Ratio
4 = Doubling
5 = Daily confirmed
6 = Daily deaths

The default setting if the parameter is not set is:

Code: Select all

header: [1, 2, 3, 4],
The image below is with the block set to:

Code: Select all

header: [5, 6],
Image

I have raised a PR requesting this change, once it is implemented in the latest beta, I will let you know.

Cheers ;)
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Vomera »

wow nice! can't wait to test it! Let me know :D
User avatar
clinkadink
Posts: 417
Joined: Tuesday 31 December 2019 1:15
Target OS: Linux
Domoticz version: 2020.2
Location: Swindon, UK
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by clinkadink »

It's now available in the latest beta.

Sent from my HD1913 using Tapatalk

"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
Vomera
Posts: 184
Joined: Wednesday 06 September 2017 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz Coronavirus - Features, Fixes & Updates

Post by Vomera »

I'm going to test tomorrow ! :D thank you
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest