Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Flan: Animations in Flapjax
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
noelwelsh@gmail.com  
View profile  
 More options Apr 17, 11:38 am
From: "noelwe...@gmail.com" <noelwe...@gmail.com>
Date: Fri, 17 Apr 2009 08:38:17 -0700 (PDT)
Local: Fri, Apr 17 2009 11:38 am
Subject: Flan: Animations in Flapjax
I've just uploaded my (very small, very incomplete) animation library
Flan:

  http://github.com/noelwelsh/flan/

Happy hacking.
N.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shriram Krishnamurthi  
View profile  
 More options Apr 17, 9:57 pm
From: Shriram Krishnamurthi <s...@cs.brown.edu>
Date: Fri, 17 Apr 2009 21:57:47 -0400
Local: Fri, Apr 17 2009 9:57 pm
Subject: Re: [Flapjax: 388] Flan: Animations in Flapjax
Hey -- awesome!  Thanks for starting this!

The Fade In works nicely, but unfortunately Slide Down doesn't, at
least not on Firefox 3.0.8 on Windows.  Error:

Error: elt.getHeight is not a function
Source File: effects.js
Line: 13

[Heading out of town in the AM, so can't investigate more right now
I'm afraid, but hopefully this is useful.]

Shriram


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Noel Welsh  
View profile  
 More options Apr 18, 9:11 am
From: Noel Welsh <noelwe...@gmail.com>
Date: Sat, 18 Apr 2009 06:11:11 -0700 (PDT)
Local: Sat, Apr 18 2009 9:11 am
Subject: Re: Flan: Animations in Flapjax
Slide Down depends on prototype.js, which I hadn't uploaded to Git. I
have done so now, so that effect should work. (You also need
flapjax.js in the same directory, but I guess you have that already.)

For anyone trying Flan on IE, note that Fade probably won't work.

N.

On Apr 18, 2:57 am, Shriram Krishnamurthi <s...@cs.brown.edu> wrote:
...

> The Fade In works nicely, but unfortunately Slide Down doesn't, at
> least not on Firefox 3.0.8 on Windows.  Error:

...

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shriram Krishnamurthi  
View profile  
 More options Apr 18, 6:01 pm
From: Shriram Krishnamurthi <s...@cs.brown.edu>
Date: Sat, 18 Apr 2009 18:01:26 -0400
Local: Sat, Apr 18 2009 6:01 pm
Subject: Re: [Flapjax: 390] Re: Flan: Animations in Flapjax
And that did it -- awesome!  Thanks!

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Artyom Shalkhakov  
View profile  
 More options Apr 30, 5:38 am
From: Artyom Shalkhakov <artyom.shalkha...@gmail.com>
Date: Thu, 30 Apr 2009 15:38:48 +0600
Local: Thurs, Apr 30 2009 5:38 am
Subject: Re: [Flapjax: 388] Flan: Animations in Flapjax
Hi,

2009/4/17 noelwe...@gmail.com <noelwe...@gmail.com>:

> I've just uploaded my (very small, very incomplete) animation library
> Flan:

>  http://github.com/noelwelsh/flan/

That's great job. :)

I have a question: why did you use event streams instead of behaviors?
Is this because of performance?

I looked at a wide variety of javascript animation libraries out there,
and it seems like they all eat CPU like candies. What is interesting
here is the fact that the results of profiling code samples that I
posted before indicate that DOM updates are inefficient, and it
looks like there's nothing we can do about that...

For example, it turned out that an assignment to window.location.hash
is so slow that I had to "isolate" it in a setTimeout(fun,0). That doesn't
help much, ewww. :(

You can take a look at a somewhat simplified version here:
<http://www.sound-city.kz/fj/flapjax.html>
(doesn't work in IE only because of my laziness)

Also, I've written articles about Flapjax and animation
using Flapjax in Russian:
<http://chiaroscuro.yvision.kz/blog/9161.html>
<http://chiaroscuro.yvision.kz/blog/9169.html>
<http://chiaroscuro.yvision.kz/blog/9468.html>

If anybody is interested, I can as well translate them to English.

The bottom line is: don't overuse animations. :) If one needs a lot
of animation, then they should resort to Flash, I suppose.

Cheers,
Artyom Shalkhakov.

PS sorry for the late reply. I was very busy finishing my first
Flapjax-powered website. :)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Noel Welsh  
View profile  
 More options May 1, 8:07 am
From: Noel Welsh <noelwe...@gmail.com>
Date: Fri, 1 May 2009 05:07:21 -0700 (PDT)
Local: Fri, May 1 2009 8:07 am
Subject: Re: Flan: Animations in Flapjax
On Apr 30, 10:38 am, Artyom Shalkhakov <artyom.shalkha...@gmail.com>
wrote:

> That's great job. :)

Thanks!

> I have a question: why did you use event streams instead of behaviors?
> Is this because of performance?

I used event streams as they seemed natural at the time. So, no good
reason. Behaviors might be better.

> I looked at a wide variety of javascript animation libraries out there,
> and it seems like they all eat CPU like candies. What is interesting
> here is the fact that the results of profiling code samples that I
> posted before indicate that DOM updates are inefficient, and it
> looks like there's nothing we can do about that...

Yes, I don't think current browsers are the right tool for complex
animations. I'm more interested in building user interface widgets,
like grid and table controls, and using animations to provide simple
visual feedback to the user.

[I think some browsers might be capable of complex animations. For
example, it seems you can do quite a lot with the canvas in recent
versions of Firefox, but this of course doesn't work in IE.

(Nice canvas example here: http://vis.stanford.edu/protovis/ex/clock.html)]

> Also, I've written articles about Flapjax and animation
> using Flapjax in Russian:
> <http://chiaroscuro.yvision.kz/blog/9161.html>
> <http://chiaroscuro.yvision.kz/blog/9169.html>
> <http://chiaroscuro.yvision.kz/blog/9468.html>

> If anybody is interested, I can as well translate them to English.

I'm happy with the current documentation (and reading the source
code), but I imagine I'm the exception given my experience with the
work preceding Flapjax. I imagine English translations would get more
traffic.

> PS sorry for the late reply. I was very busy finishing my first
> Flapjax-powered website. :)

Excellent! (And interesting to see Kazakhstan leading the world in
functional reactive javascript!)

N.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arjun Guha  
View profile  
 More options May 2, 9:20 pm
From: Arjun Guha <arjun.g...@gmail.com>
Date: Sat, 2 May 2009 21:20:47 -0400
Local: Sat, May 2 2009 9:20 pm
Subject: Re: [Flapjax: 395] Re: Flan: Animations in Flapjax

> Yes, I don't think current browsers are the right tool for complex
> animations. I'm more interested in building user interface widgets,
> like grid and table controls, and using animations to provide simple
> visual feedback to the user.

I think this is the right.  I believe that UI widgets are
significantly harder than animations and push the language and its
abstractions much further

I thought I'd give a simple data grid a shot (Safari 4, Firefox 3):

http://www.cs.brown.edu/~arjun/tmp/table.html

There are some inefficiencies I've noted in the source.  In addition,
the code would be a lot cleaner if we had a generalized version of
tagRec that worked with multiple elements.

In this grid, I care about clicks on the <table> and keyboard events
on the <textarea>.  The structure of the <table> is dependent on
enterKeyE's on the <textarea>.  Since tagRec just works with a single
element, I had to use sendEvent (table.js:128).

Arjun


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arjun Guha  
View profile  
 More options May 7, 9:48 am
From: Arjun Guha <arjun.g...@gmail.com>
Date: Thu, 7 May 2009 09:48:20 -0400
Local: Thurs, May 7 2009 9:48 am
Subject: Re: [Flapjax: 395] Re: Flan: Animations in Flapjax
I'm trying to make animations a bit better.  You've seen the catchup demo:

http://www.flapjax-lang.org/demos/catchup.html

Here's catchup using a different implementation of Flapjax:

http://www.cs.brown.edu/~arjun/tmp/catchup.html

It should feel smoother.  Specifically, in the old catchup, if you
move the mouse fast, the word "up" gets frozen in place, and moves
around erratically.

With the new Flapjax, "up" should freeze a lot less.

Technical details:

The problem with catchup is the use of timerB and delayB: popular
functions for animations.  timerB and delayB are implemented with
JavaScript's setInterval and setTimer.  When you move the mouse really
fast, the flurry of UI events supersede the scheduled
setTimer/setInterval events, so the delayed "up" gets stuck.  We talk
about "glitches" in a single timestep.  IMO, this is a glitch-like
thing.

I've reimplemented the scheduler so that events can be scheduled for
the future.  delayB no longer creates a new callback for each event.
Instead it simply schedules them for the future.

What we have now is just a reimplementation of delayB and a new
scheduler.  If this looks promising, I'll go ahead and fix timerB.  As
I see it, timerB, delayB and other such functions would all just
schedule events for the future.  Flapjax would have a single
setInterval timer callback whose resolution would be the minimum
resolution used by the program.

Arjun


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leo Meyerovich  
View profile  
 More options May 7, 1:54 pm
From: Leo Meyerovich <lmeye...@gmail.com>
Date: Thu, 07 May 2009 10:54:39 -0700
Local: Thurs, May 7 2009 1:54 pm
Subject: Re: [Flapjax: 397] Re: Flan: Animations in Flapjax
Ha, nice :)

Two further thoughts:

1. Often, the schedule gets behind because of lack of computational
resources. For animation, it's more important to be on the absolute
schedule than to show every frame (your fix preserves frames in the
'right' order, but it can still get behind in terms of wall-time). I had
tried my hand at monitoring FPS and dropping frames in animation code
when this occurred. E.g., animation_timer(min, max, fps) goes from min
to max in fps, but may skip inbetween values of it isn't hitting the
desired framerate. This was done cooperatively with concurrent timers.
Unfortunately, it was also noticeably slower in my initial attempt :)

