d3-xyzoom | zoom adding several features | Media library

 by   wiremind JavaScript Version: v1.5.0 License: BSD-3-Clause

kandi X-RAY | d3-xyzoom Summary

kandi X-RAY | d3-xyzoom Summary

d3-xyzoom is a JavaScript library typically used in Media, Ruby On Rails, Docker applications. d3-xyzoom has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Fork of d3-zoom adding several features by separating scaling on x and y
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              d3-xyzoom has a low active ecosystem.
              It has 18 star(s) with 3 fork(s). There are 6 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 4 open issues and 4 have been closed. On average issues are closed in 2 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of d3-xyzoom is v1.5.0

            kandi-Quality Quality

              d3-xyzoom has 0 bugs and 0 code smells.

            kandi-Security Security

              d3-xyzoom has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              d3-xyzoom code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              d3-xyzoom is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              d3-xyzoom releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed d3-xyzoom and discovered the below as its top functions. This is intended to give you an instant insight into d3-xyzoom implemented functionality, and help decide if they suit your requirements.
            • Loops through mouse wheel events .
            • touchstart event handler
            • Makes a mouse position .
            • touch start event handler
            • Create a transition handler .
            • the touchend event handler
            • Returns the default dimensions of the element .
            • ZoZoom .
            • Mouse click handler
            • Convert an extent to an axis .
            Get all kandi verified functions for this library.

            d3-xyzoom Key Features

            No Key Features are available at this moment for d3-xyzoom.

            d3-xyzoom Examples and Code Snippets

            No Code Snippets are available at this moment for d3-xyzoom.

            Community Discussions

            QUESTION

            d3 zoom: pan axis on scroll, pan axis on drag, zoom axis on pinch
            Asked 2019-May-31 at 20:27

            I'm hoping to configure the zoom behavior of a plot to have three kinds of interaction:

            • It should be possible to pan from left to right with the scroll wheel.
            • It should be possible to pan from left to right with mousedown drag events.
            • it should be possible to zoom in 1-D with the pinch event (i.e. scroll wheel with control key pressed).

            Right now, I can get the latter two to work in this Fiddle: https://jsfiddle.net/s1t7mrpw/6/

            The zoomed function looks like this:

            ...

            ANSWER

            Answered 2019-May-31 at 20:27

            I am using d3-zoom on this answer as it is more common and part of the d3 bundle. d3-xyzoom, as an add-on module, adds some useful functionality using d3-zoom as a base, so this solution should work with xyzoom with minor revisions - but I don't believe its use is necessary

            The key challenge lies in using the wheel to apply a translate change not a scale change. Roughly speaking, when a scroll event without control occurs you grab the transform on the selection (this should be the node) and update it by taking the scroll and creating an x offset from it to translate the view rectangle. But, you don't update the zoomTransform to nullify the change in scale caused by the zoom - so when you pan by dragging, the rectangle changes size because you haven't updated the zoomTransform used by the zoom behavior. Likewise, the translate can be off if it doesn't account for scale.

            The disassociation between zoom transform applied to an element as a "transform" attribute and the zoom transform tracked by the zoom behavior is the cause of many headaches on SO - but it allows freer implementation options as one not need use an element's transform attribute to apply a zoom behavior (useful in canvas, zooming unorthodox things like color, etc).

            I'm going to propose a basic solution here.

            First, the zoom transform tracked by the zoom behavior can be updated by modifying the d3.event.transform object itself (or with d3.zoomTransform(selection.node) where selection is the selection that the zoom was called on originally).

            Secondly, as the d3.event.transform object registers scrolling as scaling, we need to override this and convert this scaling into translating - when needed. To do so, we need to keep track of the current (pre-event) translate and scale - so we can modify them manually:

            Source https://stackoverflow.com/questions/55778403

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install d3-xyzoom

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/wiremind/d3-xyzoom.git

          • CLI

            gh repo clone wiremind/d3-xyzoom

          • sshUrl

            git@github.com:wiremind/d3-xyzoom.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link