nhs-r-community / NHSRplotthedots

An SPC package to support NHSE/I 'Making Data Count' programme
https://nhs-r-community.github.io/NHSRplotthedots/
Other
48 stars 23 forks source link

Highlighting for points that are both improvement and concern #200

Open andrjohns opened 11 months ago

andrjohns commented 11 months ago

I had a query about the approach to highlighting in the SPC visual, and I want to make sure that the final implementation is consistent with the NHSRplotthedots approach.

In the case where a given observation is part of both a special cause improvement and special cause concern pattern, how should it be highlighted?

The following toy example has two special cause concern patterns which overlap with a special cause improvement pattern:

yvals <- c(0:7,6:1)

test_data <- data.frame(y = yvals, obs=as.Date(Sys.Date() + seq_len(length(yvals))))

NHSRplotthedots::ptd_spc(test_data, value_field = y, date_field = obs)

Created on 2023-12-17 with reprex v2.0.2

Based on this, it looks like the current logic is that:

Is this the preferred logic to implement, or is there a particular decision tree that I should be following in highlighting?

andrjohns commented 11 months ago

Also for information, one suggestion for these cases (credit to @alexmcqueen) was to use different outline vs fill colours for the points in question: image