Description
transfunc (passed via **kwargs) has inconsistent and partially broken behavior across the three element rendering methods:
render_points — correct
- Applied when
color_source_vector is None (continuous data)
- Receives raw numeric values before colormap mapping
- Use case:
np.log1p, np.sqrt etc. on expression values
render_shapes — inverted condition (bug)
- Applied when
values_are_categorical is True (render.py ~line 396)
- At that point
color_vector is a pd.Categorical of hex color strings like "#FF0000FF"
- Calling a numeric transform on hex strings is nonsensical and will either crash or silently corrupt the color vector
- The condition should be flipped to match points: apply only for continuous data
render_labels — dead code
- Extracted from kwargs and stored in
LabelsRenderParams.transfunc
_render_labels() never reads render_params.transfunc
- Parameter is silently accepted but has zero effect
Expected behavior
All three methods should match render_points: apply transfunc to raw numeric values when coloring by continuous data, and ignore it for categorical data.
Found during
Docstring & parameter audit for #463.
Description
transfunc(passed via**kwargs) has inconsistent and partially broken behavior across the three element rendering methods:render_points— correctcolor_source_vector is None(continuous data)np.log1p,np.sqrtetc. on expression valuesrender_shapes— inverted condition (bug)values_are_categoricalisTrue(render.py~line 396)color_vectoris apd.Categoricalof hex color strings like"#FF0000FF"render_labels— dead codeLabelsRenderParams.transfunc_render_labels()never readsrender_params.transfuncExpected behavior
All three methods should match
render_points: applytransfuncto raw numeric values when coloring by continuous data, and ignore it for categorical data.Found during
Docstring & parameter audit for #463.