@alisaitteke/seatmap-canvas 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +120 -96
- package/dist/cjs/seatmap.canvas.js +2 -2
- package/dist/cjs/seatmap.canvas.js.map +1 -1
- package/dist/dependencies.txt +1 -223
- package/dist/esm/seatmap.canvas.js +2 -2
- package/dist/esm/seatmap.canvas.js.map +1 -1
- package/package.json +44 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Seatmap Canvas
|
|
2
2
|
Seatmap Canvas is an advanced, open-source library for interactive seat selection in various settings such as stadiums, theaters, and event spaces. Designed with d3.js, this code version is optimized for developers looking for a customizable and efficient solution to handle seat arrangements and user interactions.
|
|
3
3
|
|
|
4
|
-
[](https://
|
|
4
|
+
[](https://seatmap.io/demo)
|
|
5
5
|
|
|
6
|
-
**[📖 Documentation](https://
|
|
6
|
+
**[📖 Documentation](https://seatmap.io)** | **[🎯 Live Demo](https://seatmap.io/demo)**
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ Seatmap Canvas is an advanced, open-source library for interactive seat selectio
|
|
|
16
16
|
- **Event System** - Simplified event listeners for seat interactions
|
|
17
17
|
|
|
18
18
|
## Screenshot
|
|
19
|
-
[](https://
|
|
19
|
+
[](https://seatmap.io/demo)
|
|
20
20
|
|
|
21
21
|
## 🚀 Framework Plugins & Integrations
|
|
22
22
|
|
|
@@ -31,7 +31,9 @@ Seatmap Canvas is an advanced, open-source library for interactive seat selectio
|
|
|
31
31
|
<img src="https://img.shields.io/badge/React-⚠️_Testing-orange?style=for-the-badge&logo=react&logoColor=white" alt="React"/>
|
|
32
32
|
</a>
|
|
33
33
|
|
|
34
|
-
<
|
|
34
|
+
<a href="src/nextjs/README.md">
|
|
35
|
+
<img src="https://img.shields.io/badge/Next.js-⚠️_Testing-orange?style=for-the-badge&logo=next.js&logoColor=white" alt="Next.js"/>
|
|
36
|
+
</a>
|
|
35
37
|
|
|
36
38
|
<img src="https://img.shields.io/badge/Svelte-Coming_Soon-FF3E00?style=for-the-badge&logo=svelte&logoColor=white&color=gray" alt="Svelte"/>
|
|
37
39
|
|
|
@@ -71,7 +73,7 @@ Seatmap Canvas is an advanced, open-source library for interactive seat selectio
|
|
|
71
73
|
| **Vanilla JS** | ✅ Available | `@alisaitteke/seatmap-canvas` | [📖 Documentation](#vanilla-javascript) | [🎯 Example](examples/) |
|
|
72
74
|
| **Vue.js 3** | ⚠️ Testing | `@alisaitteke/seatmap-canvas/vue` | [📖 Documentation](src/vue/README.md) | [🎯 Example](examples/vue/) |
|
|
73
75
|
| **React** | ⚠️ Testing | `@alisaitteke/seatmap-canvas/react` | [📖 Documentation](src/react/README.md) | [🎯 Example](examples/react/) |
|
|
74
|
-
| **Next.js** |
|
|
76
|
+
| **Next.js** | ⚠️ Testing | `@alisaitteke/seatmap-canvas/nextjs` | [📖 Documentation](src/nextjs/README.md) | [🎯 App Router](examples/nextjs-app/) • [Pages Router](examples/nextjs-pages/) |
|
|
75
77
|
| **Svelte** | 🔜 Coming Soon | - | - | - |
|
|
76
78
|
| **Angular** | 🔜 Coming Soon | - | - | - |
|
|
77
79
|
| **Nuxt** | 🔜 Coming Soon | - | - | - |
|
|
@@ -97,7 +99,7 @@ Seatmap Canvas is an advanced, open-source library for interactive seat selectio
|
|
|
97
99
|
|
|
98
100
|
---
|
|
99
101
|
|
|
100
|
-
[LIVE DEMO](https://
|
|
102
|
+
[LIVE DEMO](https://seatmap.io/demo)
|
|
101
103
|
|
|
102
104
|
|
|
103
105
|
|
|
@@ -184,7 +186,7 @@ const onSeatClick = (seat) => {
|
|
|
184
186
|
</table>
|
|
185
187
|
|
|
186
188
|
<p align="center">
|
|
187
|
-
<a href="
|
|
189
|
+
<a href="https://seatmap.io/frameworks/vue"><img src="https://img.shields.io/badge/📖_Full_Documentation-4FC08D?style=for-the-badge&logoColor=white" alt="Documentation"/></a>
|
|
188
190
|
|
|
189
191
|
<a href="examples/vue/"><img src="https://img.shields.io/badge/🎯_Examples-35495E?style=for-the-badge&logoColor=white" alt="Examples"/></a>
|
|
190
192
|
</p>
|
|
@@ -240,13 +242,95 @@ function App() {
|
|
|
240
242
|
</table>
|
|
241
243
|
|
|
242
244
|
<p align="center">
|
|
243
|
-
<a href="
|
|
245
|
+
<a href="https://seatmap.io/frameworks/react"><img src="https://img.shields.io/badge/📖_Full_Documentation-61DAFB?style=for-the-badge&logoColor=black" alt="Documentation"/></a>
|
|
244
246
|
|
|
245
247
|
<a href="examples/react/"><img src="https://img.shields.io/badge/🎯_Examples-20232A?style=for-the-badge&logoColor=white" alt="Examples"/></a>
|
|
246
248
|
</p>
|
|
247
249
|
|
|
248
250
|
---
|
|
249
251
|
|
|
252
|
+
<h3>
|
|
253
|
+
<img src="https://api.iconify.design/logos:nextjs-icon.svg" width="24" height="24" alt="Next.js" style="vertical-align: middle;" />
|
|
254
|
+
Next.js
|
|
255
|
+
</h3>
|
|
256
|
+
|
|
257
|
+
<table>
|
|
258
|
+
<tr>
|
|
259
|
+
<td width="50%">
|
|
260
|
+
|
|
261
|
+
**Installation**
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
npm install @alisaitteke/seatmap-canvas next react react-dom
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**App Router (Client Component)**
|
|
268
|
+
|
|
269
|
+
```tsx
|
|
270
|
+
'use client';
|
|
271
|
+
|
|
272
|
+
import { SeatmapCanvas } from '@alisaitteke/seatmap-canvas/nextjs';
|
|
273
|
+
import '@alisaitteke/seatmap-canvas/dist/seatmap.canvas.css';
|
|
274
|
+
|
|
275
|
+
export default function VenuePage() {
|
|
276
|
+
const handleSeatClick = (seat) => {
|
|
277
|
+
seat.isSelected() ? seat.unSelect() : seat.select();
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
return (
|
|
281
|
+
<SeatmapCanvas
|
|
282
|
+
data={blocks}
|
|
283
|
+
options={{ legend: true }}
|
|
284
|
+
onSeatClick={handleSeatClick}
|
|
285
|
+
/>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
</td>
|
|
291
|
+
<td width="50%">
|
|
292
|
+
|
|
293
|
+
**Server Component + Data Fetching**
|
|
294
|
+
|
|
295
|
+
```tsx
|
|
296
|
+
import { SeatmapServerWrapper } from '@alisaitteke/seatmap-canvas/nextjs/app-router';
|
|
297
|
+
import '@alisaitteke/seatmap-canvas/dist/seatmap.canvas.css';
|
|
298
|
+
|
|
299
|
+
export default async function VenuePage({ params }) {
|
|
300
|
+
return (
|
|
301
|
+
<SeatmapServerWrapper
|
|
302
|
+
dataSource={`/api/venues/${params.id}/seatmap`}
|
|
303
|
+
options={{ legend: true }}
|
|
304
|
+
revalidate={3600}
|
|
305
|
+
/>
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Pages Router (Dynamic Import)**
|
|
311
|
+
|
|
312
|
+
```tsx
|
|
313
|
+
import { SeatmapCanvas } from '@alisaitteke/seatmap-canvas/nextjs/pages-router';
|
|
314
|
+
|
|
315
|
+
export default function VenuePage({ data }) {
|
|
316
|
+
return <SeatmapCanvas data={data} />;
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
</td>
|
|
321
|
+
</tr>
|
|
322
|
+
</table>
|
|
323
|
+
|
|
324
|
+
<p align="center">
|
|
325
|
+
<a href="https://seatmap.io/frameworks/nextjs"><img src="https://img.shields.io/badge/📖_Full_Documentation-000000?style=for-the-badge&logoColor=white" alt="Documentation"/></a>
|
|
326
|
+
|
|
327
|
+
<a href="examples/nextjs-app/"><img src="https://img.shields.io/badge/🎯_App_Router-000000?style=for-the-badge&logoColor=white" alt="App Router"/></a>
|
|
328
|
+
|
|
329
|
+
<a href="examples/nextjs-pages/"><img src="https://img.shields.io/badge/🎯_Pages_Router-000000?style=for-the-badge&logoColor=white" alt="Pages Router"/></a>
|
|
330
|
+
</p>
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
250
334
|
<h3>
|
|
251
335
|
<img src="https://api.iconify.design/logos:javascript.svg" width="24" height="24" alt="JavaScript" style="vertical-align: middle;" />
|
|
252
336
|
Vanilla JavaScript
|
|
@@ -474,90 +558,8 @@ background_fit: "contain"
|
|
|
474
558
|
|
|
475
559
|
</details>
|
|
476
560
|
|
|
477
|
-
<details>
|
|
478
|
-
<summary><strong>📝 Complete Example</strong></summary>
|
|
479
|
-
```javascript
|
|
480
|
-
|
|
481
|
-
var config = {
|
|
482
|
-
"resizable": true,
|
|
483
|
-
"seat_style": {
|
|
484
|
-
"radius": 12,
|
|
485
|
-
"color": "#6796ff",
|
|
486
|
-
"hover": "#5671ff",
|
|
487
|
-
"not_salable": "#424747",
|
|
488
|
-
"selected": "#56aa45",
|
|
489
|
-
"focus": "#435fa4",
|
|
490
|
-
"focus_out": "#56aa45"
|
|
491
|
-
},
|
|
492
|
-
"block_style": {
|
|
493
|
-
"fill": "#e2e2e2",
|
|
494
|
-
"stroke": "#e2e2e2"
|
|
495
|
-
},
|
|
496
|
-
"label_style": {
|
|
497
|
-
"color": "#000",
|
|
498
|
-
"radius": 12,
|
|
499
|
-
"font-size": "12px",
|
|
500
|
-
"bg": "#ffffff"
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
var seatmap = new SeatmapCanvas(".seats_container",config);
|
|
505
|
-
seatmap.addEventListener("seat_click", (seat) => {
|
|
506
|
-
console.log(seat);
|
|
507
|
-
if (seat.selected) {
|
|
508
|
-
seatmap.seatUnselect(seat);
|
|
509
|
-
} else {
|
|
510
|
-
seatmap.seatSelect(seat);
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
var data = {
|
|
514
|
-
"blocks": [
|
|
515
|
-
{
|
|
516
|
-
"id": 1,
|
|
517
|
-
"title": "Test Block 1",
|
|
518
|
-
"color": "#2c2828",
|
|
519
|
-
"labels": [
|
|
520
|
-
{
|
|
521
|
-
"title": "A",
|
|
522
|
-
"x": -30,
|
|
523
|
-
"y": 0
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
"title": "B",
|
|
527
|
-
"x": 120,
|
|
528
|
-
"y": 30
|
|
529
|
-
}
|
|
530
|
-
],
|
|
531
|
-
"seats": [
|
|
532
|
-
{
|
|
533
|
-
"id": 1,
|
|
534
|
-
"x": 0,
|
|
535
|
-
"y": 0,
|
|
536
|
-
"salable": true,
|
|
537
|
-
"note": "note test",
|
|
538
|
-
"title": "49"
|
|
539
|
-
},
|
|
540
|
-
{
|
|
541
|
-
"id": 2,
|
|
542
|
-
"x": 30,
|
|
543
|
-
"y": 0,
|
|
544
|
-
"salable": true,
|
|
545
|
-
"note": "note test",
|
|
546
|
-
"title": "47"
|
|
547
|
-
}
|
|
548
|
-
]
|
|
549
|
-
}
|
|
550
|
-
]
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
// SET SEATS DATA
|
|
554
|
-
seatmap.setData(data);
|
|
555
|
-
```
|
|
556
|
-
|
|
557
|
-
</details>
|
|
558
|
-
|
|
559
561
|
<p align="center">
|
|
560
|
-
<a href="
|
|
562
|
+
<a href="https://seatmap.io/frameworks/vanilla-js"><img src="https://img.shields.io/badge/📖_Full_Documentation-F7DF1E?style=for-the-badge&logoColor=black" alt="Documentation"/></a>
|
|
561
563
|
|
|
562
564
|
<a href="examples/"><img src="https://img.shields.io/badge/🎯_Examples-333333?style=for-the-badge&logoColor=white" alt="Examples"/></a>
|
|
563
565
|
</p>
|
|
@@ -566,13 +568,35 @@ seatmap.setData(data);
|
|
|
566
568
|
|
|
567
569
|
## Links
|
|
568
570
|
|
|
569
|
-
- 📖 [Documentation](https://
|
|
570
|
-
- 🎯 [Live Demo](https://
|
|
571
|
+
- 📖 [Full Documentation](https://seatmap.io)
|
|
572
|
+
- 🎯 [Live Demo](https://seatmap.io/demo)
|
|
571
573
|
- 📦 [NPM Package](https://www.npmjs.com/package/@alisaitteke/seatmap-canvas)
|
|
572
574
|
- 🐛 [Report Issues](https://github.com/alisaitteke/seatmap-canvas/issues)
|
|
573
575
|
|
|
576
|
+
## Author
|
|
577
|
+
|
|
578
|
+
<div align="center">
|
|
579
|
+
<a href="https://github.com/alisaitteke">
|
|
580
|
+
<img src="https://github.com/alisaitteke.png" width="100" height="100" style="border-radius: 50%;" alt="Ali Sait Teke"/>
|
|
581
|
+
</a>
|
|
582
|
+
|
|
583
|
+
<h3>Ali Sait Teke</h3>
|
|
584
|
+
|
|
585
|
+
<p>
|
|
586
|
+
<a href="https://github.com/alisaitteke">
|
|
587
|
+
<img src="https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=github&logoColor=white" alt="GitHub"/>
|
|
588
|
+
</a>
|
|
589
|
+
|
|
590
|
+
<a href="https://www.linkedin.com/in/alisaitteke">
|
|
591
|
+
<img src="https://img.shields.io/badge/LinkedIn-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white" alt="LinkedIn"/>
|
|
592
|
+
</a>
|
|
593
|
+
|
|
594
|
+
<a href="https://twitter.com/alisaitteke">
|
|
595
|
+
<img src="https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white" alt="Twitter"/>
|
|
596
|
+
</a>
|
|
597
|
+
</p>
|
|
598
|
+
</div>
|
|
599
|
+
|
|
574
600
|
## Contributors
|
|
575
601
|
|
|
576
|
-
|
|
577
|
-
<img src="https://img.shields.io/badge/Ali_Sait_Teke-Maintainer-blue?style=flat-square&logo=github" alt="Ali Sait Teke"/>
|
|
578
|
-
</a>
|
|
602
|
+
Contributions are welcome! Feel free to submit issues and pull requests.
|