Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky pair clusterer #297

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2067f6a
Added sticky-pair-clusterer
safa0 Oct 5, 2024
2ed0d30
Added text box for number of trait pairs to add
safa0 Oct 7, 2024
cd170bd
removed event listner for changing selection size, added sticky pair …
safa0 Oct 7, 2024
c7bb5ad
create matrix button creates frames and places stickynotes on them. W…
safa0 Oct 17, 2024
2e1fd41
sticky note and its corresponding sticky in other frames is doubled i…
safa0 Oct 17, 2024
55fea6a
code cleanup and refactor
safa0 Oct 17, 2024
693c561
store metadata on board so that when the board is closed and reopened…
safa0 Oct 17, 2024
953b604
Copy the content of one sticky note when it changes to its correspond…
safa0 Oct 17, 2024
63f037a
added button to assign random tags for debug purpose
safa0 Oct 18, 2024
7c2be05
Update matrix so that it contains tags and create predefined tags for…
safa0 Oct 18, 2024
9b2caef
optimized matrix creation
safa0 Oct 20, 2024
fc74447
Added handling of api rate limit
safa0 Oct 21, 2024
0924f8f
Added light blue color to frames
safa0 Oct 21, 2024
96e6768
Added better handling of storage collection
safa0 Oct 22, 2024
7c9f4b3
Removed dead code
safa0 Oct 24, 2024
ab6471c
Removed dead code
safa0 Oct 24, 2024
15fa913
fixed bug in resize of sticky nots upon de/selectoin
safa0 Oct 25, 2024
0b4df91
refactor of g_matrix, optimized
safa0 Oct 26, 2024
cc7deec
removed tagtitles from g_matrix
safa0 Oct 26, 2024
3f3b673
Added exprot table construction of traits, benefits, and their corres…
safa0 Oct 26, 2024
d6b8a76
Added formating of data for direct copy to excel
safa0 Oct 26, 2024
292c936
fixed app.html
safa0 Oct 26, 2024
e840495
Fixed styling for app
safa0 Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions examples/sticky-pair-clusterer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Miro Template Builder App

This app shows how you can create a template with shape and text items on the board.

# 👨🏻‍💻 App Demo

https://github.com/miroapp/app-examples/assets/10428517/24aacae3-5183-4142-bdae-9cbfeff06a69

# 📒 Table of Contents

