<commit_before>= Stack 

Stack is an neat little JS library for displaying a slideshow of flickr photos. It makes heavy
use of CSS3 for a photo "look." See `sample.css` for one possible way to style your photos.

== Install & Setup

To get Stack just clone to your javascript directory (or somewhere temporary first so you don't
clutter it with this readme or the sample.css file):

  git clone git://github.com/cannikin/stack.git

== Usage

Using Stack is pretty simple:

  <div id="flickr"></div>
  <script type="text/javascript">
    function jsonFlickrApi(response) {
      stack.add(response.photos.photo);
      stack.drop();
    }
    var stack = new Stack('flickr', { 'api_key':'01234567890123456789',
                                      'photos':25,
                                      'user_id':'123456789@N00',
                                      'onclick':function() { stack.drop() } });
  </script>
  
First you create a <div> that will contain your slideshow. Notice that we need to create the
`jsonFlickrApi()` function here manually. I'd love to roll this into stack.js but unfortunately
Flickr calls this method directly so it needs to live outside of any namespace. It's ugly, but it
works. Finally, create an instance of Stack and tell it the id of the <div> you just created
along with a couple of parameters.

If you prefer you can call `drop()` yourself by maybe placing a button below the stack labeled "Next."
If you want a photo to be clickable you can define the `onclick` parameter and pass any callback you'd
like. In the example above we're calling `drop()` on our `stack` instance.

=== Parameters

Stack can be customized with several options. Here they are:

* *api_key* => (required) your Flickr API key (see http://www.flickr.com/services/api/keys/apply/ to get yours)
* *photos* => (optional, defaults to 25) How many photos you want in your stack
* *user_id* => (optional) What user to pull photos from (see http://idgettr.com/ to get the user_id for a username)
* *tags* => (optional) List of tags to search photos for
* *text* => (optional) Open-ended text search, looks in a photo's title, description and tags
* *sort* => (optional) How to sort the returned photos (defaults to descending by date uploaded [newest photos first])
* *randomize* => (optional) Should stack randomize the order of the photos regardless of `sort`
* *keep* => (optional, defaults to 2) How many photos to keep on the screen before removing ones in the background (for performance, the more you have stacked the worse the animation becomes)
* *min_rotate* => (optional, defaults to -5) How far (in degrees) a photo can rotate counter-clockwise
* *max_rotate* => (optional, defaults to 5) How far (in degrees) a photo can rotate clockwise
* *speed* => (optional, defaults to 1) How long (in seconds) it takes for a photo to fade in
* *onclick* => (optional) Function to call if a photo is clicked<commit_msg>Updated readme with data types for parameters<commit_after>= Stack 

Stack is an neat little JS library for displaying a slideshow of flickr photos. It makes heavy
use of CSS3 for a photo "look." See `sample.css` for one possible way to style your photos.

== Install & Setup

To get Stack just clone to your javascript directory (or somewhere temporary first so you don't
clutter it with this readme or the sample.css file):

  git clone git://github.com/cannikin/stack.git

== Usage

Using Stack is pretty simple:

  <div id="flickr"></div>
  <script type="text/javascript">
    function jsonFlickrApi(response) {
      stack.add(response.photos.photo);
      stack.drop();
    }
    var stack = new Stack('flickr', { 'api_key':'01234567890123456789',
                                      'photos':25,
                                      'user_id':'123456789@N00',
                                      'onclick':function() { stack.drop() } });
  </script>
  
First you create a <div> that will contain your slideshow. Notice that we need to create the
`jsonFlickrApi()` function here manually. I'd love to roll this into stack.js but unfortunately
Flickr calls this method directly so it needs to live outside of any namespace. It's ugly, but it
works. Finally, create an instance of Stack and tell it the id of the <div> you just created
along with a couple of parameters.

If you prefer you can call `drop()` yourself by maybe placing a button below the stack labeled "Next."
If you want a photo to be clickable you can define the `onclick` parameter and pass any callback you'd
like. In the example above we're calling `drop()` on our `stack` instance.

=== Parameters

Stack can be customized with several options. Here they are:

* *api_key* => [String] (required) your Flickr API key (see http://www.flickr.com/services/api/keys/apply/ to get yours)
* *photos* => [Number] (optional, defaults to 25) How many photos you want in your stack
* *user_id* => [String] (optional) What user to pull photos from (see http://idgettr.com/ to get the user_id for a username)
* *tags* => [String] (optional) List of tags to search photos for
* *text* => [String] (optional) Open-ended text search, looks in a photo's title, description and tags
* *sort* => [String] (optional) How to sort the returned photos (defaults to descending by date uploaded [newest photos first]). Can be one of date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, interestingness-asc, and relevance
* *randomize* => [Boolean] (optional) Should stack randomize the order of the photos regardless of `sort`
* *keep* => [Number] (optional, defaults to 2) How many photos to keep on the screen before removing ones in the background (for performance, the more you have stacked the worse the animation becomes)
* *min_rotate* => [Number] (optional, defaults to -5) How far (in degrees) a photo can rotate counter-clockwise
* *max_rotate* => [Number] (optional, defaults to 5) How far (in degrees) a photo can rotate clockwise
* *speed* => [Number] (optional, defaults to 1) How long (in seconds) it takes for a photo to fade in
* *onclick* => [Function] (optional) Callback when a photo is clicked
{'fraction_non_alphanumeric': 0.09405052974735126, 'fraction_numerical': 0.013039934800325998, 'mean_word_length': 3.6414523449319214, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7002148', 'n_tokens_mistral': 1760, 'n_tokens_neox': 1622, 'n_words': 829}