Commit graph

315 commits

Author SHA1 Message Date
satoqz
a3afa11830
Merge branch 'terrastruct:master' into master 2023-04-30 22:32:08 +02:00
satoqz
dc14418ace
add "PK FK" constraint to sql_table 2023-04-25 16:48:06 +02:00
Gavin Nishizawa
e6e9673ddd
arrowhead refactor 2023-04-24 18:32:24 -07:00
Antoine Poivey
760dbfe5ae
merge with master 2023-04-20 16:48:52 +02:00
Gavin Nishizawa
71d880c3e1
enforce min size for text shapes 2023-04-18 13:01:14 -07:00
Gavin Nishizawa
cd1f802d3a
remove d2graph edge.MinWidth MinHeight 2023-04-17 15:02:22 -07:00
Gavin Nishizawa
6e4faefb4b
position arrowhead labels 2023-04-17 13:01:38 -07:00
Gavin Nishizawa
5e5f9f476c
set arrowhead label dimensions 2023-04-17 13:01:38 -07:00
gavin-ts
a78698610c
Merge pull request #1198 from gavin-ts/refactor-attributes
refactor d2graph.Attributes
2023-04-14 20:18:30 -07:00
Andreas Deininger
6ae417cde9
Fixing typos
Signed-off-by: Andreas Deininger <andreas@deininger.net>
2023-04-14 07:48:22 +02:00
Gavin Nishizawa
214c95eefc
refactor d2graph.Attributes 2023-04-13 20:04:55 -07:00
Gavin Nishizawa
882df2fac9
refactor LabelWidth and LabelHeight to LabelDimensions 2023-04-13 15:43:25 -07:00
Antoine Poivey
ed79ccae74
feat: revert percentage border-radius. Accept higher border-radius value and limit it to half of the smaller shape side to be rendered as a pill 2023-04-13 16:20:31 +02:00
Gavin Nishizawa
8b791c7ed4
don't increase font size for md text if container 2023-04-12 20:19:36 -07:00
Gavin Nishizawa
d02e1ebb52
update markdown text measurement and rendering to use font-size 2023-04-12 20:14:45 -07:00
Gavin Nishizawa
c0e164e44b
rename to horizontal-gap and vertical-gap 2023-04-12 13:51:04 -07:00
Gavin Nishizawa
c20c122ee4
add grid-gap keywords 2023-04-10 18:18:48 -07:00
Alexander Wang
70b3dd7b87
add text-transform as keyword 2023-04-08 12:24:29 -07:00
Alexander Wang
343b9daaca
add space 2023-04-08 11:35:54 -07:00
Stoica Alex
a260068d2c
Add text-transform attribute to the style block
This provides an option to override the functionality provided by the
theme, or apply `text-transform` outside of the theme.

The functionality of the `text-transform` is as below:

- `text-transform: none` - will disable **any** transformation (like the uppercasing by `terminal` theme)
- `text-transform: uppercase` (uppercase not upper as per your message) - will force all characters into uppercase.
- `text-transform: lowercase` - will force all characters into lowercase.
- `text-transform: capitalize` - will uppercase the first letter of every word

In addition, this commit introduces:
- helper methods on the `d2graph.Style` struct to determine the type of
  `text-transform` to be applied.
- `ApplyTextTransform` method on the `d2graph.Attributes` which will
  transform the `Label.Value` to the correct text case.
2023-04-08 18:56:13 +01:00
Alexander Wang
305c72d239
implement classes 2023-04-07 09:57:51 -07:00
donglixiaoche
b2f905efb8
Merge branch 'master' into near-keys-for-container
Conflicts:
	d2layouts/d2near/layout.go
