Merge pull request #298 from andys8/patch-2

README: fitView needs an argument
This commit is contained in:
Moritz
2020-06-19 13:04:35 +02:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -376,7 +376,8 @@ export const storeModel: StoreModel = {
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;
if (!d3Selection || !d3Zoom || !nodes.length) {
+2 -2
View File
@@ -134,9 +134,9 @@ export interface WrapNodeProps {
}
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;
type OnLoadParams = {