From 99091b93c2bdbf84f9cbbf3a125b87779abda91a Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Mon, 10 Feb 2020 18:18:25 +0100 Subject: [PATCH 01/30] Remove max bounds --- geography/js/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/geography/js/index.js b/geography/js/index.js index fe21664..6365c32 100644 --- a/geography/js/index.js +++ b/geography/js/index.js @@ -24,8 +24,6 @@ function addMap() { // Set map options (bounds) var mapOptions = { "minZoom": 2, - "maxBounds": new L.latLngBounds(new L.latLng(-90, -180), new L.latLng(90, 180)), - "maxBoundsViscosity": 0.5, "attributionControl": true } From fa8339c8327d48166b3fce93a0acfb323ae3a03a Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Mon, 10 Feb 2020 18:22:40 +0100 Subject: [PATCH 02/30] Decrease map width by 20% --- css/style.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/css/style.css b/css/style.css index e6ea234..c275b5d 100644 --- a/css/style.css +++ b/css/style.css @@ -31,7 +31,10 @@ p { #wrapper { position: relative; + width: 80%; + margin: auto; } + .popover { min-width: 25%; } From 9afa9fd9cf500f716681a118378725553a120694 Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Mon, 10 Feb 2020 19:23:09 +0100 Subject: [PATCH 03/30] Add satellite imagery --- geography/index.html | 16 +++++++++++++--- geography/js/index.js | 27 ++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/geography/index.html b/geography/index.html index a035569..fd1face 100644 --- a/geography/index.html +++ b/geography/index.html @@ -192,14 +192,24 @@
-
-
+
+
+ +
+ + +
+ +

+
diff --git a/geography/js/index.js b/geography/js/index.js index 6365c32..090a0f4 100644 --- a/geography/js/index.js +++ b/geography/js/index.js @@ -18,7 +18,8 @@ function addMap() { */ const MAP_CONTAINER = "map"; - const TILE_LAYER = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"; + const TILE_LAYER_DEFAULT = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"; + const TILE_LAYER_ARCGIS = "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"; const VIEWPORT = new L.latLng(35, 0); // Set map options (bounds) @@ -29,7 +30,10 @@ function addMap() { // Create the map and tile layer map = L.map(MAP_CONTAINER, mapOptions).setView(VIEWPORT, 1); - L.tileLayer(TILE_LAYER).addTo(map); + + window.defaultLayer = L.tileLayer(TILE_LAYER_DEFAULT); + window.arcgisLayer = L.tileLayer(TILE_LAYER_ARCGIS); + toggleSatelliteLayer(); // Reload the map when the tab is focussed on $("#nav-apwp-tab").on("shown.bs.tab", map.invalidateSize.bind(map)); @@ -63,10 +67,10 @@ function createGridLayer(map) { */ return L.latlngGraticule({ - "opacity": 0.5, + "opacity": 1, "color": HIGHCHARTS_WHITE, - "fontColor": HIGHCHARTS_BLACK, - "font": "12px Helvetica", + "fontColor": HIGHCHARTS_WHITE, + "font": "12px Sans-Serif", "showLabel": true, "zoomInterval": [ {"start": 2, "end": 3, "interval": 30}, @@ -79,6 +83,18 @@ function createGridLayer(map) { } +function toggleSatelliteLayer() { + + if(document.getElementById("enable-satellite").checked) { + map.removeLayer(window.defaultLayer); + map.addLayer(window.arcgisLayer); + } else { + map.removeLayer(window.arcgisLayer); + map.addLayer(window.defaultLayer); + } + +} + function toggleGridLayer() { /* @@ -242,6 +258,7 @@ function registerEventHandlers() { document.getElementById("cutoff-selection").addEventListener("change", redrawCharts); document.addEventListener("keydown", keyboardHandler); document.getElementById("defaultCheck1").addEventListener("change", toggleGridLayer); + document.getElementById("enable-satellite").addEventListener("change", toggleSatelliteLayer); document.getElementById("calculate-reference").addEventListener("click", plotPredictedDirections); document.getElementById("defer-input").addEventListener("click", inputFileWrapper); From a960a73c4a0cb5257b261cfaf509f325767956bf Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Tue, 11 Feb 2020 10:37:04 +0100 Subject: [PATCH 04/30] Fix GPlates rotation file referencing plate ID 0 as int --- geography/js/gplates.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geography/js/gplates.js b/geography/js/gplates.js index c414255..c4daed5 100644 --- a/geography/js/gplates.js +++ b/geography/js/gplates.js @@ -99,12 +99,12 @@ function readGPlatesRotation(ID, age) { } // Continue when we are referencing the fixed plate ID - while(ID !== "000") { + while(parseInt(ID) !== 0) { var plateData = GPlatesData[ID]; // Search input for matching plateID & age - for(var i = 0; i < plateData.length; i++) { + for(var i = 1; i < plateData.length; i++) { if(plateData[i].age < age) { From 47492371a5b504d07de255beae9ae29bde5bab47 Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Tue, 11 Feb 2020 10:52:27 +0100 Subject: [PATCH 05/30] Update library layout --- library/index.html | 7 ++++--- library/js/index.js | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/library/index.html b/library/index.html index ce77efa..630fcdb 100644 --- a/library/index.html +++ b/library/index.html @@ -94,11 +94,12 @@
Paleomagnetism.org 2 - Data Library
Available Publications in Library
-
-
-
Map showing the geographical distribution of publications. Hover over publication marker to shows its geographical coverage.
+
+
+
+
diff --git a/library/js/index.js b/library/js/index.js index 5ae8ecf..c0aa2d7 100644 --- a/library/js/index.js +++ b/library/js/index.js @@ -39,9 +39,9 @@ function addCollectionsToTable(publications) { " " + x.author + "", " " + x.institution + "", " " + x.description + "", - " " + x.pid.slice(0, 16) + "…", + " " + x.pid.slice(0, 6) + "…", " " + ("" + x.doi + "" || "N/A") + "", - " " + new Date(x.created).toISOString().slice(0, 10) + "", + " " + new Date(x.created).toISOString().slice(0, 10) + "", "" ].join("\n"); }); @@ -54,7 +54,7 @@ function addCollectionsToTable(publications) { " Author", " Institution", " Description", - " Persistent Identifier", + " Identifier", " DOI", " Created", " ", From eb3a3492c4f6b5185b8318679260677250d2ea8d Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Fri, 14 Feb 2020 20:10:37 +0100 Subject: [PATCH 06/30] Add beta warning --- js/utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/utils.js b/js/utils.js index 7138a63..754a0e9 100644 --- a/js/utils.js +++ b/js/utils.js @@ -1277,9 +1277,15 @@ function addFooter() { * Adds footer to all HTML pages */ + var isBetaVersion = window.location.href.includes("beta"); + + if(isBetaVersion) { + document.getElementsByClassName("navbar-brand")[0].innerHTML += " BETA*"; + } + document.getElementById("footer-container").innerHTML = new Array( "
", - "Paleomagnetism.org © " + new Date().getFullYear() + ". All Rights Reserved.", + "Paleomagnetism.org" + (isBetaVersion ? " BETA" : "" ) + " © " + new Date().getFullYear() + ". All Rights Reserved.", "
Version v" + __VERSION__ + " (" + __DOI__ + ")
", "  Source Code", "  Licensed under MIT.", From 3d0f84c97f1023823d4324584fca2f8f6111ee65 Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Mon, 17 Feb 2020 12:44:33 +0100 Subject: [PATCH 07/30] Add DOI through statistics portal in mean tab --- js/utils.js | 1 + statistics/js/graphs.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/js/utils.js b/js/utils.js index 7138a63..b798617 100644 --- a/js/utils.js +++ b/js/utils.js @@ -221,6 +221,7 @@ function addSiteWindowWrapper() { "color": null, "type": "collection", "name": collectionName, + "doi": null, "components": components, "created": new Date().toISOString(), "index": collections.length diff --git a/statistics/js/graphs.js b/statistics/js/graphs.js index 8ad1bb5..6e26af2 100644 --- a/statistics/js/graphs.js +++ b/statistics/js/graphs.js @@ -1837,6 +1837,28 @@ function generateHemisphereTooltip() { } +function addCollectionMetadata(index) { + + let value = prompt("Enter a new DOI for this collection."); + + if(value === null) { + return; + } + + if(value === "") { + value = null; + } else if(!value.startsWith("10.")) { + return notify("danger", "The input " + value + " is not a valid DOI."); + } else { + notify("success", "The DOI " + value + " has succesfully been assigned."); + } + + collections[index].doi = value; + eqAreaProjectionMean(); + saveLocalStorage(); + +} + function eqAreaProjectionMean() { /* @@ -1897,6 +1919,12 @@ function eqAreaProjectionMean() { } }); + if(site.doi) { + var icon = ""; + } else { + var icon = ""; + } + statisticsRows.push([ "", " " + site.name + "", @@ -1916,6 +1944,7 @@ function eqAreaProjectionMean() { " " + statistics.butler.dDx.toFixed(PRECISION) + "", " " + statistics.butler.dIx.toFixed(PRECISION) + "", " " + statistics.dir.lambda.toFixed(PRECISION) + "", + " " + icon + "", "" ].join("\n")); @@ -1947,6 +1976,7 @@ function eqAreaProjectionMean() { " ΔDx", " ΔIx", " λ", + " DOI", " ", " ", " ", From d0ba56803145221fb2d53bd2ef3a53763ec232d8 Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Mon, 17 Feb 2020 12:46:31 +0100 Subject: [PATCH 08/30] Update PALPOLE description --- miscellaneous/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miscellaneous/index.html b/miscellaneous/index.html index da215ca..3cced7d 100644 --- a/miscellaneous/index.html +++ b/miscellaneous/index.html @@ -102,7 +102,7 @@
Param
Directions & Poles

-

This tool can be used to parametrically sample a Fisherian distribution of poles or directions and generate declination, inclination pairs.

+

This tool can be used to convert between magnetic directions and virtual geomagnetic poles at site locations following the GAD model.

From 9cb57a2c2f4cb1d5a4342bf19b561365152f7bb8 Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Mon, 17 Feb 2020 15:02:06 +0100 Subject: [PATCH 09/30] Increase interpretation chart size --- interpretation/index.html | 6 +++--- interpretation/js/graphs.js | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/interpretation/index.html b/interpretation/index.html index 6aede91..39a5d1d 100644 --- a/interpretation/index.html +++ b/interpretation/index.html @@ -190,7 +190,7 @@
Paleomagnetism.org 2 - Interpretation
-
+
@@ -215,10 +215,10 @@
Paleomagnetism.org 2 - Interpretation
-
+
-
+
diff --git a/interpretation/js/graphs.js b/interpretation/js/graphs.js index fe8d87c..d8ac86b 100644 --- a/interpretation/js/graphs.js +++ b/interpretation/js/graphs.js @@ -447,6 +447,7 @@ function plotZijderveldDiagram(hover) { "chart": { "animation": false, "id": "zijderveld-container", + "height": 500, "zoomType": "xy", "events": { "load": resetMarkerSize @@ -1099,6 +1100,7 @@ function eqAreaProjection(hover) { Highcharts.chart(CHART_CONTAINER, { "chart": { "polar": true, + "height": 500, "events": { "load": resetMarkerSize }, From 89757c5eef87d69fb71218cc60d3b231ba22d821 Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Mon, 17 Feb 2020 16:24:04 +0100 Subject: [PATCH 10/30] Use categories for intensity plot --- interpretation/js/graphs.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/interpretation/js/graphs.js b/interpretation/js/graphs.js index d8ac86b..793fd76 100644 --- a/interpretation/js/graphs.js +++ b/interpretation/js/graphs.js @@ -108,6 +108,7 @@ function plotIntensityDiagram(hover) { var specimen = getSelectedSpecimen(); var intensities = new Array(); + var categories = new Array(); var hoverIndex = null; specimen.steps.forEach(function(step, i) { @@ -122,11 +123,10 @@ function plotIntensityDiagram(hover) { hoverIndex = intensities.length; } - // Get the treatment step as a number - var treatmentStep = extractNumbers(step.step); + // Use categories to stop mixing AF / TH + categories.push(step.step) intensities.push({ - "x": treatmentStep, "y": new Coordinates(step.x, step.y, step.z).length, "stepIndex": i }); @@ -217,7 +217,7 @@ function plotIntensityDiagram(hover) { "zIndex": 0 }); - createIntensityDiagram(hover, plotSeries); + createIntensityDiagram(hover, plotSeries, categories); } @@ -834,7 +834,7 @@ function resetMarkerSize() { } -function createIntensityDiagram(hover, series) { +function createIntensityDiagram(hover, series, categories) { /* * Function createIntensityDiagram @@ -895,6 +895,7 @@ function createIntensityDiagram(hover, series) { "formatter": intensityTooltip }, "xAxis": { + "categories": categories, "title": { "text": "Demagnetization steps" } From 71d0228dc7c71f6c33e3f1df930434ce2d4e7ea7 Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Mon, 17 Feb 2020 17:09:52 +0100 Subject: [PATCH 11/30] Fix reading of files in reverse order --- interpretation/js/importing.js | 2 +- js/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interpretation/js/importing.js b/interpretation/js/importing.js index d443464..fabed2d 100644 --- a/interpretation/js/importing.js +++ b/interpretation/js/importing.js @@ -1320,7 +1320,7 @@ function importCaltech(file) { line = lines[i]; var stepType = line.slice(0, 2); - var step = line.slice(2, 6).trim() || "0"; + var step = line.slice(0, 6).trim() || "0"; var dec = Number(line.slice(46, 51)); var inc = Number(line.slice(52, 57)); diff --git a/js/utils.js b/js/utils.js index ad8f883..1481bd7 100644 --- a/js/utils.js +++ b/js/utils.js @@ -1199,7 +1199,7 @@ function readMultipleFiles(files, callback) { } // Next queued file: create a new filereader instance - file = files.pop(); + file = files.shift(); reader = new FileReader(); // XML should be readable as text From 7f210186d679f547584cbe0ead92bc0172de3db0 Mon Sep 17 00:00:00 2001 From: Jollyfant Date: Tue, 18 Feb 2020 10:06:01 +0100 Subject: [PATCH 12/30] Add feature to update metadata for collection --- geography/js/index.js | 1 - js/utils.js | 43 +++++++++++++++++++++ statistics/index.html | 83 +++++++++++++++++++++++++++++++++++++++++ statistics/js/graphs.js | 64 ++++++++++++++++++++++++++----- statistics/js/index.js | 1 + 5 files changed, 181 insertions(+), 11 deletions(-) diff --git a/geography/js/index.js b/geography/js/index.js index 090a0f4..cb7eaad 100644 --- a/geography/js/index.js +++ b/geography/js/index.js @@ -3,7 +3,6 @@ var GPlatesData = new Object(); var KMLLayers = new Array(); var APWPs, PLATE_NAMES; var mapMakers = new Array(); -var openedCollection; $(".selectpicker").selectpicker("show"); diff --git a/js/utils.js b/js/utils.js index 1481bd7..0c47365 100644 --- a/js/utils.js +++ b/js/utils.js @@ -42,6 +42,8 @@ if(document.getElementById("enable-sound")) { window.addEventListener("online", notify.bind(null, "success", "Your connection to the internet has been recovered.")); window.addEventListener("offline", notify.bind(null, "danger", "Your connection to the internet was dropped.")); +var openedCollection; + function padLeft(nr, n){ return Array(n - String(nr).length + 1).join("0") + nr; } @@ -1964,5 +1966,46 @@ function doiLookup(doi, callback) { } +function generateColorPalette() { + + /* + * Function generateColorPalette + * Generates the color palette for site color picking + */ + + function createColorItem(color) { + + /* + * Function generateColorPalette::createColorItem + * Generates a div for a particular color that can be clicked + */ + + return "
"; + + } + + // Choose from a nice saturated gradient + const COLOR_PALETTE = new Array( + // First row + "#F55", "#FA5", "#FF5", + "#AF5", "#5F5", "#5FA", + "#5FF", "#5AF", "#55F", + "#A5F", "#F5F", "#F5A", + // Second row + "#A00", "#A50", "#AA0", + "#5A0", "#0A0", "#0A5", + "#0AA", "#05A", "#00A", + "#50A", "#A0A", "#A05", + // Third row + "#FFF", "#DDD", "#AAA", + "#888", "#555", "#222", + "#000" + ); + + // Create color bar + return COLOR_PALETTE.map(createColorItem).join(""); + +} + // Add the footer to every page that includes the utils addFooter(); diff --git a/statistics/index.html b/statistics/index.html index fed8754..82b7e9e 100644 --- a/statistics/index.html +++ b/statistics/index.html @@ -511,6 +511,87 @@
+ + + +
+ +