saladday1 commited on
Commit
946b77d
·
verified ·
1 Parent(s): 55c820f

2026-11-17.8: public dashboard data, PE untracked, NSFW rule

Browse files
code/README.md CHANGED
@@ -34,7 +34,7 @@ cache/<family>/enrich.jsonl 每个仓库的证据,按仓库 sha 缓存
34
 
35
  ## 加一个模型家族
36
 
37
- 1. 写 `hfeco/families/<key>.py`,按 `family.py` 的字段填:成员和官方仓库、搜索词、能区分成员的结构指纹(独有的层、config 里的架构名、训练元数据里的字样)、抽查用的张量名。
38
  2. 在 `hfeco/families/__init__.py` 里注册。
39
  3. `python scripts/build_reference.py --family <key>` 生成官方参考数据。
40
  4. `python scripts/daily.py --family <key>` 试跑,用 `eval/` 的方法抽样核对准确率。
 
34
 
35
  ## 加一个模型家族
36
 
37
+ 1. 写 `hfeco/families/<key>.py`,按 `family.py` 的字段填:成员和官方仓库、搜索词、能区分成员的结构指纹(独有的层、config 里的架构名、训练元数据里的字样)、抽查用的张量名。只用来区分、不需要展示的成员(比如 H3 家族的 H3-Image-PE)写 `tracked=False`:照常分类,好把它的衍生品从别的成员里排除,但不上看板、不进 PR 候选。
38
  2. 在 `hfeco/families/__init__.py` 里注册。
39
  3. `python scripts/build_reference.py --family <key>` 生成官方参考数据。
40
  4. `python scripts/daily.py --family <key>` 试跑,用 `eval/` 的方法抽样核对准确率。
code/hfeco/classify.py CHANGED
@@ -16,7 +16,7 @@ import re
16
 
17
  import numpy as np
18
 
19
- VERSION = "2026-11-17.7"
20
  DERIVED = {"adapter", "finetune", "merge", "quantized", "repackage", "mirror", "component"}
21
  HF_RELATIONS = {"adapter", "finetune", "merge", "quantized"}
22
  SAME = 1e-3 # probe distance below this = same weights (bf16 -> fp16 copies land at ~0)
@@ -31,7 +31,7 @@ TUNED_NAME = re.compile(r"finetun|fine-tun|\bft\b|turbo|lightning|distill|\d+[-_
31
  r"lcm|dmd|pdmd|singularity|eros|nsfw|uncensor|heretic|abliterat", re.I)
32
  DISTILL_NAME = re.compile(r"turbo|lightning|distill|\d+[-_ ]?steps?|\bacc\b|lcm|dmd|pdmd|fast", re.I)
33
  NSFW = re.compile(r"nsfw|porn|hentai|nude|nudity|\bsex|dildo|cumshot|\bcum\b|pussy|deepthroat|blowjob|"
34
- r"erotic|\beros\b|xxx|uncensor", re.I)
35
  # Training/merge tools describe merges in prose; quantizers have a bare "merge" field for a compute step.
36
  META_MERGE = re.compile(r"lora[ _-]?merg|merged|graft|merge[ _](of|from|method|ratio|weights)|linear merge|"
37
  r"consensus merge|baked", re.I)
 
16
 
17
  import numpy as np
18
 
19
+ VERSION = "2026-11-17.8"
20
  DERIVED = {"adapter", "finetune", "merge", "quantized", "repackage", "mirror", "component"}
21
  HF_RELATIONS = {"adapter", "finetune", "merge", "quantized"}
22
  SAME = 1e-3 # probe distance below this = same weights (bf16 -> fp16 copies land at ~0)
 
31
  r"lcm|dmd|pdmd|singularity|eros|nsfw|uncensor|heretic|abliterat", re.I)
32
  DISTILL_NAME = re.compile(r"turbo|lightning|distill|\d+[-_ ]?steps?|\bacc\b|lcm|dmd|pdmd|fast", re.I)
33
  NSFW = re.compile(r"nsfw|porn|hentai|nude|nudity|\bsex|dildo|cumshot|\bcum\b|pussy|deepthroat|blowjob|"
34
+ r"erotic|(?:\b|(?<=\d)|(?<=ten)|(?<=_))eros(?![a-z])|xxx|uncensor", re.I) # "10Eros", "TenEros"
35
  # Training/merge tools describe merges in prose; quantizers have a bare "merge" field for a compute step.
36
  META_MERGE = re.compile(r"lora[ _-]?merg|merged|graft|merge[ _](of|from|method|ratio|weights)|linear merge|"
37
  r"consensus merge|baked", re.I)
code/hfeco/families/h3.py CHANGED
@@ -38,7 +38,7 @@ FAMILY = Family(
38
  members=[
39
  Member("H3", "MiniMaxAI/MiniMax-H3", "video", None),
40
  Member("H3-Image", "MiniMaxAI/MiniMax-H3-Image", "image", IMAGE_TEXT),
41
- Member("H3-Image-PE", "MiniMaxAI/MiniMax-H3-Image-PE", "text", PE_TEXT),
42
  ],
43
  default_member="H3",
44
  name_queries=["h3", "hailuo"],
 
38
  members=[
39
  Member("H3", "MiniMaxAI/MiniMax-H3", "video", None),
40
  Member("H3-Image", "MiniMaxAI/MiniMax-H3-Image", "image", IMAGE_TEXT),
41
+ Member("H3-Image-PE", "MiniMaxAI/MiniMax-H3-Image-PE", "text", PE_TEXT, tracked=False),
42
  ],
43
  default_member="H3",
44
  name_queries=["h3", "hailuo"],
code/hfeco/family.py CHANGED
@@ -18,6 +18,8 @@ class Member:
18
  base: str # official repo id
19
  modality: str # video | image | text | audio | ...
20
  text_hint: Optional[re.Pattern] = None # how cards/names refer to this member specifically
 
 
21
 
22
 
23
  @dataclass
@@ -63,6 +65,10 @@ class Family:
63
  def lineages(self):
64
  return [m.lineage for m in self.members]
65
 
 
 
 
 
66
  @property
67
  def bases(self):
68
  return [m.base for m in self.members]
 
18
  base: str # official repo id
19
  modality: str # video | image | text | audio | ...
20
  text_hint: Optional[re.Pattern] = None # how cards/names refer to this member specifically
21
+ tracked: bool = True # False: still classified (so its derivatives are kept out of
22
+ # the others), but not on the dashboard or in PR candidates
23
 
24
 
25
  @dataclass
 
65
  def lineages(self):
66
  return [m.lineage for m in self.members]
67
 
68
+ @property
69
+ def tracked(self):
70
+ return [m for m in self.members if m.tracked]
71
+
72
  @property
73
  def bases(self):
74
  return [m.base for m in self.members]
code/hfeco/metrics.py CHANGED
@@ -29,91 +29,90 @@ def daily_downloads(raw):
29
 
30
 
31
  def build(raw, labels, hf_tree_counts, fam):
 
 
 
 
32
  days = sorted(raw.day.unique())
33
  today = days[-1]
34
  lab = pd.DataFrame(labels)
35
  cur = raw[raw.day == today].merge(lab, on=["kind", "repo_id"], how="left")
36
  dd = daily_downloads(raw)
 
 
37
  famdf = cur[cur.family.fillna(False).astype(bool)]
38
 
39
- out = {"generated_at": dt.datetime.now(dt.timezone.utc).isoformat(timespec="seconds"),
40
- "snapshot_days": days, "today": today,
41
- "classifier_version": lab.classifier_version.iloc[0] if len(lab) else None,
42
  "family": {"key": fam.key, "title": fam.title,
43
- "members": [{"lineage": m.lineage, "base": m.base, "modality": m.modality}
44
- for m in fam.members]},
45
- "rel_order": REL_ORDER, "lineages": {}}
46
- lob = fam.lineage_of_base()
47
- for lin in fam.lineages:
48
  base = fam.base_of(lin)
49
- sub = famdf[(famdf.lineage == lin)]
50
- models = sub[(sub.kind == "model") & sub.relation.isin(REL_ORDER)]
51
- spaces = sub[sub.kind == "space"]
52
- datasets = sub[sub.kind == "dataset"]
53
- tools = sub[(sub.kind == "model") & sub.relation.isin(["tool", "no-weights"])]
54
- off = cur[cur.repo_id == base]
55
- # daily series by relation
56
- d = dd[dd.kind == "model"].merge(models[["repo_id", "relation"]], on="repo_id")
57
- daily = (d.dropna(subset=["daily"]).groupby(["day", "relation"]).daily.sum()
58
- .round().astype(int).reset_index())
59
- off_daily = dd[(dd.kind == "model") & (dd.repo_id == base)].dropna(subset=["daily"])
60
- # growth by creation date (real history)
61
- cr = models.assign(month=models.created_at.str[:10]).groupby(["month", "relation"]).size()
62
- growth = [{"date": k[0], "relation": k[1], "n": int(v)} for k, v in cr.items()]
63
- by_rel = {}
64
- is_copy = models["flags"].apply(lambda f: "copy" in (f if isinstance(f, list) else []))
65
- for rel in REL_ORDER:
66
- m = models[models.relation == rel]
67
- by_rel[rel] = {"n": int(len(m)), "dl30": int(m.downloads_30d.fillna(0).sum()),
68
- "dlall": int(m.downloads_all_time.fillna(0).sum()),
69
- "copies": int(is_copy[models.relation == rel].sum())}
70
- decl = models.declared_status.value_counts().to_dict()
71
  out["lineages"][lin] = {
72
  "base": base,
73
- "official": {"dl30": _i(off.downloads_30d), "dlall": _i(off.downloads_all_time),
74
- "likes": _i(off.likes),
75
- "daily": [{"day": r.day, "n": int(round(r.daily))} for r in off_daily.itertuples()]},
76
  "n_models": int(len(models)),
77
- "n_copies": int(is_copy.sum()),
78
  "dl30": int(models.downloads_30d.fillna(0).sum()),
79
  "dlall": int(models.downloads_all_time.fillna(0).sum()),
80
- "n_spaces": int(len(spaces)), "space_likes": int(spaces.likes.fillna(0).sum()),
81
- "n_datasets": int(len(datasets)), "n_tools": int(len(tools)),
82
- "by_relation": by_rel,
 
83
  "hf_tree": hf_tree_counts.get(base, {}),
84
- "declared": {k: int(v) for k, v in decl.items()},
85
- "confidence": {k: int(v) for k, v in models.confidence.value_counts().items()},
86
- "daily": daily.to_dict("records"),
87
- "growth": growth,
88
  }
89
- out["unknown_family"] = int(((famdf.lineage == "unknown") & (famdf.kind == "model")).sum())
90
-
91
- # Repo table: every family repo plus repos HF counts under a family base but we reject.
92
- rows = []
93
- last = dd[dd.day == today].set_index(["kind", "repo_id"]).daily.to_dict()
94
- hf_base_children = {}
95
- for r in cur.itertuples():
96
- for p in r.hf_parents:
97
- if p.split(":", 1)[1] in lob:
98
- hf_base_children[r.repo_id] = lob[p.split(":", 1)[1]]
99
- keep = cur[cur.family.fillna(False).astype(bool) | cur.repo_id.isin(hf_base_children)]
100
- for r in keep.itertuples():
101
- rows.append({
102
- "id": r.repo_id, "kind": r.kind, "lineage": r.lineage, "relation": r.relation,
103
- "conf": r.confidence, "dl30": _i(r.downloads_30d), "dlall": _i(r.downloads_all_time),
104
- "d1": None if pd.isna(last.get((r.kind, r.repo_id))) else int(round(last.get((r.kind, r.repo_id)))),
105
- "likes": _i(r.likes), "created": (r.created_at or "")[:10],
106
- "declared": r.declared_status if isinstance(r.declared_status, str) else None,
107
- "hf_under": hf_base_children.get(r.repo_id),
108
- "proposed": r.proposed_base_model if isinstance(r.proposed_base_model, str) else None,
109
- "copy_of": r.copy_of if isinstance(r.copy_of, str) else None,
110
- "flags": list(r.flags) if isinstance(r.flags, list) else [],
111
- "evidence": list(r.evidence) if isinstance(r.evidence, list) else [],
112
- })
113
- out["repos"] = rows
114
  return out
115
 
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  def hf_tree_counts(raw_today, fam):
118
  """What the Hub's Model tree shows: direct children per relation tag."""
119
  out = {b: {k: 0 for k in HF_ORDER} for b in fam.bases}
 
29
 
30
 
31
  def build(raw, labels, hf_tree_counts, fam):
32
+ """The dashboard's data file. The Space may become public, so this is a whitelist of
33
+ what the page renders: no evidence, confidence, declaration status or flags, and no
34
+ names of NSFW repos (they still count in the totals). Internal detail stays in the
35
+ labels parquet in the private dataset."""
36
  days = sorted(raw.day.unique())
37
  today = days[-1]
38
  lab = pd.DataFrame(labels)
39
  cur = raw[raw.day == today].merge(lab, on=["kind", "repo_id"], how="left")
40
  dd = daily_downloads(raw)
41
+ dd = dd[dd.kind == "model"]
42
+ last = dd[dd.day == today].set_index("repo_id").daily.to_dict()
43
  famdf = cur[cur.family.fillna(False).astype(bool)]
44
 
45
+ out = {"today": today, "snapshot_days": days,
 
 
46
  "family": {"key": fam.key, "title": fam.title,
47
+ "members": [{"lineage": m.lineage, "base": m.base} for m in fam.tracked]},
48
+ "rel_order": REL_ORDER, "lineages": {}, "repos": []}
49
+ for lin in [m.lineage for m in fam.tracked]:
 
 
50
  base = fam.base_of(lin)
51
+ models = famdf[(famdf.lineage == lin) & (famdf.kind == "model") & famdf.relation.isin(REL_ORDER)
52
+ & (famdf.repo_id != base)]
53
+ off = cur[(cur.kind == "model") & (cur.repo_id == base)]
54
+ d = dd.merge(models[["repo_id"]], on="repo_id").dropna(subset=["daily"])
55
+ daily = d.groupby("day").daily.sum().round().astype(int)
56
+ growth = models.created_at.str[:10].value_counts().sort_index()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  out["lineages"][lin] = {
58
  "base": base,
59
+ "official": {"dl30": _i(off.downloads_30d), "dlall": _i(off.downloads_all_time)},
 
 
60
  "n_models": int(len(models)),
 
61
  "dl30": int(models.downloads_30d.fillna(0).sum()),
62
  "dlall": int(models.downloads_all_time.fillna(0).sum()),
63
+ "by_relation": {rel: {"n": int((models.relation == rel).sum()),
64
+ "dl30": int(models[models.relation == rel].downloads_30d.fillna(0).sum()),
65
+ "dlall": int(models[models.relation == rel].downloads_all_time.fillna(0).sum())}
66
+ for rel in REL_ORDER},
67
  "hf_tree": hf_tree_counts.get(base, {}),
68
+ "daily": [{"day": k, "n": int(v)} for k, v in daily.items()],
69
+ "growth": [{"date": k, "n": int(v)} for k, v in growth.items()],
 
 
70
  }
71
+ up = tree_parents(models, base)
72
+ nsfw = set(models[models["flags"].apply(lambda f: "nsfw" in (f if isinstance(f, list) else []))].repo_id)
73
+ for r in models[~models.repo_id.isin(nsfw)].itertuples():
74
+ p = up[r.repo_id]
75
+ while p in nsfw: # hidden repos keep their place in the totals, not in the tree
76
+ p = up[p]
77
+ v = last.get(r.repo_id)
78
+ out["repos"].append({"id": r.repo_id, "lin": lin, "rel": r.relation, "up": p,
79
+ "dl30": _i(r.downloads_30d), "dlall": _i(r.downloads_all_time),
80
+ "d1": None if v is None or pd.isna(v) else int(round(v))})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  return out
82
 
83
 
84
+ def tree_parents(models, base):
85
+ """Parent of every derived model, for the tree.
86
+
87
+ 1. a declared base_model that is itself a derived model of the same member
88
+ 2. the official base, if the author declared it
89
+ 3. the community repo this one is a byte-identical copy of
90
+ 4. otherwise the official base (what the weights say it is built on)
91
+ """
92
+ ids = set(models.repo_id)
93
+ up = {}
94
+ for r in models.itertuples():
95
+ decl = list(r.card_base_model or [])
96
+ fam_decl = [p for p in decl if p in ids and p != r.repo_id]
97
+ if fam_decl:
98
+ up[r.repo_id] = fam_decl[0]
99
+ elif base in decl:
100
+ up[r.repo_id] = base
101
+ elif isinstance(r.copy_of, str) and r.copy_of in ids and r.copy_of != r.repo_id:
102
+ up[r.repo_id] = r.copy_of
103
+ else:
104
+ up[r.repo_id] = base
105
+ for x in ids: # break cycles (A declares B, B declares A)
106
+ seen, p = {x}, up[x]
107
+ while p != base:
108
+ if p in seen:
109
+ up[x] = base
110
+ break
111
+ seen.add(p)
112
+ p = up[p]
113
+ return up
114
+
115
+
116
  def hf_tree_counts(raw_today, fam):
117
  """What the Hub's Model tree shows: direct children per relation tag."""
118
  out = {b: {k: 0 for k in HF_ORDER} for b in fam.bases}
code/octo-hf/README.md CHANGED
@@ -32,7 +32,7 @@ Repo 主表每行一个仓库,去重键沿用 `repo_url + reason`:
32
  - `hf-base-model-relation` 默认不提(`--include-relation` 打开):关系是作者自己选的,我们在这类上也更容易错
33
  - 每天最多 20 个(`--limit`),按近 30 天下载从高到低
34
 
35
- 2026-11-17 的数据按这些条件有 58 个候选,都是"没写 base_model"。
36
 
37
  ## PR 内容
38
 
 
32
  - `hf-base-model-relation` 默认不提(`--include-relation` 打开):关系是作者自己选的,我们在这类上也更容易错
33
  - 每天最多 20 个(`--limit`),按近 30 天下载从高到低
34
 
35
+ 只给看板上展示的成员(`tracked=True`)提。2026-11-17 的数据按这些条件有 56 个候选,都是"没写 base_model"。
36
 
37
  ## PR 内容
38
 
code/octo-hf/hf_basemodel.py CHANGED
@@ -49,7 +49,8 @@ def candidates(fam, min_downloads, limit, include_relation=False):
49
  df = lab.merge(raw, on="repo_id")
50
  df["flags"] = df["flags"].apply(json.loads)
51
  df["evidence"] = df.evidence.apply(json.loads)
52
- keep = df[(df.kind == "model") & df.declared_status.isin(list(REASON)) & (df.confidence == "high")
 
53
  & ~df["flags"].apply(lambda f: "nsfw" in f or "copy" in f) & (df.downloads_all_time.fillna(0) >= min_downloads)
54
  & (df.gated == "False")]
55
  if not include_relation:
 
49
  df = lab.merge(raw, on="repo_id")
50
  df["flags"] = df["flags"].apply(json.loads)
51
  df["evidence"] = df.evidence.apply(json.loads)
52
+ keep = df[(df.kind == "model") & df.lineage.isin([m.lineage for m in fam.tracked])
53
+ & df.declared_status.isin(list(REASON)) & (df.confidence == "high")
54
  & ~df["flags"].apply(lambda f: "nsfw" in f or "copy" in f) & (df.downloads_all_time.fillna(0) >= min_downloads)
55
  & (df.gated == "False")]
56
  if not include_relation:
code/space/index.html CHANGED
@@ -11,85 +11,81 @@
11
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
12
  --grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,0.10); --wash: #f0efec;
13
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
14
- --good: #006300; --warn-bg: #fff4dc; --accent: #2a78d6;
15
  }
16
  @media (prefers-color-scheme: dark) {
17
  :root:not([data-theme="light"]) {
18
  color-scheme: dark;
19
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
20
- --grid: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,0.10); --wash: #262624;
21
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
22
- --good: #0ca30c; --warn-bg: #2e2614; --accent: #3987e5;
23
  }
24
  }
25
  :root[data-theme="dark"] {
26
  color-scheme: dark;
27
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
28
- --grid: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,0.10); --wash: #262624;
29
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
30
- --good: #0ca30c; --warn-bg: #2e2614; --accent: #3987e5;
31
  }
32
  * { box-sizing: border-box; }
33
  body { margin: 0; background: var(--page); color: var(--ink);
34
- font: 15px/1.55 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
35
- .wrap { max-width: 1240px; margin: 0 auto; padding: 28px 16px 64px; }
36
- @media (max-width: 600px) { .tile .value { font-size: 26px; } .tile.hero .value { font-size: 40px; } .card { padding: 16px 14px; } }
37
- header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
38
- h1 { font-size: 26px; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
39
- .sub { color: var(--ink2); font-size: 14px; }
40
- .seg { display: inline-flex; background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 3px; }
41
- .seg button { border: 0; background: transparent; color: var(--ink2); font: inherit; font-size: 15px; padding: 7px 16px; border-radius: 7px; cursor: pointer; }
42
  .seg button[aria-pressed="true"] { background: var(--wash); color: var(--ink); font-weight: 600; }
43
  .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
44
- .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
45
- .tile { background: var(--surface); border: 1px solid var(--ring); border-radius: 12px; padding: 16px 18px; }
46
- .tile .label { color: var(--ink2); font-size: 14px; }
47
- .tile .value { font-size: 30px; font-weight: 650; margin: 2px 0; }
48
- .tile .note { color: var(--muted); font-size: 13.5px; }
49
- .tile.hero .value { font-size: 48px; line-height: 1.1; }
50
- .card { background: var(--surface); border: 1px solid var(--ring); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
51
- .card h2 { font-size: 17px; margin: 0 0 2px; font-weight: 620; }
52
- .card .desc { color: var(--ink2); font-size: 14px; margin: 0 0 12px; }
53
  .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
54
- .row2 > *, .tiles > *, .card { min-width: 0; }
55
- .seg { flex-wrap: wrap; }
56
  @media (max-width: 900px) { .row2 { grid-template-columns: 1fr; } }
57
- .chart { width: 100%; height: 300px; }
58
- .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 6px; font-size: 13.5px; color: var(--ink2); }
59
- .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
60
- .empty { height: 300px; display: grid; place-items: center; color: var(--ink2); text-align: center; background: var(--wash); border-radius: 10px; font-size: 14.5px; padding: 0 20px; }
61
- table { width: 100%; border-collapse: collapse; font-size: 14px; }
62
- th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
 
 
 
 
 
 
 
 
 
 
 
 
63
  th { color: var(--ink2); font-weight: 560; white-space: nowrap; }
64
  th.sortable { cursor: pointer; user-select: none; }
65
  th.sortable:hover { color: var(--ink); }
66
  td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
67
- tr.total td { font-weight: 620; border-bottom: 0; }
68
- .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
69
  .tablewrap { overflow-x: auto; }
70
  a { color: var(--accent); text-decoration: none; }
71
  a:hover { text-decoration: underline; }
72
- .repo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; word-break: break-all; }
73
- .chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--wash); color: var(--ink2); font-size: 13px; white-space: nowrap; }
74
- .chip.warn { background: var(--warn-bg); color: var(--ink); }
75
- .filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
76
- #famSel, .filters input[type=search], .filters select { font: inherit; font-size: 14px; color: var(--ink); background: var(--page); border: 1px solid var(--axis); border-radius: 8px; padding: 6px 10px; }
77
- .filters input[type=search] { min-width: 240px; flex: 1; max-width: 380px; }
78
- .filters label { color: var(--ink2); font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
79
- details summary { cursor: pointer; color: var(--ink2); font-size: 13.5px; white-space: nowrap; }
80
- details ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink2); font-size: 13.5px; }
81
- .more { margin-top: 10px; font: inherit; font-size: 14px; background: var(--wash); color: var(--ink); border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
82
- .method p { color: var(--ink2); font-size: 14px; margin: 6px 0; }
83
- .method b { color: var(--ink); font-weight: 600; }
84
  </style>
85
  </head>
86
  <body>
87
  <div class="wrap">
88
  <header>
89
- <div>
90
- <h1 id="title">MiniMax 开源生态</h1>
91
- <div class="sub" id="asof">加载中…</div>
92
- </div>
93
  <div style="display:flex;gap:10px;flex-wrap:wrap;align-items:center">
94
  <select id="famSel" aria-label="选择模型家族" hidden></select>
95
  <div class="seg" role="group" aria-label="选择模型" id="lineageSeg"></div>
@@ -98,78 +94,49 @@ details ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink2); font-size:
98
 
99
  <div class="tiles" id="tiles"></div>
100
 
101
- <div class="row2">
102
- <section class="card">
103
- <h2>衍生模型每日下载</h2>
104
- <p class="desc">两次快照之间的下载增量,按关系类型堆叠。</p>
105
- <div class="legend" data-legend></div>
106
- <div id="dailyChart" class="chart"></div>
107
- </section>
108
- <section class="card">
109
- <h2>每周新增衍生模型</h2>
110
- <p class="desc">按仓库创建日期统计,可以看到发布以来的完整历史。</p>
111
- <div class="legend" data-legend></div>
112
- <div id="growthChart" class="chart"></div>
113
- </section>
114
- </div>
115
 
116
  <section class="card">
117
  <h2>按关系类型</h2>
118
- <p class="desc">我们按权重内容识别的数字,和 HF Model tree 按声明显示的数字并排。HF 只有前四种关系,重打包、官方权重转存和配套组件在 HF 上会被算成 finetune 或者不显示。"整仓复制"指整个仓库的权重和别人更早的仓库逐字节相同,按内容照常归类,单独列出数量。</p>
119
  <div class="tablewrap"><table id="relTable"></table></div>
120
  </section>
121
 
122
- <section class="card">
123
- <h2>下载量最高的衍生模型</h2>
124
- <p class="desc" id="concDesc"></p>
125
- <div id="topChart" class="chart" style="height:380px"></div>
126
- </section>
 
 
 
 
 
127
 
128
  <section class="card">
129
- <h2>全部仓库</h2>
130
- <p class="desc">点开"依据"可以看到每个仓库为什么被这样归类。</p>
131
- <div class="filters">
132
- <input type="search" id="q" placeholder="搜索仓库名" aria-label="搜索仓库名">
133
- <select id="fKind" aria-label="类型"><option value="">模型、Space、数据集</option><option value="model">模型</option><option value="space">Space</option><option value="dataset">数据集</option></select>
134
- <select id="fRel" aria-label="关系"><option value="">全部关系</option></select>
135
- <select id="fConf" aria-label="置信度"><option value="">全部置信度</option><option value="high">高</option><option value="medium">中</option><option value="low">低</option></select>
136
- <select id="fDecl" aria-label="base_model 声明"><option value="">全部声明情况</option><option value="ok">声明正确</option><option value="missing">没写 base_model</option><option value="wrong_base">底模写错</option><option value="wrong_relation">关系写错</option></select>
137
- <label><input type="checkbox" id="fCopy"> 隐藏整仓复制</label>
138
- <label><input type="checkbox" id="fUnk"> 只看待确认</label>
139
- <label><input type="checkbox" id="fNsfw"> 显示 NSFW</label>
140
- </div>
141
  <div class="tablewrap"><table id="repoTable"></table></div>
142
  <button class="more" id="moreBtn" hidden>再显示 100 条</button>
143
  </section>
144
-
145
- <section class="card">
146
- <h2 id="exclTitle">HF 算在这个模型下、但其实不是它的仓库</h2>
147
- <p class="desc">这些仓库在 HF Model tree 里挂在当前模型下面,但权重或训练信息显示它们属于别的模型。</p>
148
- <div class="tablewrap"><table id="exclTable"></table></div>
149
- </section>
150
-
151
- <section class="card method">
152
- <h2>口径说明</h2>
153
- <p><b>找仓库:</b>HF Model tree(逐层往下)、仓库名搜索、模型卡全文搜索、家族标签、调用了官方模型的 Space。故意收得宽,再由分类去掉无关的。</p>
154
- <p><b>判断属于哪个模型:</b>先看权重本身(与官方文件哈希相同、完整权重里有没有某个成员独有的层,比如 H3 的音频分支和 H3-Image 的 PDD 头、抽查一层权重的数值与官方比对、LoRA 文件头里写的训练底模),这些能直接定案,置信度为"高"。没有这类证据时再看声明的 base_model、模型卡内容、仓库里有没有视频样例、创建时间(早于某个成员发布的仓库不可能基于它),置信度为"中"。只有名字能参考时为"低"。结构证据互相矛盾或分不清是哪个成员的,放进"待确认",不计入任何模型。</p>
155
- <p><b>衍生模型:</b>LoRA 等适配器、微调、融合、量化、重打包、官方权重转存、配套组件(VAE、文本编码器等)。整仓复制别人社区仓库的,按内容归类并标为"复制"。只是给它用、权重来自别的模型的(比如基于普通 Qwen 的提示词改写模型)算周边工具,不算衍生模型。</p>
156
- <p><b>每日下载:</b>HF 只公开每个仓库的累计下载和近 30 天下载,所以每天存一次快照,用相邻两天的累计下载相减。新出现的仓库第一天不计。</p>
157
- <p id="verNote"></p>
158
- </section>
159
  </div>
160
 
161
  <script>
162
- const REL_NAME = {adapter: "适配器(LoRA 等)", finetune: "微调", quantized: "量化", repackage: "重打包", merge: "融合", mirror: "官方权重转存", component: "配套组件", tool: "周边工具", "no-weights": "工作流/代码", app: "Space 应用", dataset: "数据集", official: "官方"};
163
- const CONF_NAME = {high: "高", medium: "中", low: "低"};
164
- const DECL_NAME = {ok: "正确", missing: "没写", wrong_base: "底模写错", wrong_relation: "关系写错"};
165
- let LIN_NAME = {unknown: "待确认", unrelated: "无关"};
166
  const css = n => getComputedStyle(document.documentElement).getPropertyValue(n).trim();
167
  const fmt = n => n == null ? "–" : n >= 1e6 ? (n / 1e6).toFixed(n >= 1e7 ? 1 : 2).replace(/\.?0+$/, "") + "M" : n >= 1e4 ? (n / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : n.toLocaleString("en-US");
168
  const full = n => n == null ? "–" : n.toLocaleString("en-US");
169
- let D, lineage, charts = {}, shown = 100, sortKey = "dl30", sortDir = -1, inited = false;
 
 
 
170
 
171
- function relColor(rel) { return css("--s" + (D.rel_order.indexOf(rel) + 1)); }
172
- function esc(s) { return String(s).replace(/[&<>"]/g, c => ({"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;"}[c])); }
173
 
174
  fetch("data/index.json").then(r => r.json()).then(idx => {
175
  const sel = document.getElementById("famSel");
@@ -183,198 +150,207 @@ fetch("data/index.json").then(r => r.json()).then(idx => {
183
 
184
  function loadFamily(key) {
185
  fetch(`data/${key}.json`).then(r => r.json()).then(d => {
186
- D = d; shown = 100;
187
- LIN_NAME = {unknown: "待确认", unrelated: "无关"};
188
- for (const m of d.family.members) LIN_NAME[m.lineage] = m.base.split("/")[1];
189
  lineage = d.family.members[0].lineage;
190
  document.title = `${d.family.title}开源生态`;
191
  document.getElementById("title").textContent = `${d.family.title}开源生态`;
192
- document.getElementById("asof").textContent = `数据日期 ${d.today}(UTC) · 已记录 ${d.snapshot_days.length} 天快照 · 每天自动更新`;
193
- document.getElementById("verNote").textContent = `分类规则版本 ${d.classifier_version},生成于 ${d.generated_at.replace("T", " ").replace("+00:00", " UTC")}。`;
194
  const seg = document.getElementById("lineageSeg");
195
  seg.innerHTML = "";
196
  for (const m of d.family.members) {
197
  const b = document.createElement("button");
198
- b.textContent = LIN_NAME[m.lineage]; b.dataset.k = m.lineage; b.setAttribute("aria-pressed", m.lineage === lineage);
199
- b.onclick = () => { lineage = m.lineage; shown = 100; seg.querySelectorAll("button").forEach(x => x.setAttribute("aria-pressed", x.dataset.k === lineage)); render(); };
200
  seg.appendChild(b);
201
  }
202
- const rs = document.getElementById("fRel");
203
- rs.innerHTML = `<option value="">全部关系</option>` + [...d.rel_order, "tool", "no-weights", "app", "dataset"].map(k => `<option value="${k}">${REL_NAME[k]}</option>`).join("");
204
  if (!inited) {
205
  inited = true;
206
- for (const id of ["q", "fKind", "fRel", "fConf", "fDecl", "fNsfw", "fUnk", "fCopy"]) document.getElementById(id).addEventListener("input", () => { shown = 100; renderRepos(); });
207
  document.getElementById("moreBtn").onclick = () => { shown += 100; renderRepos(); };
208
- matchMedia("(prefers-color-scheme: dark)").addEventListener("change", render);
209
- new MutationObserver(render).observe(document.documentElement, {attributes: true, attributeFilter: ["data-theme"]});
210
  addEventListener("resize", () => Object.values(charts).forEach(c => c.resize()));
211
  }
212
  render();
213
  });
214
  }
215
 
216
- function render() { renderTiles(); renderLegends(); renderDaily(); renderGrowth(); renderRel(); renderTop(); renderRepos(); renderExcl(); }
217
-
218
- function L() { return D.lineages[lineage]; }
219
 
220
  function renderTiles() {
221
- const l = L(), hf = Object.values(l.hf_tree).reduce((a, b) => a + b, 0);
222
- const miss = (l.declared.missing || 0) + (l.declared.wrong_base || 0);
223
- // Compare like with like: HF's tree only has these four relations.
224
- const four = ["adapter", "finetune", "quantized", "merge"].reduce((a, r) => a + ((l.by_relation[r] || {}).n || 0), 0);
225
- const tiles = [
226
- {label: "衍生模型", value: full(l.n_models), note: `其中适配器/微调/量化/融合 ${full(four)} 个,HF Model tree 这四类显示 ${full(hf)} 个`, hero: true},
227
- {label: "衍生模型近 30 天下载", value: fmt(l.dl30), note: `官方仓库 ${fmt(l.official.dl30)}`},
228
- {label: "衍生模型累计下载", value: fmt(l.dlall), note: `官方仓库 ${fmt(l.official.dlall)}`},
229
- {label: "用到它的 Space", value: full(l.n_spaces), note: `另有数据集 ${l.n_datasets} 个、周边工具 ${l.n_tools} 个`},
230
- {label: "base_model 没写或写错", value: full(miss), note: `占衍生模型的 ${l.n_models ? Math.round(miss / l.n_models * 100) : 0}%`},
231
- ];
232
- document.getElementById("tiles").innerHTML = tiles.map(t => `<div class="tile${t.hero ? " hero" : ""}"><div class="label">${t.label}</div><div class="value">${t.value}</div><div class="note">${t.note}</div></div>`).join("");
233
  }
234
 
235
- function renderLegends() {
236
- const html = D.rel_order.filter(r => L().by_relation[r].n > 0).map(r => `<span><i style="background:${relColor(r)}"></i>${REL_NAME[r]}</span>`).join("");
237
- document.querySelectorAll("[data-legend]").forEach(el => el.innerHTML = html);
238
- }
239
 
240
- function baseOpts() {
241
- return {
242
- animation: false, textStyle: {fontFamily: "system-ui, -apple-system, 'Segoe UI', 'PingFang SC', sans-serif"},
243
- grid: {left: 8, right: 16, top: 12, bottom: 4, containLabel: true},
244
- tooltip: {trigger: "axis", axisPointer: {type: "line", lineStyle: {color: css("--axis")}},
245
- backgroundColor: css("--surface"), borderColor: css("--ring"), textStyle: {color: css("--ink"), fontSize: 13},
246
- valueFormatter: v => full(v)},
247
- xAxis: {type: "category", axisLine: {lineStyle: {color: css("--axis")}}, axisTick: {show: false}, axisLabel: {color: css("--muted"), fontSize: 12}},
248
- yAxis: {type: "value", splitLine: {lineStyle: {color: css("--grid")}}, axisLabel: {color: css("--muted"), fontSize: 12, formatter: v => fmt(v)}},
249
- };
 
250
  }
251
 
252
- function chart(id) {
253
- const el = document.getElementById(id);
254
- if (charts[id]) { charts[id].dispose(); delete charts[id]; }
255
- return charts[id] = echarts.init(el, null, {renderer: "svg"});
256
  }
257
 
258
- function stacked(id, xs, byRel) {
259
- const rels = D.rel_order.filter(r => byRel[r] && byRel[r].some(v => v));
260
- const o = baseOpts();
261
- o.xAxis.data = xs;
262
- o.series = rels.map((r, i) => ({name: REL_NAME[r], type: "bar", stack: "s", barMaxWidth: 24, data: byRel[r],
263
- itemStyle: {color: relColor(r), borderColor: css("--surface"), borderWidth: 1,
264
- borderRadius: i === rels.length - 1 ? [4, 4, 0, 0] : 0}, emphasis: {disabled: true}}));
265
- chart(id).setOption(o);
266
  }
267
 
268
- function renderDaily() {
269
- const el = document.getElementById("dailyChart"), l = L();
270
- const days = [...new Set(l.daily.map(r => r.day))].sort();
271
- if (days.length === 0) {
272
- if (charts.dailyChart) { charts.dailyChart.dispose(); delete charts.dailyChart; }
273
- el.innerHTML = `<div class="empty">从 ${D.snapshot_days[0]} 开始每天记录快照。<br>每日下载要用相邻两天相减,第二次快照之后这里开始出数。</div>`;
274
- return;
 
 
 
 
 
 
 
 
 
 
275
  }
276
- el.innerHTML = "";
277
- const byRel = {};
278
- for (const r of D.rel_order) byRel[r] = days.map(d => (l.daily.find(x => x.day === d && x.relation === r) || {}).daily || 0);
279
- stacked("dailyChart", days, byRel);
280
- }
281
 
282
- function renderGrowth() {
283
- const l = L();
284
- const wk = s => { const d = new Date(s + "T00:00:00Z"); const k = (d.getUTCDay() + 6) % 7; d.setUTCDate(d.getUTCDate() - k); return d.toISOString().slice(0, 10); };
285
- const weeks = {};
286
- for (const g of l.growth) { const w = wk(g.date); (weeks[w] ||= {})[g.relation] = ((weeks[w] || {})[g.relation] || 0) + g.n; }
287
- const xs = Object.keys(weeks).sort();
288
- if (xs.length) { // fill missing weeks
289
- const all = []; for (let d = new Date(xs[0] + "T00:00:00Z"); d <= new Date(xs.at(-1) + "T00:00:00Z"); d.setUTCDate(d.getUTCDate() + 7)) all.push(d.toISOString().slice(0, 10));
290
- xs.splice(0, xs.length, ...all);
291
  }
292
- const byRel = {};
293
- for (const r of D.rel_order) byRel[r] = xs.map(w => (weeks[w] || {})[r] || 0);
294
- stacked("growthChart", xs.map(x => x.slice(5)), byRel);
295
- }
296
 
297
- function renderRel() {
298
- const l = L(); let tn = 0, t30 = 0, ta = 0, th = 0;
299
- let tc = 0;
300
- let h = `<thead><tr><th>关系</th><th class="num">我们识别</th><th class="num">其中整仓复制</th><th class="num">近 30 天下载</th><th class="num">累计下载</th><th class="num">HF Model tree 显示</th></tr></thead><tbody>`;
301
- for (const r of D.rel_order) {
302
- const b = l.by_relation[r], hf = l.hf_tree[r];
303
- tn += b.n; t30 += b.dl30; ta += b.dlall; th += hf || 0; tc += r === "mirror" ? 0 : (b.copies || 0);
304
- h += `<tr><td><span class="sw" style="background:${relColor(r)}"></span>${REL_NAME[r]}</td><td class="num">${full(b.n)}</td><td class="num">${r === "mirror" ? "—" : full(b.copies)}</td><td class="num">${full(b.dl30)}</td><td class="num">${full(b.dlall)}</td><td class="num">${hf == null ? "—" : full(hf)}</td></tr>`;
 
 
 
 
 
 
 
 
 
305
  }
306
- h += `<tr class="total"><td>合计</td><td class="num">${full(tn)}</td><td class="num">${full(tc)}</td><td class="num">${full(t30)}</td><td class="num">${full(ta)}</td><td class="num">${full(th)}</td></tr></tbody>`;
307
- const unk = D.unknown_family ? `<tr><td colspan="6" style="color:var(--ink2);border:0;padding-top:12px">另有 ${D.unknown_family} 个仓库看得出属于这个家族、但分不清是哪个模型,放在"待确认",没有计入上表。</td></tr>` : "";
308
- document.getElementById("relTable").innerHTML = h + unk;
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  }
310
 
311
- function renderTop() {
312
- const l = L();
313
- const rows = D.repos.filter(r => r.lineage === lineage && r.kind === "model" && D.rel_order.includes(r.relation) && r.dl30)
314
- .sort((a, b) => b.dl30 - a.dl30);
315
- const top = rows.slice(0, 10).reverse();
316
- const share = l.dl30 ? rows.slice(0, 1).reduce((a, r) => a + r.dl30, 0) / l.dl30 : 0;
317
- const share10 = l.dl30 ? rows.slice(0, 10).reduce((a, r) => a + r.dl30, 0) / l.dl30 : 0;
318
- document.getElementById("concDesc").textContent = rows.length
319
- ? `近 30 天下载。第一名占全部衍生模型下载的 ${Math.round(share * 100)}%,前十名占 ${Math.round(share10 * 100)}%,看总量时要注意头部集中。`
320
- : "暂无数据。";
321
- const o = baseOpts();
322
- o.tooltip = {...o.tooltip, trigger: "item", formatter: p => `${esc(p.name)}<br>${REL_NAME[top[p.dataIndex].relation]} · 近 30 天 ${full(p.value)}`};
323
- o.grid = {left: 8, right: 64, top: 4, bottom: 4, containLabel: true};
324
- o.xAxis = {type: "value", show: false};
325
- o.yAxis = {type: "category", data: top.map(r => r.id), axisLine: {show: false}, axisTick: {show: false},
326
- axisLabel: {color: css("--ink2"), fontSize: 12.5, width: Math.min(330, document.getElementById("topChart").clientWidth * 0.42), overflow: "truncate"}};
327
- o.series = [{type: "bar", barMaxWidth: 20, data: top.map(r => ({value: r.dl30, itemStyle: {color: relColor(r.relation), borderRadius: [0, 4, 4, 0]}})),
328
- label: {show: true, position: "right", color: css("--ink2"), fontSize: 12.5, formatter: p => fmt(p.value)}}];
329
- chart("topChart").setOption(o);
330
- }
331
 
332
- function filtered() {
333
- const q = document.getElementById("q").value.trim().toLowerCase();
334
- const k = document.getElementById("fKind").value, rel = document.getElementById("fRel").value;
335
- const conf = document.getElementById("fConf").value, decl = document.getElementById("fDecl").value;
336
- const nsfw = document.getElementById("fNsfw").checked, unk = document.getElementById("fUnk").checked;
337
- const hideCopy = document.getElementById("fCopy").checked;
338
- return D.repos.filter(r => r.relation !== "official" && (unk ? r.lineage === "unknown" : r.lineage === lineage)
339
- && (!q || r.id.toLowerCase().includes(q)) && (!k || r.kind === k) && (!rel || r.relation === rel)
340
- && (!conf || r.conf === conf) && (!decl || r.declared === decl) && (nsfw || !r.flags.includes("nsfw"))
341
- && (!hideCopy || !r.copy_of));
 
342
  }
343
 
344
  function renderRepos() {
345
- const rows = filtered().sort((a, b) => {
 
346
  const x = a[sortKey], y = b[sortKey];
347
  return (x == null) - (y == null) || (x < y ? -1 : x > y ? 1 : 0) * sortDir;
348
  });
349
- const hasDaily = D.snapshot_days.length > 1;
350
- const cols = [["id", "仓库"], ["relation", "关系"], ["conf", "置信度"], ["dl30", "近 30 天", 1], ["dlall", "累计", 1], ...(hasDaily ? [["d1", "最近一天", 1]] : []), ["created", "��建"], ["declared", "base_model"]];
351
- let h = "<thead><tr>" + cols.map(([k, n, num]) => `<th class="sortable${num ? " num" : ""}" data-k="${k}">${n}${sortKey === k ? (sortDir < 0 ? " ↓" : " ↑") : ""}</th>`).join("") + "<th>依据</th></tr></thead><tbody>";
352
  for (const r of rows.slice(0, shown)) {
353
- const url = "https://huggingface.co/" + (r.kind === "space" ? "spaces/" : r.kind === "dataset" ? "datasets/" : "") + r.id;
354
- const dec = r.declared ? `<span class="chip${r.declared === "ok" ? "" : " warn"}">${DECL_NAME[r.declared]}</span>` : "";
355
- const sw = D.rel_order.includes(r.relation) ? `<span class="sw" style="background:${relColor(r.relation)}"></span>` : "";
356
- h += `<tr><td class="repo"><a href="${url}" target="_blank" rel="noopener">${esc(r.id)}</a>${r.copy_of ? ` <span class="chip" title="复制自 ${esc(r.copy_of)}">复制</span>` : ""}${r.flags.includes("nsfw") ? ' <span class="chip">NSFW</span>' : ""}</td>
357
- <td style="white-space:nowrap">${sw}${REL_NAME[r.relation] || "–"}</td><td>${CONF_NAME[r.conf] || "–"}</td>
358
- <td class="num">${full(r.dl30)}</td><td class="num">${full(r.dlall)}</td>${hasDaily ? `<td class="num">${full(r.d1)}</td>` : ""}<td style="white-space:nowrap">${r.created}</td><td>${dec}</td>
359
- <td><details><summary>${r.evidence.length} 条</summary><ul>${r.evidence.map(e => `<li>${esc(e)}</li>`).join("")}</ul></details></td></tr>`;
360
  }
361
- h += "</tbody>";
362
  const t = document.getElementById("repoTable");
363
- t.innerHTML = h;
364
  t.querySelectorAll("th.sortable").forEach(th => th.onclick = () => { const k = th.dataset.k; sortDir = sortKey === k ? -sortDir : -1; sortKey = k; renderRepos(); });
365
- const btn = document.getElementById("moreBtn");
366
- btn.hidden = rows.length <= shown;
367
- btn.textContent = `再显示 100 条(共 ${rows.length} 条)`;
 
 
 
 
 
368
  }
369
 
370
- function renderExcl() {
371
- const rows = D.repos.filter(r => r.hf_under === lineage && r.lineage !== lineage)
372
- .sort((a, b) => (b.dl30 || 0) - (a.dl30 || 0));
373
- document.getElementById("exclTitle").textContent = `HF 算在 ${LIN_NAME[lineage]} 下、但其实不是它的仓库(${rows.length} 个)`;
374
- let h = `<thead><tr><th>仓库</th><th>实际属于</th><th>关系</th><th class="num">近 30 天</th><th>依据</th></tr></thead><tbody>`;
375
- for (const r of rows) h += `<tr><td class="repo"><a href="https://huggingface.co/${r.id}" target="_blank" rel="noopener">${esc(r.id)}</a></td><td>${LIN_NAME[r.lineage] || r.lineage}</td><td>${REL_NAME[r.relation] || "–"}</td><td class="num">${full(r.dl30)}</td><td><details><summary>${r.evidence.length} 条</summary><ul>${r.evidence.map(e => `<li>${esc(e)}</li>`).join("")}</ul></details></td></tr>`;
376
- if (!rows.length) h += `<tr><td colspan="5" style="color:var(--ink2)">没有。</td></tr>`;
377
- document.getElementById("exclTable").innerHTML = h + "</tbody>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  }
379
  </script>
380
  </body>
 
11
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
12
  --grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,0.10); --wash: #f0efec;
13
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
14
+ --accent: #2a78d6; --bar: #6b6a65;
15
  }
16
  @media (prefers-color-scheme: dark) {
17
  :root:not([data-theme="light"]) {
18
  color-scheme: dark;
19
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
20
+ --grid: #2c2c2a; --axis: #45453f; --ring: rgba(255,255,255,0.10); --wash: #262624;
21
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
22
+ --accent: #3987e5; --bar: #a3a29b;
23
  }
24
  }
25
  :root[data-theme="dark"] {
26
  color-scheme: dark;
27
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
28
+ --grid: #2c2c2a; --axis: #45453f; --ring: rgba(255,255,255,0.10); --wash: #262624;
29
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9;
30
+ --accent: #3987e5; --bar: #a3a29b;
31
  }
32
  * { box-sizing: border-box; }
33
  body { margin: 0; background: var(--page); color: var(--ink);
34
+ font: 16px/1.55 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
35
+ .wrap { max-width: 1240px; margin: 0 auto; padding: 32px 16px 72px; }
36
+ header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
37
+ h1 { font-size: 30px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
38
+ .seg { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 3px; }
39
+ .seg button { border: 0; background: transparent; color: var(--ink2); font: inherit; font-size: 16px; padding: 8px 16px; border-radius: 7px; cursor: pointer; }
 
 
40
  .seg button[aria-pressed="true"] { background: var(--wash); color: var(--ink); font-weight: 600; }
41
  .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
42
+ #famSel { font: inherit; color: var(--ink); background: var(--page); border: 1px solid var(--axis); border-radius: 8px; padding: 7px 10px; }
43
+ .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
44
+ .tile { background: var(--surface); border: 1px solid var(--ring); border-radius: 12px; padding: 18px 20px; min-width: 0; }
45
+ .tile .label { color: var(--ink2); font-size: 16px; }
46
+ .tile .value { font-size: 40px; font-weight: 650; line-height: 1.2; margin-top: 4px; }
47
+ .card { background: var(--surface); border: 1px solid var(--ring); border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; min-width: 0; }
48
+ .card h2 { font-size: 20px; margin: 0 0 14px; font-weight: 620; }
 
 
49
  .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
50
+ .row2.one { grid-template-columns: 1fr; }
51
+ .row2 > * { min-width: 0; }
52
  @media (max-width: 900px) { .row2 { grid-template-columns: 1fr; } }
53
+ @media (max-width: 600px) { .tile .value { font-size: 32px; } .card { padding: 16px 14px; } h1 { font-size: 24px; } }
54
+ .chart { width: 100%; height: 320px; }
55
+ .legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 12px; font-size: 15px; color: var(--ink2); }
56
+ .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
57
+ .treewrap { overflow-x: auto; }
58
+ .tree { display: block; font: 15px system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
59
+ .tree .link { fill: none; stroke: var(--axis); stroke-width: 1.5; }
60
+ .tree text { fill: var(--ink); dominant-baseline: central; }
61
+ .tree .num { fill: var(--ink2); }
62
+ .tree .root { font-size: 16px; font-weight: 650; }
63
+ .tree a:hover .nm { fill: var(--accent); text-decoration: underline; }
64
+ .tree .fold { cursor: pointer; }
65
+ .tree .fold text { fill: var(--accent); }
66
+ .tree .fold:hover text { text-decoration: underline; }
67
+ .tree .fold circle { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
68
+ .tree .fold:focus-visible { outline: 2px solid var(--accent); }
69
+ table { width: 100%; border-collapse: collapse; font-size: 15px; }
70
+ th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--grid); }
71
  th { color: var(--ink2); font-weight: 560; white-space: nowrap; }
72
  th.sortable { cursor: pointer; user-select: none; }
73
  th.sortable:hover { color: var(--ink); }
74
  td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
75
+ tr.sum td { font-weight: 620; }
76
+ tr.sum + tr td { padding-top: 14px; }
77
  .tablewrap { overflow-x: auto; }
78
  a { color: var(--accent); text-decoration: none; }
79
  a:hover { text-decoration: underline; }
80
+ td.repo { word-break: break-all; }
81
+ #q { font: inherit; font-size: 15px; color: var(--ink); background: var(--page); border: 1px solid var(--axis); border-radius: 8px; padding: 8px 12px; width: 100%; max-width: 420px; margin-bottom: 12px; }
82
+ .more { margin-top: 12px; font: inherit; font-size: 15px; background: var(--wash); color: var(--ink); border: 0; border-radius: 8px; padding: 8px 16px; cursor: pointer; }
 
 
 
 
 
 
 
 
 
83
  </style>
84
  </head>
85
  <body>
86
  <div class="wrap">
87
  <header>
88
+ <h1 id="title">MiniMax 开源生态</h1>
 
 
 
89
  <div style="display:flex;gap:10px;flex-wrap:wrap;align-items:center">
90
  <select id="famSel" aria-label="选择模型家族" hidden></select>
91
  <div class="seg" role="group" aria-label="选择模型" id="lineageSeg"></div>
 
94
 
95
  <div class="tiles" id="tiles"></div>
96
 
97
+ <section class="card">
98
+ <h2>Model tree(数字为累计下载)</h2>
99
+ <div class="legend" id="treeLegend"></div>
100
+ <div class="treewrap"><svg class="tree" id="tree" role="group" aria-label="衍生关系树"></svg></div>
101
+ </section>
 
 
 
 
 
 
 
 
 
102
 
103
  <section class="card">
104
  <h2>按关系类型</h2>
 
105
  <div class="tablewrap"><table id="relTable"></table></div>
106
  </section>
107
 
108
+ <div class="row2" id="chartRow">
109
+ <section class="card">
110
+ <h2>每周新增衍生模型</h2>
111
+ <div id="growthChart" class="chart"></div>
112
+ </section>
113
+ <section class="card" id="dailyCard" hidden>
114
+ <h2>衍生模型每日下载</h2>
115
+ <div id="dailyChart" class="chart"></div>
116
+ </section>
117
+ </div>
118
 
119
  <section class="card">
120
+ <h2>全部衍生模型</h2>
121
+ <input type="search" id="q" placeholder="搜索模型名" aria-label="搜索模型名">
 
 
 
 
 
 
 
 
 
 
122
  <div class="tablewrap"><table id="repoTable"></table></div>
123
  <button class="more" id="moreBtn" hidden>再显示 100 条</button>
124
  </section>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  </div>
126
 
127
  <script>
128
+ const REL_NAME = {adapter: "适配器(LoRA 等)", finetune: "微调", quantized: "量化", repackage: "重打包", merge: "融合", mirror: "官方权重转存", component: "配套组件"};
129
+ const HF_RELS = ["adapter", "finetune", "quantized", "merge"]; // the four kinds HF's Model tree has
 
 
130
  const css = n => getComputedStyle(document.documentElement).getPropertyValue(n).trim();
131
  const fmt = n => n == null ? "–" : n >= 1e6 ? (n / 1e6).toFixed(n >= 1e7 ? 1 : 2).replace(/\.?0+$/, "") + "M" : n >= 1e4 ? (n / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : n.toLocaleString("en-US");
132
  const full = n => n == null ? "–" : n.toLocaleString("en-US");
133
+ const esc = s => String(s).replace(/[&<>"]/g, c => ({"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;"}[c]));
134
+ const FONT = 'system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif';
135
+ let D, lineage, charts = {}, shown = 100, sortKey = "dlall", sortDir = -1, inited = false;
136
+ let open = {}, trees = {};
137
 
138
+ const relColor = rel => rel === "official" ? "var(--ink)" : `var(--s${D.rel_order.indexOf(rel) + 1})`;
139
+ const L = () => D.lineages[lineage];
140
 
141
  fetch("data/index.json").then(r => r.json()).then(idx => {
142
  const sel = document.getElementById("famSel");
 
150
 
151
  function loadFamily(key) {
152
  fetch(`data/${key}.json`).then(r => r.json()).then(d => {
153
+ D = d; shown = 100; open = {}; trees = {};
 
 
154
  lineage = d.family.members[0].lineage;
155
  document.title = `${d.family.title}开源生态`;
156
  document.getElementById("title").textContent = `${d.family.title}开源生态`;
 
 
157
  const seg = document.getElementById("lineageSeg");
158
  seg.innerHTML = "";
159
  for (const m of d.family.members) {
160
  const b = document.createElement("button");
161
+ b.textContent = m.base.split("/")[1]; b.dataset.k = m.lineage; b.setAttribute("aria-pressed", m.lineage === lineage);
162
+ b.onclick = () => { lineage = m.lineage; shown = 100; open = {}; seg.querySelectorAll("button").forEach(x => x.setAttribute("aria-pressed", x.dataset.k === lineage)); render(); };
163
  seg.appendChild(b);
164
  }
 
 
165
  if (!inited) {
166
  inited = true;
167
+ document.getElementById("q").addEventListener("input", () => { shown = 100; renderRepos(); });
168
  document.getElementById("moreBtn").onclick = () => { shown += 100; renderRepos(); };
169
+ matchMedia("(prefers-color-scheme: dark)").addEventListener("change", renderCharts);
170
+ new MutationObserver(renderCharts).observe(document.documentElement, {attributes: true, attributeFilter: ["data-theme"]});
171
  addEventListener("resize", () => Object.values(charts).forEach(c => c.resize()));
172
  }
173
  render();
174
  });
175
  }
176
 
177
+ function render() { renderTiles(); renderTree(); renderRel(); renderCharts(); renderRepos(); }
178
+ function renderCharts() { renderGrowth(); renderDaily(); }
 
179
 
180
  function renderTiles() {
181
+ const l = L();
182
+ const tiles = [["衍生模型", full(l.n_models)], ["衍生模型近 30 天下载", fmt(l.dl30)], ["衍生模型累计下载", fmt(l.dlall)]];
183
+ document.getElementById("tiles").innerHTML = tiles.map(([k, v]) => `<div class="tile"><div class="label">${k}</div><div class="value">${v}</div></div>`).join("");
 
 
 
 
 
 
 
 
 
184
  }
185
 
186
+ /* ---------- Model tree ---------- */
 
 
 
187
 
188
+ function tree() {
189
+ if (trees[lineage]) return trees[lineage];
190
+ const l = L(), node = new Map();
191
+ node.set(l.base, {id: l.base, rel: "official", dlall: l.official.dlall || 0, kids: []});
192
+ const rows = D.repos.filter(r => r.lin === lineage);
193
+ for (const r of rows) node.set(r.id, {id: r.id, rel: r.rel, dlall: r.dlall || 0, kids: []});
194
+ for (const r of rows) (node.get(r.up) || node.get(l.base)).kids.push(node.get(r.id));
195
+ const sub = n => n.sub ??= n.dlall + n.kids.reduce((a, k) => a + sub(k), 0);
196
+ sub(node.get(l.base));
197
+ for (const n of node.values()) n.kids.sort((a, b) => b.sub - a.sub || a.id.localeCompare(b.id));
198
+ return trees[lineage] = node.get(l.base);
199
  }
200
 
201
+ // How many children a node shows: the root its top 12, others their top 4 that have downloads.
202
+ function nShown(n, depth) {
203
+ if (open[n.id] != null) return open[n.id];
204
+ return Math.min(depth === 0 ? 12 : 4, n.kids.filter(c => c.sub > 0).length);
205
  }
206
 
207
+ const ROW = 38, RMAX = 13, PAD_LABEL = 10, NUM_DX = 10;
208
+ const indent = () => innerWidth < 600 ? 28 : 46;
209
+ let measureCtx;
210
+ function textW(s, font) {
211
+ measureCtx ||= document.createElement("canvas").getContext("2d");
212
+ measureCtx.font = font;
213
+ return measureCtx.measureText(s).width;
 
214
  }
215
 
216
+ function renderTree() {
217
+ const root = tree(), items = [];
218
+ let row = 0;
219
+ const maxDl = Math.max(1, root.dlall, ...root.kids.map(k => k.dlall), ...D.repos.filter(r => r.lin === lineage).map(r => r.dlall || 0));
220
+ const rad = dl => 3.5 + (RMAX - 3.5) * Math.sqrt((dl || 0) / maxDl);
221
+ // One row per node, children below their parent and indented one step: full names fit at
222
+ // any depth and on a phone, and every link is a short elbow from parent to child.
223
+ function walk(n, d) {
224
+ const k = nShown(n, d), rest = n.kids.slice(k);
225
+ const it = {n, d, kids: [], y: row++};
226
+ items.push(it);
227
+ for (const c of n.kids.slice(0, k)) it.kids.push(walk(c, d + 1));
228
+ if (rest.length) {
229
+ const f = {fold: true, n, d: d + 1, label: `其余 ${full(rest.length)} 个 · ${fmt(rest.reduce((a, c) => a + c.sub, 0))}`, kids: [], y: row++};
230
+ items.push(f); it.kids.push(f);
231
+ }
232
+ return it;
233
  }
234
+ walk(root, 0);
 
 
 
 
235
 
236
+ const f15 = `15px ${FONT}`, fRoot = `650 16px ${FONT}`;
237
+ for (const it of items) {
238
+ if (it.fold) { it.w = textW(it.label, f15); continue; }
239
+ it.num = fmt(it.n.dlall);
240
+ it.w = textW(it.n.id, it.d === 0 ? fRoot : f15) + NUM_DX + textW(it.num, f15);
 
 
 
 
241
  }
242
+ const INDENT = indent(), cx = d => 4 + RMAX + d * INDENT, lx = d => cx(d) + RMAX + PAD_LABEL;
243
+ const Y = y => 6 + y * ROW + ROW / 2;
244
+ const r = it => it.fold ? 5 : rad(it.n.dlall);
 
245
 
246
+ let links = "", nodes = "";
247
+ for (const it of items) {
248
+ if (!it.kids.length) continue;
249
+ const x = cx(it.d), last = it.kids.at(-1);
250
+ links += `M${x},${Y(it.y) + r(it) + 2}V${Y(last.y)}`;
251
+ for (const k of it.kids) links += `M${x},${Y(k.y)}H${cx(k.d) - r(k) - 3}`;
252
+ }
253
+ for (const it of items) {
254
+ const y = Y(it.y), d = it.d;
255
+ if (it.fold) {
256
+ nodes += `<g class="fold" tabindex="0" role="button" data-id="${esc(it.n.id)}"><circle cx="${cx(d)}" cy="${y}" r="5"/><text x="${lx(d)}" y="${y}">${esc(it.label)}</text></g>`;
257
+ continue;
258
+ }
259
+ const n = it.n;
260
+ nodes += `<circle cx="${cx(d)}" cy="${y}" r="${rad(n.dlall).toFixed(1)}" style="fill:${relColor(n.rel)}"/>`
261
+ + `<a href="https://huggingface.co/${esc(n.id)}" target="_blank" rel="noopener"><text x="${lx(d)}" y="${y}"${d === 0 ? ' class="root"' : ""}>`
262
+ + `<tspan class="nm">${esc(n.id)}</tspan><tspan class="num" dx="${NUM_DX}">${it.num}</tspan></text></a>`;
263
  }
264
+ const svg = document.getElementById("tree");
265
+ const W = Math.ceil(Math.max(...items.map(i => lx(i.d) + i.w)) + 12), H = Math.ceil(Y(row - 1) + ROW / 2 + 6);
266
+ svg.setAttribute("width", W); svg.setAttribute("height", H); svg.setAttribute("viewBox", `0 0 ${W} ${H}`);
267
+ svg.innerHTML = `<path class="link" d="${links}"/>${nodes}`;
268
+ svg.querySelectorAll(".fold").forEach(g => {
269
+ const go = () => {
270
+ const it = items.find(i => !i.fold && i.n.id === g.dataset.id);
271
+ open[it.n.id] = nShown(it.n, it.d) + (it.d === 0 ? 20 : 10);
272
+ renderTree();
273
+ };
274
+ g.onclick = go;
275
+ g.onkeydown = e => { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); go(); } };
276
+ });
277
+ const present = new Set(D.repos.filter(r => r.lin === lineage).map(r => r.rel));
278
+ document.getElementById("treeLegend").innerHTML = D.rel_order.filter(r => present.has(r))
279
+ .map(r => `<span><i style="background:${relColor(r)}"></i>${REL_NAME[r]}</span>`).join("");
280
  }
281
 
282
+ /* ---------- tables ---------- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
 
284
+ function renderRel() {
285
+ const l = L(), b = l.by_relation, hf = l.hf_tree;
286
+ const row = (name, n, h, d30, da, cls = "") => `<tr${cls ? ` class="${cls}"` : ""}><td>${name}</td><td class="num">${full(n)}</td><td class="num">${h == null ? "—" : full(h)}</td><td class="num">${full(d30)}</td><td class="num">${full(da)}</td></tr>`;
287
+ const sum = (rels, k) => rels.reduce((a, r) => a + b[r][k], 0);
288
+ const extra = D.rel_order.filter(r => !HF_RELS.includes(r));
289
+ let h = `<thead><tr><th>关系</th><th class="num">识别到</th><th class="num">HF Model tree 显示</th><th class="num">近 30 天下载</th><th class="num">累计下载</th></tr></thead><tbody>`;
290
+ for (const r of HF_RELS) h += row(REL_NAME[r], b[r].n, hf[r] || 0, b[r].dl30, b[r].dlall);
291
+ h += row("小计", sum(HF_RELS, "n"), HF_RELS.reduce((a, r) => a + (hf[r] || 0), 0), sum(HF_RELS, "dl30"), sum(HF_RELS, "dlall"), "sum");
292
+ for (const r of extra) h += row(REL_NAME[r], b[r].n, null, b[r].dl30, b[r].dlall);
293
+ h += row("合计", l.n_models, null, l.dl30, l.dlall, "sum");
294
+ document.getElementById("relTable").innerHTML = h + "</tbody>";
295
  }
296
 
297
  function renderRepos() {
298
+ const q = document.getElementById("q").value.trim().toLowerCase();
299
+ const rows = D.repos.filter(r => r.lin === lineage && (!q || r.id.toLowerCase().includes(q))).sort((a, b) => {
300
  const x = a[sortKey], y = b[sortKey];
301
  return (x == null) - (y == null) || (x < y ? -1 : x > y ? 1 : 0) * sortDir;
302
  });
303
+ const cols = [["id", "模型"], ["rel", "关系"], ["dl30", "近 30 天下载", 1], ["dlall", "累计下载", 1], ...(D.snapshot_days.length > 1 ? [["d1", "最近一天", 1]] : [])];
304
+ let h = "<thead><tr>" + cols.map(([k, n, num]) => `<th class="sortable${num ? " num" : ""}" data-k="${k}">${n}${sortKey === k ? (sortDir < 0 ? " ↓" : " ↑") : ""}</th>`).join("") + "</tr></thead><tbody>";
 
305
  for (const r of rows.slice(0, shown)) {
306
+ h += `<tr><td class="repo"><a href="https://huggingface.co/${esc(r.id)}" target="_blank" rel="noopener">${esc(r.id)}</a></td><td style="white-space:nowrap">${REL_NAME[r.rel]}</td>`
307
+ + `<td class="num">${full(r.dl30)}</td><td class="num">${full(r.dlall)}</td>${cols.length > 4 ? `<td class="num">${full(r.d1)}</td>` : ""}</tr>`;
 
 
 
 
 
308
  }
 
309
  const t = document.getElementById("repoTable");
310
+ t.innerHTML = h + "</tbody>";
311
  t.querySelectorAll("th.sortable").forEach(th => th.onclick = () => { const k = th.dataset.k; sortDir = sortKey === k ? -sortDir : -1; sortKey = k; renderRepos(); });
312
+ document.getElementById("moreBtn").hidden = rows.length <= shown;
313
+ }
314
+
315
+ /* ---------- charts ---------- */
316
+
317
+ function chart(id) {
318
+ if (charts[id]) { charts[id].dispose(); delete charts[id]; }
319
+ return charts[id] = echarts.init(document.getElementById(id), null, {renderer: "svg"});
320
  }
321
 
322
+ function bars(id, xs, ys, tip) {
323
+ chart(id).setOption({
324
+ animation: false, textStyle: {fontFamily: FONT},
325
+ grid: {left: 8, right: 16, top: 14, bottom: 4, containLabel: true},
326
+ tooltip: {trigger: "axis", axisPointer: {type: "shadow", shadowStyle: {color: css("--wash")}},
327
+ backgroundColor: css("--surface"), borderColor: css("--ring"), textStyle: {color: css("--ink"), fontSize: 15},
328
+ formatter: p => tip(p[0].dataIndex)},
329
+ xAxis: {type: "category", data: xs, axisLine: {lineStyle: {color: css("--axis")}}, axisTick: {show: false}, axisLabel: {color: css("--ink2"), fontSize: 14}},
330
+ yAxis: {type: "value", splitLine: {lineStyle: {color: css("--grid")}}, axisLabel: {color: css("--ink2"), fontSize: 14, formatter: v => fmt(v)}},
331
+ series: [{type: "bar", data: ys, barMaxWidth: 22, itemStyle: {color: css("--bar"), borderRadius: [4, 4, 0, 0]}, emphasis: {disabled: true}}],
332
+ });
333
+ }
334
+
335
+ function renderGrowth() {
336
+ const wk = s => { const d = new Date(s + "T00:00:00Z"); d.setUTCDate(d.getUTCDate() - (d.getUTCDay() + 6) % 7); return d.toISOString().slice(0, 10); };
337
+ const weeks = {};
338
+ for (const g of L().growth) weeks[wk(g.date)] = (weeks[wk(g.date)] || 0) + g.n;
339
+ const keys = Object.keys(weeks).sort(), xs = [];
340
+ // Only finished weeks: the current one would show as a drop.
341
+ const end = new Date(wk(D.today) + "T00:00:00Z");
342
+ if (keys.length) for (let d = new Date(keys[0] + "T00:00:00Z"); d < end; d.setUTCDate(d.getUTCDate() + 7)) xs.push(d.toISOString().slice(0, 10));
343
+ const ys = xs.map(w => weeks[w] || 0);
344
+ bars("growthChart", xs.map(x => x.slice(5)), ys, i => `${xs[i]} 起一周:新增 ${full(ys[i])} 个`);
345
+ }
346
+
347
+ function renderDaily() {
348
+ const daily = L().daily, card = document.getElementById("dailyCard");
349
+ card.hidden = daily.length === 0;
350
+ document.getElementById("chartRow").classList.toggle("one", card.hidden);
351
+ if (card.hidden) { if (charts.dailyChart) { charts.dailyChart.dispose(); delete charts.dailyChart; } return; }
352
+ bars("dailyChart", daily.map(r => r.day.slice(5)), daily.map(r => r.n), i => `${daily[i].day}:${full(daily[i].n)} 次下载`);
353
+ if (charts.growthChart) charts.growthChart.resize();
354
  }
355
  </script>
356
  </body>
labels/h3/latest.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d48ca1ad3fffeabf2165b28ec1e160ee4ac9d5ccbb9cd095b45521f012e15e11
3
- size 169338
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c49a3e52b9be6b440d916ceacbd1bdd55382018fc99430a43b22b2527d749379
3
+ size 169348