- [Included Features](#features)
- [Tools and Technologies](#tools)
- [Prerequisites](#prerequisites)
- [Associated Developer Tutorial](#tutorial)
- [Run the app locally](#run)
- [Folder Structure](#folder)
- [Contributing](#contributing)
- [License](#license)

# ⚙️ Included Features <a name="features"></a>

- [Miro Web SDK](https://developers.miro.com/docs/web-sdk-reference)
- [miro.board.createText()](https://developers.miro.com/docs/board_board#createtext)
- [miro.board.createShape()](https://developers.miro.com/docs/board_board#createshape)
- [miro.board.ui.openPanel()](https://developers.miro.com/docs/ui_boardui#openpanel)

# 🛠️ Tools and Technologies <a name="tools"></a>

- [Vite](https://vitejs.dev/)

# ✅ Prerequisites <a name="prerequisites"></a>

- You have a [Miro account](https://miro.com/signup/).
- You're [signed in to Miro](https://miro.com/login/).
- Your Miro account has a [Developer team](https://developers.miro.com/docs/create-a-developer-team).
- Your development environment includes [Node.js 14.13](https://nodejs.org/en/download) or a later version.
- All examples use `npm` as a package manager and `npx` as a package runner.

# 🏃🏽‍♂️ Run the app locally <a name="run"></a>

1. Run `npm install` to install dependencies.
2. Run `npm start` to start developing. \
Your URL should be similar to this example:
```
http://localhost:3000
```
3. Open the [app manifest editor](https://developers.miro.com/docs/manually-create-an-app#step-2-configure-your-app-in-miro) by clicking **Edit in Manifest**. \
In the app manifest editor, configure the app as follows:

```yaml
# See https://developers.miro.com/docs/app-manifest on how to use this
appName: Template Builder
sdkVersion: SDK_V2
sdkUri: http://localhost:3000
scopes:
- boards:read
- boards:write
```

4. Go back to your app home page, and under the `Permissions` section, you will see a blue button that says `Install app and get OAuth token`. Click that button. Then click on `Add` as shown in the video below. <b>In the video we install a different app, but the process is the same regardless of the app.</b>

> ⚠️ We recommend to install your app on a [developer team](https://developers.miro.com/docs/create-a-developer-team) while you are developing or testing apps.⚠️

https://github.com/miroapp/app-examples/assets/10428517/1e6862de-8617-46ef-b265-97ff1cbfe8bf

5. Go to your developer team, and open your boards.
6. Click on the plus icon from the bottom section of your left sidebar. If you hover over it, it will say `More apps`.
7. Search for your app `Template Builder` or whatever you chose to name it. Click on your app to use it, as shown in the video below. <b>In the video we search for a different app, but the process is the same regardless of the app.</b>

https://github.com/horeaporutiu/app-examples-template/assets/10428517/b23d9c4c-e785-43f9-a72e-fa5d82c7b019

# 🗂️ Folder structure <a name="folder"></a>

```
.
├── src
│ ├── assets
│ │ └── style.css
│ ├── app.js // The code for the app lives here.
│ └── index.js // The code for the app entry point lives here.
├── app.html // The app itself. It's loaded on the board inside the 'appContainer'.
└── index.html // The app entry point. This is the value you assign to 'sdkUri' in the app manifest file.
```

# 🫱🏻‍🫲🏽 Contributing <a name="contributing"></a>

If you want to contribute to this example, or any other Miro Open Source project, please review [Miro's contributing guide](https://github.com/miroapp/app-examples/blob/main/CONTRIBUTING.md).

# 🪪 License <a name="license"></a>

[MIT License](https://github.com/miroapp/app-examples/blob/main/LICENSE).
7 changes: 7 additions & 0 deletions examples/sticky-pair-clusterer/app-manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://developers.miro.com/docs/app-manifest on how to use this
#appName: Template Builder
appName: Sticky notes to shapes
sdkUri: "http://localhost:3000"
scopes:
- boards:read
- boards:write
62 changes: 62 additions & 0 deletions examples/sticky-pair-clusterer/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!doctype html>
<html lang="en">
<head>
<title></title>
<link rel="stylesheet" href="/src/styles.css" />
<script src="https://miro.com/app/static/sdk/v2/miro.js"></script>
</head>
<body>
<div class="scrollable-container">
<div class="input-container">
<label for="rowsCount">No. of Traits: </label>
<input
type="number"
id="rowsCount"
class="rows-count-input"
min="1"
value="20"
placeholder="Number of rows"
/>
</div>
<div class="input-container">
<label for="columnsCount">No. of Benefits:</label>
<input
type="number"
id="columnsCount"
class="columns-count-input"
min="1"
value="3"
placeholder="Number of columns"
/>
</div>
<div>
<button id="createPair" class="create-pair-button">Create Pair</button>
<button id="updateBenefits" class="update-benefits-button">
Update Benefits
</button>
<button
id="assignRandomTagsToSelection"
class="assign-random-tags-to-selection-button"
>
Assign Random Tags To Selection
</button>
<button id="createMatrix" class="create-matrix-button">
Create Matrix
</button>
<button id="removeAllTags" class="remove-all-tags-button">
Remove All Tags
</button>
<button id="printAppData" class="print-app-data-button">
Print App Data
</button>
<button id="copyToClipboard" class="copy-to-clipboard-button">
Copy To Clipboard
</button>
<button id="debugButton" class="debug-button">Debug</button>
</div>
</div>
<div>
<script type="module" src="/src/app.js"></script>
</div>
</body>
</html>
9 changes: 9 additions & 0 deletions examples/sticky-pair-clusterer/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://miro.com/app/static/sdk/v2/miro.js"></script>
<script type="module" src="/src/index.js"></script>
</head>
</html>
7 changes: 7 additions & 0 deletions examples/sticky-pair-clusterer/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"typeRoots": ["./node_modules/@types", "./node_modules/@mirohq"]
},
"include": ["src"],
"exclude": ["node_modules"]
}
15 changes: 15 additions & 0 deletions examples/sticky-pair-clusterer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "sticky-pair-clusterer",
"description": "Create a template programmatically with the Miro Web SDK. This app uses Vite.",
"keywords": ["Miro SDK", "Vite"],
"version": "0.0.0",
"scripts": {
"start": "vite",
"build": "vite build",
"serve": "vite preview"
},
"devDependencies": {
"@mirohq/websdk-types": "latest",
"vite": "2.9.17"
}
}
Loading