2023-04-07 10:40:40 +08:00
Gavin Nishizawa
a75d4dd0b9
update keywords rows -> grid-rows 2023-04-06 15:48:01 -07:00
Gavin Nishizawa
37fc3ea8e0
cleanup 2023-04-06 15:37:35 -07:00
Antoine Poivey
e59a50fd08
merge with master 2023-04-06 19:04:53 +02:00
Gavin Nishizawa
06a942cf99
rename to grid diagram 2023-04-05 11:15:52 -07:00
Gavin Nishizawa
bce774fd4a
validate edges 2023-04-04 18:45:08 -07:00
donglixiaoche
7a395ecf71
fix: cr, OutNearContianer 2023-04-05 08:31:23 +08:00
Gavin Nishizawa
c958269b03
more dynamic grid sizing according to node sizes 2023-04-03 21:38:08 -07:00
Gavin Nishizawa
d139eeadad
layout with grids 2023-04-03 13:48:38 -07:00
donglixiaoche
063d438780
fix: find outer near contaienr 2023-03-31 22:54:44 +08:00
donglixiaoche
cea4355341
fix: cr, validation for near obj connect to outside 2023-03-31 22:31:43 +08:00
donglixiaoche
9089253872
Merge branch 'master' into near-keys-for-container 2023-03-31 21:18:46 +08:00
Alexander Wang
76cc889c18
fix latex uppercasing 2023-03-29 20:11:56 -07:00
Gavin Nishizawa
4e2821de52
consider bold edge labels 2023-03-29 16:41:30 -07:00
donglixiaoche
3d45f6ab51
fix: cr, return value 2023-03-28 08:57:15 +08:00
donglixiaoche
77822318aa
fix: cr, use method instead of attribute 2023-03-27 21:38:11 +08:00
donglixiaoche
df19311f9b
fix: ignore objects inside near container when calc boundingBox 2023-03-27 21:38:10 +08:00
Alexander Wang
436531dbc2
paper pattern 2023-03-20 19:08:56 -07:00
Alexander Wang
ed2efda29a
don't uppercase code blocks 2023-03-17 20:20:30 -07:00
Antoine Poivey
58b596854b
merge with master 2023-03-17 18:54:12 +01:00
Antoine Poivey
cd1027314e
feat: check border-radius value value before checking its decimals. New rx and ry compute method. 2023-03-17 18:52:21 +01:00
Alexander Wang
65d36215f9
fix monospaced edge labels 2023-03-16 15:02:06 -07:00
Alexander Wang
384cc6e74b
[ci-base] apply caps lock to table/class headers 2023-03-16 12:21:29 -07:00
Alexander Wang
1c67286f85
[ci-base] fix again 2023-03-16 11:01:25 -07:00
Alexander Wang
64836ce827
fix 2023-03-16 10:48:54 -07:00
Alexander Wang
e11d4f4e69
apply theme to measured too 2023-03-16 10:35:38 -07:00
Alexander Wang
c30887b363
new fill-patterns, grayscale 2023-03-15 23:02:17 -07:00
Alexander Wang
4c8c2b1ab5
define new theme 2023-03-15 17:54:34 -07:00
Alexander Wang
366a36df67
compiler 2023-03-13 20:07:13 -07:00
Alexander Wang
ba282b5f96
font: mono 2023-03-09 20:06:15 -08:00
Alexander Wang
adbf9f775b
handle empty markdown for pre-measured 2023-03-09 16:55:34 -08:00
Antoine Poivey
6632740fb1
feat: add possiblity to set shape border-radius with percentage value 2023-03-09 17:10:12 +01:00
Alexander Wang
78c3f3f797
Merge branch 'master' into link-layers 2023-03-02 18:42:06 -08:00
Alexander Wang
78e6f3fc06
pr feedback 2023-03-02 17:56:32 -08:00
Gavin Nishizawa
609b3e5eb3
move person labels to outside bottom 2023-03-02 14:57:13 -08:00
Alexander Wang
85985bbaf5
ok 2023-03-01 15:38:02 -08:00
Alexander Wang
3a9745974c
save 2023-03-01 14:53:58 -08:00
Alexander Wang
8e074070d8
abs
id
2023-03-01 10:43:53 -08:00
Alexander Wang
756068bef5
save 2023-03-01 10:28:01 -08:00
Anmol Sethi
f64b5c010d
IsContainerOnly -> IsFolderOnly 2023-02-27 14:39:09 -08:00
Anmol Sethi
78b09f5007
BoardContainer -> IsContainerOnly
As discussed on slack.
2023-02-27 14:39:08 -08:00
Anmol Sethi
e4fac7840f
cli: Improve multiboard output
- Boards with subboards are now selfcontained folders with index.svg/png as
  the root board render.
- Boards that are only containers of other boards are not rendered. For example a
  scenario with no modifications and only steps only has its steps
  rendered.
- Boards with sibling boards of another type are rendered under a
  subdirectory indicating their type to separate them. For example a
  board with layers and scenarios has its layers rendered into subfolder
  layers and scenarios into subfolder scenarios.

cc @berniexie see BoardContainer field on d2target.Board for the field
you were looking for to skip renders for PDFs too.
2023-02-27 13:50:03 -08:00
Anmol Sethi
bc3942fa7e
d2graph: Actually remove board keyword check
d2ir change alone is enough.
2023-02-27 12:10:36 -08:00
Anmol Sethi
903bf7e206
Ignore BoardKeywords in d2graph and change d2ir.IDA to return from nearest board 2023-02-27 11:52:55 -08:00
Alexander Wang
fa9f402f8c
ensure 2023-02-27 10:33:35 -08:00
Alexander Wang
4411fbdabc
fix class shape in sequence diagram render 2023-02-24 20:17:09 -08:00
Vojtěch Fošnár
6c8ff99eaf
merge updates 2023-02-23 11:41:42 +01:00
Gavin Nishizawa
a346542465
add error for dagre container-child edge 2023-02-22 12:16:04 -08:00
Vojtěch Fošnár
00be0de277
Merge branch 'terrastruct:master' into master 2023-02-21 08:56:05 +01:00
Alexander Wang
aff6723d38
replace link and tooltip 2023-02-20 14:15:47 -08:00
Vojtěch Fošnár
6a89beaeb1
merge updates 2023-02-19 12:32:44 +01:00
Alexander Wang
e5b575f301
change back 2023-02-18 16:23:27 -08:00
Alexander Wang
6f81e9b96b
change 2023-02-18 16:10:44 -08:00
Alexander Wang
641a6741ff
add top, left keywords 2023-02-18 14:54:10 -08:00
Júlio César Batista
8d7dadd2ea
move comparison to serde 2023-02-18 13:56:17 -03:00
Júlio César Batista
92f774ba53
fix error messages 2023-02-18 12:20:58 -03:00
Júlio César Batista
8105f02dc7
fix root serialization 2023-02-18 12:20:28 -03:00
Júlio César Batista
3311bfee47
compare graphs 2023-02-18 12:00:58 -03:00
Júlio César Batista
1df56853b5
pr comment 2023-02-17 15:54:02 -03:00
Júlio César Batista
a6533067ec
fix test 2023-02-17 15:44:33 -03:00
Júlio César Batista
d1efedca9a
fix deserialization of obj.children 2023-02-17 15:35:19 -03:00
Anmol Sethi
11d1c111d5
d2oracle: Fix out_of_newline_container 2023-02-13 17:30:10 -08:00
Gavin Nishizawa
4de1f76751
limit oval shape aspect ratio 2023-02-13 11:23:30 -08:00
Alexander Wang
1baf999760
update right font 2023-02-06 13:14:31 -08:00
Alexander Wang
ea58e1139b
update back font size 2023-02-06 13:12:43 -08:00
Alexander Wang
01445768d8
fix for class 2023-02-06 00:47:13 -08:00
Alexander Wang
301e692a24
fix sql table font-size 2023-02-06 00:42:28 -08:00
Alexander Wang
fc3b7286a8
changes 2023-02-05 01:54:35 -08:00
Gavin Nishizawa
220351d48d
fix height of class with no rows 2023-02-03 18:28:26 -08:00
Gavin Nishizawa
f4dcaa481d
cleanup 2023-02-03 15:34:41 -08:00
Gavin Nishizawa
e524f43566
refactor and fix #699 2023-02-03 14:53:17 -08:00
Gavin Nishizawa
1567de64e1
don't set obj.LabelDimensions with padding 2023-02-03 13:53:24 -08:00
Gavin Nishizawa
4bfb6af7e6
Merge branch 'master' into shape-specific-inner-boxes 2023-02-02 20:25:52 -08:00
Anmol Sethi
8860b6b716
d2graph: Sort objects by AST order 2023-02-02 12:24:48 -08:00
Anmol Sethi
9384800435
e2etests/testdata: Fix 2023-02-02 11:55:12 -08:00
Anmol Sethi
09dc9fd12f
Merge remote-tracking branch 'upstream/master' into scenarios-a407 2023-02-02 10:33:31 -08:00
Anmol Sethi
8f58e4ca54
d2ir: Review fixes #714 2023-02-02 10:31:09 -08:00
Anmol Sethi
da500a8437
d2ir: Review fixes #714 2023-02-02 10:31:07 -08:00
Gavin Nishizawa
1b1cdaff15
Merge branch 'master' into shape-specific-inner-boxes 2023-02-01 10:31:46 -08:00
Gavin Nishizawa
491b4b7066
cleanup 2023-01-31 16:19:22 -08:00
Gavin Nishizawa
57fa903fe6
also limit person AR with width/height attributes unless both are entered 2023-01-31 16:08:06 -08:00
Vojtěch Fošnár
61bf09107a
Merge branch 'terrastruct:master' into master 2023-01-29 23:23:22 +01:00
Alexander Wang
b05ec48843
Merge pull request #710 from kevin-david/fonts
render: fonts: add bold + italic styles for Source Code Pro
2023-01-29 14:13:31 -08:00
Anmol Sethi
291f2fdfe3
d2ir: Review fixes #714 2023-01-27 23:45:04 -08:00
Anmol Sethi
30b5b64cad
d2ir: Review fixes #714 2023-01-27 23:19:50 -08:00
Anmol Sethi
192cb10a61
d2ir: Review fixes #714 2023-01-27 17:19:55 -08:00
Anmol Sethi
f056700152
d2ir: Review fixes #714 2023-01-27 17:19:12 -08:00
Vojtěch Fošnár
af2be1232f
resolved conflicts, updated tests 2023-01-27 22:30:44 +01:00
Vojtěch Fošnár
462bd1e23d
resolve conflicts 2023-01-27 21:08:01 +01:00
Gavin Nishizawa
c4db001781
fix unlabelled circle/square with desired width/height 2023-01-27 11:51:03 -08:00
Gavin Nishizawa
d6493887d9
cleanup desiredWidth/Height 2023-01-27 11:41:10 -08:00
Gavin Nishizawa
f6caac0127
use label height for padding shapes with icons 2023-01-27 10:57:55 -08:00
Gavin Nishizawa
781194e8ba
add class row ascii diagram 2023-01-27 10:52:46 -08:00
Anmol Sethi
2d36513e2c
Merge remote-tracking branch 'upstream/master' into scenarios-a407 2023-01-27 10:51:33 -08:00
Anmol Sethi
caef5a5a8f
cli: Add support for rendering layers/scenarios/steps 2023-01-27 10:41:25 -08:00
Gavin Nishizawa
c4efe2812f
check message ref is group 2023-01-26 18:39:33 -08:00
Gavin Nishizawa
74b0ed2064
only add message offset after loops in another group 2023-01-26 18:02:32 -08:00
Gavin Nishizawa
162227e196
only add extra x padding for non-special shapes 2023-01-26 16:44:19 -08:00
Gavin Nishizawa
b1beddc9e2
Adjust padding per shape 2023-01-26 16:44:19 -08:00
Gavin Nishizawa
6f26167beb
fix class dimensions 2023-01-26 16:44:19 -08:00
Gavin Nishizawa
0311a3f7d7
use paddingX and paddingY in GetDimensionsToFit 2023-01-26 16:44:19 -08:00
Gavin Nishizawa
23097370e2
set up shape specific inner bounding boxes for labels 2023-01-26 16:43:36 -08:00
Alexander Wang
bea8a47ece
Merge pull request #565 from OneRain233/master
Implement the `double_circle` shape including basic shape and the sketch.
2023-01-26 16:30:17 -08:00
Kevin David
9ba1d85d21
d2graph: check that font family is entirely loaded before using it
I tested this by removing the changes I added in `d2fonts`, which led to:
```
[21:23:54] info: compiling GetUniqueColumnName-fix.d2...
[21:23:54] err: failed to compile: ruler does not have entire font family SourceCodePro loaded, is a style missing?
```

