Reconfigure width and height automatically from the first graph #382

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

Only configure from first graph if we initially got our width from it, though.

Noah Gibbs Reconfigure width and height automatically from the first graph if we…
… initially got our width and height from it.
52b8f86

In response to an email reply to this that I can't find now...

Yeah, I can totally do this manually by directly poking into the internals of the graph object. But I'd prefer not to, where possible. I believe that if the graph is sized automatically, it should be resized automatically, because then Rickshaw has declared itself to be in charge of the graph's size, not the app programmer.

So then it should either never size based on the graph, or should always resize from it.

mstrutt commented Feb 18, 2014

Hey, sorry that was my mistake. I somehow missed that this was a pull
request and that you'd fixed the issue. I thought you'd asked for help and
received none so was posting my work around. As soon as I realised, I
removed my comment. I completely agree with you that this is behaviour one
would expect from 'auto'.
On 17 Feb 2014 20:11, "Noah Gibbs" notifications@github.com wrote:

In response to an email reply to this that I can't find now...

Yeah, I can totally do this manually by directly poking into the internals
of the graph object. But I'd prefer not to, where possible. I believe that
if the graph is sized automatically, it should be resized automatically,
because then Rickshaw has declared itself to be in charge of the graph's
size, not the app programmer.

So then it should either never size based on the graph, or should always
resize from it.

Reply to this email directly or view it on GitHubhttps://github.com/shutterstock/rickshaw/pull/382#issuecomment-35318627
.

Contributor

rbu commented Feb 25, 2014

This actually contains an implicit bugfix, which is:

    if(this.svg) { this.svg.style("width", args.width + "px"); }

(same for height, although I have not tested this)

Without this, the rickshaw_range_slider_preview will keep its size and enlarging a graph will move the right handle outside its container.

Yeah, there are actually several oddities with resizing. However, they seem to exist with or without my pull request -- I couldn't find anything new that I'd broken. And as you say, one or two existing things I seemed to fix :-)

dchester closed this in 972c2bd Apr 12, 2014

Contributor

dchester commented Apr 12, 2014

Thanks much.

Awesome. Thanks!

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