From d833e4db24f54d40e4b6f4dee529896bfbd0cca1 Mon Sep 17 00:00:00 2001 From: modelearth Date: Sun, 19 May 2024 22:36:33 -0400 Subject: [PATCH] Tree update --- view/index.html | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/view/index.html b/view/index.html index 2b55c84..d55863f 100644 --- a/view/index.html +++ b/view/index.html @@ -134,6 +134,7 @@ {"value":"bsky","name":"BlueSky Model.Earth RSS (CORS)"}, {"value":"film-scouting","name":"Film Scouting Locations"}, {"value":"flow","name":"USEEIO Impact Flow"}, + {"value":"Dmatrix","name":"USEEIO D Matrix Commodities"}, {"value":"civictechindex","name":"Civic Tech Organizations"}, {"value":"civictechlinks","name":"Civic Tech Links"}, {"value":"epd","name":"Environmental Product Declarations (EPD)"}, @@ -207,7 +208,7 @@ url = "https://bsky.app/profile/did:plc:ileopdnhib52emw3veem5zxk/rss"; //alert(url) selected_array = []; - $('#pageTitleText').html('Turn on CORS passthrough'); + $('#pageTitleText').html('Turn on CORS passthrough'); } else if (hash.feed == "usda") { // Nutrition label $('#pageTitle').html("Nutrition label"); url = "https://api.nal.usda.gov/fdc/v1/food/2015943?api_key=bLecediTVa2sWd8AegmUZ9o7DxYFSYoef9B4i1Ml"; @@ -245,6 +246,7 @@ } else if (hash.feed == "LandCoverFraction_Forest") { $('#pageTitle').html("US State Populations"); url = "https://api.datacommons.org/v2/observation?key=AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI&date=2015&date=LATEST&entity.expression=geoId%2F06%3C-containedInPlace%2B%7BtypeOf%3ACounty%7D&select=date&select=entity&select=value&select=variable&variable.dcids=LandCoverFraction_Forest"; + // = "response.byVariable.LandCoverFraction_Forest.byEntity"; } else if (hash.feed == "311") { $('#pageTitle').html("See Click Fix - v2"); url = `https://seeclickfix.com/api/v2/issues?lat=${latitude}&lng=${longitude}&zoom=8&per_page=10`; @@ -253,13 +255,16 @@ barName = "summary" } else if (hash.feed == "open311") { url = `https://seeclickfix.com/open311/v2/requests.json?lat=${latitude}&long=${longitude}`; - $('#pageTitleText').html('Turn on CORS passthrough'); + $('#pageTitleText').html('Turn on CORS passthrough'); } else if (hash.feed == "film-scouting") { $('#pageTitle').html("Film Scounting Locations"); url = "https://raw.githubusercontent.com/GeorgiaFilm/cameraready_locations_curl/main/cameraready.json"; } else if (hash.feed == "flow") { $('#pageTitleText').html("USEEEIO Flow GAEEIOv1.0-s-20"); url = "https://raw.githubusercontent.com/ModelEarth/OpenFootprint/main/impacts/2020/GAEEIOv1.0-s-20/flows.json"; + } else if (hash.feed == "Dmatrix") { + $('#pageTitleText').html("D Matrix"); + url = "https://raw.githubusercontent.com/ModelEarth/OpenFootprint/main/impacts/2020/GAEEIOv1.0-s-20/matrix/D.json"; } else if (hash.feed == "civictechindex") { $('#pageTitle').html("Civic Tech Organizations"); //url = "https://api-stage.civictechindex.org/swagger/?format=openapi" @@ -287,13 +292,20 @@ } } function displayJson(url){ + let hash = getHash(); d3.json(url).then(function(json) { var fullHtml = ''; + if (hash.feed == "LandCoverFraction_Forest") { // Limit to list of states + json = json.byVariable.LandCoverFraction_Forest.byEntity; + } + //fullHtml += formatRow(b,json[a][b],1); // Resides in localsite.js // Key, Value, Level, Params fullHtml += formatRow("",json,0); // Resides in localsite.js + $("#resultJson").html(JSON.stringify(json)); + $("#resultFull").show(); //resultFull.innerHTML = fullHtml; $("#resultFull").html(fullHtml); @@ -413,6 +425,8 @@

${capFirst(item.description)}

-->
+ TestMe +