Skip to content

Commit b05020f

Browse files
committed
corrections
1 parent 28427e9 commit b05020f

File tree

12 files changed

+63
-109
lines changed

12 files changed

+63
-109
lines changed

src/components/cards/AgentCard.Nav.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
cursor: pointer;
132132
z-index: 1000;
133133
background: var(--bg-primary);
134+
border-top: 1px solid var(--border-secondary);
134135
border-bottom: 1px solid var(--border-secondary);
135136
scrollbar-width: none; /* Firefox */
136137
-ms-overflow-style: none; /* IE and Edge */

src/components/charts/ScrollScatter.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
controlsMetric={"oracle/nop"}
213213
{rangeW}
214214
{rangeH}
215-
padding={windowW >= 700 ? 156 : 32}
215+
padding={windowW >= 700 ? 192 : 32}
216216
/>
217217
<Range
218218
min={0}

src/components/intro/Intro.CDF.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@
126126
ticks={[0, 25, 50, 75, 100]}
127127
formatTick={(d) => `${d}%`}
128128
/>
129-
<CDFLines {selectedAgent} agentColors={AGENT_COLORS} />
130-
<CDFTooltip agentColors={AGENT_COLORS} agentNames={AGENT_NAMES} />
129+
<CDFLines {selectedAgent} />
130+
<CDFTooltip />
131131
</Svg>
132132
</LayerCake>
133133
<div class="cdf-overlay">

src/components/intro/Intro.Headline.svelte

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import { cubicInOut } from 'svelte/easing';
55
import { interpolateString } from 'd3-interpolate';
66
7-
// EXPORTS
8-
export let scrollIndex;
9-
107
//VARIABLES
118
const copy = getContext("copy");
129
const startD = `M0,0.2 C0.15,0 0.35,0.42 0.6,0.2 C0.85,0 1.05,0.42 1.2,0.2 L1.2,1 L0,1 Z`;
@@ -73,4 +70,3 @@
7370
</clipPath>
7471
</defs>
7572
</svg> -->
76-

src/components/intro/Intro.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
120120
<section id="intro">
121121
<div class="sticky">
122-
<IntroHeadline {scrollIndex} />
122+
<IntroHeadline />
123123
<IntroAgents bind:this={introAgentsRef} {scrollIndex} {scrollyContainer} />
124124
<IntroCDF {scrollIndex} />
125125
</div>

src/components/layercake/CDF.svg.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
getContext("LayerCake");
77
88
export let selectedAgent = null;
9-
export let agentColors = {};
109
const clipId = "cdf-plot-clip";
1110
1211
// Create path generator

src/components/layercake/CDFTooltip.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
55
const { data, xGet, yGet, width, height } = getContext("LayerCake");
66
7-
export let agentColors = {};
8-
export let agentNames = {};
9-
107
let hoveredPoint = null;
118
let mouseX = 0;
129
let mouseY = 0;
@@ -73,6 +70,8 @@
7370
<!-- Invisible overlay for mouse tracking -->
7471
<rect
7572
class="tooltip-overlay"
73+
role="presentation"
74+
aria-hidden="true"
7675
width={$width}
7776
height={$height}
7877
on:mousemove={handleMouseMove}

src/components/layercake/ScrollScatter.svg.svelte

