-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow icon for sql_table, class, code/md #1774
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
-- sql-icon -- | ||
without: { | ||
tableEx: { | ||
shape: sql_table | ||
a: b | ||
} | ||
classEx: { | ||
shape: class | ||
a: b | ||
} | ||
codeEx: |go | ||
a := 1 | ||
| | ||
mdEx: |md | ||
# This is for all ill-treated fellows | ||
|
||
You will live a long, healthy, happy life and make bags of money. | ||
| | ||
} | ||
|
||
with: { | ||
tableEx: { | ||
shape: sql_table | ||
a: b | ||
icon: https://icons.terrastruct.com/essentials%2F213-alarm.svg | ||
} | ||
classEx: { | ||
shape: class | ||
a: b | ||
icon: https://icons.terrastruct.com/essentials%2F213-alarm.svg | ||
} | ||
codeEx: |go | ||
a := 1 | ||
| { | ||
icon: https://icons.terrastruct.com/essentials%2F213-alarm.svg | ||
} | ||
mdEx: |md | ||
# This is for all ill-treated fellows | ||
|
||
You will live a long, healthy, happy life and make bags of money. | ||
| { | ||
icon: https://icons.terrastruct.com/essentials%2F213-alarm.svg | ||
} | ||
} | ||
|
||
without.tableEx -> with.tableEx | ||
without.classEx -> with.classEx | ||
without.codeEx -> with.codeEx | ||
without.mdEx -> with.mdEx |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gavin-ts there is currently a collision between the icon and label in ELK. I believe it's unrelated to my change and that this code has a bug as described. Can you confirm if so or if I'm just missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it looks like elk hasn't been updated for this. previously all icon positions would be placed in an inside position by default so this would only be possible with custom set positions.
not sure why but elk only seems to be adjusting horizontally for icons but not vertically
d2/d2layouts/d2elklayout/layout.go
Lines 1125 to 1131 in 56a549d
also noticed elk layout is still doing some old height manipulations but we already look for intersections with outside labels so these are no longer needed
d2/d2layouts/d2elklayout/layout.go
Lines 1184 to 1187 in 56a549d
d2/d2layouts/d2elklayout/layout.go
Lines 1112 to 1115 in 56a549d
d2/d2graph/layout.go
Lines 439 to 445 in 56a549d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the elk
icon_positions
test it appears this is unaccounted for prior to your PR, it also may not be accounted for in dagre if the label were insideThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, i'll get in followup then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gavin-ts
are you sure about the "these are no longer needed"? Many tests change when I remove those:
8ce19c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i reverted that file, there's still changes: 705225e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8ce19c5#r134821504
looks like we do want the || icon part for this
![Screenshot 2023-12-12 at 10 46 19 AM](https://private-user-images.githubusercontent.com/85081687/289970786-febff510-8656-4881-b604-16c6a79d86f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTI4NTgsIm5iZiI6MTczOTU5MjU1OCwicGF0aCI6Ii84NTA4MTY4Ny8yODk5NzA3ODYtZmViZmY1MTAtODY1Ni00ODgxLWI2MDQtMTZjNmE3OWQ4NmY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA0MDkxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFhOGYyMGI0ODA5ZDExNGFiYmIzNjY0Njk0ZjIxNTZiNzk4N2RlMGJmYWI2MzE2ZDlkODlhMWQxZGQwYTRkYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ipPSnOF4lc8Aojyfc8E3Q-4OBZi53HfMhwFN6Z7TYmM)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may actually want this adjustment for all outside labels/icons unless we adjust the spacing in another way
8ce19c5#r134822027
to avoid this
![Screenshot 2023-12-12 at 10 49 31 AM](https://private-user-images.githubusercontent.com/85081687/289971564-988411c9-3c46-4dc5-9c07-ac2590149369.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTI4NTgsIm5iZiI6MTczOTU5MjU1OCwicGF0aCI6Ii84NTA4MTY4Ny8yODk5NzE1NjQtOTg4NDExYzktM2M0Ni00ZGM1LTljMDctYWMyNTkwMTQ5MzY5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA0MDkxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZiNDNiZmFiMjE5NjE0OTkwMjE2MDhhYjI1NTkxYjI2ZGVkZDA5ODNlZTEwM2NmMTUxYzYxNzA3NmIwN2JmYmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hxY4DZKYj_HsFszO81j1WJQFyQqutZSGsjZDXpCZ94E)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this captured in #1776 or can you make another issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes this is captured in #1776, all margins are now included in the width/height passed to elk, so elk ends up routing the edge distance to shape + margin, instead of routing to shape then cutting at margin.