How to use the d3-zoom.zoomIdentity function in d3-zoom

To help you get started, we’ve selected a few d3-zoom 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 tmobile / pacbot / webapp / src / app / pacman-features / secondary-components / multiline-brush-zoom / multiline-brush-zoom.component.ts View on Github external
.selectAll('.axis--x')
          .call(d3Axis.axisBottom(this.x).ticks(ticksLengthNumber));
      }

      this.focus.selectAll('.axis--x.zoom-axis').call(
        d3Axis
          .axisBottom(this.x)
          .ticks(10)
          .tickFormat(d3TimeFormat.timeFormat('%b / %d'))
      );

      this.svg
        .select('.zoom')
        .call(
          this.zoom.transform,
          d3Zoom.zoomIdentity
            .scale(this.width / (s[1] - s[0]))
            .translate(-s[0], 0)
        );

      this.updateMainAreaLabels();
      this.updateTimeLineLabels();
    } catch (error) {
      this.error.emit('jsError');
      this.loggerService.log('error', error);
    }
  }
github babsey / nest-desktop / src / deprecated / src / neuronal-state-activity-tsodysk.js View on Github external
function update() {

    var ids = data.nodes[1].ids;
    window.times = []
    var ids = data.nodes[1].ids;
    window.values = ids.map(function() {
        return []
    });

    if (document.getElementById('autoscale').checked) {
        d3Zoom.zoomIdentity.scale(1)
        chart.xScale.domain([data.kernel.time - data.sim_time, data.kernel.time])
    }

    data.nodes[2].events.senders.map(function(d, i) {
        if ((data.nodes[2].events.times[i] >= chart.xScale.domain()[0]) && (data.nodes[2].events.times[i] < chart.xScale.domain()[1])) {
            values[d - ids[0]].push(data.nodes[2].events[data.nodes[2].record_from][i])
            if (d == ids[0]) {
                times.push(data.nodes[2].events.times[i])
            }
        }
    });
    chart.yScale.domain(d3Array.extent([].concat.apply([], values)))

    chart.data({
            x: times,
            y: values
github ideditor / id-sdk / packages / math / projection / built / projection.js View on Github external
Projection.prototype.transform = function(obj) {
    if (!arguments.length) return d3_zoom_1.zoomIdentity.translate(this._x, this._y).scale(this._k);
    this._x = +obj.x;
    this._y = +obj.y;
    this._k = +obj.k;
    return this;
  };
  Projection.prototype.getStream = function() {

d3-zoom

Pan and zoom SVG, HTML or Canvas using mouse or touch input.

ISC
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis