import type { Class_DrawingArea } from '../types/DrawingArea'; import { Class_NodeBase } from './NodeBase'; import { NodeDrawValueLabel } from './DrawLabel'; import type { Class_NodeElement } from './Node'; /** * Visual sub-element representing a node's stock. * * Design (cf SA#1229): rather than a parallel set of `stock_shape_*` styling * attributes, the stock is modelled as a node-like element that REUSES the full * Class_NodeBase attribute machinery — shape_*, name_label_*, value_label_*, * color, icon — so it benefits from every node appearance attribute for free * and plugs into the existing node appearance menus. * * It is NOT a graph node: it is owned by its host Class_NodeElement, drawn as a * child of the host's SVG group (so it moves with the node, stacked above it), * and never registered in sankey.nodes / drawing_area.list_g_element. Its value * is sourced from the host's Class_StockValue (stock_value), not from links. */ export declare class Class_StockShape extends Class_NodeBase { protected class_name: string; private _host; protected _nodeDrawValueLabel: NodeDrawValueLabel; private _gap; constructor(host: Class_NodeElement, drawing_area: Class_DrawingArea); get host(): Class_NodeElement; /** * Current stock initial value for the selected data tags (year). Result in * reconciled/calculated mode, raw data otherwise. Mirrors drawStockBox. */ private _currentStockInitial; /** * Seuil d'affichage du label de stock (#seuil px) : compare |stock initial| (mode * valeur) ou l'épaisseur rendue scaleValueToPx(|.|) (mode pixel) au seuil * `filter_stock[_px]`. Piloté par le même helper que drawStockBox (legacy). */ get is_above_label_threshold(): boolean; /** * Height encodes the stock magnitude, scaled like link thickness (so it * updates when the selected year/data tag changes). Overrides the node's * shape_min_height-based sizing. */ getShapeHeightToUse(): number; /** * Width matches the host node so the stock sits flush above it. */ getShapeWidthToUse(): number; /** * Visible only when the host carries a stock and is itself visible. */ get is_visible(): boolean; /** * Attach this shape's d3 group INSIDE the host node's group (instead of the * drawing-area parent group), so it follows the node. Replicates the * essentials of Class_NodeBase._initDraw without the parent-group lookup. */ protected _initDraw(): void; /** * Draw the shape + name label + icon (inherited from Class_NodeBase) plus the * stock value label. Event listeners are wired so the shape is selectable * (click), but it is NOT independently draggable — it follows its host (drag * events are neutralized below). */ protected _draw(): void; /** * Select this stock shape and open the node appearance menu bound to it. * stopPropagation is essential: the shape's d3 group is a child of the host * node's group, so without it the click would bubble up and select the host. */ eventSimpleLMBClick(event: React.MouseEvent): void; protected eventMouseDragStart(): void; protected eventMouseDrag(): void; eventMouseDragEnd(): void; /** * Selection feedback: just re-render the shape (NodeDrawShape applies the * selected stroke when is_selected). No resize/drag handles. */ drawAsSelected(): void; /** * Stacked flush above the host node, horizontally centered on it. Coordinates * are node-local (the group is a child of the host's group). */ applyPosition(): void; /** * Formatted stock value, read by NodeDrawValueLabel. Mirrors drawStockBox: * result in reconciled/calculated mode, raw data otherwise. */ get data_label(): string; }