From 41ccb50e4b2952b7062e5e3885a51ead3b60487e Mon Sep 17 00:00:00 2001 From: Evolvedexperiment Date: Mon, 11 May 2020 14:12:47 +0000 Subject: [PATCH] Separated height gradient and biome/height data --- modules/ui/elevation-profile.js | 56 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/modules/ui/elevation-profile.js b/modules/ui/elevation-profile.js index daa9080e..5455ee91 100644 --- a/modules/ui/elevation-profile.js +++ b/modules/ui/elevation-profile.js @@ -33,7 +33,7 @@ function showElevationProfile(data, routeLen, isRiver) { $("#elevationProfile").dialog({ title: "Elevation profile", resizable: false, width: window.width, close: closeElevationProfile, - position: {my: "left top", at: "left+20 bottom-240", of: window, collision: "fit"} + position: {my: "left top", at: "left+20 bottom-340", of: window, collision: "fit"} }); // prevent river graphs from showing rivers as flowing uphill @@ -84,7 +84,7 @@ function showElevationProfile(data, routeLen, isRiver) { const xOffset = 100; const yOffset = 80; - const chart = d3.select("#elevationGraph").append("svg").attr("width", w+200).attr("height", h+yOffset).attr("id", "elevationGraph"); + const chart = d3.select("#elevationGraph").append("svg").attr("width", w+200).attr("height", h+yOffset+60).attr("id", "elevationGraph"); // arrow-head definition chart.append("defs").append("marker").attr("id", "arrowhead").attr("orient", "auto").attr("markerWidth", "2").attr("markerHeight", "4").attr("refX", "0.1").attr("refY", "2").append("path").attr("d", "M0,0 V4 L2,2 Z"); @@ -94,38 +94,42 @@ function showElevationProfile(data, routeLen, isRiver) { skydef.append("stop").attr("offset", "100%").attr("style", "stop-color:"+skyGradient(0.25)+";stop-opacity:1"); const sky = chart.append("g").append("rect").attr("y", yOffset).attr("x", xOffset).attr("width", w).attr("height", h).attr("fill", "url(#skydef)"); - // biome colors - for (var k=0; k