From edce6c913f616629b537e2130ce45a2d7138d87a Mon Sep 17 00:00:00 2001 From: Wolf1610 Date: Thu, 16 Oct 2025 23:54:48 +0530 Subject: [PATCH 1/6] Fix: redundant node labels and overlays (#454) --- src/js/netjsongraph.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/netjsongraph.config.js b/src/js/netjsongraph.config.js index 3dd09558..5105809b 100644 --- a/src/js/netjsongraph.config.js +++ b/src/js/netjsongraph.config.js @@ -41,7 +41,7 @@ const NetJSONGraphDefaultConfig = { clusterRadius: 80, clusterSeparation: 20, showMetaOnNarrowScreens: false, - showLabelsAtZoomLevel: 13, + showLabelsAtZoomLevel: 100, showGraphLabelsAtZoom: null, crs: L.CRS.EPSG3857, echartsOption: { From 3097a22217fee690b1f8902f3392bce82e0dbd35 Mon Sep 17 00:00:00 2001 From: Wolf1610 Date: Sat, 25 Oct 2025 01:16:32 +0530 Subject: [PATCH 2/6] fix: add default map option (worldCopyJump: true) to LeafletCoordSys (#373) --- lib/js/echarts-leaflet/LeafletCoordSys.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/js/echarts-leaflet/LeafletCoordSys.js b/lib/js/echarts-leaflet/LeafletCoordSys.js index f4b11cac..0d7ebf9c 100644 --- a/lib/js/echarts-leaflet/LeafletCoordSys.js +++ b/lib/js/echarts-leaflet/LeafletCoordSys.js @@ -156,7 +156,15 @@ function createLeafletCoordSystem(echarts, L) { mapRoot.classList.add("ec-extension-leaflet"); root.appendChild(mapRoot); - leafletModel.__map = L.map(mapRoot, leafletModel.get("mapOptions")); + const userOptions = leafletModel.get("mapOptions") || {}; + const defaultOption = { + worldCopyJump: true, + }; + const mapOptions = Object.assign({}, defaultOption, userOptions); + + leafletModel.__map = L.map(mapRoot, mapOptions); + + // leafletModel.__map = L.map(mapRoot, leafletModel.get("mapOptions")); const map = leafletModel.__map; const tiles = leafletModel.get("tiles"); const baseLayers = {}; From 98a97e67e0af2d61c6f7fa8342f430902cfe1f1e Mon Sep 17 00:00:00 2001 From: Wolf1610 Date: Sat, 25 Oct 2025 01:16:32 +0530 Subject: [PATCH 3/6] fix: add default map option (worldCopyJump: true) to LeafletCoordSys (#373) --- src/js/netjsongraph.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/netjsongraph.config.js b/src/js/netjsongraph.config.js index 5105809b..3dd09558 100644 --- a/src/js/netjsongraph.config.js +++ b/src/js/netjsongraph.config.js @@ -41,7 +41,7 @@ const NetJSONGraphDefaultConfig = { clusterRadius: 80, clusterSeparation: 20, showMetaOnNarrowScreens: false, - showLabelsAtZoomLevel: 100, + showLabelsAtZoomLevel: 13, showGraphLabelsAtZoom: null, crs: L.CRS.EPSG3857, echartsOption: { From 33719faa92e3c678d7a0433df4a2b56b594819cb Mon Sep 17 00:00:00 2001 From: Wolf1610 Date: Sat, 25 Oct 2025 01:41:28 +0530 Subject: [PATCH 4/6] fix: add default map option (worldCopyJump: true) to LeafletCoordSys (#373) --- lib/js/echarts-leaflet/LeafletCoordSys.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/js/echarts-leaflet/LeafletCoordSys.js b/lib/js/echarts-leaflet/LeafletCoordSys.js index 0d7ebf9c..423f65ef 100644 --- a/lib/js/echarts-leaflet/LeafletCoordSys.js +++ b/lib/js/echarts-leaflet/LeafletCoordSys.js @@ -164,7 +164,6 @@ function createLeafletCoordSystem(echarts, L) { leafletModel.__map = L.map(mapRoot, mapOptions); - // leafletModel.__map = L.map(mapRoot, leafletModel.get("mapOptions")); const map = leafletModel.__map; const tiles = leafletModel.get("tiles"); const baseLayers = {}; From 704b273d84a4027417459344c72a72100bc17077 Mon Sep 17 00:00:00 2001 From: Wolf1610 Date: Sun, 26 Oct 2025 02:06:10 +0530 Subject: [PATCH 5/6] test: assert worldCopyJump is true by default in LeafletCoordSys --- lib/js/echarts-leaflet/LeafletCoordSys.js | 2 -- test/LeafletCoordSys.test.js | 44 +++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 test/LeafletCoordSys.test.js diff --git a/lib/js/echarts-leaflet/LeafletCoordSys.js b/lib/js/echarts-leaflet/LeafletCoordSys.js index 423f65ef..0e5ed80c 100644 --- a/lib/js/echarts-leaflet/LeafletCoordSys.js +++ b/lib/js/echarts-leaflet/LeafletCoordSys.js @@ -161,9 +161,7 @@ function createLeafletCoordSystem(echarts, L) { worldCopyJump: true, }; const mapOptions = Object.assign({}, defaultOption, userOptions); - leafletModel.__map = L.map(mapRoot, mapOptions); - const map = leafletModel.__map; const tiles = leafletModel.get("tiles"); const baseLayers = {}; diff --git a/test/LeafletCoordSys.test.js b/test/LeafletCoordSys.test.js new file mode 100644 index 00000000..5f06d93c --- /dev/null +++ b/test/LeafletCoordSys.test.js @@ -0,0 +1,44 @@ +import L from "leaflet"; +import createLeafletCoordSystem from "../lib/js/echarts-leaflet/LeafletCoordSys"; + +describe("LeafletCoordSys", () => { + it("should set worldCopyJump to true by default", () => { + const echartsMock = { + util: { + curry: (fn, method) => fn.bind(null, method), + }, + graphic: { + BoundingRect: class {}, + }, + matrix: { + create: () => [], + }, + }; + const LeafletCoordSys = createLeafletCoordSystem(echartsMock, L); + const mockModel = { + get: (key) => { + if (key === "mapOptions") return {}; // no user options + if (key === "tiles") return []; + if (key === "layerControl") return {}; + return undefined; + }, + __map: null, + }; + const api = { + getDom: () => document.createElement("div"), + getZr: () => ({ + painter: { + getViewportRoot: () => document.createElement("div"), + }, + }), + }; + const ecModel = { + eachComponent: (type, callback) => { + if (type === "leaflet") callback(mockModel); + }, + eachSeries: () => {}, + }; + LeafletCoordSys.create(ecModel, api); + expect(mockModel.__map.options.worldCopyJump).toBe(true); + }); +}); From 9fb38f13c8c795cf2951c67ccd5420fd09f86790 Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Fri, 7 Nov 2025 13:19:40 +0100 Subject: [PATCH 6/6] [chores] Renamed test file for consistency --- test/{LeafletCoordSys.test.js => leaflet.test.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/{LeafletCoordSys.test.js => leaflet.test.js} (100%) diff --git a/test/LeafletCoordSys.test.js b/test/leaflet.test.js similarity index 100% rename from test/LeafletCoordSys.test.js rename to test/leaflet.test.js