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

Regression on pie plugin in the data format allowed #1024

Merged
merged 1 commit into from Apr 28, 2013

Conversation

nmorel
Copy link
Contributor

@nmorel nmorel commented Apr 21, 2013

Since 0.8, datas in format [[1, 80]] are not working.

@dnschnur
Copy link
Member

You're absolutely right; thank you for catching and reporting this. I'd prefer to fix this without using recursion, though; otherwise we incorrectly accept further levels of nesting, and I would generally prefer not to pull this block out into a function. I think the problem could be solved neatly by adding a check above the original block, like this:

if ($.isArray(value) && value.length == 1) {
    value = value[0];
}

If you rewrite your patch along these lines, I'll merge it right away. Thanks again for catching this!

@ghost ghost assigned dnschnur Apr 27, 2013
@nmorel
Copy link
Contributor Author

nmorel commented Apr 27, 2013

I rewrote it but I'm not sure I did it correctly. There are now 3 commits. Can you just pick the last one ?

@dnschnur
Copy link
Member

If you're okay doing a 'git rebase', that's the best way to tidy it up. Otherwise I don't have a big problem merging the original + revert, since it's a clean and obvious change.

@nmorel
Copy link
Contributor Author

nmorel commented Apr 28, 2013

Should be ok now (I learned a new git command!)

@dnschnur
Copy link
Member

Excellent, thank you!

dnschnur added a commit that referenced this pull request Apr 28, 2013
Regression on pie plugin in the data format allowed
@dnschnur dnschnur merged commit f124815 into flot:master Apr 28, 2013
@cphill02
Copy link

Why on lines 300 - 304 is the centerLeft overwritten with:
if (centerLeft < maxRadius) {
centerLeft = maxRadius;
} else if (centerLeft > canvasWidth - maxRadius) {
centerLeft = canvasWidth - maxRadius;
}
....
Doesn't this break the offset.left user option under every circumstance?

@dnschnur
Copy link
Member

That code is trying to ensure that the pie fits within the canvas, even if the offset would place it outside. If you disagree with that behavior, please open a new issue describing what you'd like to see instead; it has nothing to do with this issue.

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

Successfully merging this pull request may close these issues.

None yet

3 participants