in captum/insights/attr_vis/frontend/src/components/Feature.tsx [69:107]
backgroundColor: calcHSLFromScore(props.data.modified[i], false),
}}
className={styles["text-feature-word"]}
>
{w}
<Tooltip label={props.data.modified[i]?.toFixed(3)} />
</span>{" "}
</>
);
});
return (
<>
{props.hideHeaders && (
<div className={styles["panel__column__title"]}>
{props.data.name} (Text)
</div>
)}
<div className={styles["panel__column__body"]}>
<div className={styles["model-number-spacer"]} />
{color_words}
</div>
</>
);
}
type GeneralFeatureProps = FeatureProps<{
base: number[];
modified: number[];
name: string;
}>;
function GeneralFeature(props: GeneralFeatureProps) {
const data = {
labels: props.data.base,
datasets: [
{
barPercentage: 0.5,
data: props.data.modified,
backgroundColor: (dataPoint: DataPoint) => {