Move brush to top of parallel coordinates plot
@@ -18,7 +18,7 @@ function parcoor(
reactEl,
brushCallback,
mouseOverCallback,
- mouseOutCallback,
+ mouseOutCallback
) {
let isBrushing = false;
let computedWidth = 1070;
@@ -58,7 +58,7 @@ function parcoor(
(y[d] = d3
.scaleLinear()
.domain(d3.extent(data, p => +parseFloat(p[d])))
- .range([height, 0])),
+ .range([height, 0]))
);
x.domain(dimensions);
@@ -84,6 +84,8 @@ function parcoor(
.append('path')
.attr('d', path);
+ addHover();
+
// Add a group element for each dimension.
const g = svg
.selectAll('.dimension')
@@ -118,7 +120,7 @@ function parcoor(
.duration(0)
.attr('visibility', null);
addHover();
- }),
+ })
);
// Add an axis and title.
g
@@ -153,7 +155,7 @@ function parcoor(
}
let [high, low] = selection.map(y[d].invert);
brushend(axis, low, high);
- })),
+ }))
);
let select = reactEl.props.select[d];
if (select && select.low && select.high) {
@@ -182,7 +184,6 @@ function parcoor(
.on('mouseover', (row, index) => mouseOverCallback(row, index))
.on('mouseout', (row, index) => mouseOutCallback());
}
- addHover();
function position(d) {
const v = dragging[d];
@@ -209,7 +210,7 @@ function parcoor(
if (d3.event.selection) {
extents[i] = d3.event.selection.map(
y[dimensions[i]].invert,
- y[dimensions[i]],
+ y[dimensions[i]]
);
}
}
@@ -225,7 +226,7 @@ function parcoor(
return extents[i][1] <= d[p] && d[p] <= extents[i][0];
})
? null
- : 'none',
+ : 'none'
);
}
@@ -339,7 +340,7 @@ class PlotParCoor extends React.Component {
this,
(axis, low, high) => this.props.onBrushEvent(axis, low, high),
(row, index) => this.props.onMouseOverEvent(data[index].name),
- () => this.props.onMouseOutEvent(),
+ () => this.props.onMouseOutEvent()
);
}}
/>
@@ -372,7 +373,7 @@ class ParCoordPanel extends React.Component {
for (var dim of dimensions) {
this.select[dim] = Selection.bounds(
nextProps.selections,
- Run.keyFromString(dim),
+ Run.keyFromString(dim)
);
}
}
@@ -464,13 +465,13 @@ class ParCoordPanel extends React.Component {
selections,
Run.keyFromString(axis),
'>=',
- low,
+ low
);
selections = Selection.Update.addBound(
selections,
Run.keyFromString(axis),
'<=',
- high,
+ high
);
this.props.setFilters('select', selections);
}}
@@ -511,7 +512,7 @@ const mapDispatchToProps = (dispatch, ownProps) => {
};
const ConnectParCoordPanel = connect(mapStateToProps, mapDispatchToProps)(
- ParCoordPanel,
+ ParCoordPanel
);
ConnectParCoordPanel.type = ParCoordPanel.type;
ConnectParCoordPanel.options = ParCoordPanel.options;
