yeet jointjs

This commit is contained in:
1ilit 2023-09-19 15:47:08 +03:00
parent 1fb3239db0
commit 99c7407049
3 changed files with 9 additions and 63 deletions

48
package-lock.json generated
View File

@ -19,7 +19,6 @@
"codemirror": "^5.65.13",
"file-saver": "^2.0.5",
"html2canvas": "^1.4.1",
"jointjs": "^3.7.2",
"node-sql-parser": "^4.7.0",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
@ -5559,14 +5558,6 @@
"babel-plugin-transform-react-remove-prop-types": "^0.4.24"
}
},
"node_modules/backbone": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.1.tgz",
"integrity": "sha512-ADy1ztN074YkWbHi8ojJVFe3vAanO/lrzMGZWUClIP7oDD/Pjy2vrASraUP+2EVCfIiTtCW4FChVow01XneivA==",
"dependencies": {
"underscore": ">=1.8.3"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@ -6693,15 +6684,6 @@
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
},
"node_modules/dagre": {
"version": "0.8.5",
"resolved": "https://registry.npmjs.org/dagre/-/dagre-0.8.5.tgz",
"integrity": "sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==",
"dependencies": {
"graphlib": "^2.1.8",
"lodash": "^4.17.15"
}
},
"node_modules/damerau-levenshtein": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz",
@ -8909,14 +8891,6 @@
"resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag=="
},
"node_modules/graphlib": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz",
"integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==",
"dependencies": {
"lodash": "^4.17.15"
}
},
"node_modules/gzip-size": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz",
@ -11885,23 +11859,6 @@
"jiti": "bin/jiti.js"
}
},
"node_modules/jointjs": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/jointjs/-/jointjs-3.7.2.tgz",
"integrity": "sha512-0L25Q4doy3d9ypyATCVQzbNiggXzcDD/gzTB3Kk4HW0VYmKT/UDBP2XT3ROQCWza/vcUP7ZjitnikaI8nyFpew==",
"dependencies": {
"backbone": "~1.4.1",
"dagre": "~0.8.5",
"graphlib": "~2.1.8",
"jquery": "~3.6.4",
"lodash": "~4.17.21"
}
},
"node_modules/jquery": {
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.4.tgz",
"integrity": "sha512-v28EW9DWDFpzcD9O5iyJXg3R3+q+mET5JhnjJzQUZMHOv67bpSIHq81GEYpPNZHG+XXHsfSme3nxp/hndKEcsQ=="
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@ -16744,11 +16701,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/underscore": {
"version": "1.13.6",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz",
"integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A=="
},
"node_modules/unicode-canonical-property-names-ecmascript": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz",

View File

@ -14,7 +14,6 @@
"codemirror": "^5.65.13",
"file-saver": "^2.0.5",
"html2canvas": "^1.4.1",
"jointjs": "^3.7.2",
"node-sql-parser": "^4.7.0",
"react": "^18.2.0",
"react-dnd": "^16.0.1",

View File

@ -4,7 +4,6 @@ import CodeMirror from "@uiw/react-codemirror";
import { createTheme } from "@uiw/codemirror-themes";
import { sql } from "@codemirror/lang-sql";
import { tags as t } from "@lezer/highlight";
import { shapes } from "jointjs";
import Shape from "./shape";
import { saveAs } from "file-saver";
import html2canvas from "html2canvas";
@ -87,19 +86,15 @@ export default function EditorPanel(props) {
return;
}
map.current.set(t.table, t);
const rect = new shapes.standard.Rectangle();
rect.position(100, 100);
rect.resize(100, 40);
rect.attr({
body: {
fill: "#7039FF",
},
label: {
text: t.table,
fill: "white",
},
});
rect.addTo(props.graph);
const newRectangle = {
id: props.rectangles.length + 1,
x: 0,
y: 0,
width: 100,
height: 100,
label: `rect ${props.rectangles.length + 1}`,
};
props.setRectangles([...props.rectangles, newRectangle]);
});
});
} catch (e) {