Commit graph

370 commits

Author SHA1 Message Date
Alexander Wang
92d87b553f
new implementation 2023-07-11 17:19:34 -07:00
Alexander Wang
4a9327e102
non-root err check 2023-07-11 15:05:16 -07:00
Alexander Wang
85cf491d74
quotes 2023-07-11 14:56:09 -07:00
Alexander Wang
a6125c46ec
cleanup 2023-07-11 14:01:35 -07:00
Alexander Wang
741a9aa306
cleanup 2023-07-11 13:40:44 -07:00
Alexander Wang
090d10e9ca
handle interpolation 2023-07-11 13:32:07 -07:00
Alexander Wang
e7e2566564
save 2023-07-11 11:19:50 -07:00
Alexander Wang
08cc907f07
more test 2023-07-10 22:22:04 -07:00
Alexander Wang
0347dff7a4
more tests 2023-07-10 22:02:58 -07:00
Alexander Wang
acdbfddf23
add replace tests 2023-07-10 21:56:10 -07:00
Alexander Wang
7269ee1706
add overlay tests 2023-07-10 21:54:34 -07:00
Alexander Wang
fd70b5ef46
layers work 2023-07-10 21:32:30 -07:00
Alexander Wang
05802edb07
edge label working 2023-07-10 21:18:18 -07:00
Alexander Wang
c9793b9a87
label works 2023-07-10 19:24:21 -07:00
Alexander Wang
db051a95b6
pr fixes 2023-07-03 15:58:22 -07:00
Alexander Wang
2cce7a89c8
Revert "portal keyword"
This reverts commit 92cfc5c40a.
2023-07-01 20:31:45 -07:00
Alexander Wang
92cfc5c40a
portal keyword 2023-07-01 16:36:33 -07:00
Alexander Wang
0749d4fb41
attribute 2023-06-26 12:15:24 -07:00
Alexander Wang
1acc3d685a
new implementation 2023-06-26 11:57:18 -07:00
Alexander Wang
905a9317a2
fix 2023-06-26 10:51:07 -07:00
Alexander Wang
5be1f6c187
cleanup 2023-06-26 10:39:38 -07:00
Alexander Wang
02fa36d598
save 2023-06-26 10:36:12 -07:00
Alexander Wang
e1eecf7c7b
reimplement 2023-06-25 23:11:47 -07:00
Alexander Wang
09d1ec6314
reimplement 2023-06-25 23:10:56 -07:00
Alexander Wang
757f292a20
edge works 2023-06-25 20:36:10 -07:00
Alexander Wang
6749115ce2
reappear works 2023-06-25 18:59:53 -07:00
Alexander Wang
48bb6df3fe
save 2023-06-25 18:43:30 -07:00
Alexander Wang
80ddea94fa
set on edge. fix arrowhead setting case 2023-06-25 11:51:21 -07:00
Alexander Wang
6f9e478f59
label and icon position attributes 2023-06-22 16:13:08 -07:00
Alexander Wang
21d2c44413
set wip 2023-06-20 18:56:03 -07:00
Alexander Wang
a25f418c12
new implementation 2023-06-20 18:56:02 -07:00
Alexander Wang
1ff119d803
baseAST 2023-06-20 18:56:02 -07:00
Alexander Wang
c790ddd172
fix 2023-06-18 11:19:37 -07:00
Alexander Wang
77911aa313
Merge pull request #1414 from alixander/board-ast
use right AST for nested board
2023-06-17 22:22:57 -07:00
Alexander Wang
b30f9702bd
fix shape composite 2023-06-16 16:50:16 -07:00
Alexander Wang
64daf4643f
use right AST 2023-06-16 16:23:57 -07:00
Alexander Wang
8b8afb2638
fix idval edge case 2023-06-12 11:26:51 -07:00
Anmol Sethi
1f891a3c9e
d2ir: Fix for windows
Closes #1388
2023-06-09 19:45:31 -07:00
Gavin Nishizawa
28be902870
don't consider tooltip value a valid url if host is empty 2023-06-09 14:10:51 -07:00
Gavin Nishizawa
405f1c9777
add test 2023-06-09 14:10:49 -07:00
Alexander Wang
a283e619bb
prevent bad constraint usage 2023-06-08 11:07:46 -07:00
Alexander Wang
538812f928
Merge branch 'master' into imports 2023-06-07 15:38:52 -07:00
Alexander Wang
0d4392eac2
add class array footgun 2023-06-06 20:24:47 -07:00
Anmol Sethi
de0a863e9f
d2: Fix nested import spread ghost container bug 2023-06-06 15:09:27 -07:00
Anmol Sethi
111759f6bd
d2cli: Pass path for imports correctly 2023-06-06 13:44:41 -07:00
Anmol Sethi
2fcc9ed140
d2ir: Compile imports
Works as so:

index.d2:
```d2
x: @x
```

x.d2:
```d2
label: meow
shape: circle
```

TODO:

- [ ] Correctly import into fields by handling the scenarios/steps overlay.
      - And links.
- [ ] Test every kind of import.
2023-06-04 23:31:18 -07:00
satoqz
78995c38bd
Merge branch 'terrastruct:master' into master 2023-06-03 13:57:52 +02:00
Bernard Xie
cd09aba54f
trim space 2023-06-02 10:42:44 -07:00
Bernard Xie
1a6b1a4084
add test 2023-06-01 18:48:37 -07:00
Bernard Xie
3db70bb31d
Update compile.go 2023-06-01 18:42:43 -07:00
Alexander Wang
6d2b77170b
fix arrowhead overriding 2023-06-01 17:11:11 -07:00
Alexander Wang
e998a95b96
d2ir: prevent illegal non-tail keywords 2023-05-31 23:04:09 -07:00
Alexander Wang
3afbf724f0
fix 2023-05-16 10:45:35 -07:00
Gavin Nishizawa
590a18c8bd
update compile test 2023-05-10 12:57:40 -07:00
Gavin Nishizawa
aff2c5c68e
layout nested grids 2023-05-10 12:57:38 -07:00
satoqz
14f88e2db9
address code review 2023-05-03 13:42:31 +02:00
satoqz
fd8eee7219
implement compiler changes 2023-05-01 13:59:57 +02:00
Alexander Wang
ddd997e3f0
add md block info 2023-04-29 20:45:03 -07:00
Alexander Wang
b08431b73a
Merge pull request #1256 from alixander/class-array
implement arrays for classes
2023-04-27 15:21:06 -07:00
Alexander Wang
7c401a4806
implement arrays for classes
update

changelog
2023-04-27 15:12:39 -07:00
Alexander Wang
72b0f62bf0
fix test 2023-04-27 11:58:42 -07:00
Alexander Wang
595fafc4c8
fix class
style validation

changelog
2023-04-27 11:48:07 -07:00
Alexander Wang
16478fd894
fix classes panic 2023-04-26 12:40:42 -07:00
Antoine Poivey
760dbfe5ae
merge with master 2023-04-20 16:48:52 +02: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
Antoine Poivey
b2d0a44e2f
remove border-radius percent tests, add border-radius pill (with a big value) test 2023-04-13 18:18:28 +02:00
Gavin Nishizawa
c0e164e44b
rename to horizontal-gap and vertical-gap 2023-04-12 13:51:04 -07:00
Gavin Nishizawa
e871cee0bb
add compile test 2023-04-10 18:21:39 -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
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
Alexander Wang
ad880fa9be
Merge pull request #1090 from alixander/scenarios-bug
fix scenarios/steps inheritence
2023-04-06 22:27:03 -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
Alexander Wang
a2cffc9341
fix inheritence bug 2023-04-05 19:29:08 -07:00
donglixiaoche
e61629e692
fix: cr 2023-04-06 05:00:12 +08:00
Gavin Nishizawa
06a942cf99
rename to grid diagram 2023-04-05 11:15:52 -07:00
Gavin Nishizawa
04775c8491
validate descendants 2023-04-04 21:00:40 -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
06fb313d3e
values must be positive 2023-04-03 13:49:10 -07:00
Gavin Nishizawa
d139eeadad
layout with grids 2023-04-03 13:48:38 -07: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
Antoine Poivey
e96eb4c6f0
add compile test 2023-03-30 18:43:16 +02:00
donglixiaoche
ad515e6110
chore: regenerate testcases 2023-03-30 18:15:35 +08:00
donglixiaoche
6ee58d756e
fix: cr, error info 2023-03-30 18:15:11 +08:00
Gavin Nishizawa
ad2e3af900
add compiler error for neara set to title with constant near 2023-03-28 11:37:40 -07:00
donglixiaoche
b9dd247c75
fix: cr, validateNear outside connection 2023-03-28 21:10:37 +08:00
alankan886
bb54d03033
compiler: Compiler error when Link is set and Tooltip is an URL 2023-03-28 00:12:05 -04:00
alankan886
1250ad3ea7
# This is a combination of 2 commits.
# This is the 1st commit message:

compiler: Compiler error when Link is set and Tooltip is an URL

# The commit message #2 will be skipped:

# Update changelog
2023-03-28 00:02:27 -04:00
donglixiaoche
22cce86892
fix: cr, add validation for near connectioins 2023-03-27 21:38:09 +08:00
donglixiaoche
72253e892f
fix: compile_test testcase 2023-03-27 21:38:09 +08:00
donglixiaoche
1af6896883
fix: revert near_bad_connected compile_test 2023-03-27 21:38:09 +08:00
donglixiaoche
597385e19c
fix: delete redundant testcases 2023-03-27 21:38:09 +08:00
donglixiaoche
115f46f428
feat: descendants now is allowed for container with near attribute 2023-03-27 21:38:08 +08:00
Alexander Wang
436531dbc2
paper pattern 2023-03-20 19:08:56 -07:00
Alexander Wang
c30887b363
new fill-patterns, grayscale 2023-03-15 23:02:17 -07:00
Alexander Wang
366a36df67
compiler 2023-03-13 20:07:13 -07:00
Alexander Wang
a9433a5204
fix arrowhead label detection 2023-03-11 21:33:03 -08:00
Alexander Wang
a556160306
validate markdown 2023-03-07 09:38:19 -08:00
Alexander Wang
9199554800
give err msg for invalid edge style 2023-03-06 22:44:45 -08:00
Alexander Wang
60c912c605
compile reserved keys to lowercase in IR 2023-03-06 16:38:13 -08:00
Alexander Wang
e13be5c09a
fix 2023-03-02 19:32:31 -08:00
Alexander Wang
81ce1f8209
pr feedback 2023-03-02 18:25:14 -08:00
Alexander Wang
78e6f3fc06
pr feedback 2023-03-02 17:56:32 -08:00
Alexander Wang
2997a6ef59
test 2023-03-01 15:40:08 -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
9fd773bbb7
save 2023-03-01 11:27:58 -08:00
Alexander Wang
5c96ffe6a1
save 2023-03-01 11:27:18 -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
Alexander Wang
f5e9114786
fix 2023-02-28 14:30:25 -08:00
Alexander Wang
e83cf8d157
Merge branch 'master' into link-layers 2023-02-28 14:28:33 -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
Alexander Wang
be09118633
Merge pull request #876 from alixander/fix-d2oracle-underscore
compiler: Fix underscore reference
2023-02-27 12:10:07 -08:00
Alexander Wang
6594ffc904
cleanup 2023-02-27 10:33:35 -08:00
Alexander Wang
fa9f402f8c
ensure 2023-02-27 10:33:35 -08:00
Alexander Wang
1bc5d90d22
add failing compiler test 2023-02-27 10:33:34 -08:00
Jett Chen
c9477639cc
Merge branch 'master' into 3d-hexagon 2023-02-27 10:22:09 +08:00
JettChenT
5b5a976b7c
squash commits
upate tests

Update changelog

add support for Fill

update test case

