d2 icon indicating copy to clipboard operation
d2 copied to clipboard

Container Icon in one of the corner

Open ppalka-lingaro opened this issue 2 years ago • 9 comments

Is there any way to display icon in corner with lower gap than it's by default

image

ppalka-lingaro avatar Oct 08 '23 18:10 ppalka-lingaro

@ppalka-lingaro did you want it on the corner? like this?

Screen Shot 2023-10-08 at 12 31 43 PM

alixander avatar Oct 08 '23 19:10 alixander

Yes top left , This time, next time Maybe top right Or Maybe outside of the box.

PS. This is my other account.

Palkers76 avatar Oct 08 '23 22:10 Palkers76

Outside the box, there are keywords for that.

Maybe we should add the following keywords:

border-x for x in every position keyword value.

Low priority, but I'll keep this open as a post-1.0 feature

alixander avatar Oct 08 '23 23:10 alixander

How about image in corner?

Palkers76 avatar Oct 09 '23 06:10 Palkers76

on similar note is there a way to force engine to align all containers on same level ? I have tried to use width: 200, height: 700 but only a little better

image

diagram code with no icons but the problem is visable

ppalka-lingaro avatar Oct 09 '23 19:10 ppalka-lingaro

@ppalka-lingaro that is not a similar note. please don't hijack this issue. create a new issue if one does not fit.

alixander avatar Oct 09 '23 23:10 alixander

i just realized this is your own lol. Still applies though, let's keep issues focused on one thing

alixander avatar Oct 09 '23 23:10 alixander

you can position icons with x.icon.near: top-left

Screenshot 2023-10-11 at 2 55 16 PM

https://play.d2lang.com/?script=fFbLbqQwELzzFf6BgTt7293LSrtaKZpb5APxeCZIgJHtySXKv0fGJNNPLom6ugoK2tWDK48yLj725r0x5re_Dvcpt9sL7k15PIDu_5vGmP_3nMaLP4f1r79-85-L4AdpWkT_5ZfsoyqobSx5Ku9dVWxdCzyVe57DKgv2psX0f-PlMnldUftE9DPkHGZdVPvQ2WZVtfbVtURwZA4QqOzIHiBAfxXRB_roWyo6GitkMOHBcAFhc_ln0Y8c6llIFp2RLhJIjnATuKnvXjX0aFsiObAFCVSmmwN94E8dKW1bIjnwR-cJUd0fnSbZILiUVgYFhB1BamEp4FLcAgwRY88QKeekloPNITnJHJKjyxAlqwImh5NDPI2oEuJHap43XIoBo4CcKA6JEWKImBkKyCHhkJgKhjQfTbN_ytSf33Eebr7dvgr6WhTQhaUtf3rzmvOa-q4rVWqzj3FIOd5dbl2YO5-SX_I4TKnL4-zb9HYTgrZdrnyS9CbUzimH9TQpqVPoTougwo9KHgV6cVI0Yjg1PvUDkqpJXtTYCorNP3YFM6wqqC8YaFXEnIETKYgqnUwQHVBdRP3B86qrorwEgAAcKboKCMspC4HQoroWALFeC98YLQfOdfqK4OSoLgrAxeMQ1gXnOn1pcHLcV8dnAAAA__8%3D&

gavin-ts avatar Oct 11 '23 21:10 gavin-ts

another example of where being on the border is cool. i think we should make this an option.

Maybe to further achieve this effect the icon needs to also allow nested values of shape and fill.

something like

model: {
  ...
  icon: https://something.com/x.png {
    near: border-top-center
    shape: circle
    style.fill: blue
  }
}
Screenshot 2024-05-31 at 10 57 04 PM

alixander avatar Jun 01 '24 06:06 alixander