Skip to content

Enable box annotation label as label sub-element#725

Merged
kurkle merged 15 commits into
chartjs:masterfrom
pepstock-org:subelementBoxLabel
Apr 25, 2022
Merged

Enable box annotation label as label sub-element#725
kurkle merged 15 commits into
chartjs:masterfrom
pepstock-org:subelementBoxLabel

Conversation

@stockiNail
Copy link
Copy Markdown
Collaborator

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

This PR enables the box label animation.

Comment thread src/types/label.js Outdated
Comment thread src/types/box.js
@stockiNail
Copy link
Copy Markdown
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
Comment thread test/fixtures/box/label-dynamic.js Outdated
@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
Comment thread src/types/label.js Outdated
Comment thread src/annotation.js Outdated
Comment thread test/fixtures/box/label-dynamic.js Outdated
@kurkle
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator Author

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

Yes, a fast path. breaking change anyway!

@stockiNail
Copy link
Copy Markdown
Collaborator Author

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

Yes, a fast path. breaking change anyway!

done

Comment thread src/annotation.js Outdated
Comment thread src/annotation.js Outdated
Comment thread src/annotation.js Outdated
@stockiNail
Copy link
Copy Markdown
Collaborator Author

@kurkle thanks for approval. What about CC issues?

@kurkle kurkle merged commit b877dc6 into chartjs:master Apr 25, 2022
@stockiNail stockiNail deleted the subelementBoxLabel branch April 26, 2022 13:29
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.

2 participants