Show all analysis phases in token chart legend and preview
This commit is contained in:
1 parent
58fc00601e
commit
cbb69a2115
6 files changed
+70
-7
No files matched your search
@@ -57,7 +57,8 @@ function renderPie(buckets) {
|
||||
const legend=$('legend'); legend.replaceChildren(); let angle=-Math.PI/2;
|
||||
if(!total) {ctx.beginPath();ctx.arc(180,180,140,0,Math.PI*2);ctx.fillStyle='#edf0f7';ctx.fill();}
|
||||
buckets.forEach((b,i)=>{
|
||||
const count=b.input_tokens+b.output_tokens; if(!count&&!b.calls)return;
|
||||
const count=b.input_tokens+b.output_tokens;
|
||||
if(b.id==='unknown'&&!count&&!b.calls)return;
|
||||
const color=colors[i%colors.length]; if(total&&count) {const end=angle+count/total*Math.PI*2;
|
||||
ctx.beginPath();ctx.moveTo(180,180);ctx.arc(180,180,140,angle,end);ctx.closePath();ctx.fillStyle=color;ctx.fill();angle=end;}
|
||||
const item=document.createElement('li'), swatch=text('span','','swatch');swatch.style.background=color;
|
||||
|
||||
Reference in new issue
Block a user