VEuPathDB / EdaNewIssues

0 stars 0 forks source link

Need legend for overlay variables with only 1 unique value in the data set #202

Closed danicahelb closed 2 years ago

danicahelb commented 2 years ago

In https://github.com/VEuPathDB/plot.data/issues/121, @bobular noted an undesirable behavior.

When an overlay variable only ever has one value in the entire dataset (e.g. Country in WASH-b Bangladesh), then you are allowed to select it as overlay, but is a "no op" and nothing happens (because there is only one value in the vocabulary the overlay legend is not shown). This is disconcerting, as the user has no idea if something has gone wrong or not.

image

This issue was discussed in the 3/21/2022 EDA meeting. We decided add a legend to plots even when the overlay variable only has 1 unique value in the entire dataset. (in the above screenshot, the legend should just have a single value for Bangladesh).

We had also discussed having the check box greyed out (non-functional) when the overlay variable only has 1 value. I don't think this is necessary as it is possible to uncheck all values in other legends and end up with a blank graph (example 1). Also, the check mark is greyed out and non-functional when that value does not appear in the data being plotted (example 2); making the check box next to "Bangladesh" would be different behavior from the default.

Example 1, with all overlay values deselected:

image

Example 2, with check box next to values not in the plotted data being greyed out:

image
moontrip commented 2 years ago

I can probably work for this. But to make sure of the scope of work, @danicahelb, is it for all Vizs that utilize the custom legend ?

danicahelb commented 2 years ago

Hi @moontrip, yes this is for all visualizations that use the custom legend. Which I believe is all of them?

moontrip commented 2 years ago

@danicahelb Thank you for your confirmation! πŸ‘ Actually Mosaic-related ones do not use the custom legend so they are exceptions πŸ˜„

sweverschulman commented 2 years ago

I have checked the functionality of this ticket over two different studies: WASH Bangladesh and SCORE Rwanda, using the following plots: Line, Box, Scatter, Bar and Histogram.

When overlay is applied a legend appears. One can click the check box for the one value variable and the plot disappears.