Scalene-GUI.md
gui-elements.ts: Add chart function (e.g., makeAwaitPie) following existing patternsscalene-gui.ts:
const await_pies: (unknown | null)[] = [])makeTableHeader()makeProfileLine() — push chart specs to arrayembedCharts(await_pies, "await_pie") at the endnpm --prefix scalene/scalene-gui run build — produces a minified scalene-gui-bundle.js. The raw esbuild command is defined in scalene/scalene-gui/package.json; don't invoke esbuild directly without --minify or the checked-in bundle will balloon ~2.3× on disk.scalene_json.py: Add field to FunctionDetail, compute in payloadscalene_output.py: Add column for CLI --html outputscalene_parseargs.py: Add column in _display_profile_cli() for scalene view --cliAll charts are Vega-Lite specs rendered via vegaEmbed() after DOM insertion.
makeBar() — stacked horizontal bar (CPU time: Python/native/system)makeGPUPie(), makeAwaitPie(), makeMemoryPie() — arc chartsmakeSparkline() — line chart for memory timelinemakeNRTBar(), makeNCTimeBar() — Neuron time barsscale: { domain: [0, 100] } show partial arcs with gaps — looks bad.scale: { range: [startAngle, startAngle + 2*PI] } on the theta encoding. Track cumulative angle:
pieAngles.await += (pct / 100) * 2 * Math.PI;
pieAngles objects).makeProfileLine() builds HTML string with <span id="chart_name${index}"> placeholderscpu_bars, gpu_pies, await_pies)embedCharts(array, "prefix") calls vegaEmbed() for each specThis function has many parameters. When adding new ones, append to the end with defaults. The two call sites are:
linePieAngles = { await: 0, gpu: 0 } before the loopfnPieAngles = { await: 0, gpu: 0 } before the loop