basic Exhibit3 example from google spreadsheet

107 views
Skip to first unread message

Jon Crump

unread,
Jan 4, 2017, 6:20:56 PM1/4/17
to SIMILE Widgets
Dear all,

I'm returning to Exhibit after long hiatus, and I'm trying to get my head around Exhibit3. Are there any examples out there of bare-bones Exhibit demo drawing data from a Google spreadsheet? 

I've got a link:
    <link rel="exhibit/data" 
        type="application/jsonp"
        ex:converter="googleSpreadsheets" />

that returns some pretty opaque looking json wrapped in a gdata.io.handleScriptLoaded() function, and I've called Exhibit thus:

<script src="./scripted/src/exhibit-api.js?bundle=false" type="text/javascript"></script>

but I'm somewhat at a loss to know how to go next.

any hints for the clueless, but willing, would be welcome.

thanks,
Jon

David Karger

unread,
Jan 4, 2017, 6:22:34 PM1/4/17
to simile-...@googlegroups.com
Jon, google made it much more mysterious to get json feeds from their spreadsheets.  We built a little form to help; let me know if this solves your problem:
http://projects.csail.mit.edu/exhibit/googleJSON/
--
You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simile-widget...@googlegroups.com.
To post to this group, send email to simile-...@googlegroups.com.
Visit this group at https://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/d/optout.

Jon Crump

unread,
Jan 4, 2017, 7:08:37 PM1/4/17
to SIMILE Widgets
Hi David,

Thanks for responding so swiftly. Yes, based on my experience with Ex2, I had gotten as far as constructing a json-p url, and it returns a gdata.io.handleScriptLoaded() function which wraps a json object which I've pretty printed below. (the toy spreadsheet is here)

What I'm wondering now is how to address that data in the exhibit html to get a table representation of the spreadsheet rows. I gather that Ex3 uses a different expression language from Ex2. All of the examples at simile-widgets.org draw their data from purpose-built js objects rather than a google spreadsheet, and without a working example, I'm a little unsure how to proceed.

{'encoding': 'UTF-8',
 
'feed': {'author': [{'email': {'$t': 'jjc...@uw.edu'},
                     
'name': {'$t': 'jjcrump'}}],
         
'category': [{'scheme': 'http://schemas.google.com/spreadsheets/2006',
                       
'term': 'http://schemas.google.com/spreadsheets/2006#list'}],
         
'entry': [{'category': [{'scheme': 'http://schemas.google.com/spreadsheets/2006',
                                   
'term': 'http://schemas.google.com/spreadsheets/2006#list'}],
                     
'content': {'$t': 'bar: barbell, bing: bingarang, baz: bazkite',
                                 
'type': 'text'},
                     
'id': {'$t': 'https://spreadsheets.google.com/feeds/list/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/od6/public/basic/cokwr'},
                     
'link': [{'href': 'https://spreadsheets.google.com/feeds/list/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/od6/public/basic/cokwr',
                               
'rel': 'self',
                               
'type': 'application/atom+xml'}],
                     
'title': {'$t': 'row1', 'type': 'text'},
                     
'updated': {'$t': '2017-01-04T21:50:19.545Z'}},
                   
{'category': [{'scheme': 'http://schemas.google.com/spreadsheets/2006',
                                   
'term': 'http://schemas.google.com/spreadsheets/2006#list'}],
                     
'content': {'$t': 'bar: barbibble, bing: bingbabble, baz: bazurote',
                                 
'type': 'text'},
                     
'id': {'$t': 'https://spreadsheets.google.com/feeds/list/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/od6/public/basic/cpzh4'},
                     
'link': [{'href': 'https://spreadsheets.google.com/feeds/list/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/od6/public/basic/cpzh4',
                               
'rel': 'self',
                               
'type': 'application/atom+xml'}],
                     
'title': {'$t': 'row2', 'type': 'text'},
                     
'updated': {'$t': '2017-01-04T21:50:19.545Z'}}],
         
'id': {'$t': 'https://spreadsheets.google.com/feeds/list/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/od6/public/basic'},
         
'link': [{'href': 'https://docs.google.com/a/uw.edu/spreadsheets/d/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/pubhtml',
                   
'rel': 'alternate',
                   
'type': 'application/atom+xml'},
                   
{'href': 'https://spreadsheets.google.com/feeds/list/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/od6/public/basic',
                   
'rel': 'http://schemas.google.com/g/2005#feed',
                   
'type': 'application/atom+xml'},
                   
{'href': 'https://spreadsheets.google.com/feeds/list/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/od6/public/basic',
                   
'rel': 'http://schemas.google.com/g/2005#post',
                   
'type': 'application/atom+xml'},
                   
{'href': 'https://spreadsheets.google.com/feeds/list/1d4LtDRQaIDAb-1CplH14UoRoKdtsKsAivXfOckinU4U/od6/public/basic?alt\\u003djson-in-script',
                   
'rel': 'self',
                   
'type': 'application/atom+xml'}],
         
'openSearch$startIndex': {'$t': '1'},
         
'openSearch$totalResults': {'$t': '2'},
         
'title': {'$t': 'Sheet1', 'type': 'text'},
         
'updated': {'$t': '2017-01-04T21:50:19.545Z'},
         
'xmlns': 'http://www.w3.org/2005/Atom',
         
'xmlns$gsx': 'http://schemas.google.com/spreadsheets/2006/extended',
         
'xmlns$openSearch': 'http://a9.com/-/spec/opensearchrss/1.0/'},
 
'version': '1.0'}


