2.16.0 • Published 2 months ago

phoenix-event-display v2.16.0

Weekly downloads
18
License
Apache-2.0
Repository
github
Last release
2 months ago

Phoenix event display

Version Downloads Documentation Coverage

A highly modular and API driven experiment independent event display that uses three.js for processing and presenting detector geometry and event data.

To use in your application, install the package.

npm install phoenix-event-display
# or
yarn add phoenix-event-display

Usage

As a module

To create a simple event display.

// Import required classes
import { EventDisplay, PhoenixLoader } from 'phoenix-event-display';

// Create the event display
const eventDisplay = new EventDisplay();

// Define the configuration
const configuration = {
  elementId: '<wrapper_element_id>',
  eventDataLoader: new PhoenixLoader(), // or some other event data loader
  // ... other configuration options
};

// Initialize the event display with the configuration
eventDisplay.init(configuration);

// Load and parse event data in Phoenix format and display it
fetch('path/to/event-data.json')
  .then((res) => res.json())
  .then((res) => {
    eventDisplay.parsePhoenixEvents(res);
  });

// Load detector geometry
eventDisplay.loadOBJGeometry(
  'path/to/geometry.obj',
  'Detector OBJ',
  0x8c8c8c /* color */,
);

As a standalone bundle

Phoenix can be bundled and used directly in the HTML as a script along with three.js. You can either use the CDN or build from source.

To build Phoenix as a bundle.

yarn build:bundle

This will generate a file phoenix.min.js in the ./dist/bundle directory which can be included in your HTML code.

Without building, you can include the bundle directly from CDN.

<html lang="en">
  <head>
    ...
  </head>

  <body>
    <div id="eventDisplay"></div>

    <script src="https://cdn.jsdelivr.net/npm/three/build/three.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/phoenix-event-display/dist/bundle/phoenix.min.js"></script>

    <script>
      // Create the event display
      const eventDisplay = new EventDisplay();

      // Define the configuration
      const configuration = {
        elementId: 'eventDisplay',
        eventDataLoader: new PhoenixLoader(), // or some other event data loader
        // ... other configuration options
      };

      // Initialize the event display with the configuration
      eventDisplay.init(configuration);

      // ... other event display functions
    </script>
  </body>
</html>

Examples

2.16.0

2 months ago

2.15.1

2 months ago

2.14.1

12 months ago

2.12.0

1 year ago

2.13.0

1 year ago

2.14.0

1 year ago

2.11.4

2 years ago

2.11.0

2 years ago

2.11.1

2 years ago

2.11.2

2 years ago

2.10.0

2 years ago

2.9.0

2 years ago

2.8.0

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.5.0

2 years ago

2.5.2

2 years ago

2.4.0

3 years ago

2.3.2

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

4 years ago

1.0.3-alpha.0

4 years ago

1.0.3-alpha.1

4 years ago

1.0.2

4 years ago

1.0.2-alpha.4

4 years ago

1.0.2-alpha.3

4 years ago

1.0.2-alpha.0

4 years ago

1.0.2-alpha.1

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago