Merge branch 'main' into a11y
This commit is contained in:
@@ -53,7 +53,7 @@ const useViewportHelper = (): ViewportHelperFunctions => {
|
||||
y: viewport.y ?? tY,
|
||||
zoom: viewport.zoom ?? tZoom,
|
||||
},
|
||||
{ duration: options?.duration }
|
||||
options
|
||||
);
|
||||
|
||||
return Promise.resolve(true);
|
||||
@@ -78,7 +78,7 @@ const useViewportHelper = (): ViewportHelperFunctions => {
|
||||
y: centerY,
|
||||
zoom: nextZoom,
|
||||
},
|
||||
{ duration: options?.duration }
|
||||
{ duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate }
|
||||
);
|
||||
|
||||
return Promise.resolve(true);
|
||||
@@ -91,7 +91,11 @@ const useViewportHelper = (): ViewportHelperFunctions => {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
await panZoom.setViewport(viewport, { duration: options?.duration });
|
||||
await panZoom.setViewport(viewport, {
|
||||
duration: options?.duration,
|
||||
ease: options?.ease,
|
||||
interpolate: options?.interpolate,
|
||||
});
|
||||
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
|
||||
@@ -149,6 +149,7 @@ export type ViewportHelperFunctions = {
|
||||
*
|
||||
* @param viewport - the viewport to set
|
||||
* @param options.duration - optional duration. If set, a transition will be applied
|
||||
* @param options.ease - optional ease function.
|
||||
*/
|
||||
setViewport: SetViewport;
|
||||
/**
|
||||
@@ -164,6 +165,8 @@ export type ViewportHelperFunctions = {
|
||||
* @param x - x position
|
||||
* @param y - y position
|
||||
* @param options.zoom - optional zoom
|
||||
* @param options.duration - optional duration. If set, a transition will be applied
|
||||
* @param options.ease - optional ease function.
|
||||
*/
|
||||
setCenter: SetCenter;
|
||||
/**
|
||||
@@ -173,6 +176,8 @@ export type ViewportHelperFunctions = {
|
||||
*
|
||||
* @param bounds - the bounds ({ x: number, y: number, width: number, height: number }) to fit the view to
|
||||
* @param options.padding - optional padding
|
||||
* @param options.duration - optional duration. If set, a transition will be applied
|
||||
* @param options.ease - optional ease function.
|
||||
*/
|
||||
fitBounds: FitBounds;
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ import { NodeTypes } from './general';
|
||||
*/
|
||||
export type Node<
|
||||
NodeData extends Record<string, unknown> = Record<string, unknown>,
|
||||
NodeType extends string = string
|
||||
NodeType extends string | undefined = string | undefined
|
||||
> = NodeBase<NodeData, NodeType> & {
|
||||
style?: CSSProperties;
|
||||
className?: string;
|
||||
|
||||
Reference in New Issue
Block a user