Git Product home page Git Product logo

Comments (5)

danielcaldas avatar danielcaldas commented on May 12, 2024

Hello there @wulucxy, glad it's useful. It's a pretty obvious feature indeed controlling zoom with other actions. Today you are able to double click to zoom, did you tried that? It is provided out of the box by the browser or d3 I'm not quite sure of the nature of the feature.

Regardless, I would challenge you to leave here a few suggestions of specific controls for zooming, or we could also go with a client configurable zoom ing actions (more generic).

from react-d3-graph.

wulucxy avatar wulucxy commented on May 12, 2024

Hi,@danielcaldas,I mean how can I control the zoom scale by outside props,not only by inner state

Like I have three buttons,one for zoomIn,one for zoomOut,one for reset,I think this is a general UI case。

from react-d3-graph.

danielcaldas avatar danielcaldas commented on May 12, 2024

So let's imagine something like 3 new properties in the config object where you could pass in your own key bindings for zoom control, something like:

const graphConfig = {
   ...
   zoomIn: 'w',
   zoomOut: 's',
   reset: 'r',
   ...
};

And you as client would have the hability to define those properties with other key bindings. How thus this sounds to you @wulucxy?

from react-d3-graph.

wulucxy avatar wulucxy commented on May 12, 2024

@danielcaldas actually I have found a solution for this, https://spotify.github.io/reactochart/docs/build/#/zoom-container。

you can control the zoom by props, or you can only put it stateful

what I want is fully control of zoom,not just by mousewheel or dbclick event。

from react-d3-graph.

danielcaldas avatar danielcaldas commented on May 12, 2024

Oh well nice then, thanks for providing that link, others might find this useful as well. I didn't know the component, nice one.

from react-d3-graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.