excalidraw / excalidraw

Virtual whiteboard for sketching hand-drawn like diagrams
https://excalidraw.com
MIT License
86.8k stars 8.24k forks source link

Configure grid step #8687

Open Mrazator opened 1 month ago

Mrazator commented 1 month ago

Converted from #8553.

I'm integrating Excalidraw into a browser-based application and want to change the default grid step to 1.

Here's my current configuration:

const options = {
    langCode: 'ja-JP',
    name: name,
    initialData: {
        libraryItems: library.libraryItems,
        elements: [imageElement, ...elements],
        files: files,
        appState: {
            ...scene.appState,
            ...appStateDefault(),
            currentItemFontFamily: 2,
            gridSize: 20, // Controls the grid box size
        },
    },
};

I've tried adding 'gridStep: 1' to the appState to change it to a 1x1 grid, but the gridstep still defaults to a 5x5.

How can I correctly change the default grid step to 1x1 instead of the default 5x5? Which part of the code should I update to ensure this works?

azad52786 commented 1 month ago

Can you please tell me what the grid step does?

LDSmj commented 1 month ago

Can you please tell me what the grid step does?

sample of gridstep that has a value of 1 Image

sample of gridstep that has a value of 5 Image