Skip to content

Commit 323a844

Browse files
committed
Drag Inspector graphs horizontally with mouse
1 parent a655acc commit 323a844

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/scripts/status.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,20 @@ function renderChart(options) {
770770
select("#" + nameBase + "svg_" + longName).remove();
771771
var jobElementGraphInspector = document.getElementById(svgParentName);
772772

773-
var svg = select(jobElementGraphInspector).append("svg");
773+
var start_x;
774+
var svgdrag = drag()
775+
.on("start", function () {
776+
start_x = event.x;
777+
})
778+
.on("drag", function () {
779+
document.getElementById(svgParentName).scrollBy((start_x - event.x), 0);
780+
start_x = event.x;
781+
});
782+
783+
var svg = select(jobElementGraphInspector)
784+
.append("svg")
785+
.call(svgdrag);
786+
774787

775788
var graphMargin;
776789
var graphHeight;

0 commit comments

Comments
 (0)