-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The Multimedia Graph Visualization project is designed to simplify the complexities of filter graphs by enabling visualization of data flow within a web application. This project is part of the GPAC project, focusing on creating an intuitive and interactive interface that allows users to understand and manipulate multimedia graphs effectively.
The project aims to provide an interactive and user-friendly interface for visualizing multimedia graphs. By leveraging modern web technologies and responsive design principles, the tool allows users to create, import, and manipulate multimedia graphs to understand data flow more effectively.
To install and run the project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/tancetiner/Multimedia-Graph-Visualization.git cd multimedia-graph-visualization -
Install Dependencies:
npm install
-
Run on local port:
npm run dev # for debugging npm run build # for production
The application is built using React with functional components to ensure maintainability. The visualization aspect leverages the React Flow library, and various third-party layout libraries like ELK and Dagre are used for automatic layout adjustments.
- Graph Import/Export: Users can import graphs from JSON files.
- Custom Node and Edge Styling: Nodes and edges are customizable, with support for gradient coloring and dynamic sizing.
- Multiple Layout Options: Various layout algorithms (ELK, Dagre, etc.) are integrated to provide the best visual representation, both vertical and horizontal layout are possible.
- Sub-flow Grouping: Blocks can be grouped to simplify complex graphs.
- Example Graphs: Pre-loaded example graphs for quick visualization and testing.
The application uses a custom JSON format to define the structure of multimedia graphs. Below is an example to demonstrate the format:
{
"title": "Simple Graph",
"description": "A simple graph with one input, two filters, and one output",
"blocks": [
{
"id": "Input0",
"name": "Input0",
"type": "input",
"outputs": [
{
"targets": ["Filter0", "Filter1"],
"type": "video"
}
]
},
{
"id": "Filter0",
"name": "Filter0",
"type": "filter",
"outputs": [
{
"targets": ["Output0"],
"type": "video"
}
]
},
{
"id": "Filter1",
"name": "Filter1",
"type": "filter",
"outputs": [
{
"targets": ["Output0"],
"type": "audio"
}
]
},
{
"id": "Output0",
"name": "Output0",
"type": "output",
"inputs": ["Filter0", "Filter1"]
}
]
}Each block in the JSON file adheres to the following format, in typescript syntax:
export interface Block {
id: string;
name: string;
outputs: Output[];
type: BlockType;
group?: string;
}
export interface Output {
targets: string[];
type: LinkType;
}
export enum LinkType {
audio = "audio",
video = "video",
text = "text",
file = "file",
}
export enum BlockType {
FILTER = "filter",
INPUT = "input",
OUTPUT = "output",
GROUP = "group",
}A script is provided to generate random graphs based on specified parameters. The script ensures the following constraints:
- Acyclic relationships
- Unique input-output relationships
- Compliance with input/output file constraints
- Valid paths from inputs to outputs
The application integrates several libraries for graph visualization:
- React Flow: Provides the core graph rendering functionality with interactivity.
- Dagre and ELK: Alternative layout libraries offering various configuration options.
- Run the Application:
- Interact with the Interface: • Upload Graph: Import a graph from a JSON file. • Example Graphs: Load example graphs from the predefined set. • Graph Generation: Generate a random graph by specifying the number of inputs, outputs, and blocks. • Layout Options: Switch between different graph layouts and toggle node grouping.