Comments (4)
Why do you want to scale the container? If you want to adjust the viewport, you should use setViewport
.
from xyflow.
Thanks for your reply!
I have a special situation where the position of the ReactFlow layout is pre-calculated, and it is aligned with other components (ReactFlow's sibling component). The setViewport
can only adjust the flow's viewport, but I want both the flow component and the other components to be adjusted together. So I used transform: scale()
to achieve it.
from xyflow.
React Flow needs the dimensions of the flow to figure out things - supporting scaling by transforms would add an immens overhead to this, because it would have to be respected in many internal calculations. You can however resize the flow component and adjust the zoom level of the viewport at the same time to achieve the same effect. (napkin math: halving the size while halving the zoom level should yield the same same effect as scaling)
from xyflow.
Thank you for your suggestion! I will try it out later.
from xyflow.
Related Issues (20)
- Removing extent attribute onNodeDragStart doesn't allows for free roam until after onNodeDragStop HOT 7
- Multiple dragging doesn't trigger onNodeDragStop event. HOT 2
- Class for connecting from node HOT 1
- How automatically enabled the lock viewport of controls in ReactFlow HOT 1
- SvelteFlow: Copy/Paste (If not supported out-of-the-box, the easiest way to achieve it) HOT 6
- Source and Target handle getting null HOT 5
- Working Reactflow, when i add a Panel it errors HOT 1
- Drag problem after changing parentNode HOT 1
- SvelteFlow: Copy/Paste (continued issue) HOT 1
- Be able to pan the viewport on right mouse click on Node. HOT 6
- Disable node drag on multitouch HOT 3
- Remove pointer events from Pane if user selection active HOT 1
- Not possible to deselect edges HOT 1
- Edges not initially rendered onlyRenderVisibleElements is set and connecting offscreen node has height set HOT 1
- @types packages should be devDependencies HOT 1
- In SvelteFlow, setting viewport on initialization gets overridden on pan HOT 1
- Dynamic edge label updates not working HOT 1
- Rename `updateEdge` to `reconnectEdge` HOT 5
- Using Jest to click on handle throws "S?.elementFromPoint is not a function" error HOT 5
- when draggin a node it leave a trail
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 xyflow.