Commit Graph

45 Commits

Author SHA1 Message Date
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
1ilit
2b4b01c358 Configure i18n and add simplified chinese (#99) 2024-05-16 06:45:47 +03:00
dependabot[bot]
1b9dc9dc1d
Bump follow-redirects from 1.15.5 to 1.15.6
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-24 15:51:22 +00:00
1ilit
1beed53cb6 Handle default function parsing 2024-04-20 11:40:28 +03:00
1ilit
3656d60099 Switch to codemirror 2024-04-19 17:28:32 +03:00
1ilit
2c525a2ffd Add prettier 2024-04-06 11:11:12 +03:00
1ilit
c9ad695abb Clean up dependencies 2024-03-07 13:28:43 +02:00
1ilit
420006ca57 Add vercel anaytics 2024-02-29 16:14:41 +02:00
1ilit
7cea7c9f5f Fix dependencies 2024-02-12 21:05:21 +02:00
1ilit
78d0a26807 Add instructions for custom templates tab 2024-01-29 11:39:06 +02:00
1ilit
6c65134c93 Fix precison for float bug 2024-01-18 12:45:58 +02:00
1ilit
df9a3f8089 Add framer motion 2024-01-18 09:21:30 +02:00
1ilit
d080790aed Add dashboard 2024-01-08 19:39:27 +02:00
1ilit
fa1ea7a9d4 Connect to login endpoint 2024-01-07 05:10:34 +02:00
1ilit
ece4a9e95a Fix import 2023-12-20 02:57:29 +02:00
1ilit
46685a98fe Migrate to Vite from CRA 2023-12-16 05:39:13 +02:00
1ilit
69dd120c0d Add favicon 2023-10-21 14:37:04 +03:00
1ilit
bb0229ac5c Add signup page 2023-09-24 19:38:39 +03:00
1ilit
03c981f65f Submit bug reports by email 2023-09-22 20:09:02 +03:00
1ilit
45c95c7f11 Add rich text editot 2023-09-19 15:51:59 +03:00
1ilit
f2b02e5d42 Add bug report page 2023-09-19 15:51:49 +03:00
1ilit
4181ef4c74 refactor chat 2023-09-19 15:51:00 +03:00
1ilit
274c434206 added chat 2023-09-19 15:50:57 +03:00
1ilit
348363acbb parse tables 2023-09-19 15:50:39 +03:00
1ilit
38da28ac99 migrate to monaco editor 2023-09-19 15:50:37 +03:00
1ilit
2d36c04a49 keyboard shortcuts baby 2023-09-19 15:50:22 +03:00
1ilit
44e179f15a yum 2023-09-19 15:50:02 +03:00
1ilit
16bc0edd36 more undo redo for resize and panning 2023-09-19 15:50:00 +03:00
1ilit
db843f32f3 File validation 2023-09-19 15:49:28 +03:00
1ilit
a3307784cd Export to pdf 2023-09-19 15:49:24 +03:00
1ilit
974c254e48 Parse diagram to json 2023-09-19 15:49:20 +03:00
1ilit
16102ac7a9 Remove resizable lib 2023-09-19 15:48:30 +03:00
1ilit
c83667be4e brr 2023-09-19 15:48:24 +03:00
1ilit
7f6a2d208f fix deleting tables 2023-09-19 15:48:13 +03:00
1ilit
a49e90991b legalize nuclear bombs 2023-09-19 15:48:08 +03:00
1ilit
eeec8998e0 add modal for new fields 2023-09-19 15:47:24 +03:00
1ilit
99c7407049 yeet jointjs 2023-09-19 15:47:08 +03:00
1ilit
1fb3239db0 Get rid of jointjs 2023-09-19 15:47:06 +03:00
1ilit
62ad20fb1d parse sql into gui yaaayy 2023-09-19 15:47:04 +03:00
1ilit
4cfc2edc81 Add exporting src and diagram as img 2023-09-19 15:47:03 +03:00
1ilit
09c84e0379 stinky poopy working code to add shapes 2023-09-19 15:46:54 +03:00
1ilit
fb96932379 Add code editor 2023-09-19 15:46:50 +03:00
1ilit
e65905cd3e Make windows 2023-09-19 15:46:44 +03:00
1ilit
db580f892d Add tailwind 2023-09-19 15:46:40 +03:00
1ilit
cc6e46f4c3 Initial commit 2023-09-19 15:46:33 +03:00