d2target: add support for cross arrowhead
Add support for cross arrowhead in d2target (and d2sketch).
closes #2028
Why i chose polygon In order to keep the look of the suggestion i went with a rotated polygon instead of simple crossing lines. Would appreciate feedback on this.
End-to-End Tests:
- Added a new test case for
CrossArrowheadine2etests/stable_test.go. - Created test data for
CrossArrowheadine2etests/testdata/files/cross_arrowhead.d2. - Added expected output for
CrossArrowheadtests ine2etests/testdata/txtar/sketch-cross-arrowhead/dagre/board.exp.jsonande2etests/testdata/txtar/sketch-cross-arrowhead/elk/board.exp.json. - Included
CrossArrowheadin thee2etests/txtar.txtfile.
Images
excellent! @MxHonesty @alixander
the japanese are unique. most Japanese read the following. '◯' means 'OK', 'correct', 'true', 'pass' and so on. 'x' means 'NG', 'wrong', 'false', 'fail' ...
e.g.
source-arrowhead: OK {
shape: circle
style.filled: false
}
target-arrowhead: NG {
shape: cross
}
what is better for non-Japanese? looking to the future, there are three patterns.
@bo-ku-ra Good insight, X has distinct meaning. I think the O for ✅ and X for 🚫 is pretty common. In which case * is different from X.
How did you get that screenshot from Mermaid? What's the code for it?
@alixander
How did you get that screenshot from Mermaid? What's the code for it?
https://github.com/terrastruct/d2/issues/2028#issue-2435421509
I think the O for ✅ and X for 🚫 is pretty common.
yes, i agree.
surprisingly, '✅' is the same as 'x' in japan. 'x' and '✅' means 'NG', 'wrong', 'false', 'fail' ...
e.x. do you know DORAEMON?
Hah, interesting.
Well in any case, I think D2's cross should be a true X shape.
E.g. the sketch version looks right
but the non-sketch version looks like a snowflake
@MxHonesty could you investigate that in this PR? I think the circle is an example of where the connection path doesn't extend all the way, instead stopping at the arrowhead shape.
Sure, i will try doing it this way!
hi @MxHonesty just wanted to check if you're still interested in pursuing this. No obligation of course, I can carry on what you have already if not.
hi @alixander sorry for the inactivity. i had some busy weeks but was actually planning on picking up this work again this weekend if that's okay with you
@MxHonesty No worries at all
unfortunately canceled?
I'll pick this back up before next release
forgot?
it's a lot of code changes required to hide that line that extends past the cross intersection unfortunately. We'll release v1 of it as this type of cross, and if there's sufficient demand, update it