Comments (5)
I just tried to replace the altKeyZoom attribute with modKeyZoom('Alt'), the latter one works! So I suspect the problem might arise from line 212 in diagram.js:
_diagram.modKeyZoom = _diagram.altKeyZoom = property(false);
from dc.graph.js.
Hey, sorry I haven’t had a chance to look at this.
I think it is probably a documentation bug. It is definitely delicate and I am sure there is a better system, but there is usually a way to get it working, so I’ve never cleaned it up.
In situations like this it’s probably best to look for an example that does work and then see what it did.
Let’s see if we can document this better, and deprecate one of the APIs if the name is misleading.
from dc.graph.js.
Thanks for the reply! And yes, I think the documentation could be further improved because the 'altKeyZoom' attribute could be found by entering into the search bar but not 'modKeyZoom'. However, I don't quite understand why make them two different attributes while they should serve the same function (zoom with Alt key pressed). ('altKeyZoom' is used in the brushing and filtering demo, and 'modKeyZoom' is used in the drag-drop composition demo.)
On the other hand, I still think there's bug within the 'altKeyZoom' attribute because after my attempts I found that when it's set to false, the graph can be zoomed and moved; when it's true, the graph cannot be zoomed or moved (even after I pressed Alt).
from dc.graph.js.
IIRC what happened here is that we tried to add new functionality in a backward-compatible way, but we slipped up.
Originally it was a boolean altKeyZoom
that allowed you to turn the feature on or off. Then we tried to generalize it to modKeyZoom
taking a string or an array of strings, all of which must match the current modifier keys pressed, in order for the "mode" to be activated.
We probably tried to upgrade boolean into "Alt"
at first, but broke it as we continued to change things.
So altKeyZoom
should really be deprecated, or if it totally doesn't work, it should be outright removed.
The key-matching logic is here:
Lines 57 to 66 in 1466cef
Please let me know if using the string "Alt"
works for you.
from dc.graph.js.
I just tried AltKeyZoom with 'Alt', and it worked! So it wasn't successfully set to Boolean and still carries the same function as modKeyZoom.
from dc.graph.js.
Related Issues (20)
- upgrade to modern D3
- "semantic zoom"
- highlight-neighbors is unreliable HOT 1
- do arrowheads and edge stubs work in angular? HOT 1
- layout algorithm directedness?
- options toggling on Edge
- user-select: none not working in Edge HOT 1
- explore.html?expanded=x with user file
- d3force layout doesn't work in simple viewer
- mod-key brushing doesn't select all contained nodes
- cola layout temporarily NaNs a lot of node positions
- edges not showing
- eliminate unqualified d3.selects in render_svg
- scoping event handlers to the chart
- layered_layout crashes if there are no nodes
- compatibility with yoga for flexbox layout HOT 1
- Rendering of nested subgraphs fails. HOT 1
- Merging the brushing-filtering function with simple viewer layouts using loaded data file HOT 14
- Archiving this repo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dc.graph.js.