import React, { useState } from 'react'; import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell, Timeline, LineChart, Line } from 'recharts'; import { Film, User, Calendar, Award, TrendingUp } from 'lucide-react'; const Dashboard = () => { const [selectedDirector, setSelectedDirector] = useState(null); // Director movie count data const directorData = [ { name: 'Lilly Wachowski', count: 5, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A5#this' }, { name: 'Lana Wachowski', count: 5, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A6#this' }, { name: 'Ron Howard', count: 3, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A115#this' }, { name: 'Rob Reiner', count: 3, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A27#this' }, { name: 'Robert Zemeckis', count: 2, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A151#this' } ]; // Movie details by director const moviesByDirector = { 'Lana Wachowski': [ { title: 'The Matrix', year: 1999, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A0#this' }, { title: 'The Matrix Reloaded', year: 2003, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A9#this' }, { title: 'The Matrix Revolutions', year: 2003, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A10#this' }, { title: 'Speed Racer', year: 2008, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A121#this' }, { title: 'Cloud Atlas', year: 2012, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A105#this' } ], 'Lilly Wachowski': [ { title: 'The Matrix', year: 1999, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A0#this' }, { title: 'The Matrix Reloaded', year: 2003, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A9#this' }, { title: 'The Matrix Revolutions', year: 2003, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A10#this' }, { title: 'Speed Racer', year: 2008, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A121#this' }, { title: 'Cloud Atlas', year: 2012, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A105#this' } ], 'Rob Reiner': [ { title: 'Stand By Me', year: 1986, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A46#this' }, { title: 'A Few Good Men', year: 1992, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A15#this' }, { title: 'When Harry Met Sally', year: 1998, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A81#this' } ], 'Robert Zemeckis': [ { title: 'Cast Away', year: 2000, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A150#this' }, { title: 'The Polar Express', year: 2004, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A161#this' } ], 'Ron Howard': [ { title: 'Apollo 13', year: 1995, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A144#this' }, { title: 'The Da Vinci Code', year: 2006, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A111#this' }, { title: 'Frost/Nixon', year: 2008, uri: 'http://demo.openlinksw.com/neo4j-demo/4%3Ae59af592-6787-42d0-8f70-6a86711b5241%3A137#this' } ] }; // Color palette for charts const colors = ['#8B5CF6', '#06B6D4', '#10B981', '#F59E0B', '#EF4444']; // Helper function to create describe URL const createDescribeUrl = (uri) => { return `https://demo.openlinksw.com/describe?url=${encodeURIComponent(uri)}`; }; // Custom tooltip for bar chart const CustomTooltip = ({ active, payload, label }) => { if (active && payload && payload.length) { return (

{label}

Movies Directed: {payload[0].value}

); } return null; }; return (
{/* Header */}

Most Prolific Directors

Discover the directors with the most films in our Neo4j movie database

{/* Key Metrics */}

5

Top Directors

18

Total Movies

5

Max Films/Director

1986-2012

Year Range

{/* Main Charts Grid */}
{/* Bar Chart */}

Movies Directed

} />
{/* Pie Chart */}

Distribution

`${name}: ${value}`} outerRadius={80} fill="#8884d8" dataKey="count" > {directorData.map((entry, index) => ( ))}
{/* Director Details Table */}

Director Filmographies

{Object.entries(moviesByDirector).slice(0, 4).map(([director, movies]) => { const directorUri = directorData.find(d => d.name === director)?.uri; return (

{director} ({movies.length} films)

{movies.map((movie, idx) => (
{movie.title} {movie.year}
))}
); })}
{/* Summary Stats */}

Key Insights

Wachowski Sisters

Lead with 5 films each (The Matrix trilogy + Speed Racer + Cloud Atlas)

Collaborative Works

The Wachowski sisters co-directed all their films together

Genre Diversity

From sci-fi (Matrix) to drama (Apollo 13) to romance (When Harry Met Sally)

); }; export default Dashboard;