Fix graph spacing and edge labels

Adjust graph to full width and reduce edge constraints to improve spacing and clarity.
This commit is contained in:
gpt-engineer-app[bot] 2025-08-10 07:08:34 +00:00
parent f61e852d45
commit 361aaf9000

View file

@ -78,25 +78,27 @@ const DogsBunnyPuzzle: React.FC<DogsBunnyPuzzleProps> = ({
// Connect all locations with conditional edges // Connect all locations with conditional edges
for (let i = 0; i < locations.length; i++) { for (let i = 0; i < locations.length; i++) {
for (let j = i + 1; j < locations.length; j++) { for (let j = i + 1; j < locations.length; j++) {
const numConditions = diff === 'easy' ? 1 : diff === 'medium' ? 2 : 3; const FREE_RATIO = 0.33;
const conditions: string[] = []; let conditions: string[] = [];
if (rng() >= FREE_RATIO) {
for (let k = 0; k < numConditions; k++) { const numConditions = diff === 'easy' ? 1 : diff === 'medium' ? 2 : 3;
const conditionType = locationTypes[Math.floor(rng() * locationTypes.length)]; for (let k = 0; k < numConditions; k++) {
const prefix = conditionPrefixes[Math.floor(rng() * conditionPrefixes.length)]; const conditionType = locationTypes[Math.floor(rng() * locationTypes.length)];
conditions.push(`${prefix} ${conditionType.toUpperCase()}`); const prefix = conditionPrefixes[Math.floor(rng() * conditionPrefixes.length)];
conditions.push(`${prefix} ${conditionType.toUpperCase()}`);
}
} }
edges.push({ edges.push({
from: locations[i].id, from: locations[i].id,
to: locations[j].id, to: locations[j].id,
conditions: conditions conditions
}); });
edges.push({ edges.push({
from: locations[j].id, from: locations[j].id,
to: locations[i].id, to: locations[i].id,
conditions: conditions conditions
}); });
} }
} }
@ -339,7 +341,7 @@ const DogsBunnyPuzzle: React.FC<DogsBunnyPuzzleProps> = ({
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<div className="flex flex-col lg:flex-row gap-6"> <div className="flex flex-col gap-6">
{/* Puzzle Area */} {/* Puzzle Area */}
<div className="flex-1"> <div className="flex-1">
<div <div
@ -473,7 +475,7 @@ const DogsBunnyPuzzle: React.FC<DogsBunnyPuzzleProps> = ({
</div> </div>
{/* Instructions & Controls */} {/* Instructions & Controls */}
<div className="w-full lg:w-80 space-y-4"> <div className="w-full space-y-4">
<div className="space-y-2"> <div className="space-y-2">
<h3 className="font-semibold">How to Play:</h3> <h3 className="font-semibold">How to Play:</h3>
<ul className="text-sm text-muted-foreground space-y-1"> <ul className="text-sm text-muted-foreground space-y-1">