HBGDki / hbgd

hbgd
http://HBGDki.github.io/hbgd/
MIT License
1 stars 1 forks source link

plot_univar doesn't plot the comprisk column #3

Open schloerke opened 8 years ago

schloerke commented 8 years ago

the text is WAY to big to make. bokeh says it's a unsatisfiable constraint.

Trim the unique levels? Yell if the levels are big?

plot_univar(cpp, subject = TRUE, width = 250, height = 250)

table(get_subject_data(cpp)$comprisk)
#                                                                                                                                                                                            6 
#                                                                                                                     chronic hypertension + mild gestational hypertension without proteinuria 
#                                                                                                                                                                                            5 
#                                                                                                                                                     chronic hypertension + mild preeclampsia 
#                                                                                                                                                                                           20 
#                                                                                                                                                   chronic hypertension + severe preeclampsia 
#                                                                                                                                                                                            1 
#                                                                                                                                                                    chronic hypertension only 
#                                                                                                                                                                                            4 
#                                                                                                                                                          mild gestational hypertension alone 
#                                                                                                                                                                                           18 
#                                                                                                                                                           mild gestational proteinuria alone 
#                                                                                                                                                                                            4 
#                                                                                                                      mild preeclampsia (mild gestational HTN + mild gestational proteinuria) 
#                                                                                                                                                                                            3 
#                                                                                                                                                                                         none 
#                                                                                                                                                                                          431 
#                                                                                                                                                        severe gestational hypertension alone 
#                                                                                                                                                                                            6 
# severe preeclampsia and eclampsia (severe gestational HTN + any of the following: mild/severe proteinuria, oliguria, pulmonary edema, or convulsion from gestation Wk 24 to postpartum Wk 2) 
#                                                                                                                                                                                            2
hafen commented 8 years ago

It would be good to be robust to long level names. I think trimming and adding "..." would be good. I don't know how / if you can make an axis label hoverable to get the whole thing, but that would be nice to have. But since these will usually only be for quick viewing, we can probably get away with trimming. Could even have a trim = 20 argument or something.