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

Provide a rectangle getArea implementation for horizontal bars #6027

Merged
merged 2 commits into from Feb 4, 2019

Conversation

etimberg
Copy link
Member

Resolves #4480

It should be noted that since #5857 getArea() is not used anywhere in the code.

~/D/o/chartjs ❯❯❯ grep getArea -rni src/*
src/elements/element.arc.js:68:	getArea: function() {
src/elements/element.point.js:55:	getArea: function() {
src/elements/element.rectangle.js:207:	getArea: function() {
~/D/o/chartjs ❯❯❯ 

I considered removing the method from the different elements but that would be a breaking change. I don't think anyone is using it, but we can't guarantee it.

@benmccann benmccann changed the title Provide a rectange getArea implementation for horizontal bars Provide a rectangle getArea implementation for horizontal bars Jan 30, 2019
@benmccann
Copy link
Contributor

Should we mark the method as deprecated as well?

Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this should be deprecated, its probably needed at some point anyway.
As a side note (v3 in mind): width and height should be "right", so this is kind of wrong place to check orientation.

src/elements/element.rectangle.js Outdated Show resolved Hide resolved
@simonbrunel
Copy link
Member

That's the kind of methods we would have preferred private.

benmccann
benmccann previously approved these changes Feb 2, 2019
@benmccann
Copy link
Contributor

Looks like you'll need to rebase this against master after #6039 is merged to get Travis to pass

@kurkle
Copy link
Member

kurkle commented Feb 4, 2019

Disclaimer: this has little or nothing to do with this PR

For V3 we should think of removing orientation from rectangle and adding a bar element that brings orientation, start and end properties.

I would also brainstorm more around the properties, we should be able to extract at least configurable and those that should be transitioned. We should also try not to have to check for hasOwnProperty in interpolate (so would have to make sure those transitioning properties always exist = move the check out of the loop).

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

5 participants