@luhtech/site-template 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -249,6 +249,19 @@ own printed reference output at several points, not assumed-correct.
|
|
|
249
249
|
strip-types`) to import `.ts` test subjects directly -- no build step, no
|
|
250
250
|
`ts-node`.
|
|
251
251
|
|
|
252
|
+
## RingComparison: a loss reads at a glance (0.6.1)
|
|
253
|
+
|
|
254
|
+
Found in real local review (LuhTech-Business's "The Shape of a Strategy",
|
|
255
|
+
the real three-company example where C's cost genuinely exceeds its
|
|
256
|
+
revenue): the component computed correct, area-proportional radii from
|
|
257
|
+
day one, but with no dollar labels and no color distinction, a real loss
|
|
258
|
+
case was easy to miss at a glance -- exactly the finding the source essay
|
|
259
|
+
exists to make legible. `RingComparison.astro` now renders each ring's
|
|
260
|
+
real revenue/cost values as text, and a ring where `cost > revenue`
|
|
261
|
+
switches to a red dashed stroke with an explicit "at a loss" label --
|
|
262
|
+
computed from the same real props, not a second data path to keep in
|
|
263
|
+
sync.
|
|
264
|
+
|
|
252
265
|
## Migrating a venture site
|
|
253
266
|
|
|
254
267
|
A migration is: author `content/site.<venture>.json` + `content/pages/*.json`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luhtech/site-template",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Shared Astro component library + content-instance contract for LuhTech venture marketing sites -- one template renders every site from content/page.schema.json + content/site.schema.json instances.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,28 +25,49 @@ const maxRevenue = Math.max(...rings.map((r) => r.revenue), 1);
|
|
|
25
25
|
const scale = MAX_R / Math.sqrt(maxRevenue);
|
|
26
26
|
|
|
27
27
|
const width = rings.length * CELL_W;
|
|
28
|
-
const height = CELL_W +
|
|
28
|
+
const height = CELL_W + 76;
|
|
29
|
+
|
|
30
|
+
const fmtUSD = (n: number) => `$${n.toLocaleString('en-US')}M`;
|
|
29
31
|
|
|
30
32
|
const cells = rings.map((r, i) => {
|
|
31
33
|
const cx = i * CELL_W + CELL_W / 2;
|
|
32
34
|
const cy = CELL_W / 2 + 20;
|
|
33
35
|
const revenueR = Math.max(Math.sqrt(r.revenue) * scale, 4);
|
|
34
36
|
const costR = Math.max(Math.sqrt(r.cost) * scale, 2);
|
|
35
|
-
|
|
37
|
+
// Real signal, not decoration: cost exceeding revenue means the ring
|
|
38
|
+
// between them has vanished -- the company is running at a loss (the
|
|
39
|
+
// real source essay's own "cost circle has grown past its revenue"
|
|
40
|
+
// case). Flagged, not just left to a same-color radius difference a
|
|
41
|
+
// reader could easily miss.
|
|
42
|
+
const atLoss = r.cost > r.revenue;
|
|
43
|
+
return { ...r, cx, cy, revenueR, costR, atLoss };
|
|
36
44
|
});
|
|
45
|
+
const maxR = Math.max(...cells.map((c) => Math.max(c.revenueR, c.costR)));
|
|
37
46
|
---
|
|
38
47
|
<svg
|
|
39
48
|
xmlns="http://www.w3.org/2000/svg"
|
|
40
49
|
viewBox={`0 0 ${width} ${height}`}
|
|
41
50
|
class={className}
|
|
42
51
|
role="img"
|
|
43
|
-
aria-label={`Revenue and cost ring comparison across ${rings.length} companies`}
|
|
52
|
+
aria-label={`Revenue and cost ring comparison across ${rings.length} companies: ${rings.map((r) => `${r.label} revenue ${fmtUSD(r.revenue)}, cost ${fmtUSD(r.cost)}`).join('; ')}`}
|
|
44
53
|
>
|
|
45
54
|
{cells.map((c) => (
|
|
46
55
|
<g>
|
|
47
56
|
<circle cx={c.cx} cy={c.cy} r={c.revenueR} fill="currentColor" fill-opacity="0.06" stroke="currentColor" stroke-width="1.5" />
|
|
48
|
-
<circle
|
|
49
|
-
|
|
57
|
+
<circle
|
|
58
|
+
cx={c.cx}
|
|
59
|
+
cy={c.cy}
|
|
60
|
+
r={c.costR}
|
|
61
|
+
class={c.atLoss ? 'text-red-600' : highlightClass}
|
|
62
|
+
fill="currentColor"
|
|
63
|
+
fill-opacity="0.18"
|
|
64
|
+
stroke="currentColor"
|
|
65
|
+
stroke-width={c.atLoss ? 2 : 1.5}
|
|
66
|
+
stroke-dasharray={c.atLoss ? '4 3' : undefined}
|
|
67
|
+
/>
|
|
68
|
+
<text x={c.cx} y={c.cy + maxR + 20} text-anchor="middle" font-family="Inter, sans-serif" font-weight="600" font-size="13" fill="currentColor">{c.label}</text>
|
|
69
|
+
<text x={c.cx} y={c.cy + maxR + 36} text-anchor="middle" font-family="JetBrains Mono, monospace" font-size="10" fill="currentColor" fill-opacity="0.6">rev {fmtUSD(c.revenue)}</text>
|
|
70
|
+
<text x={c.cx} y={c.cy + maxR + 50} text-anchor="middle" font-family="JetBrains Mono, monospace" font-size="10" class={c.atLoss ? 'text-red-600' : undefined} fill="currentColor" fill-opacity={c.atLoss ? 1 : 0.6}>cost {fmtUSD(c.cost)}{c.atLoss ? ' -- at a loss' : ''}</text>
|
|
50
71
|
</g>
|
|
51
72
|
))}
|
|
52
73
|
</svg>
|