wu981526092 commited on
Commit
cc3c5e9
·
1 Parent(s): c0f7273

feat: optimize graph visualization sizes for better UI layout

Browse files

- Reduce modal graph size from 700x500 to 550x400
- Adjust SimpleGraphVisualization defaults from 600x400 to 500x350
- Lower minimum dimensions in KnowledgeGraphVisualizer from 600x500 to 500x400
- Update global config defaults from 800x600 to 650x450
- Reduce BaseGraphVisualizer minimum from 400x400 to 350x350

These changes improve screen space utilization while maintaining good readability and interactivity.

frontend/src/components/features/traces/KnowledgeGraphVisualizer.tsx CHANGED
@@ -389,8 +389,8 @@ export const KnowledgeGraphVisualizer: React.FC<
389
  }
390
 
391
  // Ensure minimum dimensions
392
- width = Math.max(width, 600);
393
- height = Math.max(height, 500);
394
 
395
  const config = createKnowledgeGraphConfig({
396
  width,
 
389
  }
390
 
391
  // Ensure minimum dimensions
392
+ width = Math.max(width, 500);
393
+ height = Math.max(height, 400);
394
 
395
  const config = createKnowledgeGraphConfig({
396
  width,
frontend/src/components/features/workspace/SimpleGraphVisualization.tsx CHANGED
@@ -15,8 +15,8 @@ interface SimpleGraphVisualizationProps {
15
 
16
  export function SimpleGraphVisualization({
17
  knowledgeGraph,
18
- width = 600,
19
- height = 400,
20
  graphData,
21
  }: SimpleGraphVisualizationProps) {
22
  const svgRef = useRef<SVGSVGElement>(null);
 
15
 
16
  export function SimpleGraphVisualization({
17
  knowledgeGraph,
18
+ width = 500,
19
+ height = 350,
20
  graphData,
21
  }: SimpleGraphVisualizationProps) {
22
  const svgRef = useRef<SVGSVGElement>(null);
frontend/src/components/shared/BaseGraphVisualizer.tsx CHANGED
@@ -189,8 +189,8 @@ export const BaseGraphVisualizer: React.FC<BaseGraphVisualizerProps> = ({
189
 
190
  const finalConfig = {
191
  ...config,
192
- width: Math.max(width, 400),
193
- height: Math.max(height, 400),
194
  };
195
 
196
  console.log(
 
189
 
190
  const finalConfig = {
191
  ...config,
192
+ width: Math.max(width, 350),
193
+ height: Math.max(height, 350),
194
  };
195
 
196
  console.log(
frontend/src/components/shared/modals/KnowledgeGraphModal.tsx CHANGED
@@ -417,8 +417,8 @@ export function KnowledgeGraphModal({
417
 
418
  <SimpleGraphVisualization
419
  knowledgeGraph={knowledgeGraph}
420
- width={700}
421
- height={500}
422
  graphData={graphData}
423
  />
424
  </div>
 
417
 
418
  <SimpleGraphVisualization
419
  knowledgeGraph={knowledgeGraph}
420
+ width={550}
421
+ height={400}
422
  graphData={graphData}
423
  />
424
  </div>
frontend/src/lib/graph-config-factory.ts CHANGED
@@ -6,8 +6,8 @@ import {
6
  // Default base configuration
7
  const DEFAULT_CONFIG: GraphVisualizationConfig = {
8
  type: GraphVisualizationType.FORCE_DIRECTED,
9
- width: 800,
10
- height: 600,
11
 
12
  // Node defaults
13
  nodeRadius: 10,
 
6
  // Default base configuration
7
  const DEFAULT_CONFIG: GraphVisualizationConfig = {
8
  type: GraphVisualizationType.FORCE_DIRECTED,
9
+ width: 650,
10
+ height: 450,
11
 
12
  // Node defaults
13
  nodeRadius: 10,