from datetime import datetime from ninja import Schema class PlayerCountOut(Schema): username: str placements: int class PixelCountOut(Schema): x: int y: int placements: int players: int class ColorCountOut(Schema): color_index: int color: str placements: int # How many pixels of the live board currently have this color on_canvas: int class HourCountOut(Schema): hour: datetime placements: int players: int class PlaceStatsOut(Schema): width: int height: int total_placements: int total_players: int first_placement_at: datetime | None last_placement_at: datetime | None # Distinct pixels placed at least once (within the current grid) pixels_touched: int coverage: float # Placements that landed on an already placed pixel overwrites: int avg_placements_per_player: float top_players: list[PlayerCountOut] most_contested_pixels: list[PixelCountOut] colors: list[ColorCountOut] per_hour: list[HourCountOut]