Algorithm-TimelinePacking

 view release on metacpan or  search on metacpan

examples/conference.html  view on Meta::CPAN

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>TinfoilConf 2024 - Timeline Demo</title>
    <script src="https://d3js.org/d3.v7.min.js"></script>
    <style>
        * { box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            margin: 0; padding: 20px; background: #f8f9fa; color: #333;
        }
        h1 { margin-top: 0; color: #2c3e50; }
        .subtitle { color: #666; margin-bottom: 20px; }

examples/generate_demo.pl  view on Meta::CPAN

    my $reduces  = 1 + int(rand(500));

    push @slices, [$start, $end, "job_$i", $user, $maps, $reduces];
}

# Arrange slices using Timeline
my $timeline = Algorithm::TimelinePacking->new(space => 2);
my ($lines, $latest) = $timeline->arrange_slices(\@slices);

# Convert to JSON
my $json = JSON::XS->new->utf8->pretty->encode($lines);
my $width = 1200;

# Generate complete HTML document
print <<"HTML";
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Timeline Demo</title>
    <script src="https://d3js.org/d3.v7.min.js"></script>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            margin: 20px;
            background: #f5f5f5;
        }
        h1 {
            color: #333;

examples/hadoop-jobs.html  view on Meta::CPAN

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Hadoop Jobs Timeline - Demo</title>
    <script src="https://d3js.org/d3.v7.min.js"></script>
    <style>
        * { box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            margin: 0; padding: 20px; background: #f8f9fa; color: #333;
        }
        h1 { margin-top: 0; color: #2c3e50; }
        .subtitle { color: #666; margin-bottom: 20px; }



( run in 0.837 second using v1.01-cache-2.11-cpan-e1769b4cff6 )