0. Installation1. Getting Started2. Importing Data3. Filtering4. Layout5. Advanced settings6. Data structureStorygramEventActor7. FAQ
Data structure
Storygram
Below is shown the internal structure of a Storygram object.
export default class Storygram<T extends {}> {// Data with filtering and optimizationpublic processedData!: Data;// Data without filtering and optimizationpublic data!: Data;// Array containing a grid of rendered points, the x length// and the maximal y lengthprivate renderedGrid!: [RenderedPoint[], number, number];// Whether the storygram has been filtered, optimized and renderedprivate isCalculated: boolean = false;// Default valuesprivate baseConfig: BaseConfig = { ... };// Custom and default configurationpublic config: FullConfig;public constructor(rawData: T[], config: Config) {this.config = { ...this.baseConfig, ...config };this.setData(rawData);}private setData(data: T[]): void { ... }// Filter, optimise and render the storygrampublic calculate() { ... }// Draw the storygram on the DOM. If the filter, optimization// and rendering steps aren't yet made, perform these firstpublic async draw() { ... }}
Event
Below is shown the internal structure of an Event object. The whole class definition is shown, but you might want to us only the "data" attribute in the constructor. It contains all the keys of the original datum.
export class Event {// sequence number of the event of all visible eventspublic index?: number;// whether the event is visible or notpublic isHidden: boolean;// which actors to addpublic add: string[];// which actors to removepublic remove: string[];// which actors to grouppublic group: string[];// which actors will be on this event, whether they are grouped or notpublic state: string[];// whitch actor positions to switchpublic switch: Switch[] = [];// whitch actors are hiddenpublic hiddenActors: string[];public constructor(public eventValue: number | string | undefined,public eventXValue: number,public data: Record<string, unknown>) {this.isHidden = false;this.add = [];this.remove = [];this.group = [];this.state = [];this.hiddenActors = [];}}
Actor
Below is shown the internal structure of an Actor object. The whole class definition is shown, but you might want to us only the "data" attribute in the constructor. It contains all the keys of the original datum.
export class Actor {public layers: Event[];public isHidden: boolean;public constructor(public actorID: string,public data: Record<string, unknown>) {this.isHidden = false;this.layers = [];}}