Where’s MIT?
Use App Inventor 2 to search from the Big Bang to locate the Massachusetts Institute of Technology (MIT) within the Universe
June 2016
After Picking Laniakea Super Cluster
See the next version of this project, using procedures instead of globals
We start with a Web Viewer pointing to a web page on The Big Bang, and a List Picker set to show the super clusters that resulted from The Big Bang .
This List Picker is loaded with the names of the major sub components of the item that was last picked, followed by the trail of prior items, to let the user go back from a poor choice.
Here we have picked the Laniakea Super Cluster, and the Web Viewer and List Picker are reloaded to show our selection and its possible children.
There are only three components:
At startup time, we start loading our csv formatted navigation map file from the Media Drawer.
Spreadsheet programs make it easy to edit a navigational map file and export it in Comma Separated Value (CSV) format. This map is set up with parent name in column 1, child name in column 2, and child URL in column 3.
Column 2 is our unique key to this table.
The first row is special in that I have coded the parent and child names on column 1 and 2 of row 1 so that the root of this tree is its own child, and also its own parent.
It’s like the Home Page of The Universe.
When the csv text map arrives, we save it into a global text variable, in case we need to diagnose it later. Then we send it through a list from csv table block to convert it into a table (list of lists).
The first column of the first row is reserved for the starting point of our tour, the root.
We visit the root.
The stack global will hold a list of all the names of places we have visited, starting at the root, newest at the front (position 1).
Given the name of the item in our map we want to visit, we first extract the children of that key from our map. We push our key onto our stack at slot 1, look up its URL in our map, and have the Web Viewer show it. We then show our current key in the List Picker, as well as all its children in the stack and the List Picker Elements.
This is a value procedure, returning a simple list of the text values in column 2 of our map where column 1 matches our key.
The URL of a key is the third column of the row in our map that belongs to that key.
The row value procedure returns a simple 3 element list containing a copy of the row in the map that matches the given key in column 2.
After the user selects a destination name from the List Picker, we visit that selection.
ai2.appinventor.mit.edu/?galleryId=6367403443486720
https://drive.google.com/drive/folders/1RXAJlODImVYw9imsEQmu9N2gNPPimcr4?usp=sharing
https://docs.google.com/document/d/1acg2M5KdunKjJgM3Rxpy_Rf6vT6OozxdIWglgbmzroA/edit?usp=sharing