Skip to content
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

element with multiple lines and icon in middle #1639

Closed
ppalka-lingaro opened this issue Oct 4, 2023 · 3 comments
Closed

element with multiple lines and icon in middle #1639

ppalka-lingaro opened this issue Oct 4, 2023 · 3 comments

Comments

@ppalka-lingaro
Copy link

ppalka-lingaro commented Oct 4, 2023

for few reasons I want to reproduce similar element
image

I experimented with few options and almost got it, however code is too long,
also it would be hard imho to change it into class.
maybe there is some way to pass parameters like Title, Desc to class?
Please advice
image

link to playbook:
https://play.d2lang.com/?script=tFQ9T_MwEN79K543ryrBkoaE6TZExYwEG2IwrhUsmjTYTiWg-e_oLmnahooBwRTdnX3PR-48OEn4UMBCR_3knXkZYoD1EZ5jbALN5xyFNFrvdYi-NTE162qu31tvZ_nNVa1Xb9GZMMuzO-s3zthZnl2zwVztT2V7jDRsSgERFwiu0qWVhHhJSOTOAatEAZ3qlGraiutcwa1fGxuCq8sLJEKbh8G7hkeBsK2W0nPaS5LAv4fHs7-TB5wPOAsbjAK2apQbXlvtLauZyMh788e5IxS7sNQNIVPAvYsruxf3_5Q8xlqOifyUn8NfliGg49vdYGRxiDKq-Mq6-DXWR7R_wJpJslr-Jrs4lZ1JefsJsiWN9raOk3q_Zd-dGN8KwmWmOvUZAAD__w%3D%3D&layout=tala&

@cyborg-ts cyborg-ts added this to D2 Oct 4, 2023
@ppalka-lingaro
Copy link
Author

This is great, but the problem is that in every object people will have to include variable

The shortes I was able to achieve is , creating common variable with style :) link
I tried to move img.label.near: outside-bottom-center to class
as
icon.label.near: outside-bottom-center
generation is not failing but label is no properly justify

Data Storage2: <<Data Storage2>> {
  ...${umlStyle}
  title.label: |md # Storage 2 |
  img.class: Data Lake
  img.label.near: outside-bottom-center
  description.label: |md # Opt Desc |
}

I think it would be very powerful to be able to create class or function which will get parameters as inputs
Link to proposal

@github-project-automation github-project-automation bot moved this to Done in D2 Nov 7, 2023
@danielsitnik
Copy link

@ppalka-lingaro hello.
I'm also interested in having a layout more close to what is possible with PlantUML.

Sadly, all the playground links that you and the other guys shared here no longer work. 😢

Do you still have a working example that you could share with me?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants