<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Fun w/SAS ODS Graphics: New Year's Eve Ball Drop in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321842#M11268</link>
    <description>&lt;P&gt;Thanks for squeezing in one more cool ODS Graphics trick,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt;! Happy New Year!&lt;/P&gt;</description>
    <pubDate>Sat, 31 Dec 2016 18:31:44 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2016-12-31T18:31:44Z</dc:date>
    <item>
      <title>Fun w/SAS ODS Graphics: New Year's Eve Ball Drop</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321841#M11267</link>
      <description>&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6543i9C259E96025E269F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="HappyNewYear.gif" title="HappyNewYear.gif" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A quick black-and-white ODS Graphics take on the &lt;A href="https://en.wikipedia.org/wiki/Times_Square_Ball" target="_self"&gt;Times Square New Year's Eve ball drop&lt;/A&gt; (hat tip to Rick Wicklin for the &lt;A href="http://blogs.sas.com/content/iml/2016/08/22/animation-by-statement-proc-sgplot.html" target="_self"&gt;BY-statement trick&lt;/A&gt;!). Happy New Year's!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CODE&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun w/SAS ODS Graphics: B&amp;amp;W New Year's Eve Ball Drop;
 
*==&amp;gt; Generate and render data for frames showing ball dropping w/countdown timer;

data HappyNewYear;                                     * Generate points/text for ball drop &amp;amp; countdown timer;
x=.5; x1=.5;                                           * X-values of ball, countdown text are constant;
x1=.5; y1=.5; y2016=2016;                              * Coordinates and label for countdown timer;
do frameid=1 to 0 by -.01;                             * Generate data for frames (ball position + timer text);
  if frameid&amp;gt;.0001 then text=compress(put(ceil(frameid*10),2.)); else text='';
  y=frameID;
  r=50;                                                * Relative size of ball for bubble plot;  
  output; 
  y=.; r=1; output;                                    * Generate small "dummy" point to make ball bigger; 
end;
run;

options nobyline;                                      * Animated GIF initialization;
ods _all_ close;
options papersize=('5 in', '5 in') printerpath=gif animation=start 
        nodate nonumber animloop=YES animduration=.1 NOANIMOVERLAY ;
ods printer file='/folders/myfolders/HappyNewYear/HappyNewYear.gif';
ods graphics / width=5in height=5in imagefmt=GIF border=off;

proc template;                                         * Display ball (bubbleplot) &amp;amp; countdown timer (textplot);
define statgraph newyearplot1;
begingraph / opaque=true border=false drawspace=layoutpercent backgroundcolor=black;
  layout overlayequated / equatetype=square border=false  
         WALLDISPLAY=NONE commonaxisopts=(viewmin=-.15 viewmax=1.15 tickvaluelist=(-.15 1.15)) 
         xaxisopts=(display=none OFFSETMAX=0 OFFSETMIN=0) yaxisopts=(display=none OFFSETMAX=0 OFFSETMIN=0);
    textplot x=x1 y=y1 text=text / position=center textattrs=(size=232pt color=grey) contributeoffsets=none;     
    bubbleplot x=x y=y size=r / datalabel=y2016 datalabelposition=center 
               datalabelattrs=(color=black weight=bold size=20pt)
               dataskin=sheen colormodel=(WHITE) colorresponse=x bubbleradiusmax=40;        
  endlayout;
endgraph;
end;

proc sgrender data=happynewyear template=newyearplot1; * Generate one frame for each position of ball;
by frameID notsorted;

*==&amp;gt; Generate and render data for Happy New Year! frames;

data happynewyear2;                                    * Generate points/text;
x1=.5; y1=.5; text1="Happy*New Year!";
x2=.5; y2=0;  text2="2017"; 

%macro genframes(duration=,backlight=);                * Vary backlighting/duration to make words "flash";
options animduration=&amp;amp;duration;

proc template;
define statgraph newyearplot2;
begingraph / opaque=true border=false drawspace=layoutpercent backgroundcolor=black;
  layout overlayequated / equatetype=square border=false  
         WALLDISPLAY=NONE commonaxisopts=(viewmin=-.15 viewmax=1.15 tickvaluelist=(-.15 1.15)) 
         xaxisopts=(display=none OFFSETMAX=0 OFFSETMIN=0) yaxisopts=(display=none OFFSETMAX=0 OFFSETMIN=0);
    textplot x=x1 y=y1 text=text1 / position=top backlight=&amp;amp;backlight splitchar='*' splitpolicy=splitalways
                                    textattrs=(size=42pt weight=bold) contributeoffsets=none;
    textplot x=x2 y=y2 text=text2 / position=center backlight=&amp;amp;backlight splitchar='*' splitpolicy=splitalways
                                    textattrs=(size=42pt weight=bold) contributeoffsets=none;             
  endlayout;
endgraph;
end;

proc sgrender data=happynewyear2 template=newyearplot2;
run;
%mend;

%genframes(duration=.5,backlight=1);                  * Alternate bright/dim for "flashing" effect;
%genframes(duration=.5,backlight=.5);
%genframes(duration=.5,backlight=1);
%genframes(duration=.5,backlight=.5);
%genframes(duration=.5,backlight=1);
%genframes(duration=.5,backlight=.5);
%genframes(duration=3,backlight=1);

options printerpath=gif animation=stop;             * Wrap-up animated GIF creation;                         
run;
ods printer close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 31 Dec 2016 18:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321841#M11267</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2016-12-31T18:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Fun w/SAS ODS Graphics: New Year's Eve Ball Drop</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321842#M11268</link>
      <description>&lt;P&gt;Thanks for squeezing in one more cool ODS Graphics trick,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt;! Happy New Year!&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2016 18:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321842#M11268</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-12-31T18:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fun w/SAS ODS Graphics: New Year's Eve Ball Drop</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321870#M11269</link>
      <description>&lt;P&gt;Nice count down&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4628"&gt;@tc&lt;/a&gt;! Will this be your next dataviz?&amp;nbsp;&lt;A href="http://www.linkedin.com/hp/update/6221188723963359232" target="_blank"&gt;www.linkedin.com/hp/update/6221188723963359232&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 06:51:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321870#M11269</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2017-01-01T06:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fun w/SAS ODS Graphics: New Year's Eve Ball Drop</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321875#M11270</link>
      <description>&lt;P&gt;It is a nice effect - perhaps&amp;nbsp;I should submit a&amp;nbsp;SASware Ballot idea for a CIRCULARDOTPLOT SGPLOT statement. &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2017 18:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/321875#M11270</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2017-01-01T18:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fun w/SAS ODS Graphics: New Year's Eve Ball Drop</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/322550#M11298</link>
      <description>&lt;P&gt;Another nice piece of work by Ted, BUT . . .&lt;/P&gt;
&lt;P&gt;what happened to the Leap Second?&lt;/P&gt;
&lt;P&gt;Or is it added to 2017 AFTER the ball drop completes?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 01:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-w-SAS-ODS-Graphics-New-Year-s-Eve-Ball-Drop/m-p/322550#M11298</guid>
      <dc:creator>LeRoyBessler</dc:creator>
      <dc:date>2017-01-05T01:00:37Z</dc:date>
    </item>
  </channel>
</rss>

