Commit a16dbca
Fix span auto-scaling after NaN masking
When span=None, datashader auto-scales from non-NaN values. After masking
zeros to NaN, the remaining minimum value (e.g. 2.0) would map to cmap(0.0)
— the transparent-white entry — and min_alpha would override the alpha,
producing opaque white.
Fix: _mask_transparent_cmap_entries now returns the pre-masking span so
ds.tf.shade uses the original data range, preventing re-scaling into the
transparent bin.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e100145 commit a16dbca
2 files changed
Lines changed: 25 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3198 | 3198 | | |
3199 | 3199 | | |
3200 | 3200 | | |
3201 | | - | |
| 3201 | + | |
3202 | 3202 | | |
3203 | 3203 | | |
3204 | 3204 | | |
3205 | 3205 | | |
3206 | 3206 | | |
3207 | 3207 | | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
3208 | 3213 | | |
3209 | 3214 | | |
3210 | | - | |
| 3215 | + | |
3211 | 3216 | | |
3212 | 3217 | | |
3213 | 3218 | | |
3214 | 3219 | | |
3215 | | - | |
| 3220 | + | |
3216 | 3221 | | |
3217 | 3222 | | |
3218 | 3223 | | |
| |||
3225 | 3230 | | |
3226 | 3231 | | |
3227 | 3232 | | |
3228 | | - | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
3229 | 3238 | | |
3230 | 3239 | | |
3231 | | - | |
| 3240 | + | |
3232 | 3241 | | |
3233 | 3242 | | |
3234 | 3243 | | |
3235 | 3244 | | |
3236 | 3245 | | |
3237 | 3246 | | |
3238 | 3247 | | |
3239 | | - | |
| 3248 | + | |
3240 | 3249 | | |
3241 | 3250 | | |
3242 | 3251 | | |
| |||
3248 | 3257 | | |
3249 | 3258 | | |
3250 | 3259 | | |
3251 | | - | |
| 3260 | + | |
| 3261 | + | |
3252 | 3262 | | |
3253 | 3263 | | |
3254 | 3264 | | |
| |||
3285 | 3295 | | |
3286 | 3296 | | |
3287 | 3297 | | |
3288 | | - | |
| 3298 | + | |
3289 | 3299 | | |
3290 | 3300 | | |
3291 | 3301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
140 | | - | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | | - | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| 177 | + | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| |||
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | | - | |
| 186 | + | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
| |||
0 commit comments