OHDSI Home | Forums | Wiki | Github

Question regarding ATLAS cohort attrition view

Dear all,

I have a question regarding the attrition diagram generated in ATLAS’ cohort definition.

Can anyone explain why the color of the attrition bar is red in some cases and green in other cases?

Many thanks in advance and Happy New Year!

Song

The logic to get the color based on the value is using a d3 scale, seen here:

Oddly, the width of the bar is using the same data point as the color, so we can see from your examples that the red bar looks like it’s about 95% of the total, but it is pulling back the color that is found under the .1 range. In both cases, the bottom bar (the shortest, which looks to be about 1%) should have been colored red.

I’m wondering if this is some kind of localization issue where percentages are being interpreted strangely? Although, it’s strange that the width of the bars are matching a percentage, but the color from the same value is not… Let me try to investigate.

Update:
It looks like that we could use thresholdScales in d3 to perform the color mapping, it could be that when we migrated to d3 v4, this behavior has changed with the quantizedScale and we should use thresholdScale. I’ll create an issue in atlas and work on a fix.

Thanks for reporting!

-Chris

1 Like

Hi @Chris_Knoll, thank you so much for your quick feedback!

Hello, @gyeol99,
A fix has been submitted here: https://github.com/OHDSI/Atlas/pull/1207. This should be made available in our next release (2.7) scheduled for March 2019.

1 Like
t