resolve changes
2023-02-27 09:50:18 +08:00
Alexander Wang
1fcb075e04
no near 2023-02-24 19:05:23 -08:00
Anmol Sethi
f0eba7dda7
d2compiler: Fix sequence-timestamp test 2023-02-22 16:07:24 -08:00
Alexander Wang
389f4cb9d3
failing test 2023-02-22 13:21:29 -08:00
Alexander Wang
6dee552e1a
nvm on 1 2023-02-21 20:26:20 -08:00
Alexander Wang
264ce21d60
validate top left 2023-02-21 20:10:34 -08:00
Alexander Wang
f7a5689280
fix 2023-02-20 14:18:55 -08:00
Alexander Wang
aff6723d38
replace link and tooltip 2023-02-20 14:15:47 -08:00
Alexander Wang
5f750f7109
Merge branch 'master' into container-dimensions 2023-02-20 09:07:12 -08:00
Alexander Wang
f1ac119c09
validate near key better 2023-02-19 08:15:59 -08:00
Alexander Wang
5ff1909935
container dimensions 2023-02-18 23:35:18 -08:00
Alexander Wang
e5b575f301
change back 2023-02-18 16:23:27 -08:00
Alexander Wang
315af7a2c2
change 2023-02-18 16:15:14 -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
Alexander Wang
4dbae3c925
prevent sql table and class from having nested children 2023-02-16 17:44:54 -08:00
Alexander Wang
5a021b8918
oops 2023-02-14 16:52:50 -08:00
Alexander Wang
a81ea842cf
add assertion 2023-02-14 16:48:16 -08:00
Alexander Wang
40b4879f47
fix underscore bug in compiler 2023-02-14 16:45:55 -08:00
Anmol Sethi
11d1c111d5
d2oracle: Fix out_of_newline_container 2023-02-13 17:30:10 -08:00
Alexander Wang
39e6f73b11
add failing test 2023-02-05 11:04:38 -08:00
Alexander Wang
102560a8ad
implement validation 2023-02-05 10:36:38 -08:00
Anmol Sethi
8860b6b716
d2graph: Sort objects by AST order 2023-02-02 12:24:48 -08:00
Anmol Sethi
8f58e4ca54
d2ir: Review fixes #714 2023-02-02 10:31:09 -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
654475f286
Fix e2etests report generation and update testdata 2023-01-27 22:20:10 -08:00
Anmol Sethi
f056700152
d2ir: Review fixes #714 2023-01-27 17:19:12 -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
Anmol Sethi
b350399d66
d2ir: Complete integration across all packages 2023-01-24 03:24:35 -08:00
Anmol Sethi
7d011bab47
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:33 -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
b900f63414
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:31 -08:00
Anmol Sethi
154c7e8947
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:30 -08:00
Anmol Sethi
afa26752e6
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:28 -08:00
Anmol Sethi
6543bf217a
d2compiler: Integrate d2ir (wip) 2023-01-24 03:24:28 -08:00
Anmol Sethi
748557d8f2
d2ir: IR Root wip 2023-01-24 03:24:24 -08:00
Anmol Sethi
c9ef6ab9c9
d2graph: Implement deep copying a graph 2023-01-24 02:56:30 -08:00
Anmol Sethi
ecd61cdb49
d2compiler: Remove another old now irrelevant TODO 2023-01-24 02:55:13 -08:00
Anmol Sethi
49428367a5
d2compiler: Remove old TODO 2023-01-24 02:55:13 -08:00
OneRain2333
9a070a52f9 Add double bordered rect, oval, square 2023-01-24 16:21:25 +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
Alexander Wang
1420dab5a9
also transfer arrowheads 2023-01-13 08:26:38 -08:00
Alexander Wang
adee356d81
fix sql attributes 2023-01-13 08:21:32 -08:00
Júlio César Batista
567009971d
pr comment 2023-01-06 16:49:17 -03:00
Júlio César Batista
07b3032eea
Merge branch 'master' into gh-1967-column-index 2023-01-06 16:12:33 -03:00
Júlio César Batista
5fc492669e
Fix table prefix check 2023-01-06 16:03:39 -03:00
Alexander Wang
54368d8672
fix dimension with style 2023-01-06 11:01:45 -08:00
Gavin Nishizawa
ae4e6364ea
add compiler error for using width or height on a container 2022-12-28 21:28:42 -08:00
Gavin Nishizawa
fbf48fa0ff
compile error for circle/square shapes with different width and height 2022-12-28 21:28:42 -08:00
Gavin Nishizawa
5d4059e470
support setting width/height on non-image shapes 2022-12-28 21:27:33 -08:00
Alexander Wang
9b409104fb
restrict near criteria 2022-12-26 21:22:23 -08:00
Alexander Wang
7beff718aa
Merge branch 'master' into fix-null 2022-12-26 11:22:37 -08:00
Anmol Sethi
dd1de57200
d2format: Escape null correctly 2022-12-26 11:18:09 -08:00
Alexander Wang
0adec7fea2
compiler 2022-12-25 13:42:11 -08:00
Alexander Wang
3a6834662d
fix sql constraint array panic 2022-12-24 13:11:45 -08:00
Alexander Wang
3c176ebfbc
fix style compiling issue 2022-12-22 23:41:15 -08:00
Alexander Wang
48973ab330
test 2022-12-22 21:23:17 -08:00
Alexander Wang
3ab9c4b182
test 2022-12-22 21:20:18 -08:00
Alexander Wang
949df0342d
fix null key 2022-12-22 19:30:07 -08:00
Gavin Nishizawa
0c71c63b2d
export column name/type dimensions to avoid ruler in renderer 2022-12-19 17:53:58 -08:00
Alexander Wang
794e864988
fix constraint keyword 2022-12-11 16:46:09 -08:00
Anmol Sethi
b704c6684b
ci: Update [ci-force] 2022-12-07 23:41:33 -08:00
Anmol Sethi
b72959a91f
fmt 2022-12-07 23:22:20 -08:00
Alexander Wang
546ea0266c
save 2022-12-05 19:50:08 -08:00
Gavin Nishizawa
2aa9e4b363
assert ID values in test 2022-12-05 13:46:46 -08:00
Gavin Nishizawa
53bceb8578
fix dagre layout with \r in IDs 2022-12-05 11:56:26 -08:00
Alexander Wang
f12067e5bd
fix unresolved scope obj setting in compiler 2022-12-04 12:47:55 -08:00