Skip to content

Commit 4855f4b

Browse files
committed
modified: htdocs/fitswebql/fitswebqlse.js
1 parent d5f0e06 commit 4855f4b

File tree

1 file changed

+17
-42
lines changed

1 file changed

+17
-42
lines changed

htdocs/fitswebql/fitswebqlse.js

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function get_js_version() {
2-
return "JS2023-11-01.0";
2+
return "JS2023-11-01.2";
33
}
44

55
function uuidv4() {
@@ -1069,7 +1069,7 @@ function pv_axes(left, top, width, height, vmin, vmax, pmin, pmax, pmean, pstd,
10691069
console.log("P-V Line offset [arcsec] dmin:", -Math.abs(dmin), "dmax:", Math.abs(dmax));
10701070

10711071
var xR = d3.scaleLinear()
1072-
.range([2 * emFontSize, 2 * emFontSize + svg_width - 1])
1072+
.range([2 * emFontSize, 2 * emFontSize + svg_width])
10731073
.domain([-Math.abs(dmin), Math.abs(dmax)]);
10741074

10751075
pvxR = xR;
@@ -1109,7 +1109,7 @@ function pv_axes(left, top, width, height, vmin, vmax, pmin, pmax, pmean, pstd,
11091109
.call(xAxis);
11101110

11111111
var yR = d3.scaleLinear()
1112-
.range([emFontSize + svg_height - 1, emFontSize])
1112+
.range([emFontSize + svg_height, emFontSize])
11131113
.domain([vmin, vmax]);
11141114

11151115
pvyR = yR;
@@ -1749,7 +1749,7 @@ function crosshair_move(event) {
17491749
let x = offset[0];
17501750
let y = offset[1];
17511751

1752-
// make sure the line lies within the SVG
1752+
// make sure the line lies FIRMLY within the SVG
17531753
x = Math.min(Math.max(x, 1), _svg_width - 1);
17541754
y = Math.min(Math.max(y, 1), _svg_height - 1);
17551755

@@ -5744,11 +5744,11 @@ function display_gridlines() {
57445744
var y_offset = parseFloat(elem.attr("y"));
57455745

57465746
var x = d3.scaleLinear()
5747-
.range([x_offset, x_offset + width - 1])
5747+
.range([x_offset, x_offset + width])
57485748
.domain([0, 1]);
57495749

57505750
var y = d3.scaleLinear()
5751-
.range([y_offset + height - 1, y_offset])
5751+
.range([y_offset + height, y_offset])
57525752
.domain([0, 1]);
57535753

57545754
var svg = d3.select("#BackgroundSVG");
@@ -5958,11 +5958,11 @@ function display_cd_gridlines() {
59585958
var y_offset = parseFloat(elem.attr("y"));
59595959

59605960
var x = d3.scaleLinear()
5961-
.range([0, width - 1])
5961+
.range([0, width])
59625962
.domain([-1, 1]);
59635963

59645964
var y = d3.scaleLinear()
5965-
.range([height - 1, 0])
5965+
.range([height, 0])
59665966
.domain([-1, 1]);
59675967

59685968
var svg = d3.select("#BackgroundSVG");
@@ -13982,31 +13982,6 @@ async function fetch_image_spectrum(_datasetId, index, fetch_data, add_timestamp
1398213982
xmlhttp.send();
1398313983
}
1398413984

13985-
function fetch_contours(datasetId) {
13986-
var xmlhttp = new XMLHttpRequest();
13987-
13988-
var url = 'get_contours?datasetId=' + encodeURIComponent(datasetId) + '&' + encodeURIComponent(get_js_version());
13989-
13990-
xmlhttp.onreadystatechange = function () {
13991-
if (xmlhttp.readyState == 4 && xmlhttp.status == 502) {
13992-
console.log("Connection error, re-fetching contours after 1 second.");
13993-
setTimeout(function () {
13994-
fetch_contours(datasetId);
13995-
}, 1000);
13996-
}
13997-
13998-
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
13999-
var response = JSON.parse(xmlhttp.responseText);
14000-
14001-
console.log(response);
14002-
}
14003-
}
14004-
14005-
xmlhttp.open("GET", url, true);
14006-
xmlhttp.timeout = 0;
14007-
xmlhttp.send();
14008-
};
14009-
1401013985
function refresh_tiles(index) {
1401113986
if (zoom_scale < 1)
1401213987
return;
@@ -14999,16 +14974,16 @@ function pv_contour(left, top, width, height, pvCanvas, flipY, pv_width, pv_heig
1499914974
console.log("PVContourSVG width = ", width, " height = ", height);
1500014975

1500114976
var x = d3.scaleLinear()
15002-
.range([width - 1, 0]) // flip the x-axis
14977+
.range([width, 0]) // flip the x-axis
1500314978
.domain([0, data[0].length - 1]);
1500414979

1500514980
if (flipY) {
1500614981
var y = d3.scaleLinear()
15007-
.range([height - 1, 0])
14982+
.range([height, 0])
1500814983
.domain([0, data.length - 1]);
1500914984
} else {
1501014985
var y = d3.scaleLinear()
15011-
.range([0, height - 1])
14986+
.range([0, height])
1501214987
.domain([0, data.length - 1]);
1501314988
}
1501414989

@@ -15025,8 +15000,8 @@ function pv_contour(left, top, width, height, pvCanvas, flipY, pv_width, pv_heig
1502515000

1502615001
d3.select("#PVContourSVG").append("svg")
1502715002
.attr("id", "PVContourPlot")
15028-
.attr("x", elem.attr("x"))
15029-
.attr("y", elem.attr("y"))
15003+
.attr("x", parseFloat(elem.attr("x")))
15004+
.attr("y", parseFloat(elem.attr("y")))
1503015005
.attr("width", width)
1503115006
.attr("height", height)
1503215007
.selectAll("path")
@@ -18022,17 +17997,17 @@ function contour_surface_webworker() {
1802217997
var height = parseFloat(elem.attr("height"));
1802317998

1802417999
var x = d3.scaleLinear()
18025-
.range([0, width - 1])
18000+
.range([0, width])
1802618001
.domain([0, data[0].length - 1]);
1802718002

1802818003
var y = d3.scaleLinear()
18029-
.range([height - 1, 0])
18004+
.range([height, 0])
1803018005
.domain([0, data.length - 1]);
1803118006

1803218007
d3.select("#ContourSVG").append("svg")
1803318008
.attr("id", "contourPlot")
18034-
.attr("x", elem.attr("x"))
18035-
.attr("y", elem.attr("y"))
18009+
.attr("x", parseFloat(elem.attr("x")))
18010+
.attr("y", parseFloat(elem.attr("y")))
1803618011
.attr("width", width)
1803718012
.attr("height", height)
1803818013
.selectAll("path")

0 commit comments

Comments
 (0)