Phoenix event display

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
yarn add phoenix-event-display
Usage
As a module
To create a simple event display.
import { EventDisplay, PhoenixLoader } from 'phoenix-event-display';
const eventDisplay = new EventDisplay();
const configuration = {
elementId: '<wrapper_element_id>',
eventDataLoader: new PhoenixLoader()
};
eventDisplay.init(configuration);
fetch('path/to/event-data.json')
.then((res) => res.json())
.then((res) => {
eventDisplay.parsePhoenixEvents(res);
});
eventDisplay.loadOBJGeometry('path/to/geometry.obj', 'Detector OBJ', 0x8c8c8c );
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>
const eventDisplay = new EventDisplay();
const configuration = {
elementId: 'eventDisplay',
eventDataLoader: new PhoenixLoader()
};
eventDisplay.init(configuration);
</script>
</body>
</html>
Examples