Playing with Words – Google Sheets to jQuery Drag/Drop

flickr photo shared by Internet Archive Book Images with no copyright restriction (Flickr Commons) This is a modification of the old refrigerator poetry concept based on a request from some of our World Languages professors but it’ll likely have some broader applicability. It essentially allows for three major things. You can create draggable elements (words, phrases, any HTML) from a Google spreadsheet You can create destination areas for those elements (also through the Google ss) You can make it so that elements that don’t match those destinations won’t “stick” there (spreadsheet again) It might be easier to see what’s up through the short video below. This was done mostly in jQuery but there are also a few Google Script elements that make life easier. The page below has everything except the CSS. It’s decently commented I think. The only real trouble I had was figuring out where/when to feed in the draggable/droppable elements. It kicked through after a bit of experimentation but I have a long way to go with javascript. Google Script There’s a directions sheet in the spreadsheet where I wrote a custom function. That allows me to write =getId() in the cell and have it generate the right URL for whatever spreadsheet it is in. You can also automatically copy my spreadsheet by going to the following […]

Fridge Poetry – Google Sheets as Database

Back in 2013 I built a refrigerator poetry page using javascript. I really wanted to make it so anyone could add any words they wanted in some easy way but didn’t have the skills to do that at the time. It’s been hanging out in the back of my mind since then and the bits and pieces I’ve learned since then now make it pretty straightforward. This url will prompt you to copy a Google Sheet. That’s a nice little trick- just append /copy to the public sheet where it normally says /edit?usp=sharing if you copy the typical sharing URL. Sadly, it only works for Sheets. Once we’ve published the sheet, we now have a JSON feed of the data and the little URL trick in the Google Sheets gives you the URL to the fridge poetry page with Sheet ID included as a parameter. (That’s the chunk after the question mark.) The PHP to make all the words into divs is below. I usually do something like feed->entry->$t to parse out the JSON but that didn’t work with the Google Sheet data.1 I still don’t quite get things well enough to know why but this alternate path works well. Part of the difference there is using the TRUE parameter on the json_decode. The other new element for me […]

Voyant (Green) – it’s a peephole!

h/t the wily Alan Levine Seeing Cindy’s post which put “As We May Think” in a tag cloud, I started wondering about other text visualization options and understandings they might drive. ManyEyes was long my default for this type of thing but the hassles with Java security have driven me away. So I decided to give Voyant a try. Will Berry1 had used it so well with students, it seemed worth a more in depth exploration. You can play with the text of “As We May Think” in Voyant here. As you can see you get the typical tag cloud. You do have the additional ability to hide words using pre-constructed common word lists or custom lists you build yourself. That can be awfully useful. You also have the ability to select certain words from the corpus2 and they will be charted in relative or raw distribution rates across the corpus. Incidents of “as”, “we”, and “may” are depicted below. You can also view occurrences of selected words contextually. Below are “record” and “thought” as I was curious how closely they would parallel one another. I think the contextual piece is nice, not quite as nice as the branch stuff ManyEyes does but nice and space appropriate. It’s interesting to see that in combination with when the words appeared. Bush […]