8000 GitHub - mona-actions/gh-stats-visualizer: Visualize GitHub statistics and collaboration patterns.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mona-actions/gh-stats-visualizer

Repository files navigation

GitHub Stats Visualizer

A static web application that visualizes GitHub statistics and collaboration patterns. Try it here

GitHub Stats Analyzer Upload

GitHub Stats Analyzer Dashboard

Features

  • πŸ“Š Interactive dashboard with multiple visualization types
  • πŸ“ˆ Time-based analysis of repository activity
  • πŸ‘₯ Collaboration pattern insights
  • 🎨 Modern, responsive UI
  • ⚑ Fast performance with Vite, React and Typescript

Getting Started

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm run dev
  4. Open http://localhost:5173 in your browser

Adding a New Dashboard Chart

The application is designed to be easily extensible. Here's how to add a new chart component:

  1. Add your chart component to src/components/Dashboard/Components.tsx:

    // Inside src/components/Dashboard/Components.tsx
    
    // Add your chart component
    function NewChart({ data }: ChartProps) {
      return (
        <div className="chart-container">
          {/* Your chart implementation */}
        </div>
      );
    }
    
    // Add it to the DashboardComponents object
    export const DashboardComponents = {
      // ... existing components
      newChart: NewChart,
    };
  2. The chart will automatically be available in the dashboard through the DashboardComponents object.

  3. Style your chart using the shared styles in src/styles.ts

Available Chart Types

The application provides several generic chart components that you can use:

  1. Bar Chart (GenericBarChart)

    interface BarChartProps {
      title: string;
      data: { name: string; value: number }[];
      bars: { dataKey: string; name: string; fill: string }[];
      formatter?: (value: ValueType) => string;
      XAxisProps?: object;
    }
  2. Pie Chart (GenericPieChart)

    interface PieChartProps {
      title: string;
      data: { name: string; value: number }[];
      colors: string[];
      formatter?: (value: ValueType) => string;
    }
  3. Line Chart (GenericLineChart)

    interface LineChartProps {
      title: string;
      data: { name: string; value: number }[];
      lines: { dataKey: string; name: string; stroke: string }[];
      formatter?: (value: ValueType) => string;
    }
  4. Table (GenericTable)

    interface TableProps {
      title: string;
      data: any[];
      columns: { key: string; label: string; render?: (value: any) => ReactNode }[];
      limit?: number;
      fullWidth?: boolean;
    }

Chart Component Guidelines

  • Use TypeScript for type safety
  • Follow the existing chart component patterns
  • Implement responsive design
  • Include loading and error states
  • Add tooltips for data points
  • Use the shared color palette from CHART_COLORS

Project Structure

.
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Charts/             # Chart visualization components
β”‚   β”‚   β”‚   β”œβ”€β”€ Bar.tsx         # Bar chart component
β”‚   β”‚   β”‚   β”œβ”€β”€ Line.tsx        # Line chart component
β”‚   β”‚   β”‚   β”œβ”€β”€ Pie.tsx         # Pie chart component
β”‚   β”‚   β”‚   β”œβ”€β”€ Table.tsx       # Table visualization
β”‚   β”‚   β”‚   β”œβ”€β”€ Utils.tsx       # Shared chart utilities
β”‚   β”‚   β”‚   └── index.ts        # Chart exports
β”‚   β”‚   β”œβ”€β”€ Dashboard/          # Dashboard components
β”‚   β”‚   β”‚   └── Visualization.tsx  # Dashboard layout and components
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx       # Main dashboard container
β”‚   β”‚   β”œβ”€β”€ Footer.tsx          # Application footer
β”‚   β”‚   β”œβ”€β”€ GitHubLogo.tsx      # GitHub logo component
β”‚   β”‚   β”œβ”€β”€ Header.tsx          # Application header
β”‚   β”‚   └── Upload.tsx          # File upload component
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ calculateStats.ts   # Statistics calculation utilities
β”‚   β”‚   β”œβ”€β”€ generateTestData.ts # Test data generation
β”‚   β”‚   └── parseCsv.ts         # CSV parsing utilities
β”‚   β”œβ”€β”€ App.tsx                 # Main application component
β”‚   β”œβ”€β”€ main.tsx               # Application entry point
β”‚   β”œβ”€β”€ styles.ts              # Shared styles
β”‚   └── types.ts               # TypeScript type definitions
β”œβ”€β”€ public/                    # Static assets
β”œβ”€β”€ index.html                # HTML entry point
β”œβ”€β”€ package.json              # Project dependencies
β”œβ”€β”€ tsconfig.json            # TypeScript configuration
└── vite.config.ts           # Vite configuration

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - feel free to use this project for your own purposes.

Credits

Built with ❀️ by the :octocat: Expert Services Team

0