npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@todaytix/seats-io-seating-chart-wrapper

v1.3.0

Published

seats-io-seating-chart-wrapper React component

Downloads

8

Readme

seats-io-seating-chart-wrapper

Travis npm package Coveralls

See the clubhouse doc for information on how this repository is used in the mobile apps and web and how to test changes locally in this repo and publish to npm to be imported/consumed by the mobile apps and website

Testing Locally

You need to make changes first to src/index.js and then build them by running npm run build which puts the minimized output into the umd/@todaytix folder.

In the repository there is a file called seats-io-example.html which you can load in the browser to see your changes take effect. It looks for the minimized seating chart JS file located at umd/@todaytix/seats-io-seating-chart-wrapper.min.js which is overwritten every time you update src/index.js and run npm run build.

Two values in seats-io-example.html need to be replaced to correctly load the seating chart: event id and public key. Public key is the seats io public key that a dev can get for you. Event id is a different key that exists per showtime and can be found in the allocated_showtime table of the database.

Example - Code snippet (Vanilla JS)

  <script src="./umd/@todaytix/seats-io-seating-chart-wrapper.min.js"></script>
  <script>
    this.seatingChart = new SeatsIOSeatingChart(
      'seat-selector', // div id
      'todaytix-example-2', // event id
      '[public-key]', // public key
      {
        holdOnSelect: false, // used for testing purposes
        selectBestAvailable: false, // used for testing purposes
        hideTooltip: false, 
      },
      {
          onChartRendered: function onChartRendered(chart) {
            // platform logic here
          },
          onChartRenderingFailed: function onChartRenderingFailed(chart) {
            // platform logic here
          },
          onObjectClicked: function onObjectClicked(object) {
            // platform logic here
          },
          onObjectSelected: function onObjectSelected(object, selectedTicketType) {
            // platform logic here
          },
          onObjectDeselected: function onObjectDeselected(object, selectedTicketType) {
            // platform logic here
          },
          onObjectDeselected: function onObjectMouseOver(object) {
            // platform logic here
          },
          onObjectMouseOut: function onObjectMouseOut(object) {
            // platform logic here
          },
          onSelectedObjectBooked: function onSelectedObjectBooked(object) {
            // platform logic here
          },
          onBestAvailableSelected: function onBestAvailableSelected(objects, nextToEachOther) {
            // platform logic here
          },
          onBestAvailableSelectionFailed: function onBestAvailableSelectionFailed() {
            // platform logic here
          },
          onScrolledOutOfBoundsVertically: function onScrolledOutOfBoundsVertically(amount) {
            // platform logic here
          },
          onHoldSucceeded: function onHoldSucceeded(objects) {
            // platform logic here
          },
          onHoldFailed: function onHoldFailed(objects) {
            // platform logic here
          },
          onReleaseHoldSucceeded: function onReleaseHoldSucceeded(objects) {
            // platform logic here
          },
          onReleaseHoldFailed: function onReleaseHoldFailed(objects) {
            // platform logic here
          },
          onSelectionInvalid: function onSelectionInvalid(violations) {
            // platform logic here
          }
        },
      },
    );

    this.seatingChart.render();

    // deselecting seats
    this.seatingChart.deselectObjects(objects);
    // chart.deselectObjects(['A-1', 'A-2']);

    // selecting seats
    this.seatingChart.deselectObjects(objects);
    // chart.selectObjects(['A-1', 'A-2']);

    // update price range
    this.seatingChart.updatePriceRange(min,max);
    // chart.updatePriceRange(20,100);

    // update inventory map
    this.seatingChart.updateInventoryMap(inventoryMap);
    // chart.updateInventoryMap(inventoryMap);

    // get selected objects
    this.seatingChart.getSelectedObjects();
    // ['A-1','A-2'];
    
    // zoom to selected objects
    this.seatingChart.zoomToSelectedObjects();
  </script>

Example - Code snippet (ReactJS)

  import SeatsIOSeatingChartWrapper from 'SeatsIOSeatingChartWrapper';
  ...
  
  componentDidMount() {
    if (!__ENV__.CLIENT) {
      return;
    }
    
    const extraConfig = {
      accessibleHeading: settings.accessibleHeading,
      accessibleText: settings.accessibleText,
      inventoryMap,
      hideTooltip,
      max: maxRange,
      min: minRange,
      orphanText: settings.orphanText,
      partialViewHeading: settings.partialViewHeading,
      partialViewText: settings.partialViewText,
      taxDescription: settings.taxDescription,
    };

    this.seatingChart = new SeatsIOSeatingChart(
      SEAT_IO_CONTAINER,
      eventId,
      publicKey,
      {
        extraConfig,
        holdOnSelect: false,
        selectBestAvailable: false,
      },
      {
        onBestAvailableSelected: this.onBestAvailableSelected,
        onBestAvailableSelectionFailed: this.onBestAvailableSelectionFailed,
        onChartRendered: this.onChartRendered,
        onChartRenderingFailed: this.onChartRenderingFailed,
        onHoldFailed: this.onHoldFailed,
        onHoldSucceeded: this.onHoldSucceeded,
        onObjectClicked: this.onObjectClicked,
        onObjectDeselected: this.onObjectDeselected,
        onObjectMouseOut: this.onObjectMouseOut,
        onObjectMouseOver: this.onObjectMouseOver,
        onObjectSelected: this.onObjectSelected,
        onReleaseHoldFailed: this.onReleaseHoldFailed,
        onReleaseHoldSucceeded: this.onReleaseHoldSucceeded,
        onScrolledOutOfBoundsVertically: this.onScrolledOutOfBoundsVertically,
        onSelectedObjectBooked: this.onSelectedObjectBooked,
        onSelectionInvalid: this.onSelectionInvalid,
        onSelectionValid: this.onSelectionValid,
      },
    );
    this.seatingChart.render();
  }