pulsatrix
Loading...
Searching...
No Matches
pulsatrix::AttributionBarChart Class Reference

Draws a horizontal bar chart of an Attribution's top-k features (hc_information_visualization.md SS1/SS5: position-on-shared-axis is the most accurately perceived encoding for magnitude – Cleveland-McGill rank 1 – and horizontal bars read naturally with long feature names). Bar length encodes magnitude; hue (DivergingColormap) encodes sign, never magnitude. Bars start at zero (Tufte lie-factor = 1). More...

#include <attribution_bar_chart.hpp>

Static Public Member Functions

static void Draw (const char *title, const Attribution &attr, int top_k=10, float shared_max_abs=-1.0f)
 

Detailed Description

Draws a horizontal bar chart of an Attribution's top-k features (hc_information_visualization.md SS1/SS5: position-on-shared-axis is the most accurately perceived encoding for magnitude – Cleveland-McGill rank 1 – and horizontal bars read naturally with long feature names). Bar length encodes magnitude; hue (DivergingColormap) encodes sign, never magnitude. Bars start at zero (Tufte lie-factor = 1).

Note
Must be called between ImPlot::BeginPlot()/EndPlot() – no, this owns its own BeginPlot/EndPlot pair; call directly from an ImGui::Begin/End window body. Deliberately not unit-tested (GoogleTest cannot meaningfully exercise ImPlot draw calls) – see plans/okay-we-have-now-buzzing-moth.md Testing Strategy. All real logic (sorting, normalization) lives in plot_data.hpp/colormap.hpp, which are.

Member Function Documentation

◆ Draw()

static void pulsatrix::AttributionBarChart::Draw ( const char *  title,
const Attribution &  attr,
int  top_k = 10,
float  shared_max_abs = -1.0f 
)
static
Parameters
titleImPlot plot title/id.
attrA rank-1 Attribution.
top_kNumber of highest-|value| features to display.
shared_max_absWhen > 0, the color/scale normalization denominator to use instead of this chart's own max |value| – lets a caller showing several ExplanationScoreCards at once (small multiples) keep every card's color scale comparable (hc_information_visualization.md SS6: "small multiples... using shared axes"), rather than each auto-scaling independently and silently making cross-card comparison invalid.

The documentation for this class was generated from the following file: