BookmarkSubscribeRSS Feed
FalkoSchulz
SAS Employee

Why not use SAS Visual Analytics and one of my favorite coordinate plot visualizations to spread some love this season! For this example - I'm borrowing some existing ASCII arts from site https://www.asciiart.eu/holiday-and-events/valentine - but you can easily apply this example to other drawings or try with your own creativity.

 

I simply copied the related text into a text file (vi.txt) and wrote a short SAS data step to generate a data set for my SAS Visual Analytics report. 

filename in "vi.txt";

/* the width of the grid depends on the input data */ %let GRID_WIDTH=68; data valentine(compress=yes); infile in truncover; input line $CHAR&GRID_WIDTH..;
/* generate 4 columns: X/Y (coordinates), C (color code) and DATE */ length x y c date 8.; format date year.; y = &GRID_WIDTH. - _n_; do i = 1 to &GRID_WIDTH.; tmp = put(line,$char&GRID_WIDTH..); n = substrn(tmp,i,1); c = rank(n); /* a simple rank to distinguish between different chars */ x = i; if (c ne 32) then do; /* */ id = put(x,z2.) || put(y,z2.); if (c eq 88) then c = 100; /* 'X' */

/* animate the color code for some color ranges (>100) */ do year = 1950 to 1960 by 1; date = mdy(1,1,year); if (c ge 100) then c = c + (year - 1950); output; end; do year = 1961 to 1970 by 1; date = mdy(1,1,year); if (c ge 100) then c = c - (year - 1950); output; end; end; end; keep id y x c date; run;

With that data set loaded into SAS Visual Analytics, we can add a coordinate plot visualization to the canvas. I decided to use the Geo Coordinate object as it allows me to animate the data using a date variable. The original geo map background is hidden using related option in the Options panel. As geographic item, I used the ID variable with related X & Y coordinates variables and a custom coordinate space EPSG:900913 for better flat rendering of the data points.

SAS Visual Analytics report - Spreading LoveSAS Visual Analytics report - Spreading Love

Some finishing touches around additional header and footer - produces the example above.

 

Happy Valentines Day Everyone!

2 REPLIES 2
MichelleHomes
Meteorite | Level 14

Struck by Cupid's arrow, @FalkoSchulz?

 

L❤️VE it!

 

Cheers,

Michelle

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com
Bjones81
Calcite | Level 5

Amazing!!!!

Explore and visualize your data

 
With a free 14-day SAS® Viya trial, you can:

 

  • Experience all the capabilities of SAS Viya Enterprise, our top-tier Viya offering.
  • Use our pre-loaded data or upload your own (up to 1GB).
  • Access training resources and videos.
  • Add up to four other users so your team can see how Viya works for everyone.
Register Now
Discussion stats
  • 2 replies
  • 628 views
  • 12 likes
  • 3 in conversation