Commit graph

345 commits

Author SHA1 Message Date
Gavin Nishizawa
ee70180a87
fixes 2023-05-25 18:35:58 -07:00
Gavin Nishizawa
53709d641a
export connection truncate decimals along route 2023-05-25 16:22:04 -07:00
Alexander Wang
cd6c6b6fda
bump tests 2023-05-01 13:53:19 -07:00
Gavin Nishizawa
ae6618a195
update get point at distance 2023-05-01 13:24:56 -07:00
Júlio César Batista
56af2f41e3
search for white index 2023-04-28 18:53:29 -03:00
Júlio César Batista
129d51a1e6
fix gif pallete 2023-04-28 18:26:25 -03:00
Alexander Wang
648161fbea
bump version 2023-04-17 18:47:47 -07:00
gavin-ts
eae415a206
Merge pull request #1207 from gavin-ts/arrowhead-label-dimensions
Update arrowhead label positioning and use label dimensions
2023-04-17 15:26:57 -07:00
Gavin Nishizawa
4b931f7aec
cleanup 2023-04-17 14:46:10 -07:00
Gavin Nishizawa
6e4faefb4b
position arrowhead labels 2023-04-17 13:01:38 -07:00
Júlio César Batista
ee93929750
Merge pull request #1204 from ejulio-ts/gh-1199-navbar
GH 1199: navbar links
2023-04-17 16:06:17 -03:00
Júlio César Batista
ac1ea5f9e5
Merge pull request #1200 from ejulio-ts/gh-1151-gif
GH 1151: export GIF
2023-04-17 14:47:27 -03:00
Júlio César Batista
18494bee45
show message while generating gif 2023-04-17 10:25:40 -03:00
Júlio César Batista
7918f265d4
navbar on pptx 2023-04-14 19:25:01 -03:00
Júlio César Batista
6f18b232b9
navbar on pdfs 2023-04-14 17:02:40 -03:00
Júlio César Batista
d1bb3cc575
Update lib/xgif/xgif.go
Co-authored-by: gavin-ts <85081687+gavin-ts@users.noreply.github.com>
2023-04-14 15:52:50 -03:00
Júlio César Batista
492db16e92
package docs 2023-04-14 11:06:22 -03:00
Júlio César Batista
34b74388a2
add test 2023-04-14 10:52:27 -03:00
Júlio César Batista
8b3fea259c
export gifs 2023-04-14 10:35:14 -03:00
Andreas Deininger
6ae417cde9
Fixing typos
Signed-off-by: Andreas Deininger <andreas@deininger.net>
2023-04-14 07:48:22 +02:00
Júlio César Batista
588398a4df
convert png boards to gif 2023-04-13 18:16:53 -03:00
Bernard Xie
51077e0b82
Update generate_png.js 2023-04-13 13:40:58 -07:00
Gavin Nishizawa
d02e1ebb52
update markdown text measurement and rendering to use font-size 2023-04-12 20:14:45 -07:00
Júlio César Batista
9b3b43eb50
Merge pull request #1168 from ejulio-ts/gh-821-ppt-links
GH 821: links on pptx
2023-04-11 14:54:13 -03:00
Júlio César Batista
1b8122b0f9
set scale when generating png 2023-04-11 14:38:44 -03:00
Júlio César Batista
cbd1afeaef
pr comments 2023-04-11 10:25:04 -03:00
Gavin Nishizawa
3c832d36f6
measure with semibold 2023-04-10 15:06:26 -07:00
Júlio César Batista
989c3f88ac
add blank line 2023-04-10 17:24:34 -03:00
Júlio César Batista
8322261d24
fix conflicts 2023-04-10 17:18:22 -03:00
Júlio César Batista
ac0c9105ff
Merge branch 'gh-821-ppt' into gh-821-ppt-links 2023-04-10 16:40:46 -03:00
Júlio César Batista
442f61331e
move to a single file 2023-04-10 15:47:37 -03:00
Júlio César Batista
0fad458858
generate files from templates 2023-04-10 15:45:10 -03:00
Júlio César Batista
e39b9c15c2
move xml to templates 2023-04-10 13:49:30 -03:00
Júlio César Batista
6993c0e557
PR comments 2023-04-10 11:45:04 -03:00
Júlio César Batista
38cafc9d40
Merge branch 'master' into gh-821-ppt 2023-04-10 11:05:24 -03:00
Júlio César Batista
7c06d1bc2e
fix links in keynote 2023-04-10 10:35:54 -03:00
Júlio César Batista
da14037466
add links to pptx 2023-04-09 20:29:27 -03:00
Alexander Wang
7fe562fd82
[ci-base] bump version 2023-04-07 21:03:33 -07:00
Júlio César Batista
ff7438fc2a
Merge branch 'master' into gh-821-ppt 2023-04-07 18:12:50 -03:00
Júlio César Batista
944fb0c476
fix image resizing 2023-04-07 11:00:25 -03:00
Júlio César Batista
37c46b7435
add CLI test 2023-04-06 15:16:32 -03:00
Júlio César Batista
e4bbc26959
minor fixes for MS PowerPoint 2023-04-06 11:01:44 -03:00
Júlio César Batista
356ab93941
fix image size 2023-04-05 16:09:33 -03:00
Júlio César Batista
eb2518c0e4
rename and docs 2023-04-05 15:35:03 -03:00
Júlio César Batista
f0adecf1dc
metadata 2023-04-05 15:22:12 -03:00
Júlio César Batista
ace4715f04
update title 2023-04-05 11:40:21 -03:00
Júlio César Batista
2976c9b0a2
todos 2023-04-04 19:26:50 -03:00
Júlio César Batista
0f362c3024
slide title 2023-04-04 18:47:22 -03:00
Júlio César Batista
3a5c389d2b
fix size and position 2023-04-04 18:00:45 -03:00
Júlio César Batista
b9ce8324a4
base ppt export 2023-04-04 15:30:33 -03:00
Alexander Wang
7d301be3a2
atan2 2023-04-03 12:49:14 -07:00
Patrick Conti
0c9fc13466
Truncate to 32-bit precision to avoid floating-point arithmetic divergence between platforms 2023-04-03 19:05:03 +02:00
Toyam Cox
3228ae4a0d
fix builds on 32bit
If you put the uint32 type at the top instead of later, 32 bit builds

All credit @ahesford
2023-03-31 19:31:20 -04:00
Alexander Wang
c42e2cd06a
[ci-force] bump src version 2023-03-29 20:40:59 -07:00
Bernard Xie
fe80fd27f5
comment 2023-03-29 12:00:55 -07:00
Bernard Xie
70b4fd8912
copy byte slice first 2023-03-28 13:58:53 -07:00
Bernard Xie
ffc414260e
refactor 2023-03-27 19:26:49 -07:00
Bernard Xie
48a7472667
add and fix utf8cutfont 2023-03-27 19:19:12 -07:00
Bernard Xie
62faa1ef33
remove unused 2023-03-27 15:02:25 -07:00
Bernard Xie
ff1ef999a3
tests still borken 2023-03-27 14:46:03 -07:00
Bernard Xie
02673d423d
subset test 2 2023-03-27 14:22:58 -07:00
Bernard Xie
7a137227e7
test without woff 2023-03-27 14:17:48 -07:00
Bernard Xie
7c146dd213
subset fonts 2023-03-24 19:50:16 -07:00
Bernard Xie
5f2958ef88
add sfnt to woff font converter 2023-03-24 13:33:15 -07:00
Alexander Wang
2684f3bfde
[ci-base] bump version in src 2023-03-20 11:57:25 -07:00
Alexander Wang
c253287fb8
Merge pull request #1058 from alixander/png-still-working
print msg when png or layout takes a long time
2023-03-18 15:33:25 -07:00
Alexander Wang
579bbace03
print msg when png and layout in progress 2023-03-18 15:29:46 -07:00
Alexander Wang
95bc2e4fb5
fix multiple br 2023-03-18 14:45:58 -07:00
Alexander Wang
56a4ee5fff
markdown strikethrough 2023-03-18 14:00:52 -07:00
Alexander Wang
8d3bab92f3
[ci-base] bump src version 2023-03-16 16:01:01 -07:00
Gavin Nishizawa
0fe8a6b5f0
cleanup and optimization for Point.OnSegment 2023-03-15 13:29:23 -07:00
Alexander Wang
7f9bc2b033
Merge branch 'master' into elk-shim 2023-03-14 18:38:43 -07:00
Alexander Wang
108b744f3c
fix bug 2023-03-14 18:36:16 -07:00
Alexander Wang
73c35bb14b
implement s-shape 2023-03-14 14:11:51 -07:00
Gavin Nishizawa
8fe2eee56d
lint 2023-03-14 11:20:00 -07:00
Alexander Wang
0292ea2627
add exif to png 2023-03-13 17:58:47 -07:00
Alexander Wang
d1040bf4f8
save 2023-03-13 17:52:50 -07:00
Alexander Wang
2f2056da2a
embed d2 version in svg 2023-03-13 16:26:42 -07:00
Alexander Wang
e6644549be
implement internal links in PDF 2023-03-02 23:17:29 -08:00
Bernard Xie
5e2ce123fc
pass viewbox coords in 2023-02-28 14:14:38 -08:00
Bernard Xie
a85a225c73
reverts 2023-02-28 12:45:00 -08:00
Bernard Xie
e8a473f0fd
working 2023-02-28 12:40:07 -08:00
Bernard Xie
202575cb83
Merge branch 'master' into pdf-link-overlay 2023-02-28 10:19:04 -08:00
Anmol Sethi
102ed4f7ba
lib/version: Update 2023-02-27 21:42:48 -08:00
Bernard Xie
f327a23cc5
wip 2023-02-27 20:02:33 -08:00
Bernard Xie
479127b3c6
add else 2023-02-27 19:55:37 -08:00
Bernard Xie
349fac7193
Fix when using theme colors 2023-02-27 19:50:30 -08:00
Bernard Xie
48593357a5
Merge pull request #929 from berniexie/support-diagram-fill-pdf
pdf: Support diagram fill in pdf exports
2023-02-27 16:56:38 -08:00
Bernard Xie
2292ed4653
Update color.go 2023-02-27 16:46:44 -08:00
Bernard Xie
d72068d194
Update color.go 2023-02-27 16:45:25 -08:00
Bernard Xie
3427ea1717
w3 official source 2023-02-27 16:38:48 -08:00
Bernard Xie
2fb0df3563
add rebecca purple 2023-02-27 16:34:44 -08:00
Bernard Xie
8e0feef0da
color comment 2023-02-27 16:30:25 -08:00
Bernard Xie
7c295c1942
to lower on name2rgb 2023-02-27 16:27:28 -08:00
Bernard Xie
b48c2b411f
Update color.go 2023-02-27 16:22:10 -08:00
Gavin Nishizawa
4b97eefdeb
update d2 version for go install oss.terrastruct.com/d2@latest 2023-02-27 16:20:43 -08:00
Bernard Xie
63ffcba215
error 2023-02-27 16:10:00 -08:00
Bernard Xie
66083e2d98
set root fill as transparent on pdf exports 2023-02-27 16:05:41 -08:00
Bernard Xie
29e76b77b8
Merge branch 'master' into support-diagram-fill-pdf 2023-02-27 14:11:07 -08:00
Bernard Xie
fb4eb36214
Add support 2023-02-27 14:10:59 -08:00
Alexander Wang
9cdfd20ff9
changelog 2023-02-27 12:58:21 -08:00
Alexander Wang
e5eacbd499
fix theme regex 2023-02-27 12:56:04 -08:00
Anmol Sethi
5c2a80330f
docker: Install playwright dependencies on arm64
Also changed our code to only install chromium.

