8000 test adding an option to use country borderlines from a UN geojson dataset for geo subplots by archmoj · Pull Request #7327 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

test adding an option to use country borderlines from a UN geojson dataset for geo subplots #7327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
fix empty
  • Loading branch information
archmoj committed Dec 27, 2024
commit 03a6b84668fd9800de4b2e006762c4ce659b1574
14 changes: 9 additions & 5 deletions src/traces/scattergeo/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ function plot(gd, geo, calcData) {
var gTraces = Lib.makeTraceGroups(scatterLayer, calcData, 'trace scattergeo');

function removeBADNUM(d, node) {
if(d.lonlat[0] === BADNUM) {
if(
d.lonlat &&
d.lonlat[0] === BADNUM
) {
d3.select(node).remove();
}
}
Expand Down Expand Up @@ -98,12 +101,13 @@ function calcGeoJSON(calcTrace, fullLayout) {
lonArray = [bboxGeojson[0], bboxGeojson[2]];
latArray = [bboxGeojson[1], bboxGeojson[3]];
} else {
lonArray = new Array(len);
latArray = new Array(len);
lonArray = [];
latArray = [];
for(i = 0; i < len; i++) {
calcPt = calcTrace[i];
lonArray[i] = calcPt.lonlat[0];
latArray[i] = calcPt.lonlat[1];
if(!calcPt.lonlat) continue;
lonArray.push(calcPt.lonlat[0]);
latArray.push(calcPt.lonlat[1]);
}

opts.ppad = calcMarkerSize(trace, len);
Expand Down
0