George Adams

unread,
Jan 4, 2017, 7:14:55 PM1/4/17
to simile-...@googlegroups.com
Not sure this will help.
This is a Google spreadsheet as a backend with exhibit 3.1.1
The map is in an iframe which is a custom Google widget. The widget has no access to the <head> so the exhibit code is loaded with JS at the end.
To view the source right click on the iFrame.

It has been over a year since I worked on this page. There were changes to Google Spreadsheets that required jumping through a number of hoops to get that to work. I wrote those up on this list. If you have that part working you are most of the way there.


George Adams

--
You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simile-widgets+unsubscribe@googlegroups.com.
To post to this group, send email to simile-widgets@googlegroups.com.

David Karger

unread,
Jan 4, 2017, 7:35:34 PM1/4/17
to simile-...@googlegroups.com

Jon, do you need to access stuff at the api level for some reason?  Because exhibit will automatically import and display data that you access using the gsheets urls generated by that page I sent you.

Jon Crump

unread,
Jan 7, 2017, 4:30:01 PM1/7/17
to SIMILE Widgets
David,

Many thanks for your reply. As is often the case, I was creating problems where there were none. The url I constructed successfully drew the data from my spreadsheet. The js object for the data in the webpage seemed complex and opaque, but no matter. Addressing it in the traditional way in the html worked just fine. Which brings me to my other puzzlement:

George,

Thanks very much for your example! It was very instructive for several reasons. Studying it, I finally got my head around the right relationship between view and lens.

I basically just copied your whole viewPanel div into my page and just changed things until something worked. But one of the things I had to change was the syntax for all the element properties e.g. `data-ex-src-content` had to be changed to the old syntax: `ex:src-content`. Trawling through the various, sparse, and isolated sources of documentation, I can't reconstruct when, why, or how this syntax was changed, or why the new syntax doesn't work in my current exhibit which is running on Exhibit 3.1.2-rc3.

Can anyone enlighten me?

Jon

George Adams

unread,
Jan 7, 2017, 10:33:17 PM1/7/17
to simile-...@googlegroups.com
I don't know why my  `data-ex-src-content` code works. It has been too long for me to remember and I didn't understand it all even back when I was working on it. Maybe David knows if something was fixed or changed between the versions.


George Adams

--

David Karger

unread,
Jan 8, 2017, 12:04:55 AM1/8/17
to simile-...@googlegroups.com

Jon, questions without any online examples are hard to answer.

--
You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simile-widget...@googlegroups.com.
To post to this group, send email to simile-...@googlegroups.com.

David Karger

unread,
Jan 8, 2017, 10:05:42 AM1/8/17
to simile-...@googlegroups.com

George, I believe exhibit 3 will generally work fine if you put the script tag in the body, although there may be exceptions.  If it fails, put up an example and let me know.

Also, the "?bundle=false" part of the script tag prevents exhibit from loading its optimized bundle, so the page will load slower.  I suggest removing.

-- You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To unsubscribe from this group and stop receiving emails from it, send an email to simile-widget...@googlegroups.com. To post to this group, send email to simile-...@googlegroups.com. Visit this group at https://groups.google.com/group/simile-widgets. For more options, visit https://groups.google.com/d/optout.

Jon Crump

unread,
Jan 8, 2017, 6:34:31 PM1/8/17
to SIMILE Widgets
Hi David,

Yes, you're quite right. I've been doing preliminary development locally, but I've now put up an early draft here: http://neolography.com/staging/OACCtesting/test2.html

As you'll see, things are now working as expected, and by mainly trial and error, I'm beginning to get the hang of it, but I'm still puzzled by the discrepancy between the old and the new syntax (ie. `ex:src-content` -> `data-ex-src-content`). Can you direct me to anywhere in the documentation, or on the web where this change was discussed or explained?

Thanks for continuing to take an interest.

Jon
Reply all
Reply to author
Forward
0 new messages