feat(viz): dp coin change
This commit is contained in:
@@ -86,6 +86,9 @@ export interface DataState {
|
||||
trees?: BinaryTreeState[];
|
||||
// Queue support
|
||||
queues?: QueueState[];
|
||||
// Grid support (for DP visualizations)
|
||||
grids?: GridState[];
|
||||
gridPointers?: GridPointerState[];
|
||||
}
|
||||
|
||||
/** Single step in the visualization */
|
||||
@@ -246,3 +249,34 @@ export interface QueueState {
|
||||
elements: QueueElementState[];
|
||||
label?: string;
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Grid Types (for DP visualizations)
|
||||
// ============================================
|
||||
|
||||
/** State of a grid cell */
|
||||
export interface GridCellState {
|
||||
id: string;
|
||||
value: number | string;
|
||||
row: number;
|
||||
col: number;
|
||||
state: 'normal' | 'highlighted' | 'comparing' | 'computing' | 'success' | 'dimmed';
|
||||
}
|
||||
|
||||
/** Complete grid state */
|
||||
export interface GridState {
|
||||
id: string;
|
||||
cells: GridCellState[][]; // 2D array: cells[row][col]
|
||||
colLabels?: (string | number)[];
|
||||
rowLabels?: (string | number)[];
|
||||
label?: string;
|
||||
}
|
||||
|
||||
/** Pointer for grid visualization */
|
||||
export interface GridPointerState {
|
||||
id: string;
|
||||
name: string;
|
||||
row: number;
|
||||
col: number;
|
||||
color: 'current' | 'dependency' | 'result' | 'default';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user