-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Crow's Foot and IDEF1X notation for diagrams #334
base: main
Are you sure you want to change the base?
Conversation
@Francisco-Galindo is attempting to deploy a commit to the dottle's projects Team on Vercel. A member of the Team first needs to authorize it. |
nice work, is this pr ready for review? |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@1ilit could you please approve CI to build / deploy? we think this is ready for reciew : ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work guys, really appreciate it. I'm leaving some comments for now but will take a closer look once these are resolved. Feel free to reach out if you need clarification or have any questions
@@ -134,7 +134,8 @@ | |||
} | |||
|
|||
.table-border { | |||
border-color: rgba(var(--semi-grey-2), 1); | |||
/* border-color: rgba(var(--semi-grey-2), 1); */ | |||
border-color: rgba(0, 255, 0, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for this change? Actaully i'm checking now and this class is not used anywhere you can remove it if it has no use
@@ -50,6 +50,10 @@ const en = { | |||
reset_view: "Reset view", | |||
show_grid: "Show grid", | |||
show_cardinality: "Show cardinality", | |||
default_notation: "Default notation", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the word 'notation' here so that we have 'Notation'>'Crow's foot' | 'IDEF1X' | 'Default'
@@ -10,6 +10,7 @@ const defaultSettings = { | |||
panning: true, | |||
showCardinality: true, | |||
showRelationshipLabels: true, | |||
notation: "default", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using string constants here let's have an object like this in constants.js
const Notation = {
DEFAULT: "default",
CROWS_FOOT: "crows_foot",
IDEF1X: "idef1x",
NONE: "none",
};
and you can use Notation.DEFAULT
, for example, instead of constants
This way we can mimic an enum and have a more unified approach
notation: { | ||
children: [ | ||
{ | ||
default_notation: () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you add the Notation
object you can reuse the keys here
idef1x_notation: () => { | ||
setSettings((prev) => ({ ...prev, notation: "idef1x" })); | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also keep the option to not show cardinalities at all. Some people, e.g. me, don't really care about the cardinality and prefer not to set it and not to show it
</text> | ||
</> | ||
)} | ||
{format(pathRef.current, cardinalityEndX, cardinalityEndY, cardinalityStartX, cardinalityStartY, direction, cardinalityStart, cardinalityEnd)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format this
y2={cardinalityEndY-15} | ||
stroke="gray" | ||
strokeWidth='2' | ||
className="group-hover:fill-sky-700" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -10,6 +10,7 @@ const defaultSettings = { | |||
panning: true, | |||
showCardinality: true, | |||
showRelationshipLabels: true, | |||
notation: "default", | |||
tableWidth: tableWidth, | |||
showDebugCoordinates: false, | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On line 26 add this to prevent any errors that might arise for the cached settings not containing the notation field
setSettings({ ...defaultSettings, ...JSON.parse(settings) });
@@ -10,6 +10,8 @@ import { useDiagram, useSettings, useLayout, useSelect } from "../../hooks"; | |||
import { useTranslation } from "react-i18next"; | |||
import { SideSheet } from "@douyinfe/semi-ui"; | |||
import RelationshipInfo from "../EditorSidePanel/RelationshipsTab/RelationshipInfo"; | |||
import { CrowOM, CrowOO, CrowZM, IDEFZM, DefaultNotation } from "./RelationshipFormat"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CromZM is imported but not used, causes linting error. Also remove the function definition if not used
@@ -10,6 +10,7 @@ const defaultSettings = { | |||
panning: true, | |||
showCardinality: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer used
We want to add both notations to the editor, through a setting so users can select which notation they like best. Adding IDEF1X in particular this would allow our school to use this project as their main DBER editor. Would fix #301.
Support for hierarchical relationships is being worked on, in a non-breaking manner so this doesn't disrupt other people's workflows.
IDEF1X would look like this:

Hierarchies would look something like this:
