fsanyoto commited on
Commit
fece542
·
verified ·
1 Parent(s): 7c8c1a6

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "current": "931db7b11",
3
  "releases": []
4
  }
 
1
  {
2
+ "current": "cd6ed6d43",
3
  "releases": []
4
  }
VERSION CHANGED
@@ -1 +1 @@
1
- 931db7b11
 
1
+ cd6ed6d43
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- 9c3d247d2ee9a34334c4a4675d27e3c5f07f9de89285c8b976ba008ce7fae2db
 
1
+ 93921882416517519e28c4a1393221d3cf985557ef7fd006f9d3292c03307acf
web/src/viz/kit/charts.tsx CHANGED
@@ -274,8 +274,9 @@ export function ComboChart({ title, currency, data, bars, line, markers = [], si
274
  const start = Math.max(64, 16 + 7 * Math.max(...ticks.map(t => formatMeasure(t, currency).length)));
275
  const right = width - Math.max(40, labelWidth);
276
  const top = 24, bottom = height - 48;
277
- const every = Math.max(1, Math.ceil(data.length / Math.max(2, Math.floor((right - start) / 90))));
278
  const step = (right - start) / data.length;
 
 
279
  const y = (v: number) => bottom - (v - lo) / (hi - lo) * (bottom - top);
280
  const x = (i: number) => start + (i + 0.5) * step;
281
  const barWidth = step * 0.8 / Math.max(1, bars.length);
@@ -308,8 +309,11 @@ export function ComboChart({ title, currency, data, bars, line, markers = [], si
308
  <text x={start - 10} y={y(tick) + 4} textAnchor="end">{formatMeasure(tick, unit)}</text>
309
  </g>)}
310
  {lo < 0 && <g className="lp-chart-axis"><line x1={start} x2={right} y1={y(0)} y2={y(0)} strokeWidth={2} /></g>}
311
- {data.map((row, i) => (i === 0 || i === data.length - 1 || i % every === 0)
312
- && <text key={row.label} className="lp-chart-tick" x={x(i)} y={bottom + 28} textAnchor="middle">{row.label}</text>)}
 
 
 
313
  {data.map((row, i) => marked.has(row.label) && <g key={`marker:${row.label}`} className="lp-chart-axis" data-chart-marker={row.label}>
314
  <line x1={x(i)} x2={x(i)} y1={top} y2={bottom} strokeDasharray="4 4" />
315
  </g>)}
 
274
  const start = Math.max(64, 16 + 7 * Math.max(...ticks.map(t => formatMeasure(t, currency).length)));
275
  const right = width - Math.max(40, labelWidth);
276
  const top = 24, bottom = height - 48;
 
277
  const step = (right - start) / data.length;
278
+ const every = Math.max(1, Math.ceil(data.length / Math.max(2, Math.floor((right - start) / 90))),
279
+ Math.ceil((Math.max(...data.map(row => row.label.length)) * 7 + 16) / step));
280
  const y = (v: number) => bottom - (v - lo) / (hi - lo) * (bottom - top);
281
  const x = (i: number) => start + (i + 0.5) * step;
282
  const barWidth = step * 0.8 / Math.max(1, bars.length);
 
309
  <text x={start - 10} y={y(tick) + 4} textAnchor="end">{formatMeasure(tick, unit)}</text>
310
  </g>)}
311
  {lo < 0 && <g className="lp-chart-axis"><line x1={start} x2={right} y1={y(0)} y2={y(0)} strokeWidth={2} /></g>}
312
+ {data.map((row, i) => (i === 0 || i === data.length - 1
313
+ || (i % every === 0 && i >= every && data.length - 1 - i >= every))
314
+ && <text key={row.label} className="lp-chart-tick"
315
+ x={i === 0 ? start : i === data.length - 1 ? right : x(i)} y={bottom + 28}
316
+ textAnchor={i === 0 ? "start" : i === data.length - 1 ? "end" : "middle"}>{row.label}</text>)}
317
  {data.map((row, i) => marked.has(row.label) && <g key={`marker:${row.label}`} className="lp-chart-axis" data-chart-marker={row.label}>
318
  <line x1={x(i)} x2={x(i)} y1={top} y2={bottom} strokeDasharray="4 4" />
319
  </g>)}