feat: Add dashboard chat integration and MCP server
Major changes: - Dashboard: WebSocket-based chat with session management - Dashboard: New chat components (ChatPane, ChatInput, ModeToggle) - Dashboard: Enhanced UI with parallel coordinates chart - MCP Server: New atomizer-tools server for Claude integration - Extractors: Enhanced Zernike OPD extractor - Reports: Improved report generator New studies (configs and scripts only): - M1 Mirror: Cost reduction campaign studies - Simple Beam, Simple Bracket, UAV Arm studies Note: Large iteration data (2_iterations/, best_design_archive/) excluded via .gitignore - kept on local Gitea only. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,10 +7,11 @@
|
||||
* - FEA vs NN trial differentiation
|
||||
* - Hover tooltips with trial details
|
||||
* - Range slider for zooming
|
||||
* - Log scale toggle
|
||||
* - Export to PNG/SVG
|
||||
*/
|
||||
|
||||
import { useMemo } from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
import Plot from 'react-plotly.js';
|
||||
|
||||
interface Trial {
|
||||
@@ -32,6 +33,7 @@ interface PlotlyConvergencePlotProps {
|
||||
direction?: 'minimize' | 'maximize';
|
||||
height?: number;
|
||||
showRangeSlider?: boolean;
|
||||
showLogScaleToggle?: boolean;
|
||||
}
|
||||
|
||||
export function PlotlyConvergencePlot({
|
||||
@@ -40,8 +42,10 @@ export function PlotlyConvergencePlot({
|
||||
objectiveName = 'Objective',
|
||||
direction = 'minimize',
|
||||
height = 400,
|
||||
showRangeSlider = true
|
||||
showRangeSlider = true,
|
||||
showLogScaleToggle = true
|
||||
}: PlotlyConvergencePlotProps) {
|
||||
const [useLogScale, setUseLogScale] = useState(false);
|
||||
|
||||
// Process trials and calculate best-so-far
|
||||
const { feaData, nnData, bestSoFar, allX, allY } = useMemo(() => {
|
||||
@@ -177,9 +181,10 @@ export function PlotlyConvergencePlot({
|
||||
rangeslider: showRangeSlider ? { visible: true } : undefined
|
||||
},
|
||||
yaxis: {
|
||||
title: objectiveName,
|
||||
title: useLogScale ? `log₁₀(${objectiveName})` : objectiveName,
|
||||
gridcolor: '#E5E7EB',
|
||||
zerolinecolor: '#D1D5DB'
|
||||
zerolinecolor: '#D1D5DB',
|
||||
type: useLogScale ? 'log' : 'linear'
|
||||
},
|
||||
legend: {
|
||||
x: 1,
|
||||
@@ -202,18 +207,35 @@ export function PlotlyConvergencePlot({
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
{/* Summary stats */}
|
||||
<div className="flex gap-6 justify-center mb-3 text-sm">
|
||||
<div className="text-gray-600">
|
||||
Best: <span className="font-semibold text-green-600">{bestVal.toFixed(4)}</span>
|
||||
<span className="text-gray-400 ml-1">(Trial #{bestTrial})</span>
|
||||
</div>
|
||||
<div className="text-gray-600">
|
||||
Current: <span className="font-semibold">{allY[allY.length - 1].toFixed(4)}</span>
|
||||
</div>
|
||||
<div className="text-gray-600">
|
||||
Trials: <span className="font-semibold">{allX.length}</span>
|
||||
{/* Summary stats and controls */}
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<div className="flex gap-6 text-sm">
|
||||
<div className="text-gray-600">
|
||||
Best: <span className="font-semibold text-green-600">{bestVal.toFixed(4)}</span>
|
||||
<span className="text-gray-400 ml-1">(Trial #{bestTrial})</span>
|
||||
</div>
|
||||
<div className="text-gray-600">
|
||||
Current: <span className="font-semibold">{allY[allY.length - 1].toFixed(4)}</span>
|
||||
</div>
|
||||
<div className="text-gray-600">
|
||||
Trials: <span className="font-semibold">{allX.length}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Log scale toggle */}
|
||||
{showLogScaleToggle && (
|
||||
<button
|
||||
onClick={() => setUseLogScale(!useLogScale)}
|
||||
className={`px-3 py-1 text-xs rounded transition-colors ${
|
||||
useLogScale
|
||||
? 'bg-blue-600 text-white'
|
||||
: 'bg-gray-200 text-gray-700 hover:bg-gray-300'
|
||||
}`}
|
||||
title="Toggle logarithmic scale - better for viewing early improvements"
|
||||
>
|
||||
{useLogScale ? 'Log Scale' : 'Linear Scale'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Plot
|
||||
|
||||
Reference in New Issue
Block a user