Socket
Socket
Sign inDemoInstall

@alisaitteke/seatmap-canvas

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @alisaitteke/seatmap-canvas

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


Version published
Maintainers
1
Created

Changelog

Source

v2.5.16 - 2024-01-13

Miscellaneous Chores
  • (package.json) update version from 2.5.14 to 2.5.15 for the @alisaitteke/seatmap-canvas package - (c4ef5f2) - Ali

Readme

Source

LIVE DEMO

Seatmap Canvas

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.

Features

  • React Integration: Designed specifically for React projects, offering a streamlined development experience.
  • Dynamic Seat Selection: Enables interactive selection, categorization, and location of seats.
  • Customizable Styles: Extensive styling options for seats, blocks, and labels to fit your application's design.
  • Interactive Seat Models: Define properties and behaviors for seats, including salability, notes, and custom data.
  • Block Model Configuration: Organize seats into blocks with customizable titles, colors, and labels.
  • Event Handling: Simplified event listeners for seat interactions, allowing dynamic responses to user actions.

Planned

  • Vue Integration: Designed specifically for Vue or Nuxt projects, offering a streamlined development experience.
  • Angular Integration: Designed specifically for Angular projects, offering a streamlined development experience.

LIVE DEMO

What does it do?

In any organization
  • Seat selection
  • Seat categorizing
  • Locating
  • Turnstile and Gate information

Installation

npm i @alisaitteke/seatmap-canvas --save
OR
yarn add @alisaitteke/seatmap-canvas --save
Example Config
{
    "resizable": true,
    "seat_style": {
        "radius": 12,
        "color": "#6796ff",
        "hover": "#5671ff",
        "not_salable": "#424747",
        "selected": "#56aa45",
        "focus": "#435fa4",
        "focus_out": "#56aa45"
    },
    "block_style": {
        "fill": "#e2e2e2",
        "stroke": "#e2e2e2"
    },
    "label_style": {
        "color": "#000",
        "radius": 12,
        "font-size": "12px",
        "bg": "#ffffff"
    }
}

Usage
var seatmap = new SeatmapCanvas(".seats_container",config);
Seat Model
{
  "id": 1,
  "title": "49",
  "x": 0,
  "y": 0,
  "salable": true,
  "note": "note test",
  "color":"#ffffff",
  "custom_data": {
    "any": "things"
  }
}
Block Model
{
  "blocks": [
    {
      "id": 1,
      "title": "Test Block 1",
      "color": "#2c2828",
      "labels": [
        {
          "title": "A",
          "x": -30,
          "y": 0
        },
        {
          "title": "B",
          "x": 120,
          "y": 30
        }
      ],
      "seats": [
        {
          "id": 1,
          "x": 0,
          "y": 0,
          "salable": true,
          "note": "note test",
          "title": "49"
        },
        {
          "id": 2,
          "x": 30,
          "y": 0,
          "salable": true,
          "note": "note test",
          "title": "47"
        }
      ]
    }
  ]
}

Set Block Data
seatmap.setData(data);
Seat Click Trigger
seatmap.addEventListener("seat_click", (seat) => {
    console.log(seat);
    if (seat.selected) {
        seatmap.seatUnselect(seat);
    } else {
        seatmap.seatSelect(seat);
    }
});
Activated unsalable seat click
click_enable_sold_seats param add to config object
let config = {
    click_enable_sold_seats: true // default false
}
Get selected seat
seatmap.addEventListener("seat_click", (seat) => {
    var selectedSeats = seatmap.getSelectedSeats();
});

Contributors

Ali Sait TEKE alisaitt@gmail.com

Keywords

FAQs

Last updated on 13 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc