-
Notifications
You must be signed in to change notification settings - Fork 453
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
Near keys for container #1071
Near keys for container #1071
Conversation
Lines 43 to 52 in 9ab0d0f
@alixander these codes that set labelPosition of near shape should be removed once we allow descendant, but if outside label is allowed, does that mean these containers should also be included during the core layout? we shouldn't let label position affect the main layout
|
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.
👏 amazing
why should it be removed? we need to place the labels somewhere. maybe we could place it depending on direction, so that it'll never collide with core layout. e.g. the |
fdc91e7
to
f69ec48
Compare
@donglixiaoche
actually... i think you're right. if you run core layout on the near object, the label placement should happen too. ohh and so what you're calculating now is this new x, y right? the position considering the label, otherwise, the label might collide with the main diagram? |
@alixander one thing to confirm, for this line Line 59 in 718daee
|
@donglixiaoche no. i can't remember what the exceptions were, but it can't be assumed to always be 0, 0 |
@alixander you can now continue the code review process |
5cb285a
to
849b117
Compare
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.
can you add this test? label still off. (got it from an issue with the motivating use case for this feature: #1001 )
direction: right
x -> y: {
style.stroke: green
}
y -> z: {
style.stroke: red
}
legend: {
near: bottom-center
color1: foo {
shape: text
style.font-color: green
}
color2: bar {
shape: text
style.font-color: red
}
}
confilcts resolved by run |
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.
apologies for how long my reviews have taken @donglixiaoche . this is really good and i'm excited about this. tested locally across all the layout engine and works beautifully
@alixander no worries, actually i'm on vacation right now. and i know i could do better about the details. and i'd love to pick another hard one, do you got one for me? |
@donglixiaoche nice! where are you vacationing? Does this sound interesting? #1107
Or if you want to stick to rendering stuff, this one could result in some big layout improvements: #1031 Feel free to say "pass" and I'm more than happy to find more! |
@alixander haha, i'm now in Tibet watching those big views. and #1107 sounds interesting, want to do some optimizations about font size 🙋🏻♂️ |
Nice! Definitely hope to go someday. Could you please leave a comment in that issue? Just a "." or anything will do, GitHub won't let me assign otherwise |
Conflicts: d2layouts/d2near/layout.go
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.
beautiful! 💯
is this good to go for merging?
ready to merge if you don't have any other considerations |
nope, that's what the approval means =). i just started taking a habit of confirming with the author after ran into an instance where i merged too early (#1091 (comment)). Thanks @donglixiaoche |
#848
now descendants are allowed for contianer with
near
attributethe screenshot can be generated by run script: