chore(changelogs): update
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# @xyflow/react
|
# @xyflow/react
|
||||||
|
|
||||||
|
## 12.0.0-next.28
|
||||||
|
|
||||||
|
- add `paneDistanceClick` prop (max distance between mousedown/up that will trigger a click)
|
||||||
|
|
||||||
## 12.0.0-next.27
|
## 12.0.0-next.27
|
||||||
|
|
||||||
- return Promises for `setViewport`, `fitView`, `fitBounds` and `zoomTo` to be able to await viewport update
|
- return Promises for `setViewport`, `fitView`, `fitBounds` and `zoomTo` to be able to await viewport update
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# @xyflow/svelte
|
# @xyflow/svelte
|
||||||
|
|
||||||
|
## 0.1.10
|
||||||
|
|
||||||
|
- add `paneDistanceClick` prop (max distance between mousedown/up that will trigger a click)
|
||||||
|
|
||||||
## 0.1.9
|
## 0.1.9
|
||||||
|
|
||||||
- return Promises for `setViewport`, `fitView`, `fitBounds` and `zoomTo` to be able to await viewport update
|
- return Promises for `setViewport`, `fitView`, `fitBounds` and `zoomTo` to be able to await viewport update
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function XYPanZoom({
|
|||||||
};
|
};
|
||||||
const bbox = domNode.getBoundingClientRect();
|
const bbox = domNode.getBoundingClientRect();
|
||||||
const d3ZoomInstance = zoom()
|
const d3ZoomInstance = zoom()
|
||||||
.clickDistance(paneClickDistance)
|
.clickDistance(!isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance)
|
||||||
.scaleExtent([minZoom, maxZoom])
|
.scaleExtent([minZoom, maxZoom])
|
||||||
.translateExtent(translateExtent);
|
.translateExtent(translateExtent);
|
||||||
const d3Selection = select(domNode).call(d3ZoomInstance);
|
const d3Selection = select(domNode).call(d3ZoomInstance);
|
||||||
@@ -272,17 +272,8 @@ export function XYPanZoom({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setClickDistance(distance: number) {
|
function setClickDistance(distance: number) {
|
||||||
let validNumber = distance;
|
const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance;
|
||||||
|
d3ZoomInstance?.clickDistance(validDistance);
|
||||||
if (!isNumeric(distance)) {
|
|
||||||
validNumber = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (validNumber < 0) {
|
|
||||||
validNumber = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
d3ZoomInstance?.clickDistance(validNumber);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user