Timeline Generator
Overview
The timeline-generator skill creates professional, interactive timeline visualizations using vis-timeline.js library. It generates complete MicroSim packages with HTML, CSS, JSON data, and documentation suitable for displaying chronological events with rich context including descriptions, notes, and category filtering.
Purpose
This skill automates the creation of interactive timelines for historical events, project schedules, course timelines, or any chronological data visualization with optional category-based filtering capabilities.
Key Features
- Interactive Timelines: Zoom, pan, click events for details
- Category Filtering: Optional filter buttons to view specific event types
- Hover Tooltips: Show contextual notes on event hover
- Event Details Panel: Display full event information on selection
- Color-Coded Categories: Visual distinction for different event types
- Responsive Design: Works on desktop, tablet, and mobile
- TimelineJS Format: Standard JSON data structure
When to Use
Use this skill when users request: - Historical timelines (family histories, organizational milestones, historical periods) - Project timelines (development phases, product roadmaps, release schedules) - Event sequences (course schedules, curriculum timelines, process flows) - Category-based timelines (multi-track timelines with filtering) - Interactive visualizations (hover tooltips, clickable events, zoom/pan navigation)
Common Trigger Phrases
- "Create a timeline showing..."
- "Visualize the history of..."
- "Build an interactive timeline for..."
- "Show chronological events for..."
Workflow Steps
Step 1: Gather Timeline Requirements
Collect information about: - Timeline subject/title and time period covered - Specific events to display with dates - Event data (headline, date, description, category, context notes) - Category filtering preference - Integration context (standalone or embedded)
Step 2: Create Directory Structure
1 2 3 4 | |
Naming: Use kebab-case (e.g., project-history-timeline, course-schedule)
Step 3: Create timeline.json Data File
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Key data structure notes:
- year is required in start_date
- month and day are optional (default to 1)
- display_date is optional for custom formatting
- group is the category used for filtering
- notes provides tooltip/hover text
- All text fields support basic HTML
Step 4: Create main.html with vis-timeline
Generate HTML with: 1. vis-timeline CDN imports (JS and CSS) 2. Styled header with title and subtitle 3. Category filter controls (if requested) 4. Timeline container div 5. Info panel with legend and event details 6. JavaScript implementation
Key vis-timeline configuration:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
Step 5: Create index.md Documentation
Include: - Brief description of timeline - Links to main.html and timeline.json - Overview of content and coverage - Features list (interactive elements, visual design) - Data structure example - Customization guide - Technical details - Use cases
Step 6: Integrate into Navigation (MkDocs)
Add to mkdocs.yml:
1 2 3 | |
Step 7: Test and Validate
- Data validation: Verify JSON, check dates parse correctly
- Visual testing: Open main.html, test with mkdocs serve
- Interactive testing: Zoom, pan, hover, click, filter
- Content review: Proofread text, verify historical accuracy
- Browser compatibility: Test on Chrome, Firefox, Safari, Edge
Timeline Components
Category Filter Implementation
1 2 3 4 5 6 7 8 9 10 11 | |
Event Detail Display
1 2 3 4 5 | |
Features
- Color-coded events: Apply category colors
- Responsive tooltips: Show context notes on hover
- Legend display: Visual guide for category colors
Best Practices
Data Preparation
- Date accuracy: Use precise dates when available
- Chronological order: Sort events in JSON for easier maintenance
- Consistent categories: Use standardized category names
- Rich context: Provide substantive descriptions and notes
- Source validation: Verify historical facts and dates
Category Design
- Limit categories: 3-6 categories works best for filtering
- Meaningful groupings: Categories should reflect natural divisions
- Balanced distribution: Aim for relatively even event distribution
- Clear naming: Use descriptive, non-overlapping category names
- Color accessibility: Choose colors with sufficient contrast
Visual Design
- Color coding: Use distinct, visually appealing colors
- Text readability: Ensure white text on colored backgrounds is clear
- Legend placement: Make the legend visible and understandable
- Responsive sizing: Timeline should work on all screen sizes
- Loading states: Consider showing a loading indicator
Documentation
- Usage examples: Show how to interact with the timeline
- Data format: Clearly document the JSON structure
- Customization: Provide code snippets for common changes
- Attribution: Credit data sources when appropriate
- Educational context: Explain why the timeline matters
Common Variations
Simple Timeline (No Categories)
Omit category filtering UI and use a single color
Vertical Timeline
Change orientation for vertical layout:
1 2 3 | |
Range Events
For events with duration, add an end_date:
1 2 3 4 5 | |
Troubleshooting
Timeline Not Displaying
Solution: Check browser console for errors, verify timeline.json loads, ensure CDN resources accessible
Events Overlapping
Solution: Increase margin.item value or enable stack: true
Zoom Too Fast/Slow
Solution: Adjust zoomMin and zoomMax values based on date range
Filter Buttons Not Working
Solution: Verify category names match exactly, check JavaScript console
Dates Parsing Incorrectly
Solution: Ensure month values are 1-12, not 0-11
Output Structure
Generated timeline package includes:
- main.html: Standalone interactive timeline
- timeline.json: Event data in TimelineJS-compatible format
- index.md: MkDocs integration page with documentation
Technical Details
- Timeline Library: vis-timeline 7.7.3
- Data Format: TimelineJS-compatible JSON
- Browser Compatibility: Modern browsers (Chrome, Firefox, Safari, Edge)
- Dependencies: vis-timeline.js loaded from CDN
Use Cases
- Historical education
- Project planning and tracking
- Course schedules and curricula
- Organizational history
- Personal timelines and biographies
- Event sequences and process flows
Integration with Other Skills
- learning-graph-generator: Visualize concept development over time
- chapter-content-generator: Embed timelines in chapter content
- microsim-p5: Use timelines for static chronology, p5.js for dynamic simulations
- quiz-generator: Create questions about historical sequences
- glossary-generator: Define terms used in event descriptions
CDN Resources
- vis-timeline JS:
https://cdnjs.cloudflare.com/ajax/libs/vis-timeline/7.7.3/vis-timeline-graph2d.min.js - vis-timeline CSS:
https://cdnjs.cloudflare.com/ajax/libs/vis-timeline/7.7.3/vis-timeline-graph2d.min.css
References
- vis-timeline Documentation
- TimelineJS3 Data Format
- vis-timeline GitHub Repository
- Example:
/docs/sims/timeline/for reference implementation