fitView argument is optional
This commit is contained in:
+2
-1
@@ -376,7 +376,8 @@ export const storeModel: StoreModel = {
|
|||||||
state.isInteractive = isInteractive;
|
state.isInteractive = isInteractive;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
fitView: action((state, { padding = 0.1 }) => {
|
fitView: action((state, payload = { padding: 0.1 }) => {
|
||||||
|
const { padding } = payload;
|
||||||
const { nodes, width, height, d3Selection, d3Zoom } = state;
|
const { nodes, width, height, d3Selection, d3Zoom } = state;
|
||||||
|
|
||||||
if (!d3Selection || !d3Zoom || !nodes.length) {
|
if (!d3Selection || !d3Zoom || !nodes.length) {
|
||||||
|
|||||||
+2
-2
@@ -134,9 +134,9 @@ export interface WrapNodeProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type FitViewParams = {
|
export type FitViewParams = {
|
||||||
padding?: number;
|
padding: number;
|
||||||
};
|
};
|
||||||
export type FitViewFunc = (fitViewOptions: FitViewParams) => void;
|
export type FitViewFunc = (fitViewOptions?: FitViewParams) => void;
|
||||||
export type ProjectFunc = (position: XYPosition) => XYPosition;
|
export type ProjectFunc = (position: XYPosition) => XYPosition;
|
||||||
|
|
||||||
type OnLoadParams = {
|
type OnLoadParams = {
|
||||||
|
|||||||
Reference in New Issue
Block a user