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 endnpx esbuild scalene-gui.ts --bundle --outfile=scalene-gui-bundle.js --format=iife --global-name=ScaleneGUIscalene_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