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

Enable box annotation label as label sub-element #725

Merged
merged 15 commits into from
Apr 25, 2022
Merged

Enable box annotation label as label sub-element #725

merged 15 commits into from
Apr 25, 2022

Conversation

stockiNail
Copy link
Collaborator

This PR moves label node of box annotation to sub element.

This PR enables the box label animation.

src/types/label.js Outdated Show resolved Hide resolved
@stockiNail
Copy link
Collaborator Author

stockiNail commented Apr 12, 2022

@kurkle the following options are missing in the label of box annotation because the goal was to use the box rendering options.
But it makes sense to add the following missing options:

  backgroundColor
  backgroundShadowColor
  borderCapStyle
  borderDash
  borderDashOffset
  borderJoinStyle
  borderRadius
  borderShadowColor
  borderWidth
  shadowBlur
  shadowOffsetX
  shadowOffsetY

In my opinion this deserves a specific PR, with doc and new test cases.

About callout, I don't see any use case. The callout is thought to outline a point linking it to a label. I would like do not enable it in box annotation. What do you think?

@stockiNail stockiNail marked this pull request as ready for review April 12, 2022 08:16
@stockiNail stockiNail marked this pull request as draft April 12, 2022 08:24
@stockiNail stockiNail marked this pull request as ready for review April 12, 2022 09:30
@stockiNail stockiNail marked this pull request as draft April 12, 2022 15:45
@stockiNail stockiNail marked this pull request as ready for review April 12, 2022 18:56
src/types/label.js Outdated Show resolved Hide resolved
src/annotation.js Outdated Show resolved Hide resolved
test/fixtures/box/label-dynamic.js Outdated Show resolved Hide resolved
@kurkle
Copy link
Member

kurkle commented Apr 13, 2022

@kurkle the following options are missing in the label of box annotation because the goal was to use the box rendering options. But it makes sense to add the following missing options:

  backgroundColor
  backgroundShadowColor
  borderCapStyle
  borderDash
  borderDashOffset
  borderJoinStyle
  borderRadius
  borderShadowColor
  borderWidth
  shadowBlur
  shadowOffsetX
  shadowOffsetY

In my opinion this deserves a specific PR, with doc and new test cases.

About callout, I don't see any use case. The callout is thought to outline a point linking it to a label. I would like do not enable it in box annotation. What do you think?

I don't see a use case for the callout either, but you never know what people come up with.
I think it the options should fall back to box options, but be overridable for the label. This would probably be easier if #630 was finished.

@stockiNail
Copy link
Collaborator Author

I think it the options should fall back to box options, but be overridable for the label. This would probably be easier if #630 was finished.

I agree for this reason I haven't started yet. All those options could be defined as commons.

@stockiNail
Copy link
Collaborator Author

get label() { return this.elements && this.elements[0]; }

Yes, a fast path. breaking change anyway!

@stockiNail
Copy link
Collaborator Author

get label() { return this.elements && this.elements[0]; }

Yes, a fast path. breaking change anyway!

done

src/annotation.js Outdated Show resolved Hide resolved
src/annotation.js Outdated Show resolved Hide resolved
src/annotation.js Outdated Show resolved Hide resolved
@stockiNail
Copy link
Collaborator Author

@kurkle thanks for approval. What about CC issues?

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

Successfully merging this pull request may close these issues.

None yet

2 participants