diff --git a/docs/.vitepress/theme/components/FitnessLandscape3D.vue b/docs/.vitepress/theme/components/FitnessLandscape3D.vue index aa8e5dff..f9bdaf50 100644 --- a/docs/.vitepress/theme/components/FitnessLandscape3D.vue +++ b/docs/.vitepress/theme/components/FitnessLandscape3D.vue @@ -105,11 +105,11 @@ const surfaceGeometry = computed(() => { for (let i = 0; i < positions.count; i++) { const u = positions.getX(i) // [-1, 1] const v = positions.getY(i) // [-1, 1] - + const x = xMin + (u + 1) / 2 * (xMax - xMin) const y = yMin + (v + 1) / 2 * (yMax - yMin) const z = evaluateFunction(x, y, props.functionName) - + positions.setZ(i, z) zMin = Math.min(zMin, z) zMax = Math.max(zMax, z) @@ -117,7 +117,7 @@ const surfaceGeometry = computed(() => { // Second pass: apply colors based on Z values const colorScale = getColorScale(props.colorScale, zMin, zMax) - + for (let i = 0; i < positions.count; i++) { const z = positions.getZ(i) const colorValue = d3.color(colorScale(z)) @@ -168,11 +168,11 @@ const trajectoryGeometry = computed(() => { const points = props.trajectory.map(p => { const [xMin, xMax] = props.xRange const [yMin, yMax] = props.yRange - + // Map world coordinates to [-1, 1] range const u = -1 + (p.x - xMin) / (xMax - xMin) * 2 const v = -1 + (p.y - yMin) / (yMax - yMin) * 2 - + return new THREE.Vector3(u, v, p.z) }) @@ -185,10 +185,10 @@ const startPoint = computed(() => { const p = props.trajectory[0] const [xMin, xMax] = props.xRange const [yMin, yMax] = props.yRange - + const u = -1 + (p.x - xMin) / (xMax - xMin) * 2 const v = -1 + (p.y - yMin) / (yMax - yMin) * 2 - + return new THREE.Vector3(u, v, p.z) }) @@ -197,10 +197,10 @@ const endPoint = computed(() => { const p = props.trajectory[props.trajectory.length - 1] const [xMin, xMax] = props.xRange const [yMin, yMax] = props.yRange - + const u = -1 + (p.x - xMin) / (xMax - xMin) * 2 const v = -1 + (p.y - yMin) / (yMax - yMin) * 2 - + return new THREE.Vector3(u, v, p.z) }) @@ -227,15 +227,15 @@ const endPoint = computed(() => { 🖱️ Drag to rotate • Scroll to zoom • Right-click to pan - +
- + - { - diff --git a/docs/benchmark-demo.md b/docs/benchmark-demo.md index 350a86d0..61beb299 100644 --- a/docs/benchmark-demo.md +++ b/docs/benchmark-demo.md @@ -141,7 +141,7 @@ const ecdfData = computed(() => { const threshold = 0.01 / (budget / 2000) return fitnessValues.filter(f => f <= threshold).length / fitnessValues.length }) - + return { algorithm: opt, budget: budgets, @@ -171,7 +171,7 @@ const metadata = computed(() => mockData.value.metadata) Comparison of **{{ optimizers.join(' vs ') }}** on the **Shifted Ackley** function (dimension 2): - - - - { algorithm: opt, iterations: Array.from({length: 10}, (_, i) => i * 10), mean: firstRun.history.best_fitness, - std: firstRun.history.mean_fitness.map((m, i) => + std: firstRun.history.mean_fitness.map((m, i) => Math.abs(m - firstRun.history.best_fitness[i]) ) } @@ -139,7 +139,7 @@ const ecdfData = computed(() => { // Your proportion calculation logic return 0.5 // Example }) - + return { algorithm: opt, budget: budgets, diff --git a/docs/test-charts.md b/docs/test-charts.md index 06f9715c..f3a50418 100644 --- a/docs/test-charts.md +++ b/docs/test-charts.md @@ -7,7 +7,7 @@ This page demonstrates the ECharts and TresJS visualization components. ### ECDF Chart - - "$TEMP_DIR/test_types.ts" << 'TS_SCRIPT' import type { BenchmarkDataSchema } from '../../../.vitepress/theme/types/benchmark' @@ -156,7 +156,7 @@ const benchmarkData: BenchmarkDataSchema = data as BenchmarkDataSchema console.log('✓ TypeScript types are compatible') console.log(` Functions: ${Object.keys(benchmarkData.benchmarks).join(', ')}`) TS_SCRIPT - + # Check if Node.js and TypeScript are available if command -v node &> /dev/null && [[ -d "$PROJECT_ROOT/docs/node_modules" ]]; then cd "$PROJECT_ROOT/docs"