Lines changed: 49 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script>
22
import { getContext } from "svelte";
3-
import { line } from "d3-shape";
3+
import { area, line } from "d3-shape";
44
import {
55
agentSelected,
66
thresholdAgentNum,
@@ -107,68 +107,54 @@
107107
.x((d) => $xScale(d[0]))
108108
.y((d) => $yScale(d[1]))(equalAdvantagePoints);
109109
110-
// Calculate polygon for shaded "sweet spot" (right of agent threshold & below equal advantage)
111-
$: highPerformancePolygonPoints = (() => {
112-
if (!$xScale || !$yScale) return "";
110+
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
111+
112+
// Calculate shaded "sweet spot" with the same area logic as the agent-card scatterplot
113+
$: highPerformanceRegionPath = (() => {
114+
if (!xDomain || !yDomain) return null;
113115
114-
const xDomain =
115-
typeof $xScale?.domain === "function" ? $xScale.domain() : [0, 3];
116-
const yDomain =
117-
typeof $yScale?.domain === "function" ? $yScale.domain() : [0, 3];
118116
const [xMin, xMax] = xDomain;
119117
const [yMin, yMax] = yDomain;
118+
if (!Number.isFinite(xMin) || !Number.isFinite(xMax) || xMax <= xMin)
119+
return null;
120+
if (!Number.isFinite(yMin) || !Number.isFinite(yMax) || yMax <= yMin)
121+
return null;
122+
123+
const agentThreshold = Number($thresholdAgentNum);
124+
const oracleThreshold = Number($thresholdOracleNum);
125+
if (!Number.isFinite(agentThreshold) || !Number.isFinite(oracleThreshold))
126+
return null;
127+
128+
const xStart = clamp(agentThreshold, xMin, xMax);
129+
if (xStart >= xMax) return null;
130+
131+
// Vertical equal-advantage line has no well-defined "under" region.
132+
if (Math.abs(agentThreshold) < 1e-6) return null;
120133
121-
const clamp = (val, min, max) => Math.max(min, Math.min(max, val));
122-
const rawThresholdX = Number.isFinite($thresholdAgentNum)
123-
? $thresholdAgentNum
124-
: xMin;
125-
const thresholdX = clamp(rawThresholdX, xMin, xMax);
126-
if (thresholdX >= xMax) return "";
127-
128-
const slope =
129-
Number.isFinite($thresholdAgentNum) && Math.abs($thresholdAgentNum) > 0
130-
? $thresholdOracleNum / $thresholdAgentNum
131-
: null;
132-
133-
const yAtThreshold =
134-
slope === null
135-
? Number.isFinite($thresholdOracleNum)
136-
? $thresholdOracleNum
137-
: yMax
138-
: slope * thresholdX;
139-
const startY = clamp(yAtThreshold, yMin, yMax);
134+
const slope = oracleThreshold / agentThreshold;
135+
if (!Number.isFinite(slope) || slope < 0) return null;
140136
137+
const steps = 40;
138+
const dx = (xMax - xStart) / steps;
141139
const points = [];
142-
points.push([$xScale(thresholdX), $yScale(startY)]);
143-
144-
if (slope === null || !Number.isFinite(slope) || slope <= 0) {
145-
const yLine =
146-
slope === null
147-
? clamp(
148-
Number.isFinite($thresholdOracleNum) ? $thresholdOracleNum : yMax,
149-
yMin,
150-
yMax
151-
)
152-
: clamp(slope * xMax, yMin, yMax);
153-
points.push([$xScale(xMax), $yScale(yLine)]);
154-
} else {
155-
const xAtTop = yMax / slope;
156-
if (xAtTop >= xMax) {
157-
const yRight = clamp(slope * xMax, yMin, yMax);
158-
points.push([$xScale(xMax), $yScale(yRight)]);
159-
} else {
160-
const clampedXTop = Math.max(thresholdX, Math.min(xAtTop, xMax));
161-
points.push([$xScale(clampedXTop), $yScale(yMax)]);
162-
if (clampedXTop < xMax) {
163-
points.push([$xScale(xMax), $yScale(yMax)]);
164-
}
140+
let hasArea = false;
141+
142+
for (let i = 0; i <= steps; i++) {
143+
const xVal = xStart + dx * i;
144+
const rawY = slope * xVal;
145+
const clampedY = clamp(rawY, yMin, yMax);
146+
if (clampedY > yMin + 1e-6) {
147+
hasArea = true;
165148
}
149+
points.push({ x: xVal, y: clampedY });
166150
}
167151
168-
points.push([$xScale(xMax), $yScale(yMin)]);
169-
points.push([$xScale(thresholdX), $yScale(yMin)]);
152+
if (!hasArea) return null;
170153
171-
return points.map(([x, y]) => `${x},${y}`).join(" ");
154+
return area()
155+
.x((d) => $xScale(d.x))
156+
.y0(() => $yScale(yMin))
157+
.y1((d) => $yScale(d.y))(points);
172158
})();
173159
174160
// Regression zone: x < 1.0 AND y < 1.0
@@ -346,17 +332,11 @@
346332
})();
347333
</script>
348334
349-
<!--
350-
{#if isStep(7)}
351-
<g class="zone-highlights">
352-
<polygon
353-
class="highlight-quadrant"
354-
points={highPerformancePolygonPoints}
355-
fill="var(--bg-tertiary)"
356-
opacity={0.3}
357-
/>
358-
</g>
359-
{/if} -->
335+
{#if isExplorePhase && highPerformanceRegionPath}
336+
<g class="zone-highlights">
337+
<path class="highlight-region" d={highPerformanceRegionPath} />
338+
</g>
339+
{/if}
360340
361341
<defs>
362342
<marker
@@ -786,6 +766,11 @@
786766
pointer-events: none;
787767
}
788768
769+
.highlight-region {
770+
fill: var(--bg-tertiary);
771+
opacity: 0.3;
772+
}
773+
789774
.overflow-indicators {
790775
pointer-events: none;
791776
}

src/components/layout/OverviewHeader.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767
: defaultAffiliations;
6868
6969
const equalContributionNote =
70-
headerCopy.equalContributionNote ?? "* Equal Contribution";
70+
typeof headerCopy.equalContributionNote === "string"
71+
? headerCopy.equalContributionNote.trim()
72+
: "";
7173
7274
const actions =
7375
Array.isArray(headerCopy.actions) && headerCopy.actions.length > 0

src/components/layout/PaperHeader.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767
: defaultAffiliations;
6868
6969
const equalContributionNote =
70-
headerCopy.equalContributionNote ?? "* Equal Contribution";
70+
typeof headerCopy.equalContributionNote === "string"
71+
? headerCopy.equalContributionNote.trim()
72+
: "";
7173
7274
const actions =
7375
Array.isArray(headerCopy.actions) && headerCopy.actions.length > 0

0 commit comments

Comments
 (0)