2. There's s FFI question for sendEvent:

The new way for external libraries to inject events is "sendEvent(event,
source, when)". If we want multiple external events to be in the same
timestep (to prevent glitches), because sendEvent calls propagatePulses
which calls date().getTime(), we can lose this glitch-freedom. I can see
coders tempted to use 'when' for this, but that's not reliable. There
should be a glitch-free interface (multiple calls to sendEvent in a step
should get batched -- think Esterel).

A subtlety here is that I'm assuming sendEvent is asynchronous so it's
possible to express this to beginwith (atm, it is not).

- Leo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arjun Guha  
View profile  
 More options May 7, 2:05 pm
From: Arjun Guha <arjun.g...@gmail.com>
Date: Thu, 7 May 2009 14:05:05 -0400
Local: Thurs, May 7 2009 2:05 pm
Subject: Re: [Flapjax: 398] Re: Flan: Animations in Flapjax
We lack a good demo that truly taxes Flapjax and the web-browser's
speed.  Perhaps it's time to write pong, 3-body simulators, etc.
They're easy to express in FRP but they exercise the speed of our
implementation.

I suspect the new scheduler will be particularly good for programs
that make many calls to timerB and delayB: it will be be great for
composing animations and interfaces.

Btw, the animationTimerB is a great idea.

Arjun


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leo Meyerovich  
View profile  
 More options May 7, 2:31 pm
From: Leo Meyerovich <lmeye...@gmail.com>
Date: Thu, 07 May 2009 11:31:05 -0700
Local: Thurs, May 7 2009 2:31 pm
Subject: Re: [Flapjax: 399] Re: Flan: Animations in Flapjax
The one I had done it for was more typical: a bunch of menu buttons that
highlight and fadeout when you mouse over. Imagine a lightgrid or
something. You can imagine something similar with the twit map (as
events come in, show them).

My junky version was for the old 22 website; I'll try to dig it up after
work.

- Leo


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google