Skip to content

Commit acc53f7

Browse files
committed
[fix] Qa
1 parent 351fae6 commit acc53f7

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ NetJSON format used internally is based on [networkgraph](http://netjson.org/rfc
335335

336336
You can customize the style of GeoJSON features using `style` property. The list of all available properties can be found in the [Leaflet documentation](https://leafletjs.com/reference.html#geojson).
337337

338+
<!-- Todo: Update this -->
338339
- `hashParams`
339340

340341
Configuration for adding hash parameters to the URL when a node is clicked.
@@ -350,7 +351,7 @@ NetJSON format used internally is based on [networkgraph](http://netjson.org/rfc
350351
1. type – A prefix used to uniquely identify the map node.
351352
2. nodeId – The ID of the selected node.
352353
3. zoom – The current zoom level of the map.
353-
**Note: Zoom is only applied when type is set to `geoMap`**
354+
**Note: Zoom is only applied when type is set to `geoMap`**
354355

355356
- `onInit`
356357

src/js/netjsongraph.core.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ class NetJSONGraph {
136136

137137
if (resParam.length) {
138138
const renderArray = function _renderArray() {
139-
resParam.map((file) =>
140-
this.utils.JSONDataUpdate.call(this, file, false),
141-
);
139+
resParam.map((file) => this.utils.JSONDataUpdate.call(this, file, false));
142140
};
143141
this.JSONParam = [JSONParam];
144142
this.event.once("renderArray", renderArray.bind(this));

src/js/netjsongraph.render.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,10 @@ class NetJSONGraphRender {
425425
if (self.utils && typeof self.utils.enableBoundsUrlSync === "function") {
426426
const debounceMs = 300;
427427
const precision = 6;
428-
self._destroyUrlSync = self.utils.enableBoundsUrlSync(self, { debounceMs, precision });
428+
self._destroyUrlSync = self.utils.enableBoundsUrlSync(self, {
429+
debounceMs,
430+
precision,
431+
});
429432
}
430433
} catch (e) {
431434
console.warn("bbox URL restore/sync failed", e);

src/js/netjsongraph.util.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,10 +1183,10 @@ class NetJSONGraphUtil {
11831183
parseUrlFragments() {
11841184
const raw = window.location.hash.replace(/^#/, "");
11851185
const fragments = {};
1186-
raw.split(";").forEach(fragmentStr => {
1186+
raw.split(";").forEach((fragmentStr) => {
11871187
const params = new URLSearchParams(fragmentStr);
11881188
const id = params.get("id");
1189-
if (id!=null) {
1189+
if (id != null) {
11901190
fragments[id] = params;
11911191
}
11921192
});
@@ -1195,8 +1195,8 @@ class NetJSONGraphUtil {
11951195

11961196
setUrlFragments(self, params) {
11971197
if (!self.config.urlFragments.show) return;
1198-
const fragments = this.parseUrlFragments()
1199-
const id = self.config.urlFragments.id
1198+
const fragments = this.parseUrlFragments();
1199+
const id = self.config.urlFragments.id;
12001200
let nodeId, zoom;
12011201
if (params.componentSubType === "graph") {
12021202
nodeId = params.data.id;
@@ -1214,7 +1214,7 @@ class NetJSONGraphUtil {
12141214
fragments[id].set("zoom", zoom);
12151215
}
12161216
const newHash = Object.values(fragments)
1217-
.map(urlParams => urlParams.toString())
1217+
.map((urlParams) => urlParams.toString())
12181218
.join(";");
12191219

12201220
window.location.hash = newHash;
@@ -1229,15 +1229,15 @@ class NetJSONGraphUtil {
12291229
delete fragments[id];
12301230
}
12311231
const newHash = Object.values(fragments)
1232-
.map(urlParams => urlParams.toString())
1232+
.map((urlParams) => urlParams.toString())
12331233
.join(";");
12341234

12351235
window.location.hash = newHash;
12361236
}
12371237

12381238
setSelectedNodeFromUrlFragments(self, fragments, node) {
12391239
if (!self.config.urlFragments.show || !Object.keys(fragments).length) return;
1240-
const id = self.config.urlFragments.id
1240+
const id = self.config.urlFragments.id;
12411241
const nodeId = fragments[id]?.get("nodeId");
12421242
const zoom = fragments[id]?.get("zoom");
12431243
if (nodeId === node.id) {
@@ -1250,7 +1250,8 @@ class NetJSONGraphUtil {
12501250
if (!self.config.urlFragments.show) return;
12511251
const node = self.selectedNode;
12521252
if (!node) return;
1253-
const nodeType = self.config.graphConfig.series.type || self.config.mapOptions.nodeConfig.type;
1253+
const nodeType =
1254+
self.config.graphConfig.series.type || self.config.mapOptions.nodeConfig.type;
12541255
const {location, zoom} = node;
12551256
if (["scatter", "effectScatter"].includes(nodeType) && zoom != null) {
12561257
self.leaflet.setView([location.lat, location.lng], zoom);

0 commit comments

Comments
 (0)