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