-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add historic reporting for Home activity levels #543
Comments
So we want to add 2 new charts:
The home activity and activity trend chart both can be viewed at following levels of time granularity:
|
Also, I noticed this dense chart when there is a lot of data. We can remove the group mode. and only show stack-mode. Also, giving some dropdowns for filtering like for selecting a month or year, filtering by a home etc. Few other reports can be helpful
|
Just defaulting to stack mode would be a good step.
This could be useful if it were somehow normalized like activities / number of residents. That way we could highlight the most and least active homes even when they have a different number of residents. Would you make a quick sketch of how it would look to show the most/least active homes (activity count/resident count)? |
Looks good. I think the chart should be based on the following aggregation:
The "average active residents level" can then be used to sort and compare houses of various sizes. One nice addition would be to display the houses with the lowest average activity level, so managers can quickly identify areas for improvement. |
Store the pre-computed "daily activity levels" percentages in the analytics cache for use in other charts such as the "activity level trends" chart on the Home view. |
This average will "average active residents level" will be used to compare against the data from all the past months too? |
Yes, it seems reasonable to compare averages across time as well as homes. |
@brylie I was working on this card before the vue migration. I seem to have misunderstood this to be under the overall report page. But now that I revisited it I think it was for each home report page except for most active homes and least activity cards. This is what I had created for the /report page. Also, I was looking into the logic for heat map, which will basically be (active residents of all homes/total residents) of all homes for each day. It that correct? |
Yes, this is the report page for a single Home.
Since this is the report page for a single Home, the heatmap should only show activity levels of residents who had an active residency at the Home for each calendar day. |
Now that our platform supports historical reporting, we can focus on improving the visibility of home activity levels over "deeper" periods.
We will start with historic charting for the individual homes before working on visualising the whole care-system.
Goals
Task
mode
ormean
calculations for daily activity levels) @brylieCurrent report view
Note: the current report view takes several seconds to populate with data in a production deployment.
Mock-ups
The following code was used to generate the "Resident activity levels over time" chart.
var yData = [
[74, 82, 80, 74, 73, 72, 74, 70, 70, 66, 66, 69],
[45, 42, 50, 46, 36, 36, 34, 35, 32, 31, 31, 28],
[13, 14, 20, 24, 20, 24, 24, 40, 35, 41, 43, 50],
];
var colors = ['green', 'red', 'yellow',];
var lineSize = [2, 2, 4, 2];
var labels = ['Excellent', 'Poor', 'Good',];
var data = [];
for ( var i = 0 ; i < xData.length ; i++ ) {
var result = {
x: xData[i],
y: yData[i],
type: 'scatter',
mode: 'lines',
line: {
color: colors[i],
width: lineSize[i]
}
};
var result2 = {
x: [xData[i][0], xData[i][11]],
y: [yData[i][0], yData[i][11]],
type: 'scatter',
mode: 'markers',
marker: {
color: colors[i],
size: 12
}
};
data.push(result, result2);
}
var layout = {
showlegend: false,
height: 350,
width: 1000,
xaxis: {
showline: true,
showgrid: false,
showticklabels: true,
linecolor: 'rgb(204,204,204)',
linewidth: 2,
autotick: false,
ticks: 'outside',
tickcolor: 'rgb(204,204,204)',
tickwidth: 2,
ticklen: 5,
tickfont: {
family: 'Arial',
size: 12,
color: 'rgb(82, 82, 82)'
}
},
yaxis: {
showgrid: false,
zeroline: false,
showline: false,
showticklabels: false
},
autosize: false,
margin: {
autoexpand: false,
l: 100,
r: 20,
t: 100
},
annotations: [
{
xref: 'paper',
yref: 'paper',
x: 0.0,
y: 1.05,
xanchor: 'left',
yanchor: 'bottom',
text: 'Resident activity levels over time',
font:{
family: 'Arial',
size: 30,
color: 'rgb(37,37,37)'
},
showarrow: false
},
]
};
for( var i = 0 ; i < xData.length ; i++ ) {
var result = {
xref: 'paper',
x: 0.05,
y: yData[i][0],
xanchor: 'right',
yanchor: 'middle',
text: labels[i] + ' ' + yData[i][0] +'%',
showarrow: false,
font: {
family: 'Arial',
size: 16,
color: 'black'
}
};
var result2 = {
xref: 'paper',
x: 0.95,
y: yData[i][11],
xanchor: 'left',
yanchor: 'middle',
text: yData[i][11] +'%',
font: {
family: 'Arial',
size: 16,
color: 'black'
},
showarrow: false
};
layout.annotations.push(result, result2);
}
Plotly.newPlot('myDiv', data, layout);
The text was updated successfully, but these errors were encountered: