ManaDash logo ManaDash logo ManaDash
  • Home
  • Archetypes
  • Decktypes
  • Players
  • Elo
  • Deck Viewer
  • Cards Stats
  • Card Groups
  • Card Impact
  • Standings
Standings
  • Main Content
viewof draftPick = Inputs.select(draft_labels, {
  label: "Draft",
  value: draft_labels[0]
})

viewof playerPick = Inputs.select(players, {
  label: "Player",
  value: players[0]
})

viewof search = Inputs.text({
  label: "Search",
  placeholder: "Player or draft...",
  submit: false
})
standingsData = transpose(standings)
// Replaces the Dash DataTable's per-column `filter_action`: two exact-match
// selects plus a case-insensitive substring search across both text columns.
standingsRows = {
  const query = (search ?? "").trim().toLowerCase();
  return standingsData.filter(d =>
    (draftPick === "All drafts" || d.season_draft_label === draftPick) &&
    (playerPick === "All players" || d.player === playerPick) &&
    (query === "" ||
      String(d.player).toLowerCase().includes(query) ||
      String(d.season_draft_label).toLowerCase().includes(query))
  );
}
fmt2 = x => (x == null || Number.isNaN(x)) ? "" : d3.format(".2f")(x)

standingCell = x => htl.html`<span style="font-weight: ${x === 1 ? 700 : 400};
  color: ${x === 1 ? "var(--bs-success)" : "inherit"};
  font-variant-numeric: tabular-nums">${x}</span>`
Vintage Cube Standings
standingsRows.length === 0
  ? html`<p class="text-muted">No standings match the current filters.</p>`
  : Inputs.table(standingsRows, {
      columns: [
        "season_draft_label", "player", "match_points", "standing",
        "game_points", "games_played", "MWP", "OMP", "GWP", "OGP"
      ],
      header: {
        season_draft_label: "Draft ID",
        player: "Player",
        match_points: "Match Points",
        standing: "Standing",
        game_points: "Game Points",
        games_played: "Games Played",
        MWP: "Match Win % (MWP)",
        OMP: "Opp Match Win % (OMP)",
        GWP: "Game Win % (GWP)",
        OGP: "Opp Game Win % (OGP)"
      },
      format: {
        standing: standingCell,
        MWP: fmt2,
        OMP: fmt2,
        GWP: fmt2,
        OGP: fmt2
      },
      align: {
        match_points: "right", standing: "right", game_points: "right",
        games_played: "right", MWP: "right", OMP: "right",
        GWP: "right", OGP: "right"
      },
      width: {
        season_draft_label: 130,
        player: 140
      },
      rows: 30,
      layout: "auto"
    })
 

ManaDash — Vintage Cube Analysis