Published
Edited
May 16, 2021
1 star
Insert cell
Insert cell
explanation_msg = md`*The length of words in the text modulate to match the relative elevations in a kilometer around the chosen coordinates.*`
Insert cell
general_disc = md`Note: drawing maps often takes various kinds of time. There is not always a reliable way to distinguish whether the cartographer is delayed, or not returning at all.`
Insert cell
Insert cell
viewof location_select = Inputs.select(Object.keys(preset_locs), {
label: "Preset Locations",
sort: true,
value: "nowhere in particular"
})
Insert cell
Object.keys(preset_locs).map((k) => preset_locs[k])
Insert cell
Insert cell
Insert cell
{
const coords_map = new Map();
Object.keys(preset_locs).forEach((k) =>
coords_map.set(`${preset_locs[k]}`, k)
);
const curr_coords = [mylat, mylng];
return coords_map.get(`${[50, -100]}`);
}
Insert cell
search_select = {
const coords_map = new Map();
Object.keys(preset_locs).forEach((k) =>
coords_map.set(`${preset_locs[k]}`, k)
);
console.log(`${[mylat, mylng]}`);
if (!coords_map.has(`${[mylat, mylng]}`)) {
set_view(viewof location_select, "ELSEWHERE");
}
}
Insert cell
use_presets = {
if (location_select != "ELSEWHERE") {
set_view(viewof mylat, preset_locs[location_select][0]);
set_view(viewof mylng, preset_locs[location_select][1]);
return location_select;
} else {
return "ELSEWHERE";
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
reading_notes = md`## Public Notes - Reading in Place

I do intend this piece as a reflection on the variability of reading reception, but I more intend it as about the physically located situation of readers and writers. The physical location and orientation of the writer (in some canons from Virginia Woolf’s *A Room of One's Own*; Sara Ahmed’s *Queer Phenomenology: Orientations, Objects, Others* to situationists, land artists, ecopoets). The physical location of the reader. Where do you sit to read? Do you sit in the same place, indoors or outdoors, when reading, when reading poetry vs. reading student papers vs. reading mystery novels? Do you go to read in crowded places like coffee shops or bars? Do you read while walking, on the bus, on the subway? Whose land do you read on? Who previously read and wrote (beyond print) the contours of the land? What architectures and earthworks? The located nature of reading, like other acts & experiences. Subtler senses that we know our bodies track: barometric pressure, the direction of gravity and other Newtonian force, humidity, even the small tingling extensions of our surface provided by body hair. The sensations of being in land, in place, in geography are not just visual and auditory. Texts as *escape to other worlds and safe disembodiment*. Texts as *returning to awareness of the phenomenological space around you.*`
Insert cell
Insert cell
mutable geolocation_status = "initial"
Insert cell
async function geolocate_me() {
mutable geolocation_status = "getting";
const coords = new Promise((resolve, reject) => {
if (navigator.geolocation)
navigator.geolocation.getCurrentPosition(
(pos) => resolve(pos.coords),
(err) => reject(Error(err.message))
);
else reject(Error("this browser does not support geolocation."));
});
coords.then(
(v) => {
console.log(v);
if (v.latitude > -56 && v.latitude < 60) {
set_view(viewof mylat, v.latitude);
set_view(viewof mylng, v.longitude);
mutable geolocation_status = "returned";
} else {
mutable geolocation_status = md`coord_error`;
}
},
(v) => {
mutable geolocation_status = md`failed`;
}
);
}
Insert cell
get_geo_message = status => {
switch (status) {
case "initial":
return md`This internet client’s whereabouts remain unknown`;
case "getting":
return md`We are in the process of asking where you are.`;
case "returned":
return md`The device, given permission, reveals to us the user’s coordinates, which have been updated accordingly.`;
case "coord_error":
return md`You live too far South or North to watch. The Satelite didn't look there.`;
case "failed":
return md`The client’s device’s location is unknown, not permitted, or not revealed to us.`;
}
}
Insert cell
md`### Process Base Text

Populate base text and variations of words for each length.`
Insert cell
lexicon = ({
aaa: ["a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", "aaaaaaaa"],
air: ["🌬️", "ay", "air", "wind", "gusts", "breeze", "breezes", "fast-air"],
are: ["a", "be", "are", "were", "maybe", "aren’t", "are-all", "were-all"],
and: ["&", "or", "and", "also", "when", "before", "whereas", "moreover"],
ant: ["a", "aa", "ant", "pest", "creep", "insect", "critter", "huge-ant"],
can: ["a", "aa", "can", "must", "might", "mayn’t", "can-not", "couldn’t"],
din: ["🥁", "oh", "din", "yowl", "shout", "scream", "clangor", "shouting"],
eat: ["a", "aa", "eat", "chew", "munch", "ingest", "swallow", "snack-on"],
gap: ["⛺", "in", "gap", "pane", "glass", "window", "opening", "wall-gap"],
old: ["a", "aa", "old", "past", "stale", "fed-up", "haggard", "stagnant"],
new: ["a", "aa", "new", "late", "fresh", "recent", "current", "youthful"],
out: ["➡️", "at", "out", "thru", "after", "across", "outside", "out-past"],
red: ["🟥", "yt", "red", "blue", "black", "yellow", "purpled", "overcast"],
see: ["a", "aa", "see", "spot", "watch", "regard", "witness", "examine"],
sky: ["⛅", "up", "sky", "skies", "night", "clouds", "heavens", "airspace"],
the: ["a", "a(n)", "the", "this", "their", "enough", "another", "a-lot-of"],
was: ["=", "is", "was", "seem", "isn’t", "became", "will-be", "was-now"],
you: ["a", "aa", "you", "they", "y’all", "theirs", "you-too", "yourself"]
})
Insert cell
paragraph = "the sky was red and the air was the din out the gap the air see new old air and you eat air and you can see sky you are old old air and you eat din see the red and the new ant was the din the air"
Insert cell
text_to_para_array = (para) => para.split(" ");
Insert cell
inflect_with_lex = (lex) => (w, n) => ((w in lex) ? ((n in lex[w]) ? lex[w][n] : "INDEX_ERROR" ) : "KEY_ERROR")
Insert cell
inflect_word = inflect_with_lex(lexicon);
Insert cell
Insert cell
inflect_par = (par, vals) => par.map(((v, i) => inflect_word(v, vals[i])));
Insert cell
md`### Get Elevation Values

Given a longitude and latitude, calculate a matrix of relative elevations, to determine which elevation to use.
Uses the [Open Elevation API](https://open-elevation.com/).
`
Insert cell
function coord_grid (lat, long, num_rows = 7, num_cols = 7, inc = 0.05) {
let grid_arr = new Array();
for (let i = num_rows; i > 0; i--){
for (let j = 0; j < num_cols; j++){
grid_arr.push([lat + (i - Math.floor(num_cols / 2))*inc, long + (j - Math.floor(num_rows / 2)) * inc]);
}
}
return grid_arr;
}
Insert cell
async function get_elevations(
coords_arr,
api_url = "https://api.open-elevation.com/api/v1/lookup"
) {
const locations_str = coords_arr.map((p) => p[0] + "," + p[1]).join("|");
const query_url = api_url + "?locations=" + locations_str;
// return query_url;
const response = await fetch(query_url, { method: "GET" });
return response.json();

// const coords_json = {
// locations: coords_arr.map((p) => ({ latitude: p[0], longitude: p[1] }))
//};

// const reqHeaders = new Headers({
// Accept: "application/json",
// "Content-Type": "application/json"
//});

// const request_params = {
// method: "POST",
// headers: reqHeaders,
// mode: "cors",
// referrerPolicy: "origin",
// body: JSON.stringify(coords_json)
// };
//
// fetch(query_url, { method: "GET" }).then(
// (response) => {
// console.log(response);
// return response.json();
// },
// (error) => {
// console.log(error);
// return "error";
// }
// );
}
Insert cell
function process_api_results(elevations_json, l = 3, h = 8) {
let elevations = elevations_json.results.map((p) => p.elevation);
let min_el = 9999;
let max_el = -9999;
elevations.forEach(function (e) {
if (e < min_el) {
min_el = e;
}
if (e > max_el) {
max_el = e;
}
});
const diff = max_el - min_el;
return elevations.map((el) =>
diff > 0 ? Math.round(((el - min_el) / diff) * (h - l) + l - 1) : 2
);
}
Insert cell
mutable relative_elevations = Array(49).fill(2)
Insert cell
geo_coords = coord_grid(mylat, mylng)
Insert cell
response = get_elevations(geo_coords)
Insert cell
update_elevs = {
const response = await get_elevations(geo_coords);
console.log(typeof response);
console.log(response);
if (typeof response == "object") {
yield (mutable relative_elevations = process_api_results(response));
}
}
Insert cell
md`### Display Modulated Text

Render text, and allow reader to change location.`
Insert cell
import {Input, Range, bind, html} from "@observablehq/inputs"
Insert cell
preset_locs = ({
"68 1/2 Brown St., Providence, RI, USA": [41.82, -71.4],
"round numbers": [32, -100],
"school in Sompalle, Chittoor District, AP, India": [13.83, 78.29],
"the vatican in vatican city, vatican city": [41.9, 12.45],
"hills in Gilroy, CA, USA": [37, -121.6],
"mel lastman square in North York, ON, Canada": [43.77, -79.41],
"a library in Dharamshala, HP, India": [32.23, 76.33],
"badwater basin in Death Valley, CA, USA": [36.23, -116.77],
"near Juukan Gorge sacred sites in Hammersley Range, WA, Australia": [
-21.9,
116.79
],
"poetry center in Tucson, AZ, USA": [32.24, -110.95],
"nowhere in particular": [40.4, -79.6],
ELSEWHERE: [0, 0]
})
Insert cell
function set_view(input, value) {
input.value = value;
input.dispatchEvent(new Event("input"));
}
Insert cell
function para_table(para, row_len) {
const text_map = document.createElement("table");
text_map.classList.add("text-table")
let col_i = 0;
let curr_row = text_map.appendChild(document.createElement("tr"));
curr_row.classList.add("text-row")

para.forEach((elt) => {
if (col_i >= row_len) {
curr_row = text_map.appendChild(document.createElement("tr"));
curr_row.classList.add("text-row")
col_i = 0;
}
const new_elt = curr_row.appendChild(document.createElement("td"));
new_elt.appendChild(document.createTextNode(elt));
new_elt.classList.add("text-cell")
col_i++;
});
return text_map;
}
Insert cell
md`# A Composition Book - don’t look here (unless invited)!

reading further is eavesdropping: it obligates the reader to pretend not to have viewed its contents, or, to launder your acquisition of relevant information if you refer to it, like prosecution with the results of illegal wiretapping apparently does (it’s actually probably not that interesting, just scratch code)`
Insert cell
md`## Map text?

"In Place" the schtick is that the map data is rendered in characters or words. Of the reader's location? Of what the IP suggests the location is? Of what location the reader declares? Everest Pipkin's OCR cloud reader. How to make the text readable / interesting? is the map a street map or topographical? Is it a text or a filter? A filter sounds better. So we have a base text? A syntactic template? A generative pattern? And then map data somehow filters the text? Or the text somehow filters the map?`
Insert cell
md`## Concept 1

- Geographic data is a transformation on a text
- An 11x11 = 121 word paragraph. Each word has versions of different lengths.
- Words correspond to a 1km(?) square map, ideally centered on the reader.
- Depending on the elevation(?) a word of the corresponding length is chosen.
- The base text is written in three-letter words, the words correspond to ranges 1-5.
- Given the reader's longitude & latitude, an elevation grid is fetched from an API.`
Insert cell
md`### Lexicon - Working Principles
- The lists are of inflections and variations, mostly but not necessarily synonyms.
- I want the text to feel flat on its own: the shortenint/lengthening variations add tense and semantic complexity.
- The base text is a template, not the archetype (the variation is the essence of the style/semantics).
- Aiming for legible but a little off. ~85% syntactically normative, 15% head-scratching.
- Emojis acceptable but only for length 1
- Spelling is optional; i want to incorporate but not go full online-speak
`
Insert cell
md`### Drafting Text

the sky was red and the air
was the din out the gap the
air see new old air and you
eat air and you can see sky
you are old old air and you
eat din see the red and the
new ant was the din the air
`
Insert cell
rand_in_range = function (minimum, maximum) {return Math.floor(Math.random() * (maximum - minimum)) + minimum};
Insert cell
md`### Fetching and Processing Elevation Data

Goal: Create an NxM (N=M=7) matrix of relevative elevation values from (h <= v <= k, h=3, k=10?).

Keep preprocessing as API and format agnostic as possible. Don't assume constants. Best source currently seems to be a public server for Open Elevation (OpenStreetMap affiliated) [https://open-elevation.com/](https://open-elevation.com/)

`
Insert cell
coord_grid(mylat, mylng)
Insert cell
my_els = [3,3,4,5,4,4,7,3,3,5,5,5,5,7,3,4,4,5,5,7,6,5,5,4,5,2,5,7,5,6,4,3,5,5,5,5,5,5,5,4,5,5,6,6,4,5,3,4,3];
Insert cell
{
let a = new Array();
for (var i=0; i<5; i++) {
a.push([1,1 + i]);
}
return a;
}
Insert cell
mutable a = 0
Insert cell
yield mutable a++;
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more