DrawDB 官网自定义修改版。
Go to file
Felix Zedén Yverås e4e22dee20 fix: rewrite coordinate management
After some initial smaller fixes, it turned out that I had broken
the red line used when linking fields. Fixing this was not trivial
as I found myself battling a lot of small bugs relating to scale
and translation in the existing code. This was made extra difficult
as a lot of coordinates were calculated when necessary in
Canvas.jsx.

This commit attempts to simplify the coordinate management in a few
different ways:
* There are now two distinct coordinate systems in use, typically
  referred to as "spaces". Screen space and diagram space.
* Diagram space is no longer measured in pixels (though the
  dimension-less measure used instead still maps to pixels at 100%
  zoom).
* The canvas now exposes helper methods for transforming between
  spaces.
* Zoom and translation is now managed via the svg viewBox property.
  * This makes moving items in diagram space much easier as the
    coordinates remain constant regardless of zoom level.
* The canvas now wraps the current mouse position in a context
  object, making mouse movement much easier to work with.
* The transform.pan property now refers to the center of the screen.

A new feature in this commit is that scroll wheel zoom is now based
on the current cursor location, making the diagram more convenient
to move around in.

I have tried to focus on Canvas.jsx and avoid changes that might be
desctructive on existing save files. I also believe more refactors
and abstractions could be introduced based on these changes to make
the diagram even easier to work with. However, I deem that out of
scope for now.
2024-07-17 22:22:52 +02:00
.github Add FUNDING.yml 2024-07-02 13:18:38 +03:00
public Add robots.txt 2024-04-06 05:19:13 +03:00
src fix: rewrite coordinate management 2024-07-17 22:22:52 +02:00
.dockerignore Create .dockerignore 2024-05-22 15:17:07 +03:00
.env.sample Fix env variables 2024-03-15 21:09:50 +02:00
.eslintrc.cjs Add prettier 2024-04-06 11:11:12 +03:00
.gitignore Migrate to Vite from CRA 2023-12-16 05:39:13 +02:00
.prettierrc.json Add prettier 2024-04-06 11:11:12 +03:00
compose.yml Expose host directly in compose 2024-06-01 20:53:07 +03:00
CONTRIBUTING.md Create CONTRIBUTING.md 2024-05-22 14:59:41 +03:00
Dockerfile Fix dockerfile comments 2024-04-14 10:20:14 +03:00
drawdb.gif Update Readme 2024-04-06 12:39:13 +03:00
index.html fix: update remaining vercel urls to drawdb.app 2024-07-13 12:58:36 +02:00
LICENSE Add license 2024-04-06 10:55:54 +03:00
package-lock.json fix: rewrite coordinate management 2024-07-17 22:22:52 +02:00
package.json fix: rewrite coordinate management 2024-07-17 22:22:52 +02:00
postcss.config.js Migrate to Vite from CRA 2023-12-16 05:39:13 +02:00
README.md fix: update remaining vercel urls to drawdb.app 2024-07-13 12:58:36 +02:00
tailwind.config.js Redo signup page 2024-01-03 21:37:44 +02:00
vercel.json Add vercel.json 2024-02-27 15:16:14 +02:00
vite.config.js Migrate to Vite from CRA 2023-12-16 05:39:13 +02:00

drawdb logo

Free, simple, and intuitive database design tool and SQL generator.

drawDB · Discord · X

demo

drawDB

DrawDB is a robust and user-friendly database entity relationship (DBER) editor right in your browser. Build diagrams with a few clicks, export sql scripts, customize your editor, and more without creating an account. See the full set of features here.

Getting Started

Local Development

git clone https://github.com/drawdb-io/drawdb
cd drawdb
npm install
npm run dev

Build

git clone https://github.com/drawdb-io/drawdb
cd drawdb
npm install
npm run build

Docker Build

docker build -t drawdb .
docker run -p 3000:80 drawdb

Set up the server and environment variables according to .env.sample for the survey and bug report forms.