mbostock / stack

A presentation library with intuitive, scroll-based navigation.
https://mbostock.github.io/stack/
Other
1.16k stars 162 forks source link

Support swipe-to-advance on iOS? #19

Open patricioPanichelli opened 9 years ago

patricioPanichelli commented 9 years ago

I just tried Stack, and it's great. Congratulations. I've been using D3 for a while, and even though Stack is a minor thing next to D3, well... it is still great.

It is not a big issue for me, as most of my traffic is from desktop. But I was wondering if there is a quick workaround to make Stack work on iPad / iPhone.

Thanks

mbostock commented 9 years ago

What do you mean by “work”? It should just work out of the box:

screen shot 2015-06-11 at 7 04 08 pm

It doesn’t use swiping, though—just normal scrolling.

patricioPanichelli commented 9 years ago

I agree that it works, but that is not how it works (i.e. behaves) on desktop. I was not descriptive enough, I'm sorry. What I was asking about was the swiping behaviour you see on desktop, as you correctly guessed.

Had to ask, perhaps I was missing some configuration or similar to get it going. Thanks for the reply.

mbostock commented 9 years ago

I’ve updated description. This would be a nice feature, but it’s somewhat of a pain to implement page swiping on iOS.

alemieux3 commented 9 years ago

Sorry to intrude on the conversation, but I'm trying to use stack.js now on a project and it kinda works out of the box?!? What I mean is if I add jQuery and the stack.js library to my page and I have it formatted with

tags, it should just work, but it doesn't seem to. In your code example, there's some additional JS functions at the bottom of the page. Without that, stack.js doesn't seem to just work out of the box. I want the simplest implementation of stack. Do I need to write a function for that? There's also the follow id and the follow-anchor? I'm not sure what that does. The most confusing thing in the example is the lorenz code. I'm assuming this code just waits until the animation is complete before scrolling forward? On Fri, Jun 12, 2015 at 12:39 AM, patricioPanichelli < notifications@github.com> wrote: > I agree that it works, but that is not how it works (i.e. _behaves_) on > desktop. I was not descriptive enough, I'm sorry. What I was asking about > was the swiping behaviour you see on desktop, as you correctly guessed. > > Had to ask, perhaps I was missing some configuration or similar to get it > going. Thanks for the reply. > > — > Reply to this email directly or view it on GitHub > https://github.com/mbostock/stack/issues/19#issuecomment-111356630. ## Al Lemieux 90 Currier Rd Pelham, NH 03076 www.lemieux-design.net al@lemieux-design.net
mbostock commented 9 years ago

The only thing you need to do to get stack working is:

  1. Load d3.js.
  2. Load stack.js.
  3. Call the stack() function.

If you copied some of the other code from the example and deleted other parts I you may have broken something. That example demonstrates some more advanced features like using listeners to trigger behaviors such as animations. However, I can’t identify the problem without looking at your code.

alemieux3 commented 9 years ago

Mike,

How do you have a slide wait for animations to complete before moving forward? I'm using the greensock animation library. I'd like to have a slide appear, then do all of my tweens. Is that what activate is for?

On Fri, Jun 12, 2015 at 11:50 AM, Mike Bostock notifications@github.com wrote:

The only thing you need to do to get stack working is:

  1. Load d3.js.
  2. Load stack.js.
  3. Call the stack() function.

If you copied some of the other code from the example https://mbostock.github.io/stack/ and deleted other parts I you may have broken something. That example demonstrates some more advanced features like using listeners to trigger behaviors such as animations. However, I can’t identify the problem without looking at your code.

— Reply to this email directly or view it on GitHub https://github.com/mbostock/stack/issues/19#issuecomment-111533236.

Al Lemieux 90 Currier Rd Pelham, NH 03076 www.lemieux-design.net al@lemieux-design.net

alemieux3 commented 9 years ago

Here's the link: http://www.affinnova.com/breakthrough-innovation/stack-test.html

On Fri, Jun 12, 2015 at 11:50 AM, Mike Bostock notifications@github.com wrote:

The only thing you need to do to get stack working is:

  1. Load d3.js.
  2. Load stack.js.
  3. Call the stack() function.

If you copied some of the other code from the example https://mbostock.github.io/stack/ and deleted other parts I you may have broken something. That example demonstrates some more advanced features like using listeners to trigger behaviors such as animations. However, I can’t identify the problem without looking at your code.

— Reply to this email directly or view it on GitHub https://github.com/mbostock/stack/issues/19#issuecomment-111533236.

Al Lemieux 90 Currier Rd Pelham, NH 03076 www.lemieux-design.net al@lemieux-design.net

mbostock commented 9 years ago

That’s a heavily modified version of Stack.js… it’s barely recognizable. Did you make those modifications and are asking me to help, or are you using someone else’s fork? In either case, I don’t think I can help because it goes too far beyond the original design and intent of this library. In particular, it uses scrolljacking to snap to slide boundaries, which goes against one of the primary motivations of this library. (See my How To Scroll essay for more.)

I’d be okay with supporting swipe-to-advance on iOS, but that’s only because you can tell when the fingers are touching the input device and thus reliably discern swipe gestures. That’s not true on desktop.

alemieux3 commented 9 years ago

Mike,

I figured it out. Must be someone's fork. I grabbed the code from another site.

Thanks.

On Fri, Jun 12, 2015 at 5:00 PM, Mike Bostock notifications@github.com wrote:

That’s a heavily modified version of Stack.js… it’s barely recognizable. Did you make those modifications are asking me to help, or are you using someone else’s fork? In either case, I don’t think I can help because it goes too far beyond the original design and intent of this library. In particular, it uses scrolljacking to snap to slide boundaries, which goes against one of the primary motivations of this library. (See my How To Scroll http://bost.ocks.org/mike/scroll/ essay for more.)

I’d be okay with supporting swipe-to-advance on iOS, but that’s only because you can tell when the fingers are touching the input device and thus reliably discern swipe gestures. That’s not true on desktop.

— Reply to this email directly or view it on GitHub https://github.com/mbostock/stack/issues/19#issuecomment-111616548.

Al Lemieux 90 Currier Rd Pelham, NH 03076 www.lemieux-design.net al@lemieux-design.net