rubenmate / draw-entity-relation

A web application developed as my final project for the Computer Engineering Degree. It allows users to model entity-relationship diagrams and export them to SQL scripts after validation.
https://draw-entity-relation.vercel.app
0 stars 1 forks source link

Feature: Better attributes drawing management #25

Closed rubenmate closed 2 weeks ago

rubenmate commented 1 month ago

Background:

When users add new attributes, they are automatically positioned based on a default setting. This placement often causes overlapping, making it difficult to visually count or distinguish individual attributes without manually adjusting their positions. Also when a user moves an entity all its attributes will preserve its position.

Goal:

Implement a feature that dynamically adjusts the positioning of newly added attributes to prevent overlap, enhancing visibility and usability. Implement a feature that moves the attributes to the new position with the same offset as previously.

Proposed Solution:

Utilize an algorithm to calculate optimal positions for new attributes based on existing ones. We can define a predefined positions and check if that position that we are going to add has an attribute or not. When moving an entity edit the attributes position to set them back at that initial offsets.