Data Source API documentation?

76 views
Skip to first unread message

shaug

unread,
Mar 20, 2008, 5:30:55 PM3/20/08
to Google Visualization API
I notice that most of the comments on this board are around data
source issues, so I'll add my voice to the mix:

Am I missing the documentation for data sources? Google spreadsheet
support is not very useful to me. But if there's a REST-based API for
data sources that I can provide my own implementation for, then this
project opens up a world of possibilities for me.

If this API is already documented somewhere, please let me know.

Thanks,

-Scott

eAi

unread,
Mar 20, 2008, 9:53:54 PM3/20/08
to Google Visualization API
I asked a similar question (as have others below), and the answer is
'they did Google Spreadsheets first, more will come soon'. Keep asking
for it as that'll push it up their list of priorities. It seems it's
the number one request, as it is the system is not really very useful
unless you're a Google Spreadsheets user.

Eddy Mulyono

unread,
Mar 22, 2008, 6:42:20 PM3/22/08
to Google Visualization API
On Mar 20, 6:53 pm, eAi <talk...@gmail.com> wrote:
> I asked a similar question (as have others below), and the answer is
> 'they did Google Spreadsheets first, more will come soon'. Keep asking
> for it as that'll push it up their list of priorities.

+1

I also want to make my own DataSource.

-Eddy

Paul Brown

unread,
Mar 25, 2008, 1:51:16 AM3/25/08
to Google Visualization API
And +1 from here, too. For what it's worth, if you go to the trouble
of setting up a spreadsheet and publishing it and then using wget or
curl against the data source URL, the result looks like a
straightforward JSON format.

-- Paul

Julio Faerman

unread,
Mar 25, 2008, 9:05:37 AM3/25/08
to Google Visualization API
+1

I want to visualize data from other tools, such as google code hosted
projects and atlassian JIRA. A documented Data Source API is the
missing piece to make the visualization api a really powerfull tool.

jmay

unread,
Mar 26, 2008, 5:42:15 PM3/26/08
to Google Visualization API
I could not find any documentation either.

But I was able to reverse-engineer a basic example from the Google
Spreadsheet format.

If you put the following in a text file on your server, and enter that
URL into a Line Chart widget on on iGoogle page, you'll get a
visualization:

google.visualization.Query.setResponse({requestId:'0',status:'ok',table:
{cols: [{id:'A',label:'',type:'n',pattern:'#0.###############'},
{id:'B',label:'',type:'n',pattern:'#0.###############'}],"rows":
[[{"v":2001.0,"f":'2001'},{v:10.0,f:'10'}],[{v:2002.0,f:'2002'},{v:
20.0,f:'20'}],[{v:2003.0,f:'2003'},{v:30.0,f:'30'}],[{v:
2004.0,f:'2004'},{v:40.0,f:'40'}],[{v:2005.0,f:'2005'},{v:
50.0,f:'50'}],[{v:2006.0,f:'2006'},{v:60.0,f:'60'}]]}});

Observations:

* it's mostly JSON, but with a function wrapper so apparently the API
is executing the text
* I didn't fiddle with the A/B sections to figure out how the patterns
work
* each node has v & f components for both the X & Y coordinates,
presumably using the f components for mouseclick popups

Perhaps someone could take this and build a more substantial example
using the API on their own site.

Cheers,
-Jason

Jim Alateras

unread,
Mar 27, 2008, 12:45:31 AM3/27/08
to Google Visualization API
++1 on this as well. Would love to include support for the
visualization API in our product. I would envisage that the REST API
would be based on APP/GData.

cheers
</jima>

jespe...@gmail.com

unread,
Mar 28, 2008, 7:50:12 AM3/28/08
to Google Visualization API
I am also very interested in other type of data sources, but is there
a more formal way of highlighting that need for Google than adding
"+1" into this subject?

- Glad

VizGuy (Google)

unread,
Apr 1, 2008, 5:13:43 AM4/1/08
to Google Visualization API
I am losing count of all the +1. This is the top priority for us.

On Mar 28, 2:50 pm, "jesperg...@gmail.com" <jesperg...@gmail.com>
wrote:

shaug

unread,
Apr 1, 2008, 2:55:27 PM4/1/08
to Google Visualization API
ETA for this? rough estimate is just fine. 1 day? 1 week? 1 month?

