@@ -293,10 +322,50 @@ export default function Table(props) {
function field(fieldData, index) {
return (
{
if (!e.isPrimary) return;
@@ -324,7 +393,11 @@ export default function Table(props) {
} flex items-center gap-2 overflow-hidden`}
>
diff --git a/src/components/EditorHeader/ControlPanel.jsx b/src/components/EditorHeader/ControlPanel.jsx
index feef7a5b..caa3a66a 100644
--- a/src/components/EditorHeader/ControlPanel.jsx
+++ b/src/components/EditorHeader/ControlPanel.jsx
@@ -42,6 +42,7 @@ import {
SIDESHEET,
DB,
IMPORT_FROM,
+ Notation,
} from "../../data/constants";
import jsPDF from "jspdf";
import { useHotkeys } from "react-hotkeys-hook";
@@ -1323,6 +1324,26 @@ export default function ControlPanel({
showCardinality: !prev.showCardinality,
})),
},
+ notation: {
+ children: [
+ {
+ default_notation: () => {
+ setSettings((prev) => ({ ...prev, notation: Notation.DEFAULT }));
+ },
+ },
+ {
+ crows_foot_notation: () => {
+ setSettings((prev) => ({ ...prev, notation: Notation.CROWS_FOOT }));
+ },
+ },
+ {
+ idef1x_notation: () => {
+ setSettings((prev) => ({ ...prev, notation: Notation.IDEF1X }));
+ },
+ },
+ ],
+ function: () => {},
+ },
show_relationship_labels: {
state: settings.showRelationshipLabels ? (
diff --git a/src/context/SettingsContext.jsx b/src/context/SettingsContext.jsx
index 19cd69ec..3da6fedd 100644
--- a/src/context/SettingsContext.jsx
+++ b/src/context/SettingsContext.jsx
@@ -1,6 +1,5 @@
import { createContext, useEffect, useState } from "react";
-import { tableWidth } from "../data/constants";
-
+import { tableWidth, Notation } from "../data/constants";
const defaultSettings = {
strictMode: false,
showFieldSummary: true,
@@ -11,6 +10,7 @@ const defaultSettings = {
panning: true,
showCardinality: true,
showRelationshipLabels: true,
+ notation: Notation.DEFAULT,
tableWidth: tableWidth,
showDebugCoordinates: false,
};
diff --git a/src/data/constants.js b/src/data/constants.js
index 80020c1e..6e9b7a48 100644
--- a/src/data/constants.js
+++ b/src/data/constants.js
@@ -11,7 +11,11 @@ export const Cardinality = {
ONE_TO_MANY: "one_to_many",
MANY_TO_ONE: "many_to_one",
};
-
+export const Notation = {
+ DEFAULT: "default",
+ CROWS_FOOT: "crows_foot",
+ IDEF1X: "idef1x",
+}
export const Constraint = {
NONE: "No action",
RESTRICT: "Restrict",
diff --git a/src/i18n/locales/en.js b/src/i18n/locales/en.js
index 472d86ab..a78eaf82 100644
--- a/src/i18n/locales/en.js
+++ b/src/i18n/locales/en.js
@@ -51,6 +51,10 @@ const en = {
show_grid: "Show grid",
show_datatype: "Show datatype",
show_cardinality: "Show cardinality",
+ default_notation: "Default",
+ crows_foot_notation: "Crow's foot",
+ idef1x_notation: "IDEF1X",
+ notation: "Notation",
theme: "Theme",
light: "Light",
dark: "Dark",
diff --git a/src/i18n/locales/es.js b/src/i18n/locales/es.js
index 38eaf3a3..ce576394 100644
--- a/src/i18n/locales/es.js
+++ b/src/i18n/locales/es.js
@@ -50,6 +50,10 @@ const es = {
reset_view: "Restablecer vista",
show_grid: "Mostrar cuadrícula",
show_cardinality: "Mostrar cardinalidad",
+ notation: "Notación",
+ default_notation: "Notación predeterminada",
+ crows_foot_notation: "Notación Crow's Foot",
+ idef1x_notation: "Notación IDEF1X",
theme: "Tema",
light: "Claro",
dark: "Oscuro",