Skip to content

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
thera2002 committed Nov 17, 2024
1 parent dca148d commit 6f95733
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dist/examples/electron-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ The `main.js` file is the entry point for the Electron application. It handles:

The user interacts with the UI to define an annotation and its associated SVG data. The structure matches the OpenLIME `Annotation` class.

Example in the frontend (`index.js`):
```javascript
const newAnnotation = {
id: "annotation-1", // Unique identifier
Expand All @@ -120,8 +121,7 @@ The `main.js` file is the entry point for the Electron application. It handles:
window.api.createAnnotation(newAnnotation);
```

**Preload.js**: Exposes an API for secure communication.

Example in `preload.js`:
```javascript
const { ipcRenderer, contextBridge } = require('electron');

Expand All @@ -130,8 +130,7 @@ The `main.js` file is the entry point for the Electron application. It handles:
});
```

**Backend (Main.js)**: Receives the annotation, stores it in memory, and sends it back for rendering.

Example in `main.js`:
```javascript
const { ipcMain } = require('electron');
const annotations = []; // In-memory storage
Expand Down

0 comments on commit 6f95733

Please sign in to comment.