How to use the d3-selection.event.stopPropagation 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 vasturiano / timelines-chart / src / timelines.js View on Github external
state.yScale.domain().indexOf(state.yScale.invert(d))
              + ((state.zoomY && state.zoomY[0])?state.zoomY[0]:0)
            );

            const changeX=((newDomainX[1] - newDomainX[0])>(60*1000)); // Zoom damper
            const changeY=(newDomainY[0]!=state.zoomY[0] || newDomainY[1]!=state.zoomY[1]);

            if (changeX || changeY) {
              state.svg.dispatch('zoom', { detail: {
                zoomX: changeX?newDomainX:null,
                zoomY: changeY?newDomainY:null
              }});
            }
          }, true);

        d3Event.stopPropagation();
      });
github openstreetmap / iD / modules / ui / intro / welcome.js View on Github external
function keydown() {
        if (d3_event.keyCode === 93)  {   // context menu
            d3_event.preventDefault();
            d3_event.stopPropagation();
            down.menu = d3_event.timeStamp;
            tooltip.classed('rightclick', true);
        }
    }
github openstreetmap / iD / modules / ui / intro / navigation.js View on Github external
function eventCancel() {
        d3_event.stopPropagation();
        d3_event.preventDefault();
    }
github hpcc-systems / Visualization / packages / timeline / src / MiniGantt.ts View on Github external
.on("dblclick", () => {
                d3Event.stopPropagation();
                delete this.rootExtent;
                this.resetZoom();
            })
            ;
github hpcc-systems / Visualization / src / tree / CirclePacking.ts View on Github external
.on("dblclick", function (d) {
                if (this._focus !== d) {
                    context.zoom(d);
                }
                d3Event.stopPropagation();
            })
            ;
github openstreetmap / iD / modules / ui / tools / operation.js View on Github external
.on('click', function() {
                d3_event.stopPropagation();
                if (!operation || operation.disabled()) return;
                button.call(tooltipBehavior.hide);
                operation();
            })
            .call(svgIcon('#' + tool.iconName, tool.iconClass));
github openstreetmap / iD / modules / ui / fields / combo.js View on Github external
function removeMultikey(d) {
        d3_event.stopPropagation();
        var t = {};
        if (isMulti) {
            t[d.key] = undefined;
        } else if (isSemi) {
            _remove(multiData, function(md) { return md.key === d.key; });
            var arr = multiData.map(function(md) { return md.key; });
            arr = _compact(_uniq(arr));
            t[field.key] = arr.length ? arr.join(';') : undefined;
        }
        dispatch.call('change', this, t);
    }
github Caleydo / lineage / src / setSelector.ts View on Github external
.on('click', (d: any) => {

        event.stopPropagation();

        const container = document.getElementById('app');
        const coordinates = mouse(container);

        select('#nodeFilter').select('.dropdown-menu')
          .style('transform', 'translate(' + (coordinates[0] - 430) + 'px,35px)');

        select('#nodeFilter').select('.open').style('visibility', 'visible');

        let menuItems = select('#nodeFilter').select('.dropdown-menu').selectAll('.demoAttr')
          .data(this.labelProperties[d.name].sort((a, b) => a < b ? -1 : 1));

        const menuItemsEnter = menuItems.enter()
          .append('li')
          .append('a')
          .attr('class', 'dropdown-item demoAttr');
github openstreetmap / iD / modules / ui / intro / building.js View on Github external
function eventCancel() {
        d3_event.stopPropagation();
        d3_event.preventDefault();
    }
github openstreetmap / iD / modules / ui / intro / welcome.js View on Github external
function contextmenu() {
        d3_event.preventDefault();
        d3_event.stopPropagation();
        if (!down[2] && !down.menu) {
            tooltip.classed('rightclick', true);
            window.setTimeout(function() {
                tooltip.classed('rightclick', false);
            }, minTime);
            dispatch.call('click', this, 'right');
        }
    }