diff --git a/frontend/src/components/CanvasGraph.tsx b/frontend/src/components/CanvasGraph.tsx index 0e262a8..7d5219d 100644 --- a/frontend/src/components/CanvasGraph.tsx +++ b/frontend/src/components/CanvasGraph.tsx @@ -35,15 +35,15 @@ interface CanvasGraphProps { } // Physics constants -const NODE_RADIUS = 45; // Node radius in pixels -const MIN_DISTANCE = 110; // Minimum distance between any two nodes -const MAX_DISTANCE = 500; // Maximum distance between connected nodes -const REPULSION_STRENGTH = 500; // How strongly nodes repel each other when too close +const NODE_RADIUS = 50; // Node radius in pixels +const MIN_DISTANCE = 250; // Minimum distance between any two nodes +const MAX_DISTANCE = 800; // Maximum distance between connected nodes +const REPULSION_STRENGTH = 400; // How strongly nodes repel each other when too close const ATTRACTION_STRENGTH = 0.1; // Default attraction between connected nodes const CONSTRAINT_STRENGTH = 0.2; // Strength of distance constraints const DAMPING = 0.6; // Damping factor for velocity (0-1) const CENTER_GRAVITY = 0.01; // Force pulling nodes to the center -const MAX_VELOCITY = 5; // Maximum velocity to prevent wild movement +const MAX_VELOCITY = 4; // Maximum velocity to prevent wild movement const COOLING_FACTOR = 0.99; // System gradually cools down const CanvasGraph: React.FC = ({ data, width, height }) => { diff --git a/frontend/src/components/Modals.tsx b/frontend/src/components/Modals.tsx index f8c8bfd..93747e7 100644 --- a/frontend/src/components/Modals.tsx +++ b/frontend/src/components/Modals.tsx @@ -1,24 +1,10 @@ import React from 'react'; import DatePicker from 'react-datepicker'; -import { - FaPlus, - FaRegCalendarAlt, - FaSave, - FaStar, - FaTrash, - FaUserFriends, - FaUserPlus, -} from 'react-icons/fa'; +import { FaPlus, FaRegCalendarAlt, FaSave, FaStar, FaTrash, FaUserFriends, FaUserPlus } from 'react-icons/fa'; import { Button, FormField, Modal } from '../components/FriendshipNetworkComponents'; -import { - PersonNode, - RelationshipEdge, - FormErrors, - NewPersonForm, - NewRelationshipForm, -} from '../types/network'; +import { FormErrors, NewPersonForm, NewRelationshipForm, PersonNode, RelationshipEdge } from '../types/network'; import { getRelationshipColor, @@ -26,13 +12,7 @@ import { RELATIONSHIP_TYPES, RELATIONSHIPS, } from '../types/RelationShipTypes'; -import { - ErrorMessage, - KeyboardShortcut, - OptionGroup, - TipItem, - ToggleSetting, -} from './UIComponents'; +import { ErrorMessage, KeyboardShortcut, OptionGroup, TipItem, ToggleSetting } from './UIComponents'; // ============================== // Person Form Modal @@ -48,14 +28,14 @@ interface PersonFormModalProps { } export const PersonFormModal: React.FC = ({ - isOpen, - onClose, - formData, - setFormData, - errors, - onSubmit, - isEdit = false, -}) => { + isOpen, + onClose, + formData, + setFormData, + errors, + onSubmit, + isEdit = false, + }) => { return (
@@ -141,14 +121,14 @@ interface RelationshipFormModalProps { } export const RelationshipFormModal: React.FC = ({ - isOpen, - onClose, - formData, - setFormData, - errors, - onSubmit, - people, -}) => { + isOpen, + onClose, + formData, + setFormData, + errors, + onSubmit, + people, + }) => { return ( @@ -289,19 +269,19 @@ interface PersonDetailModalProps { } export const PersonDetailModal: React.FC = ({ - isOpen, - onClose, - person, - setPerson, - errors, - onSubmit, - onDelete, - relationships, - people, - onDeleteRelationship, - onAddNewConnection, - onNavigateToPerson, -}) => { + isOpen, + onClose, + person, + setPerson, + errors, + onSubmit, + onDelete, + relationships, + people, + onDeleteRelationship, + onAddNewConnection, + onNavigateToPerson, + }) => { return (
@@ -380,7 +360,7 @@ export const PersonDetailModal: React.FC = ({

Connections

{relationships.filter( - (r: RelationshipEdge) => r.source === person._id || r.target === person._id + (r: RelationshipEdge) => r.source === person._id || r.target === person._id, ).length > 0 ? ( relationships .filter((r: RelationshipEdge) => r.source === person._id || r.target === person._id) @@ -465,11 +445,11 @@ interface SettingsModalProps { } export const SettingsModal: React.FC = ({ - isOpen, - onClose, - settings, - setSettings, -}) => { + isOpen, + onClose, + settings, + setSettings, + }) => { return (