How to use the d3-selection.event.x function in d3-selection

To help you get started, we’ve selected a few d3-selection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github khartec / waltz / waltz-ng / client / flow-diagram / components / diagram / flow-diagram.js View on Github external
function dragStarted(d) {
    dragStartPos = { x: event.x, y: event.y };
    return select(this)
        .raise()
        .classed("wfd-active", true);
}
github hpcc-systems / Visualization / packages / form / src / Slider.ts View on Github external
.on("end", () => {
                    this.moveHandleTo(d3Event.x);
                    this.data([[this.xScale.invert(this.handleLeftPos), this.xScale.invert(this.handleRightPos)]]);
                    this.checkChangedValue();
                }));
github openstreetmap / iD / modules / ui / raw_member_editor.js View on Github external
.on('start', function() {
                dragOrigin = {
                    x: d3_event.x,
                    y: d3_event.y
                };
                targetIndex = null;
            })
            .on('drag', function(d, index) {
github graphsense / graphsense-dashboard / src / nodeGraph / entityNode.js View on Github external
    let searchNeighborsDialog = isOutgoing => this.dispatcher('searchNeighborsDialog', {x: event.x - 120, y: event.y - 50, id: this.id, type: this.type, isOutgoing})
    items.push(
github openstreetmap / iD / modules / ui / tools / add_recent.js View on Github external
.on('start', function() {
                    dragOrigin = {
                        x: d3_event.x,
                        y: d3_event.y
                    };
                    targetIndex = null;
                    targetData = null;
                    dragMoved = false;
                })
                .on('drag', function(d, index) {
github hpcc-systems / Visualization / packages / layout / src / Grid.ts View on Github external
                    .style("transform", function () { return "translate(" + d3Event.x + "px, " + d3Event.y + "px)"; })
                    .style("width", function () { return d.w * context.cellWidth + "px"; })
github graphsense / graphsense-dashboard / src / nodeGraph / graphNode.js View on Github external
action: () => {
          this.dispatcher('noteDialog', {x: event.x - 50, y: event.y - 50, node: this})
        },
        position: 90
github openstreetmap / iD / modules / ui / tools / add_favorite.js View on Github external
.on('start', function() {
                    dragOrigin = {
                        x: d3_event.x,
                        y: d3_event.y
                    };
                    targetIndex = null;
                    dragMoved = false;
                })
                .on('drag', function(d, index) {
github susielu / d3-annotation / src / Subject / badge.js View on Github external
const dragBadge = () => {
      subjectData.x =
        event.x < -radius * 2
          ? "left"
          : event.x > radius * 2 ? "right" : undefined
      subjectData.y =
        event.y < -radius * 2
          ? "top"
          : event.y > radius * 2 ? "bottom" : undefined

      type.redrawSubject()
    }