alignment.js
Version:
A suite of reusable [React](http://reactjs.org/) components for creating a variety of visualizations involving [multiple sequence alignments](https://en.wikipedia.org/wiki/Multiple_sequence_alignment). [View the live demo here](http://alignment.hyphy.org/
38 lines (33 loc) • 1.05 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.horizontal_scroll = horizontal_scroll;
exports.vertical_scroll = vertical_scroll;
exports.bidirectional_scroll = bidirectional_scroll;
exports.handle_wheel = handle_wheel;
function horizontal_scroll() {
var id = this.props.div_id,
node = document.getElementById(id);
node.addEventListener("alignmentjs_wheel_event", function (e) {
node.scrollTo(e.detail.x_pixel, 0);
});
}
function vertical_scroll() {
var id = this.props.div_id,
node = document.getElementById(id);
node.addEventListener("alignmentjs_wheel_event", function (e) {
node.scrollTo(0, e.detail.y_pixel);
});
}
function bidirectional_scroll() {
var id = this.props.div_id,
node = document.getElementById(id);
node.addEventListener("alignmentjs_wheel_event", function (e) {
node.scrollTo(e.detail.x_pixel, e.detail.y_pixel);
});
}
function handle_wheel(e) {
e.preventDefault();
this.props.scroll_broadcaster.handleWheel(e, this.props.sender);
}
;