How to use the d3-selection.event.y 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 vmware / hillview / web / src / main / webapp / ui / dialog.ts View on Github external
public dragStart(): void {
        this.dragging = true;
        this.dragMousePosition = { x: d3event.x, y: d3event.y };
        this.dialogPosition = this.topLevel.getBoundingClientRect();
        this.topLevel.style.transform = "";
        this.topLevel.style.cursor = "move";
        this.dragMove();  // put it in the right place; changing the transform may move it.
    }
github magda-io / magda / magda-web-client / src / Components / SearchFacets / DragBar.js View on Github external
function drag(d, i){
        let y = null;
        let data = that.props.dragBarData;
        if(i === 0){
          if (d3Event.y >=0 && d3Event.y< data[1]){
            y = d3Event.y;
          } else if(d3Event.y >= data[1]){
            y = data[1] - 1;
          } else {
            y = 0;
          }
        } else{
          if (d3Event.y >data[0] && d3Event.y <= that.props.height - 2*r){
            y = d3Event.y;
          } else if(d3Event.y <= data[0]){
            y = data[0] -1;
          } else {
            y = that.props.height - 2*r;
          }
        }
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()
    }
github zhenyanghua / MeasureTool-GoogleMaps-V3 / src / index.js View on Github external
.on('drag', (d, i) => {
        this._dragging = true;
        if (!isDragged) {
          isDragged = true;
          this._geometry.insertNode(
            i + 1,
            this._projectionUtility.svgPointToLatLng([event.x, event.y]));
          this._updateLine();
          if (this._options.showSegmentLength) {
            this._updateSegmentText();
          }
          if (this._options.showAccumulativeLength) {
            this._updateNodeText();
          }
        }
        this._updateHoverCirclePosition(event.x, event.y);
        this._updateLinePosition(this._linesBase, i + 1);
        this._updateLinePosition(this._linesAux, i + 1);
        if (this._options.showSegmentLength) {
          this._updateSegmentTextPosition(i + 1);
        }
        if (this._options.showAccumulativeLength) {
          this._updateNodeTextPosition(i + 1);
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 khartec / waltz / waltz-ng / client / logical-flow / components / boingy-graph / boingy-graph.js View on Github external
function dragEnded(d) {
        if (!event.active) {
            simulation
                .restart();
        }
        d.fx = event.x;
        d.fy = event.y;
    }
github smpio / kubernator / src / containers / Rbac / Graph / index.js View on Github external
.on('drag', node => {
        node.fx = d3event.x;
        node.fy = d3event.y;
      })
      .on('end', node => {
github yacan8 / d3-react-force / src / D3ReactForce / simulation.js View on Github external
.on('drag', d => {
        if (event.isDrag && event.isDrag(d) || !event.isDrag) {
          d.fx = d.x = d3_event.x;
          d.fy = d.y = d3_event.y;
          event.drag && event.drag(d);
        }
      })
      .on('end', d => {