The error was also rendered in the UI.
2023-01-24 21:25:01 -05:00
Anmol Sethi
310afcdf86
Merge remote-tracking branch 'upstream/master' into scenarios-a407 2023-01-24 15:29:38 -08:00
Alexander Wang
5059085f3c
fix empty labels with class & sql_tables w/ premeasured texts 2023-01-24 14:52:15 -08:00
Anmol Sethi
b350399d66
d2ir: Complete integration across all packages 2023-01-24 03:24:35 -08:00
Anmol Sethi
5af31670d1
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:32 -08:00
Anmol Sethi
566ea11db7
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:32 -08:00
Anmol Sethi
154c7e8947
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:30 -08:00
Anmol Sethi
3e7bdc5468
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:29 -08:00
Anmol Sethi
989fdb0fe5
d2ir: wip 2023-01-24 03:23:17 -08:00
Anmol Sethi
c9ef6ab9c9
d2graph: Implement deep copying a graph 2023-01-24 02:56:30 -08:00
Anmol Sethi
8ea2c71b99
d2graph: Remove TODO 2023-01-24 02:55:13 -08:00
OneRain2333
344718dad3 Remove double circle shape 2023-01-24 16:21:25 +08:00
OneRain2333
9575c768dc Make to be a style attribute and remove shape 2023-01-24 16:21:25 +08:00
OneRain2333
8bb86250fb Add double circle shape 2023-01-24 16:21:25 +08:00
Vojtěch Fošnár
66dc978418
resolved merge conflict 2023-01-15 21:36:43 +01:00
Gavin Nishizawa
7f13be1524
account for leading/trailing newlines when measuring code shapes 2023-01-13 20:04:46 -08:00
Vojtěch Fošnár
a81ab2d73e
support for prefers-color-scheme 2023-01-09 19:16:28 +01:00
Alexander Wang
69c062d8ea
update 2023-01-01 01:46:24 -08:00
Alexander Wang
87f0cc0cfe
fix 2023-01-01 01:34:03 -08:00
Alexander Wang
c04fcc920f
update 2022-12-31 15:59:07 -08:00
Alexander Wang
e8a56bda51
move 2022-12-31 15:54:50 -08:00
Alexander Wang
de0cf47016
default size for no text 2022-12-31 15:50:42 -08:00
Alexander Wang
e2c8b19af9
ignore empty text 2022-12-31 15:21:37 -08:00
Gavin Nishizawa
8b81428693
use header width for sql_tables if larger than row width 2022-12-29 12:01:31 -08:00
Gavin Nishizawa
f418e0681e
cleanup 2022-12-28 21:28:42 -08:00
Gavin Nishizawa
8384d96763
refactor SetDimensions 2022-12-28 21:28:41 -08:00