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

Resize window, step division problems #10

Open
stahlmanDesign opened this issue Apr 24, 2014 · 2 comments
Open

Resize window, step division problems #10

stahlmanDesign opened this issue Apr 24, 2014 · 2 comments

Comments

@stahlmanDesign
Copy link

Two problems when resizing the window (Bootstrap used in this example)
capture decran 2014-04-24 a 15 11 59
capture decran 2014-04-24 a 15 12 27

http://www1.journaldemontreal.com/2014/04/inondations/

  1. Does not resize correctly when window resizes (axis and slider are off)
  2. Even though specified step(1), it divides the steps into 1.5, 2, 2.5 etc. if window big enough

Am I using it wrong or are these just limitations of the current release 1.32 release?

@kbjr
Copy link

kbjr commented Nov 28, 2014

Any info about this? Is there no way to make this resize properly when the browser is resized?

@Shadowen
Copy link

I am aware that I am quite late, but I have recently encountered this problem myself.

The best workaround I have so far is to save your slider-generating function like:

var slider = d3.slider();
var sliderContainer = d3.select(parent)
    .append('div')
    .call(slider);

then re-create the slider in the window resizing event callback (I'm using jQuery):

$(window).resize(function(){
    sliderContainer.remove();
    sliderContainer = d3.select(parent)
        .append('div')
        .call(slider);
}

Hopefully that sample works (or you can get it to work).

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

No branches or pull requests

3 participants