Wednesday, May 16, 2012

A FRED Browser

After you edit a FRED graph, in a row of text above the graph are some options, including LINK to the graph. No matter how complex your graph, the URL is always short, and the filename part is never in my experience more than three characters.

That three-character simplicity amazed me. I wrote to the FRED webmaster about it and Mr. Essig offered this brief explanation:

The short links are generated from a sequence with a base of 62 characters (i.e. a-z, A-Z, 0-9) instead of the normal 10 numeric characters (i.e. 0-9).

Well, after that it was obvious! The three-digit sequence is just a number. In other words, when you create one of those links to a FRED graph, FRED gives the thing a number and saves the info needed to create that same graph again, later.

The three-character sequence is just a number.

So, why can't I pick a number at random and look at that FRED graph?

Well, I can't, because I don't have the ability to write the code to make it happen. But my son Jerry can. I described the idea to him and before I knew it, he was back to me with a link to try, and this email:

I'm not totally sure what you had in mind in terms of integrating it with your site, but here you go ...

This is two HTML pages. One has the two frames on it. The other is the nav bar, which goes inside the top frame. It sets the page in the bottom frame to be some fred graph. All of the logic is in javascript (no php or anything), but it's a little confusing because of all of the frames and the javascript. We can talk more about it ... anyway, here it is!

Well, I spent a few days with it, off and on, trying to put something in the sidebar that would access the FRED Graph/NavBar combo. Then I went back to Jerry:

Okay I give up. I can't even keep up with the posting.

What I have in mind is this: The user clicks a button or something in my sidebar to activate your FRED browser. But the FIRST call from this button is to a graph at random.

Then with your PREV/NEXT options the user can look at that random area. I thought people might find this worth trying more than once.

Jerry got back to me just a few hours later with a new link that picks one of those "base 62" numbers at random, and opens up that FRED graph.

All that was left for me to do was stick the thing in the sidebar and write this post!

Not bad. I really like the idea of accessing that base-62 list of graphs that FRED users have created. It offers a peek at what other people have been working on. And it gives me a look at data series and data relationships I've not seen before.

So I want to thank my son for developing the FRED Browser. You can find the link on my sidebar under the title Random Eyes. Just click the text below that title to open up the NavBar and a FRED graph at random!

Oh, by the way... I want to repeat something Jerry said the other day:

One thing I wonder about (I don't know if it's a serious concern or not)... maybe a more prominent attribution to FRED (in the top bar) might be appropriate. I could change the "FRED" to "St. Louis Fed." or something...

Yeah. Thanks, Jerry. And thank you, FRED.



Woj said...

Awesome tool! Very clever idea as well. Will certainly look through these graphs for areas of interest.

The Arthurian said...

Thank you Woj. You should have seen how fast Jerry turned the idea into reality!

The Arthurian said...

I might just keep track of a few of them.

#4fr -- compares (3) views of population: Total US population, Total (nonfarm) Employees, and Working age US population.

And yes, you can edit the URL to show the graph number you want to see. Case Sensitive!

The Arthurian said...

#4fL -- interesting view of Federal receipts and expenditures.

Jazzbumpa said...

Very cool.

What made you think of it?


The Arthurian said...

Dunno, Jazz. But since Mark showed us FRED's LINK option, I have been in awe of that three-character sequence. How could they describe such a complex graph in just three characters?? Then, when Mr. Essig explained it -- Of course! They just give the graph a number!

Then... after about six weeks... the question came to mind: If there is a list of graphs-by-number, why can't I look at some of those graphs? Jerry did the rest.

My main achievement was the six-week lull.

Jazzbumpa said...

Not to be outdone, I am currently working on the 7 week lull.


The Arthurian said...

#5Kt -- The price of oil, relative to the price of natural gas.

The Arthurian said...

#3AO -- Total Assets, and Total Financial Assets.
(Capital 'O' ... not 'zero')