| 34 | |
| 35 | /** Die Kennzahlen, die der Datensatz traegt. Fehlende Zahlen fehlen. */ |
| 36 | export function tooltipRows(node: GraphNode): [string, string][] { |
| 37 | const rows: [string, string][] = []; |
| 38 | if (node.in_calls !== undefined) { |
| 39 | rows.push(['fan-in', String(node.in_calls)]); |
| 40 | } |
| 41 | if (node.out_calls !== undefined) { |
| 42 | rows.push(['fan-out', String(node.out_calls)]); |
| 43 | } |
| 44 | // Zeile 0 ist keine Zeile: so antwortet query_graph fuer einen Knoten ohne Quelle (Runde 4, N1). |
| 45 | if ( |
| 46 | node.start_line !== undefined && |
| 47 | node.start_line > 0 && |
| 48 | node.end_line !== undefined && |
| 49 | node.end_line >= node.start_line |
| 50 | ) { |
| 51 | rows.push(['lines', String(node.end_line - node.start_line + 1)]); |
| 52 | } |
| 53 | return rows; |
| 54 | } |
| 55 | |
| 56 | /** Was ein Klick auf diesen Knoten tun wird, als Satz. */ |
| 57 | export function tooltipAction(node: GraphNode): string { |