VizGuy (Google)

unread,
Apr 2, 2008, 6:25:09 AM4/2/08
to Google Visualization API
I don't have an ETA I can share at this time. It's not one of the
first 2 options.

opticrealm

unread,
Apr 2, 2008, 8:57:59 PM4/2/08
to Google Visualization API
I've fiddled with the Timeseries JSON object as well.

(Pasting in chunks)

<CHUNK1>

google.visualization.Query.setResponse(
{
requestId:'0',
status:'ok',
signature:'6173382439516707022', /* Changes when data changes */

</CHUNK1>

So the timeseries gadget must download this JSON every so often and
check the new signature against it's own. If the signature is
different, it knows that the data on the "spreadsheet" has changed.

<CHUNK2>
table:{
cols:
[
{
id:'A',
label:'Date',
type:'d', /* d=date */
pattern:'M/d/yyyy' /* unique date pattern */
},
{
id:'B',
label:'Budget',
type:'n', /* n=number */
pattern:'#0.###############' /* unique number pattern */
},
{
id:'C',
label:'Revenue',
type:'n',
pattern:'#0.###############'
},
{
id:'D',
label:'Movie',
type:'t', /* t=text */
pattern:'' /* there is no text pattern */
}
],
</CHUNK2>

Chunk2 shows the columns needed for a timeseries chart. (Date,
Value1, ..., ValueN, PopupText)
Note the type and pattern fields. d=date, n=number, t=text

<CHUNK3>
rows:
[
[
{
v:new Date(1981,10,6),
f:'11/6/1981'
},
{
v:5000000.0,
f:'5000000'
},
{
v:4.2365581E7,
f:'42365581'
},
{
v:'Time Bandits'
}
],

</CHUNK3>

This is the very first row of the data. Notice the first box shows
the date, then the budget value, then the revenue value, then the
popuptext.

All that mumbo-jumbo about tabular data in the API documentation is
starting to make sense. The other rows are very similar.

I think this is enough information for me to write some code to
provide my own updating datasource.

-Patrick

opticrealm

unread,
Apr 2, 2008, 9:02:34 PM4/2/08
to Google Visualization API
One more small thing:

From <CHUNK3>:
{
v:new
Date(1981,10,6),
f:'11/6/1981'
},

Notice that it says 1981,10,6 on one line and 11/6/1981 on the other.
The JavaScript Date object must use 0-based counting.

Bjorn Sandvik

unread,
Apr 3, 2008, 1:43:58 PM4/3/08
to Google Visualization API
++1

Would it be possible to fetch data from a MySQL database?

http://blog.thematicmapping.org

shaug

unread,
Apr 3, 2008, 5:17:10 PM4/3/08
to Google Visualization API
My assumption is that because the Visualization API has you specify
the data source as a URL that returns JSON-formatted data, you would
need to provide a public web frontend to your MySQL database that
accepted these URLs and performed the appropriate transformation. My
guess is that days/weeks within the Data Source API documentation
being made public, there will be a rash of libraries and tools that
will aid in creating such services.

Brian Armstrong

unread,
Apr 17, 2008, 4:24:55 PM4/17/08
to Google Visualization API
Yes, this is really going to be useful for us once it can pull data
from a MySQL database.

Cesium

unread,
Apr 20, 2008, 11:35:03 AM4/20/08
to Google Visualization API
I'd like to see this Time-Series Chart displaying data within a Google
App Engine application.

I am at the crossroads of selecting: (mySQL, C++, ASP.NET) vs.
(BigTable, Python, Google App Engine).

This time-series chart would seal the deal.

David (cesium)

julia

unread,
Apr 30, 2008, 6:45:26 AM4/30/08
to Google Visualization API
+1
is it top priority for you to support a set of other data sources
yourself or do you intend to publish a REST-based API for
data sources as suggested by Scott, so that anyone could become a
datasource provider?
Thanks for clarifying.

Vassil Kovatchev

unread,
May 28, 2008, 1:18:05 PM5/28/08
to Google Visualization API
VizGuy,

Is publishing a DataSource API still a top priority as it was two
months ago?

Thanks

William Brendel

unread,
May 28, 2008, 1:22:25 PM5/28/08
to Google Visualization API
VizGuy posted on 24 May about this:

"Yes, there will be a way. This is one of the most popular requests.
We are aware of it and actively working to address this need."
( http://groups.google.com/group/google-visualization-api/browse_thread/thread/4e5828b180a8dc40
)

-Will

On May 28, 1:18 pm, Vassil Kovatchev <vassil.kovatc...@gmail.com>
wrote:

Mike Pretti

unread,
May 28, 2008, 1:33:23 PM5/28/08
to google-visua...@googlegroups.com
Is there a way to involve myself in addressing this issue? Can I offer my services to expediate the process ?
  -Mike

VizGuy (Google)

unread,
May 29, 2008, 2:04:52 PM5/29/08
to Google Visualization API
Today's launch addresses this most popular request. We added an option
to create a DataTable locally on the client (in JavaScript). You can
bring the data from anywhere you have it, convert it into a common
DataTable class, and run visualizations on top of that.

On May 28, 10:33 am, "Mike Pretti" <mpre...@gmail.com> wrote:
> Is there a way to involve myself in addressing this issue? Can I offer my
> services to expediate the process ?
> -Mike
>
> On Wed, May 28, 2008 at 10:22 AM, William Brendel <williambren...@gmail.com>
> wrote:
>
>
>
> > VizGuy posted on 24 May about this:
>
> > "Yes, there will be a way. This is one of the most popular requests.
> > We are aware of it and actively working to address this need."
> > (
> >http://groups.google.com/group/google-visualization-api/browse_thread...

Cesium

unread,
Jun 4, 2008, 12:46:32 PM6/4/08
to Google Visualization API

On May 29, 12:04 pm, "VizGuy (Google)" <viz...@google.com> wrote:
> Today's launch addresses this most popular request. We added an option
> to create a DataTable locally on the client (in JavaScript). You can
> bring the data from anywhere you have it, convert it into a common
> DataTable class, and run visualizations on top of that.
>

That phrase ' bring the data from anywhere you have it' would take
place in the javascript
right? The we would populate a javascript DataTable and poke it into
the visualization.

That's cool but....
I'm still leaning towards writing a DataSource. Remember how we
reverse engineered the
JSON format of the 'old time series gadget'? For example:

google.visualization.Query.setResponse({table:{rows:[[{v:new
Date(1981,10,6),f:'11/6/1981'},{v:5000000.0,f:'5000000'},{v:
4.2365581E7,f:'42365581'},{v:'Time Bandits'}],[{v:new
Date(1982,10,6),f:'11\/6\/1982'},{v:6000000.0,f:'6000000'},{v:
5.2365581E7,f:'52365581'},{v:''}],[{v:new
Date(1983,10,6),f:'11/6/1981'},{v:7000000.0,f:'7000000'},{v:
1.2365581E7,f:'12365581'},{v:'Brazil'}]],cols:
[{id:'A',label:'Date',type:'d',pattern:'M\/d\/yyyy'},
{id:'B',label:'Budget',type:'n',pattern:'#0.###############'},
{id:'C',label:'Revenue',type:'n',pattern:'#0.###############'},
{id:'D',label:'Movie',type:'t',pattern:''}]},requestId:'0',status:'ok',signature:'6173382439516707022'})

This works fine when you spit this out as a response from a GAE page,
that you specify
as the 'data source URL' in the time series gadget.

But have you noticed that this format does *not* work for
google.visualization.AnnotatedTimeLine?

For example, I tried this javascrpt:

function fetchData() {
var dataurl='http://<name omitted>.appspot.com/JSON';
var query = new google.visualization.Query(dataurl);
query.send(handleQueryResponse); // Send the query with a
callback function
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}
var data = response.getDataTable();
var chart = new
google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
chart.draw(data, {displayAnnotations: false});
}

Up comes the annotaed time series chart, I see Budget data plotted
properly, but the Revenue
data and the Movie annotations are absent.

Does the new annotated visualization expect a different JSON format?

Wouldn't it be totally sweet if we had a *Python* DataTable object
that we populated in GAE
and then serialized it out in response to a visualization query from
our javascript!!!!

Am I re-inventing the wheel here? It sure feels like it.

Cheers,
David

Cesium

unread,
Jun 4, 2008, 2:01:40 PM6/4/08
to Google Visualization API
Note about the code above:

The behavior for:
displayAnnotations: false
is the same as:
displayAnnotations: true

David
Reply all
Reply to author
Forward
0 new messages