Closes #835
2023-02-27 10:30:59 -08:00
Bernard Xie
9eaf77aa4b
Merge branch 'master' into 120/pdf-export 2023-02-24 13:48:15 -08:00
Alexander Wang
0fe1c6d0cf
fix color codes 2023-02-23 17:15:29 -08:00
Bernard Xie
ece87708d6
fix imports 2023-02-23 15:59:50 -08:00
Bernard Xie
9dca4d93f6
Fix fonts 2023-02-23 15:50:56 -08:00
Bernard Xie
f1f95ba818
Merge branch 'master' into 120/pdf-export 2023-02-23 12:55:58 -08:00
Bernard Xie
0d1c3c019d
Merge branch 'master' into 120/pdf-export 2023-02-21 14:26:18 -08:00
Vojtěch Fošnár
732f5c241f
bgColor and fgColor are now just constants 2023-02-19 15:54:17 +01:00
Vojtěch Fošnár
331cf95284
move ThemableElement and others to d2themes, smaller fixes 2023-02-19 13:00:01 +01:00
Vojtěch Fošnár
6a89beaeb1
merge updates 2023-02-19 12:32:44 +01:00
Bernard Xie
c561de4856
reset colors 2023-02-14 17:42:44 -08:00
Bernard Xie
890a7d8b2c
pdf exports 2023-02-14 17:28:42 -08:00
Alexander Wang
156c974241
unicode tests 2023-02-14 11:41:21 -08:00
Alexander Wang
9cb7e7f396
scale multi-width unicode 2023-02-14 11:40:49 -08:00
Gavin Nishizawa
4de1f76751
limit oval shape aspect ratio 2023-02-13 11:23:30 -08:00
Gavin Nishizawa
94bf92a28b
use per-axis padding 2023-02-10 16:19:19 -08:00
Gavin Nishizawa
93fa13ab0f
add FullShape to use shape's InnerBox for placement 2023-02-10 13:52:58 -08:00
Gavin Nishizawa
6b65665b61
fix GetInsidePlacement inconsistencies 2023-02-10 13:52:58 -08:00
Gavin Nishizawa
4bfb6af7e6
Merge branch 'master' into shape-specific-inner-boxes 2023-02-02 20:25:52 -08:00
Anmol Sethi
09dc9fd12f
Merge remote-tracking branch 'upstream/master' into scenarios-a407 2023-02-02 10:33:31 -08:00
Gavin Nishizawa
1b1cdaff15
Merge branch 'master' into shape-specific-inner-boxes 2023-02-01 10:31:46 -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
01928a5032
review fixes 2023-01-30 12:06:54 +01:00
Vojtěch Fošnár
61bf09107a
Merge branch 'terrastruct:master' into master 2023-01-29 23:23:22 +01:00
Vojtěch Fošnár
462bd1e23d
resolve conflicts 2023-01-27 21:08:01 +01:00
Gavin Nishizawa
bd23d0758b
update hexagon inner box 2023-01-26 16:44:20 -08:00
Gavin Nishizawa
597bc319bf
update other chopPrecision 2023-01-26 16:44:20 -08:00
Gavin Nishizawa
fed4bd2b9f
ceil dimensions to fit 2023-01-26 16:44:20 -08:00
Gavin Nishizawa
e367a007e5
chopPrecision once at end 2023-01-26 16:44:20 -08:00
Gavin Nishizawa
f30fe2c2c4
round from float32 precision 2023-01-26 16:44:20 -08:00
Gavin Nishizawa
c12e71af15
update circle fitting 2023-01-26 16:44:19 -08:00
Gavin Nishizawa
cc8c7756ab
cleanup 2023-01-26 16:44:19 -08:00
Gavin Nishizawa
d5f2ed00d5
handle person shape aspect ratio 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
b76d43536d
remove debugging code 2023-01-26 16:44:18 -08:00
Gavin Nishizawa
23097370e2
set up shape specific inner bounding boxes for labels 2023-01-26 16:43:36 -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
4b50748dd0
d2ir: Final PR imports
https://github.com/terrastruct/terrastruct-backend/pull/975/files#diff-1b00307a7a2bd1ffc68527a7df7c9c83327d8cd2dd00f4741ec6bd0b96605cd4
2023-01-24 02:56:31 -08:00
Kevin David
bd7e18395e
d2renderers: d2fonts: add bold + italic styles for Source Code Pro
👋 I've been playing around with changing the entire font of a diagram to something fixed-width, starting by hand-editing `main.go`

I noticed that if I switched over the family to Source Code Pro, d2 crashed with the following stack:

```
[23:38:30] info: compiling GetUniqueColumnName-fix.d2...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1c4 pc=0x16b562c]

goroutine 43 [running]:
github.com/golang/freetype/truetype.(*Font).Bounds(0xc000669670?, 0x0?)
        /Users/kevin/dev/go/pkg/mod/github.com/golang/freetype@v0.0.0-20170609003504-e2365dfdc4a0/truetype/truetype.go:378 +0xc
github.com/golang/freetype/truetype.NewFace(0x0, 0xc0003276c0)
        /Users/kevin/dev/go/pkg/mod/github.com/golang/freetype@v0.0.0-20170609003504-e2365dfdc4a0/truetype/face.go:199 +0x325
oss.terrastruct.com/d2/lib/textmeasure.(*Ruler).addFontSize(0xc00037c000, {{0x1bb9a34, 0xd}, {0x1b82732, 0x4}, 0x1f})
        /Users/kevin/dev/d2/lib/textmeasure/textmeasure.go:141 +0x112
oss.terrastruct.com/d2/lib/textmeasure.(*Ruler).MeasurePrecise(0xc00037c000, {{0x1bb9a34, 0xd}, {0x1b82732, 0x4}, 0x1f}, {0xc000582100, 0x1f})
        /Users/kevin/dev/d2/lib/textmeasure/textmeasure.go:157 +0xde
oss.terrastruct.com/d2/lib/textmeasure.(*Ruler).Measure(...)
        /Users/kevin/dev/d2/lib/textmeasure/textmeasure.go:151
oss.terrastruct.com/d2/d2graph.GetTextDimensions({0x0, 0x0, 0xc000657860?}, 0xc00037c000, 0xc000620280, 0xc000092020)
```

Which I tracked down to these missing styles, which appear to matter even if they aren't used.

I acquired the `ttf` files from https://fonts.google.com/specimen/Source+Code+Pro

I created the encoded fonts on my Mac with:
```
base64 -i SourceCodePro-Italic.ttf -o ../encoded/SourceCodePro-Italic.txt
```

Hopefully this is correct! Open to all feedback, especially since I think this is the first change I've ever made to a go program :)

Signed-off-by: Kevin David <kevin-david@github.com>
2023-01-23 00:35:19 -05:00
Gavin Nishizawa
1a07492517
update li measurement + h1 border-bottom 2023-01-15 23:31:06 -08:00
Vojtěch Fošnár
1e89c33cee
removed theming code from styling methods 2023-01-15 21:38:25 +01:00
Vojtěch Fošnár
66dc978418
resolved merge conflict 2023-01-15 21:36:43 +01:00
Alexander Wang
0314a74eab
unescape img hrefs 2023-01-14 14:20:08 -08:00
Gavin Nishizawa
224af99efd
add sketch versions of arrowheads 2023-01-13 18:13:28 -08:00
Gavin Nishizawa
54f34d72ad
extend previous segment to target if last segment is very short 2023-01-12 11:23:23 -08:00
Vojtěch Fošnár
19c53d5185
added missing colors conversion 2023-01-12 11:19:34 +01:00