[TASK] Add zoom modifier for forcegraph
This commit is contained in:
parent
5702b5f21b
commit
201c74d29b
@ -155,7 +155,8 @@ module.exports = function () {
|
||||
'highlightColor': 'rgba(255, 255, 255, 0.2)',
|
||||
'labelColor': '#fff',
|
||||
'tqFrom': '#770038',
|
||||
'tqTo': '#dc0067'
|
||||
'tqTo': '#dc0067',
|
||||
'zoomModifier': 1
|
||||
},
|
||||
'locate': {
|
||||
'outerCircle': {
|
||||
|
@ -236,7 +236,7 @@ define(['d3-selection', 'd3-force', 'd3-zoom', 'd3-drag', 'd3-timer', 'd3-ease',
|
||||
self.resetView = function resetView() {
|
||||
moveTo(function calcToReset() {
|
||||
draw.setHighlight(null);
|
||||
return [0, 0, (ZOOM_MIN + 1) / 2];
|
||||
return [0, 0, (ZOOM_MIN + config.forceGraph.zoomModifier) / 2];
|
||||
}, true);
|
||||
};
|
||||
|
||||
@ -247,7 +247,7 @@ define(['d3-selection', 'd3-force', 'd3-zoom', 'd3-drag', 'd3-timer', 'd3-ease',
|
||||
if (n) {
|
||||
return [n.x, n.y, (ZOOM_MAX + 1) / 2];
|
||||
}
|
||||
return [0, 0, (ZOOM_MIN + 1) / 2];
|
||||
return resetView();
|
||||
});
|
||||
};
|
||||
|
||||
@ -260,7 +260,7 @@ define(['d3-selection', 'd3-force', 'd3-zoom', 'd3-drag', 'd3-timer', 'd3-ease',
|
||||
if (l) {
|
||||
return [(l.source.x + l.target.x) / 2, (l.source.y + l.target.y) / 2, (ZOOM_MAX / 2) + ZOOM_MIN];
|
||||
}
|
||||
return [0, 0, (ZOOM_MIN + 1) / 2];
|
||||
return resetView();
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user