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

Image annotation: support more shapes #2574

Closed
damithc opened this issue Sep 13, 2024 · 2 comments · Fixed by #2577
Closed

Image annotation: support more shapes #2574

damithc opened this issue Sep 13, 2024 · 2 comments · Fixed by #2577

Comments

@damithc
Copy link
Contributor

damithc commented Sep 13, 2024

Currently, we can use image annotation features to do something like the below (i.e., the yellow circle) to indicate which area of the image the explanation refers to.

image

It may be useful to be able to draw other shapes in the diagram e.g., a box

image

@yucheng11122017
Copy link
Contributor

Hi @damithc, was wondering if the custom annotations are sufficient for this purpose?
https://markbind.org/userGuide/components/imagesAndDiagrams.html#annotations:~:text=Customising%20shapes%20for%20Annotate%20Point

I had a quick stab at it and I managed to do this.
image

This is the code for that. The idea is to create a box using CSS and to use it as a slot for a-point

<annotate src="../../images/annotateSampleImage.png" width="500" alt="Sample Image">
  <a-point x="75%" y="50%" content="This point is 75% from the left and 50% from the top">
    <div style="width: 100px; height: 100px; border: 2px solid red; margin: 20px auto;"></div>
  </a-point>
  <a-point x="25%" y="50%" content="This point is 25% from the left and 50% from the top">
    <pic src="../../images/deer.jpg" width="50" height="50">
  </a-point>
  <!-- Customised Annotate Point with styling-->
  <a-point x="50%" y="50%" content="This point is 25% from the left and 50% from the top">
    <div style="opacity: 90%; color: red">Custom</div>
  </a-point>
</annotate>

@damithc
Copy link
Contributor Author

damithc commented Dec 2, 2024

Hi @damithc, was wondering if the custom annotations are sufficient for this purpose? https://markbind.org/userGuide/components/imagesAndDiagrams.html#annotations:~:text=Customising%20shapes%20for%20Annotate%20Point

I had a quick stab at it and I managed to do this. image

This is the code for that. The idea is to create a box using CSS and to use it as a slot for a-point

<annotate src="../../images/annotateSampleImage.png" width="500" alt="Sample Image">
  <a-point x="75%" y="50%" content="This point is 75% from the left and 50% from the top">
    <div style="width: 100px; height: 100px; border: 2px solid red; margin: 20px auto;"></div>
  </a-point>
  <a-point x="25%" y="50%" content="This point is 25% from the left and 50% from the top">
    <pic src="../../images/deer.jpg" width="50" height="50">
  </a-point>
  <!-- Customised Annotate Point with styling-->
  <a-point x="50%" y="50%" content="This point is 25% from the left and 50% from the top">
    <div style="opacity: 90%; color: red">Custom</div>
  </a-point>
</annotate>

@yucheng11122017 Nice. While this is not user-friendly, most likely any syntax we introduce will be almost as complicated as this one.
That said, we should still update the user guide to include examples such as this one.

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

Successfully merging a pull request may close this issue.

2 participants