diff --git a/docs/BACKTEST-NEXTWEEK.md b/docs/BACKTEST-NEXTWEEK.md new file mode 100644 index 0000000..4e1711e --- /dev/null +++ b/docs/BACKTEST-NEXTWEEK.md @@ -0,0 +1,24 @@ +# Backtest: who is added next week + +A 1-week window starting 3 weeks after the latest complete DR week (the live page's lag), 21 forecast weeks from 2026-05-18. Release chance blended in as on the site; channels capped at the any-channel chance. + +- any: 183391 rows, 0.29% added, log loss 0.0153, ROC-AUC 0.912, PR-AUC 0.042 + +| Predicted | Rows | Mean predicted | Happened | +|---|---|---|---| +| 0-5% | 181885 | 0.2% | 0.2% | +| 5-10% | 1121 | 6.9% | 6.9% | +| 10-20% | 337 | 13.0% | 5.6% | +| 20-30% | 39 | 23.4% | 7.7% | +| 30-50% | 9 | 35.7% | 11.1% | + +- ch: 2567474 rows, 0.05% added, log loss 0.0028, ROC-AUC 0.979, PR-AUC 0.045 + +| Predicted | Rows | Mean predicted | Happened | +|---|---|---|---| +| 0-5% | 2563814 | 0.0% | 0.0% | +| 5-10% | 2810 | 6.8% | 6.9% | +| 10-20% | 765 | 12.9% | 8.6% | +| 20-30% | 82 | 22.3% | 15.9% | +| 30-50% | 3 | 39.5% | 33.3% | + diff --git a/src/model/adds.rs b/src/model/adds.rs index 69ebcbf..a29f514 100644 --- a/src/model/adds.rs +++ b/src/model/adds.rs @@ -487,6 +487,8 @@ impl AddModel { /// on windows closed before the last CAL_ORIGINS origins predicts those origins, and a Platt fit /// maps its probabilities to what happened. (The raw fits were overconfident above ~0.4.) pub fn fit(p: &Panel, r: &Rot, h: usize, last_week: usize) -> AddModel { Self::fit_with(p, r, h, last_week, false, W) } + /// The general add model for a window of `win` weeks (the "next week" page uses 1). + pub fn fit_win(p: &Panel, r: &Rot, h: usize, last_week: usize, win: usize) -> AddModel { Self::fit_with(p, r, h, last_week, false, win) } /// The release-event model: "if the artist releases a new song in week t+1, will DR add it /// within 8 weeks?" Trained only on artist-weeks where the artist did release in week t+1, with @@ -1056,3 +1058,78 @@ pub fn backtest_events(p: &Panel, tau: &[u32; C], start: usize, win: usize, md: for (n, b) in ANY_NAMES.iter().chain(REL_NAMES).chain(WAVE_NAMES).chain(LONG_NAMES).chain(NMF_NAMES).chain(SEASON_NAMES).zip(&m.any) { writeln!(md, "| {n} | {b:+.3} |")?; } Ok(rows) } + +/// Bins for the "next week" track record (upper edges). +pub const NEXT_BINS: [f64; 7] = [0.05, 0.1, 0.2, 0.3, 0.5, 0.7, 1.0]; + +/// Walk-forward test of the "next week" forecast: a 1-week window starting h + 1 weeks after the +/// origin (the page's lag between the latest complete DR week and next week), the release chance +/// blended in as on the site, each channel capped at the any-channel chance. Writes calibration bins +/// and scores as (model, h, metric, value) rows for the site's track record. +pub fn backtest_next(db: &crate::db::Db, p: &Panel, tau: &[u32; C], start: usize, h: usize, md: &mut String) -> Result> { + let r = Rot::new(p, tau); + // (origin, raw, outcome); calibrated pairs scored as the site would have shown them. + let (mut pool_any, mut pool_ch): (Vec<(usize, f64, bool)>, Vec<(usize, f64, bool)>) = (Vec::new(), Vec::new()); + let (mut raw_any, mut cal_any, mut cal_ch): (Vec<(f64, bool)>, Vec<(f64, bool)>, Vec<(f64, bool)>) = (Vec::new(), Vec::new(), Vec::new()); + let last = p.w().saturating_sub(h + 3).min(TEST_END.get().map_or(usize::MAX, |e| *e)); + let mut m: Option = None; + let mut origins = 0; + let fit = |pool: &[(usize, f64, bool)], t0: usize| -> Calib { + let pairs: Vec<(f64, bool)> = pool.iter().filter(|(o, _, _)| o + h + 2 <= t0).map(|(_, q, y)| (*q, *y)).collect(); + Calib::isotonic(&pairs) + }; + for t0 in start..=last { + if (t0 - start) % 2 == 0 || m.is_none() { m = Some(AddModel::fit_win(p, &r, h, t0, 1)); } + let mm = m.as_ref().unwrap(); + let (ca, cc) = (fit(&pool_any, t0), fit(&pool_ch, t0)); + for a in 0..p.a() { + if !p.known(a, t0) { continue; } + let (pc1, pa1) = mm.predict(p, &r, a, t0, Scenario::new(true, false), None); + let (pc0, pa0) = mm.predict(p, &r, a, t0, Scenario::new(false, false), None); + let pr = p_release(p, a, t0); + let mix = |x1: f64, x0: f64| match pr { Some(q) => q * x1 + (1.0 - q) * x0, None => x0 }; + let (pa, ya) = (mix(pa1, pa0), r.add_any_in(a, t0, h, 1)); + let pa_c = ca.apply(pa); + raw_any.push((pa, ya)); cal_any.push((pa_c, ya)); pool_any.push((t0, pa, ya)); + for c in 0..C { + let (pc, yc) = (mix(pc1[c], pc0[c]), r.add_in(a, c, t0, h, 1)); + cal_ch.push((cc.apply(pc).min(pa_c), yc)); pool_ch.push((t0, pc, yc)); + } + } + origins += 1; + eprintln!("next-week backtest: origin {} done", p.weeks[t0]); + } + // The maps the daily run applies: isotonic on every forecast in the test. + let all = |pool: &[(usize, f64, bool)]| Calib::isotonic(&pool.iter().map(|(_, q, y)| (*q, *y)).collect::>()); + db.conn.execute_batch("CREATE TABLE IF NOT EXISTS calibration_maps (name TEXT PRIMARY KEY, knots TEXT NOT NULL, made_at TEXT NOT NULL);")?; + for (name, cal) in [("next_any", all(&pool_any)), ("next_ch", all(&pool_ch))] { + if let Calib::Iso(k) = cal { + db.conn.execute("INSERT OR REPLACE INTO calibration_maps VALUES (?1, ?2, ?3)", rusqlite::params![name, serde_json::to_string(&k)?, chrono::Utc::now().to_rfc3339()])?; + } + } + let mut rows = Vec::new(); + writeln!(md, "# Backtest: who is added next week\n")?; + writeln!(md, "A 1-week window starting {} weeks after the latest complete DR week (the live page's lag), {origins} forecast weeks from {}. Release chance blended in as on the site; channels capped at the any-channel chance. \"Calibrated\" = an isotonic map refitted each week on earlier weeks' forecasts only (what the site would have shown); the final map is stored for the daily run.\n", h + 1, p.weeks[start])?; + for (label, v) in [("raw_any", &raw_any), ("any", &cal_any), ("ch", &cal_ch)] { + let n = v.len() as f64; + let rate = v.iter().filter(|x| x.1).count() as f64 / n.max(1.0); + let ll = v.iter().map(|(q, y)| ll(q.clamp(1e-6, 1.0 - 1e-6), *y)).sum::() / n.max(1.0); + let (roc, pr) = (roc_auc(v.clone()), average_precision(v.clone())); + writeln!(md, "- {label}: {} rows, {:.2}% added, log loss {ll:.4}, ROC-AUC {roc:.3}, PR-AUC {pr:.3}", v.len(), 100.0 * rate)?; + for (m, x) in [("rate", rate), ("logloss", ll), ("roc", roc), ("prauc", pr), ("n", n), ("origins", origins as f64)] { rows.push(("next_week".to_string(), h, format!("{label}_{m}"), x)); } + writeln!(md, "\n| Predicted | Rows | Mean predicted | Happened |\n|---|---|---|---|")?; + let mut lo = 0.0; + for (i, hi) in NEXT_BINS.iter().enumerate() { + let b: Vec<&(f64, bool)> = v.iter().filter(|x| x.0 >= lo && x.0 < *hi).collect(); + let k = b.len() as f64; + if k > 0.0 { + let (mp, ob) = (b.iter().map(|x| x.0).sum::() / k, b.iter().filter(|x| x.1).count() as f64 / k); + writeln!(md, "| {:.0}-{:.0}% | {} | {:.1}% | {:.1}% |", 100.0 * lo, 100.0 * hi, b.len(), 100.0 * mp, 100.0 * ob)?; + for (m, x) in [("n", k), ("pred", mp), ("obs", ob)] { rows.push(("next_week".to_string(), h, format!("{label}_bin{i}_{m}"), x)); } + } + lo = *hi; + } + writeln!(md)?; + } + Ok(rows) +} diff --git a/src/model/mod.rs b/src/model/mod.rs index dd84473..04abca7 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -11,6 +11,7 @@ //! airplay model adds [--h 0,4] [--out docs/BACKTEST-ADDS.md] backtest of the new-add model //! airplay model long [--tau 20] [--w 2] [--stay 3] [--out docs/LONG.md] 2019– any-DR model, all years vs 1 year //! airplay model comebacks [--tau 20] [--out docs/COMEBACKS.md] +//! airplay model nextweek [--h 2] the "next week" page's 1-week forecast, walk-forward //! airplay model rank [--h 4] [--max-h 12] [--top 50] pub mod addcheck; @@ -116,6 +117,22 @@ pub fn run(db: &Db, args: &[String]) -> Result<()> { if let Some(out) = arg(args, "--out") { std::fs::write(out, &md)?; } print!("{md}"); } + Some("nextweek") => { + // The "next week" page's forecast, tested walk-forward; scores stored for the site. + let h: usize = arg(args, "--h").and_then(|s| s.parse().ok()).unwrap_or(2); + let tau = common::thresholds(&p, 26); + let start = test_start(&p, args); + let mut md = String::new(); + let rows = adds::backtest_next(db, &p, &tau, start, h, &mut md)?; + rank::create_tables(db)?; + let at = chrono::Utc::now().format("%Y-%m-%dT%H:%M:%SZ").to_string(); + for (m, h, metric, v) in &rows { + db.conn.execute("INSERT OR REPLACE INTO backtest_scores VALUES (?1, ?2, ?3, ?4, ?5)", rusqlite::params![at, m, *h as i64, metric, v])?; + } + let out = arg(args, "--out").unwrap_or_else(|| "docs/BACKTEST-NEXTWEEK.md".into()); + std::fs::write(&out, &md)?; + print!("{md}"); + } Some("leakcheck") => { print!("{}", leakcheck::run(&p)?); } Some("addcheck") => { if let Some(r) = arg(args, "--rule") { let _ = adds::ADD_RULE.set(r); } diff --git a/src/model/rank.rs b/src/model/rank.rs index 31e2fcb..bd9881c 100644 --- a/src/model/rank.rs +++ b/src/model/rank.rs @@ -160,6 +160,43 @@ pub fn run(db: &Db, p: &Panel, max_h: usize, show_h: usize) -> Result> tx.commit()?; eprintln!("rank: adds h={h} stored"); } + // Next week (Monday to Sunday after today): any add in that one week ('add_next' per channel, + // 'add_next_any'), the general model with a 1-week window at the horizon that reaches it. + { + let today = Utc::now().date_naive(); + let next_monday = today + Duration::days(7 - chrono::Datelike::weekday(&today).num_days_from_monday() as i64); + let h_next = ((next_monday - origin).num_days() / 7 - 1).max(0) as usize; + let m = AddModel::fit_win(p, &rot, h_next, t0, 1); + // The isotonic maps from `airplay model nextweek` (the raw 1-week chances were overconfident above ~10%). + let map = |name: &str| -> Option { + let k: String = db.conn.query_row("SELECT knots FROM calibration_maps WHERE name = ?1", [name], |r| r.get(0)).ok()?; + Some(super::calib::Calib::Iso(serde_json::from_str(&k).ok()?)) + }; + let (cal_any, cal_ch) = (map("next_any"), map("next_ch")); + let tx = db.conn.unchecked_transaction()?; + { + let mut ins = tx.prepare("INSERT OR REPLACE INTO forecasts VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11)")?; + for a in 0..p.a() { + let id = &p.artists[a].id; + let (pc1, pa1) = m.predict(p, &rot, a, t0, Scenario::new(true, false), None); + let (pc0, pa0) = m.predict(p, &rot, a, t0, Scenario::new(false, false), None); + let pr = super::adds::p_release(p, a, t0); + let mix = |p1: f64, p0: f64| match pr { Some(r) => r * p1 + (1.0 - r) * p0, None => p0 }; + let none = Option::::None; + let pa = mix(pa1, pa0); + let pa = cal_any.as_ref().map_or(pa, |k| k.apply(pa)); + ins.execute(params![made, VERSION, "add_next_any", format!("{id}:any"), h_next as i64, origin.to_string(), next_monday.to_string(), pa, none, none, none])?; + for c in 0..C { + let pc = mix(pc1[c], pc0[c]); + let pc = cal_ch.as_ref().map_or(pc, |k| k.apply(pc)).min(pa); + if pc < 0.002 { continue; } + ins.execute(params![made, VERSION, "add_next", format!("{id}:{}", CHANNELS[c]), h_next as i64, origin.to_string(), next_monday.to_string(), pc, none, none, none])?; + } + } + } + tx.commit()?; + eprintln!("rank: next week ({next_monday}, h={h_next}) stored"); + } // Where each artist stands in the origin week: prob = 1 if in rotation, mean = plays. let tx = db.conn.unchecked_transaction()?; { diff --git a/src/web.rs b/src/web.rs index 4f4cb47..da24e66 100644 --- a/src/web.rs +++ b/src/web.rs @@ -4,6 +4,7 @@ //! {prefix}/api/meta latest forecast run, horizons, channels, backtest scores //! {prefix}/api/rank?h=4 every artist's forecast for one horizon //! {prefix}/api/artist?id= one artist: profile, 51 weeks of plays per channel, forecasts, chart runs +//! {prefix}/api/nextweek who DR adds next week: 1-week forecast, live plays, track record //! {prefix}/api/whatif?id=&h=&entry=&t40=&air= //! re-run the model for one artist with a changed chart situation //! @@ -181,10 +182,115 @@ fn handle(st: &State, method: &Method, url: &str) -> Result { "/api/bestweek" => bestweek(st, &q), "/api/artist" => artist(st, q.get("id").map(String::as_str).unwrap_or("")), "/api/whatif" => whatif(st, &q), + "/api/nextweek" => nextweek(st), _ => Ok((404, "text/plain", Arc::new("not found".into()))), } } +/// The station group a channel belongs to, as shown on the page. +fn group_label(ch: &str) -> &'static str { + match ch { "p3" => "P3", "p5" => "P5", "p6beat" => "P6", "p8jazz" => "P8", c if c.starts_with("p4") => "P4", _ => "" } +} + +/// "Who DR adds next week": the stored 1-week forecast for next Monday-Sunday ('add_next_any', +/// 'add_next'; channels capped at the any-channel chance), this week's and last week's plays from +/// the play-by-play collector (with the song), rotation thresholds, Christmas flags and the +/// walk-forward track record of exactly this forecast. +fn nextweek(st: &State) -> Result { + use chrono::Datelike; + let c = ro(&st.db_path)?; + let made: Option = c.query_row("SELECT max(made_at) FROM forecasts WHERE model_version = ?1 AND target = 'add_next_any'", [VERSION], |r| r.get(0)).optional()?.flatten(); + let Some(made) = made else { return ok(json!({"ready": false})) }; + let (origin, week, h): (String, String, i64) = c.query_row( + "SELECT origin_week, target_week, horizon FROM forecasts WHERE made_at = ?1 AND target = 'add_next_any' LIMIT 1", [&made], |r| Ok((r.get(0)?, r.get(1)?, r.get(2)?)))?; + let mut names: HashMap = HashMap::new(); + for r in c.prepare("SELECT artist_id, name, json_extract(raw, '$.artist.country') FROM dr_artists")? + .query_map([], |r| Ok((r.get::<_, String>(0)?, r.get::<_, String>(1)?, r.get::<_, Option>(2)?)))? { + let (id, n, country) = r?; + names.insert(id, (n, country.as_deref() == Some("Danmark"))); + } + let mut p_any: HashMap = HashMap::new(); + let mut p_ch: HashMap> = HashMap::new(); + let mut now: HashMap> = HashMap::new(); + for r in c.prepare("SELECT key, target, prob, mean FROM forecasts WHERE made_at = ?1 AND model_version = ?2 AND target IN ('add_next_any', 'add_next', 'now')")? + .query_map(params![made, VERSION], |r| Ok((r.get::<_, String>(0)?, r.get::<_, String>(1)?, r.get::<_, Option>(2)?, r.get::<_, Option>(3)?)))? { + let (key, target, prob, mean) = r?; + let Some((id, ch)) = key.split_once(':') else { continue }; + match target.as_str() { + "add_next_any" => { p_any.insert(id.to_string(), prob.unwrap_or(0.0)); } + "add_next" => { p_ch.entry(id.to_string()).or_default().insert(ch.to_string(), prob.unwrap_or(0.0)); } + _ => { now.entry(id.to_string()).or_default().insert(ch.to_string(), mean.unwrap_or(0.0)); } + } + } + let tau: HashMap = c.prepare("SELECT channel, tau FROM rotation_thresholds")?.query_map([], |r| Ok((r.get::<_, String>(0)?, r.get::<_, f64>(1)?)))?.collect::>()?; + // Live plays: last week and this week so far, per artist and station, and the most played song this week. + let now_t = chrono::Utc::now(); + let today = now_t.date_naive(); + let this_monday = today - chrono::Duration::days(today.weekday().num_days_from_monday() as i64); + let last_monday = this_monday - chrono::Duration::weeks(1); + let elapsed = ((now_t - this_monday.and_hms_opt(0, 0, 0).unwrap().and_utc()).num_minutes() as f64 / (7.0 * 1440.0)).clamp(0.05, 1.0); + let mut live: HashMap> = HashMap::new(); + let mut songs: HashMap> = HashMap::new(); + for r in c.prepare("SELECT artist_ids, station, played_at, title FROM plays WHERE source = 'dr' AND played_at >= ?1")? + .query_map([last_monday.to_string()], |r| Ok((r.get::<_, Option>(0)?, r.get::<_, String>(1)?, r.get::<_, String>(2)?, r.get::<_, String>(3)?)))? { + let (ids, station, at, title) = r?; + let this = at.as_str() >= this_monday.to_string().as_str(); + for id in ids.unwrap_or_default().split(',').filter(|x| !x.is_empty()) { + let e = live.entry(id.to_string()).or_default().entry(station.clone()).or_insert((0, 0)); + if this { e.1 += 1; *songs.entry(id.to_string()).or_default().entry(title.clone()).or_insert(0) += 1; } else { e.0 += 1; } + } + } + let xmas: std::collections::HashSet = st.models.read().unwrap().as_ref() + .map(|m| (0..m.panel.a()).filter(|&a| m.panel.xmas[a]).map(|a| m.panel.artists[a].id.clone()).collect()).unwrap_or_default(); + let christmas_title = |t: &str| { let l = t.to_lowercase(); ["jul", "christmas", "xmas", "navidad", "santa", "sleigh", "mistletoe", "nisse", "snow", "winter wonderland"].iter().any(|k| l.contains(k)) }; + // Expected number of adds next week and a 90% range (sum of independent chances). + let total: f64 = p_any.values().sum(); + let sd = p_any.values().map(|p| p * (1.0 - p)).sum::().sqrt(); + let groups = ["P3", "P4", "P5", "P6", "P8"]; + let artist = |id: &str, pa: f64| -> Value { + let (n, dk) = names.get(id).cloned().unwrap_or_default(); + let chs = p_ch.get(id).cloned().unwrap_or_default(); + let mut by_group = serde_json::Map::new(); + for g in groups { + let best = chs.iter().filter(|(ch, _)| group_label(ch) == g).max_by(|a, b| a.1.total_cmp(b.1)); + if let Some((ch, pc)) = best { + let lv = live.get(id).and_then(|l| l.get(ch)).copied().unwrap_or((0, 0)); + by_group.insert(g.into(), json!({"ch": ch, "p": (pc.min(pa) * 1000.0).round() / 1000.0, "tau": tau.get(ch), "origin_plays": now.get(id).and_then(|n| n.get(ch)), + "last_week": lv.0, "this_week": lv.1, "pace": (lv.1 as f64 / elapsed).round()})); + } + } + let song = songs.get(id).and_then(|s| s.iter().max_by_key(|x| x.1)).map(|(t, k)| json!({"title": t, "plays": k})); + let seasonal = xmas.contains(id) || song.as_ref().and_then(|s| s["title"].as_str()).is_some_and(christmas_title); + json!({"id": id, "name": n, "danish": dk, "p": (pa * 1000.0).round() / 1000.0, "groups": by_group, "song": song, "seasonal": seasonal}) + }; + let mut ranked: Vec<(&String, &f64)> = p_any.iter().collect(); + ranked.sort_by(|a, b| b.1.total_cmp(a.1)); + let list: Vec = ranked.iter().take_while(|(_, p)| **p >= 0.03).take(80).map(|(id, p)| artist(id, **p)).collect(); + // The add board: per station group, the most likely adds (channel chance capped at "any"). + let mut boards = serde_json::Map::new(); + for g in groups { + let mut v: Vec<(f64, &String)> = p_ch.iter().filter_map(|(id, chs)| { + let pa = *p_any.get(id)?; + chs.iter().filter(|(ch, _)| group_label(ch) == g).map(|(_, p)| p.min(pa)).fold(None, |m: Option, x| Some(m.map_or(x, |m| m.max(x)))).map(|p| (p, id)) + }).collect(); + v.sort_by(|a, b| b.0.total_cmp(&a.0)); + boards.insert(g.into(), json!(v.iter().take(6).map(|(p, id)| json!({"id": id, "name": names.get(*id).map(|n| n.0.clone()), "p": (p * 1000.0).round() / 1000.0})).collect::>())); + } + // Track record: the latest walk-forward run of this forecast. + let mut track = serde_json::Map::new(); + let run: Option = c.query_row("SELECT max(run_at) FROM backtest_scores WHERE model = 'next_week'", [], |r| r.get(0)).optional()?.flatten(); + if let Some(run) = &run { + for r in c.prepare("SELECT metric, value FROM backtest_scores WHERE model = 'next_week' AND run_at = ?1")?.query_map([run], |r| Ok((r.get::<_, String>(0)?, r.get::<_, Option>(1)?)))? { + let (m, v) = r?; + track.insert(m, json!(v)); + } + } + let bins: Vec = crate::model::adds::NEXT_BINS.to_vec(); + ok(json!({"ready": true, "made_at": made, "origin_week": origin, "week": week, "horizon": h, "this_monday": this_monday.to_string(), + "elapsed": elapsed, "expected": total, "range": [(total - 1.645 * sd).max(0.0), total + 1.645 * sd], + "list": list, "boards": boards, "track": track, "track_run": run, "bins": bins})) +} + fn meta(st: &State) -> Result { let c = ro(&st.db_path)?; let Some(made) = latest_run(&c)? else { return ok(json!({"ready": false})) }; diff --git a/src/web/index.html b/src/web/index.html index 8d75382..409b9e6 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -100,6 +100,52 @@ svg text { fill: var(--muted); font-size: 11px; } .card p { color: var(--muted); } .prose { max-width: 760px; } .prose li { margin: 6px 0; } +/* next week */ +.nw-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: end; margin-top: 6px; } +.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; } +.nw-hero h2 { margin: 4px 0 6px; font-size: 26px; letter-spacing: -.02em; } +.nw-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } +.nw-kpis .kpi b { font-size: 26px; } +.nw-kpis .kpi small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; } +.nw-h { margin: 26px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } +.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; } +.board .col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); border-top: 4px solid var(--c); } +.board .col h4 { margin: 0 0 8px; font-size: 15px; color: var(--c); } +.board .it { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; } +.board .it:last-child { border-bottom: 0; } +.board .it i { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--c); opacity: .75; } +.board .it b { font-variant-numeric: tabular-nums; } +.nw-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; } +.pill { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; } +.pill.on { background: var(--ink); color: var(--panel); border-color: var(--ink); } +.cand { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; } +.cc { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 10px; } +.cc:hover { border-color: var(--accent); } +.cc .top { display: flex; align-items: flex-start; gap: 10px; } +.cc .nm { font-weight: 700; font-size: 17px; line-height: 1.2; } +.cc .nm small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; } +.cc .big { margin-left: auto; text-align: right; } +.cc .big b { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; } +.cert { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; } +.cert.c0 { background: color-mix(in srgb, var(--good) 22%, var(--panel)); color: var(--good); } +.cert.c1 { background: color-mix(in srgb, var(--good) 12%, var(--panel)); color: var(--good); } +.cert.c2 { background: var(--accent-soft); color: var(--accent); } +.cert.c3, .cert.c4 { background: var(--bg); color: var(--muted); } +.dots { display: flex; align-items: center; gap: 4px; } +.dots span { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--accent); } +.dots span.f { background: var(--accent); } +.dots em { font-style: normal; color: var(--muted); font-size: 13px; margin-left: 8px; } +.chs { display: flex; flex-wrap: wrap; gap: 6px; } +.chs span { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--c) 14%, var(--panel)); color: var(--ink); } +.live { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; } +.live .st { font-weight: 700; } +.meter { position: relative; height: 8px; border-radius: 4px; background: var(--line); margin: 8px 0 4px; overflow: hidden; } +.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--c); } +.meter u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); } +.tag2 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; } +.track { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; } +@media (max-width: 900px) { .nw-hero, .track { grid-template-columns: 1fr; } .board { grid-template-columns: repeat(2, 1fr); } .nw-kpis { grid-template-columns: 1fr 1fr 1fr; } } +@media (max-width: 640px) { .board { grid-template-columns: 1fr; } .nw-kpis { grid-template-columns: 1fr; } .cand { grid-template-columns: 1fr; } } @media (max-width: 640px) { header, main { padding-left: 16px; padding-right: 16px; } input[type=range] { width: 100%; } @@ -116,6 +162,7 @@ svg text { fill: var(--muted); font-size: 11px; }
Loading…
@@ -161,6 +208,7 @@ svg text { fill: var(--muted); font-size: 11px; }

New add = if the artist releases a new song in the chosen week, the chance DR adds it within the chosen number of weeks: the artist enters rotation (at or above the station's weekly play threshold) after at least 4 weeks out, or, for artists who are always on, their plays jump well above their own baseline and stay up (that finds 77% of the songs DR's real lists show as new). Learned from past releases with no other release in the 6 weeks before, so a current song's success isn't counted as a new one's; a release less than 6 weeks after the artist's last one gets no estimate ("too soon"). The new song's NMF Denmark placement is weighed by how often the artist's releases were placed. "In rotation now" lists DR stations where the artist is on the list now, then Bauer stations (grey) with 14+ plays in the last 7 days. Click an artist for history and a what-if, or open Best week for their release calendar.

+