// import { COLOR_MAP, generateWaterfallData } from '../utils/chartUtils.js'; // import type { WaterfallProps } from '../types'; // // Shorten judge names for display if they are long // const shortenName = (name: string) => name.split('/')[1] || name; // const Waterfall: React.FC = ({ matrix, judge1, judge2, onCellClick }) => { // const totalCount = Object.values(matrix).reduce((sum, fromCat) => { // return sum + Object.values(fromCat).reduce((innerSum, count) => innerSum + count, 0); // }, 0); // const plotStages = generateWaterfallData(matrix, shortenName(judge1), shortenName(judge2)); // return ( //
//

// Reclassification from {judge1.split('/')[1] || judge1} to {judge2.split('/')[1] || judge2} //

//
//
// {plotStages.map(stage => { // const stage_name = stage.stage_name; // return ( //
// {stage.segments.map(segment => { // const { category_label, value, fromCategory } = segment; // const count = value || 0; // const height = (count / totalCount) * 100; // const color = COLOR_MAP[category_label] || 'rgba(0,0,0,0)'; // Default to transparent if not found // return ( //
fromCategory && onCellClick(fromCategory, category_label)} // > // {(count > 0 && category_label != 'BASE' && fromCategory) && {count}} //
// ); // })} //
// ); // })} //
//
// {plotStages.map(stage => ( //
// {stage.stage_name} //
// ))} //
//
// {Object.entries(COLOR_MAP).map(([cat, color]) => ( //
// // {cat} //
// ))} //
//
//
// ); // }; // export default Waterfall;