Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
2927 lines (2872 loc) · 113 KB
/
Copy pathindex.html
File metadata and controls
2927 lines (2872 loc) · 113 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="zh-CN" data-theme="E">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--
裸域 → www 跳转兜底:防止用户直接访问 https://pharma.ac.cn/ (不带 www)
时因 DNS / 服务器监听 / TLS 证书未覆盖而白屏或超时。
必须放在 <head> 最前面,任何其他资源(CSS、JS、图片)加载之前执行。
注:这只能救回「TCP 已握手但渲染到了我们这段 HTML」的场景;
根域名本身无法连通的问题仍需在 DNS / 托管侧解决,此脚本仅作兜底。
-->
<script>
(function () {
var host = location.hostname;
if (host === 'pharma.ac.cn') {
var target =
'https://www.pharma.ac.cn' + location.pathname + location.search + location.hash;
// HTTP 301 级别的语义:replace 不留下历史记录,避免点返回死循环
location.replace(target);
}
})();
</script>
<!-- 深色主题:地址栏底色 + 原生控件配色 + 首屏底色(index.css 由 JS 引入前避免白屏闪一下) -->
<meta name="theme-color" content="#020617" />
<meta name="color-scheme" content="dark" />
<style>
html {
background: #020617;
color-scheme: dark;
}
</style>
<!-- 字体:Space Grotesk(几何标题/logo) + Space Mono(等宽数字) -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Space+Mono:wght@400;700&display=swap"
rel="stylesheet"
/>
<!-- ── Primary SEO ───────────────────────────────────────────── -->
<title>药学知识图谱 - 执业药师备考学习可视化 - 电子书笔记本记忆卡片</title>
<meta
name="description"
content="药学家族关系星图|基于执业药师考试(药学专业知识一·二·药学综合知识与技能)的交互式知识图谱学习平台。覆盖药剂学、药理学、药物化学、药动学、临床用药等学科,支持节点搜索、关系推理、漫游学习与多种布局,系统化梳理药物脉络,助力高效备考与记忆。"
/>
<meta
name="keywords"
content="药学知识图谱,执业药师,药学专业知识一,药学专业知识二,药学综合知识与技能,药剂学,药理学,药物化学,药动学,临床药学,药学可视化,执业药师考试,药学备考,药物关系图谱,知识星图,Pharma Knowledge Graph"
/>
<meta name="author" content="meow" />
<meta
name="robots"
content="index,follow,max-image-preview:large,max-snippet:-1,max-video-preview:-1"
/>
<meta name="application-name" content="药学家族关系星图" />
<link rel="canonical" href="https://www.pharma.ac.cn/" />
<!-- Open Graph -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.pharma.ac.cn/" />
<meta property="og:title" content="药学知识图谱 | 执业药师备考可视化学习平台" />
<meta
property="og:description"
content="药学家族关系星图:交互式药学知识图谱,覆盖药剂学、药理学、药物化学、药动学、临床用药等执业药师考试核心学科,支持节点搜索、关系推理、漫游学习与多种布局探索,系统化梳理药物关系脉络。"
/>
<meta property="og:site_name" content="药学家族关系星图" />
<meta property="og:locale" content="zh_CN" />
<meta
property="og:image"
content="https://www.pharma.ac.cn/images/%E8%8D%AF%E5%AD%A6%E7%9F%A5%E8%AF%86%E6%8B%93%E6%89%91.png"
/>
<meta property="og:image:type" content="image/png" />
<meta property="og:image:alt" content="药学知识拓扑 — 药一 · 药二 · 药综三大模块关系图" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="药学知识图谱 | 执业药师备考可视化学习" />
<meta
name="twitter:description"
content="药学家族关系星图:交互式药学知识图谱,覆盖药剂学/药理学/药物化学/药动学/临床用药,支持节点搜索、关系推理、漫游学习与多种布局探索。"
/>
<meta
name="twitter:image"
content="https://www.pharma.ac.cn/images/%E8%8D%AF%E5%AD%A6%E7%9F%A5%E8%AF%86%E6%8B%93%E6%89%91.png"
/>
<meta name="twitter:image:alt" content="药学知识拓扑图" />
<!-- SVG Favicon: 苯环六角图腾(蓝青渐变)——内联 data URI 兜底,浏览器标签页无网络时也能显示 -->
<link
rel="icon"
href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20width%3D%2232%22%20height%3D%2232%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22g%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%22100%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%236366f1%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%2306b6d4%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpolygon%20points%3D%2216%2C4%2026%2C10%2026%2C22%2016%2C28%206%2C22%206%2C10%22%20fill%3D%22none%22%20stroke%3D%22url%28%23g%29%22%20stroke-width%3D%222%22%20stroke-linejoin%3D%22round%22%20stroke-linecap%3D%22round%22%2F%3E%3Cg%20stroke%3D%22url%28%23g%29%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20opacity%3D%220.7%22%3E%3Cline%20x1%3D%2216%22%20y1%3D%224%22%20x2%3D%2216%22%20y2%3D%2228%22%2F%3E%3Cline%20x1%3D%226%22%20y1%3D%2210%22%20x2%3D%2226%22%20y2%3D%2222%22%2F%3E%3Cline%20x1%3D%226%22%20y1%3D%2222%22%20x2%3D%2226%22%20y2%3D%2210%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22url%28%23g%29%22%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%224%22%20r%3D%221.9%22%2F%3E%3Ccircle%20cx%3D%2226%22%20cy%3D%2210%22%20r%3D%221.9%22%2F%3E%3Ccircle%20cx%3D%2226%22%20cy%3D%2222%22%20r%3D%221.9%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2228%22%20r%3D%221.9%22%2F%3E%3Ccircle%20cx%3D%226%22%20cy%3D%2222%22%20r%3D%221.9%22%2F%3E%3Ccircle%20cx%3D%226%22%20cy%3D%2210%22%20r%3D%221.9%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"
/>
<!-- 公开可访问的 SVG favicon(Google 搜索结果站点图标必须通过 HTTP URL 获取,不能用 data: URI)——与 topbar 苯环图腾完全一致 -->
<link rel="icon" type="image/svg+xml" href="/favicon.svg" sizes="any" />
<!-- ── JSON-LD Structured Data ────────────────────────────────── -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "https://www.pharma.ac.cn/#website",
"url": "https://www.pharma.ac.cn/",
"name": "药学家族关系星图",
"alternateName": "药学知识图谱 · Pharma Knowledge Graph",
"description": "药学家族关系星图:基于执业药师考试构建的交互式药学知识图谱,覆盖药剂学、药理学、药物化学、药动学、临床药学等核心学科,支持节点搜索、关系推理与漫游学习。",
"inLanguage": "zh-CN",
"potentialAction": {
"@type": "SearchAction",
"target": "https://www.pharma.ac.cn/?q={search_term_string}",
"query-input": "required name=search_term_string"
}
},
{
"@type": "EducationalOrganization",
"@id": "https://www.pharma.ac.cn/#eduorg",
"name": "药学知识图谱",
"url": "https://www.pharma.ac.cn/",
"description": "面向执业药师考生与药学从业者的开放知识图谱学习平台",
"address": { "@type": "PostalAddress", "addressCountry": "CN" }
},
{
"@type": "LearningResource",
"@id": "https://www.pharma.ac.cn/#learningresource",
"name": "药学专业知识知识图谱",
"about": "Pharmaceutical Science",
"educationalLevel": "Professional certification",
"learningResourceType": "Knowledge Graph",
"inLanguage": "zh-CN",
"url": "https://www.pharma.ac.cn/",
"isPartOf": { "@id": "https://www.pharma.ac.cn/#website" },
"provider": { "@id": "https://www.pharma.ac.cn/#eduorg" },
"teaches": [
"药剂学",
"药理学与毒理学",
"药物化学",
"药物动力学",
"临床药学",
"药学综合知识与技能",
"药物不良反应与安全用药"
],
"audience": {
"@type": "Audience",
"audienceType": ["执业药师考生", "药学专业学生", "临床药师", "医药行业从业者"]
}
},
{
"@type": "BreadcrumbList",
"@id": "https://www.pharma.ac.cn/#breadcrumb",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "首页",
"item": "https://www.pharma.ac.cn/"
},
{
"@type": "ListItem",
"position": 2,
"name": "学习资源",
"item": "https://www.pharma.ac.cn/#resources"
},
{
"@type": "ListItem",
"position": 3,
"name": "药学知识图谱",
"item": "https://www.pharma.ac.cn/"
}
]
}
]
}
</script>
<!-- 噪点纹理已内嵌进 src/ui/styles/layout.css 的 .noise-overlay
background-image(200×200 SVG data-URI,feTurbulence 平铺),
这里不再需要单独的隐藏 <svg> 滤镜。 -->
</head>
<body>
<!-- 背景噪点层——必须放在 #app 之外。
放在 #app 里面会被 #app 的层叠上下文挡住,behind 内容但
在 cytoscape 上方(cytoscape 在 #app 内),反过来变成"前景噪点"。
放在 body 直接子节点 → 全局最底,mix-blend-mode: overlay 让它
只影响中间亮度,不染黑角落。 -->
<div class="noise-overlay" aria-hidden="true"></div>
<div id="app">
<!-- ── Background depth layers ─────────────────────────────────────────
视觉层次:噪点(最底,破色带) → 星点视差 → 两团星云光晕(#app::after)
canvas 放 #app 第一个子节点 → 默认 z-index 最低,被 cytoscape 盖住。
pointer-events:none 让它不挡节点点击。 -->
<canvas id="starfield" aria-hidden="true"></canvas>
<!-- ── Loading indicator (corner, non-blocking) ──────────────────────────── -->
<!-- 不阻塞图谱渲染:内容流式到达时节点会"生长"出来,呼吸灯+进度仅作辅助指示。
加载完成后 fade 消失,绿色呼吸灯恢复常态。 -->
<div id="loading-indicator" class="loading-indicator">
<div class="loading-dot"></div>
<span class="loading-label" id="loading-label">准备中…</span>
<span class="loading-count" id="loading-count"></span>
<span class="loading-percent" id="loading-percent"></span>
</div>
<!-- ── Top bar ──────────────────────────────────────────────────────── -->
<header class="topbar">
<div class="topbar__logo">
<div class="topbar__logo-mark" aria-hidden="true">
<svg viewBox="0 0 32 32" fill="none">
<!-- Benzene ring: 6 atoms on a hexagon + alternating double bonds -->
<g
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
>
<polygon points="16,4 26,10 26,22 16,28 6,22 6,10" />
<line x1="16" y1="4" x2="16" y2="28" opacity="0.55" />
<line x1="6" y1="10" x2="26" y2="22" opacity="0.55" />
<line x1="6" y1="22" x2="26" y2="10" opacity="0.55" />
</g>
<g fill="currentColor">
<circle cx="16" cy="4" r="1.6" />
<circle cx="26" cy="10" r="1.6" />
<circle cx="26" cy="22" r="1.6" />
<circle cx="16" cy="28" r="1.6" />
<circle cx="6" cy="22" r="1.6" />
<circle cx="6" cy="10" r="1.6" />
</g>
</svg>
</div>
<div class="topbar__brand">
<span class="topbar__brand-name">药学家族关系星图</span>
<span class="topbar__brand-sub">PHARMA KNOWLEDGE GRAPH</span>
</div>
</div>
<div class="topbar__search-center">
<div class="topbar__search-wrap">
<svg
class="topbar__search-icon"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="11" cy="11" r="8" />
<path d="m21 21-4.35-4.35" />
</svg>
<input
id="bs-search-input"
class="topbar__search-input"
type="text"
placeholder="搜索节点…"
autocomplete="off"
spellcheck="false"
/>
</div>
</div>
<span class="topbar__badge">
<span class="topbar__badge-dot topbar__badge-dot--loading" id="badge-dot"></span>
<span class="topbar__badge-carousel" aria-live="polite">
<span id="carousel-text">信息熵</span>
</span>
<span class="badge-by">by</span>
<span
class="badge-meow"
id="badge-meow"
tabindex="0"
aria-describedby="badge-email-card"
role="button"
>meow</span
>
<div class="badge-email-card" id="badge-email-card" role="tooltip" aria-hidden="true">
<span class="badge-email-card__arrow" aria-hidden="true"></span>
<span class="badge-email-card__icon" aria-hidden="true">
<svg
viewBox="0 0 24 24"
width="14"
height="14"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect x="2" y="4" width="20" height="16" rx="2" />
<path d="m22 7-10 6L2 7" />
</svg>
</span>
<span class="badge-email-card__addr">meowquantx@gmail.com</span>
<span class="badge-email-card__hint">悬停查看</span>
</div>
</span>
</header>
<!-- ── Toolbar ─────────────────────────────────────────────────────── -->
<div class="toolbar">
<div class="toolbar__group">
<div id="layout-switcher" class="layout-switcher">
<button
id="layout-switcher-btn"
class="btn layout-btn active layout-switcher__btn"
aria-haspopup="listbox"
aria-expanded="false"
aria-controls="layout-switcher-menu"
data-action="toggle-layout-menu"
>
<span class="layout-switcher__label">布局</span>
<span class="layout-switcher__sep">·</span>
<!-- §12.6: 文案必须与 DEFAULT_LAYOUT='euler' 同步 (config-layouts.test.ts 守护) -->
<span class="layout-switcher__current" id="layout-switcher-current">Euler</span>
<svg
class="layout-switcher__chev"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="6 9 12 15 18 9" />
</svg>
</button>
</div>
</div>
<div class="toolbar__sep"></div>
<div class="toolbar__group">
<button
id="btn-fit"
class="btn"
data-action="fit"
title="适应视图(F)— 自动缩放图谱到最佳视图"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path
d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"
/>
</svg>
<span>适应</span>
</button>
<button
id="btn-random"
class="btn"
data-action="randomize"
title="随机布局(R)— 用 cose 算法重新打散所有节点位置"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M16 3h5v5M4 20 21 3M21 16v5h-5M15 15l6 6M4 4l5 5" />
</svg>
<span>随机</span>
</button>
<button
id="btn-reset"
class="btn"
data-action="reset-all"
title="重置一切 — 布局回到默认(Euler)、清除形状筛选、取消高亮"
>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="1 4 1 10 7 10" />
<path d="M3.51 15a9 9 0 1 0 .49-4" />
</svg>
<span>重置</span>
</button>
<button
id="btn-pulse"
class="btn"
data-action="pulse"
title="节点脉冲 — 所有节点闪一下,提示数据已加载"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="2" />
<path
d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"
/>
</svg>
<span>脉冲</span>
</button>
</div>
<div class="toolbar__sep"></div>
<button
id="btn-tour"
class="btn"
aria-label="漫游(T)— 悬停查看用法说明"
data-tour-action="toggle"
>
<svg
id="tour-icon-play"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="10" />
<polygon points="10 8 16 12 10 16 10 8" fill="currentColor" stroke="none" />
</svg>
<svg
id="tour-icon-stop"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="12" cy="12" r="10" />
<rect x="8" y="8" width="8" height="8" rx="1" fill="currentColor" stroke="none" />
</svg>
<span>漫游</span>
</button>
<button id="btn-music" class="btn" title="播放背景音乐">
<svg
id="music-icon-pause"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
style="display: none"
>
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" />
<path d="M15.54 8.46a5 5 0 0 1 0 7.07" />
<path d="M19.07 4.93a10 10 0 0 1 0 14.14" />
</svg>
<svg
id="music-icon-play"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" />
<line x1="23" y1="9" x2="17" y2="15" />
<line x1="17" y1="9" x2="23" y2="15" />
</svg>
<span id="music-label">音乐</span>
</button>
<div class="toolbar__sep"></div>
<button
id="btn-bigscreen"
class="btn"
data-action="toggle-bigscreen"
title="大屏(影院模式)— 隐藏 UI 并全屏,再次点击或按 ESC / 双击画布退出"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M8 3H5a2 2 0 0 0-2 2v3" />
<path d="M21 8V5a2 2 0 0 0-2-2h-3" />
<path d="M3 16v3a2 2 0 0 0 2 2h3" />
<path d="M16 21h3a2 2 0 0 0 2-2v-3" />
</svg>
<span>大屏</span>
</button>
<button
id="btn-sidebar-toggle"
class="btn layout-btn"
style="margin-left: auto"
data-action="toggle-sidebar"
title="切换侧栏"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect x="3" y="3" width="18" height="18" rx="2" />
<line x1="15" y1="3" x2="15" y2="21" />
</svg>
</button>
</div>
<!-- Layout switcher popover (outside toolbar to avoid overflow clipping) -->
<div
id="layout-switcher-menu"
class="layout-switcher__menu"
role="listbox"
aria-label="选择布局"
>
<button
class="layout-switcher__item"
role="option"
aria-selected="false"
data-name="cose"
data-action="pick-layout"
data-arg="cose"
>
COSE
</button>
<button
class="layout-switcher__item"
role="option"
aria-selected="false"
data-name="concentric"
data-action="pick-layout"
data-arg="concentric"
>
同心圆
</button>
<button
class="layout-switcher__item"
role="option"
aria-selected="false"
data-name="circle"
data-action="pick-layout"
data-arg="circle"
>
环形
</button>
<button
class="layout-switcher__item"
role="option"
aria-selected="false"
data-name="grid"
data-action="pick-layout"
data-arg="grid"
>
网格
</button>
<button
class="layout-switcher__item"
role="option"
aria-selected="false"
data-name="dagre"
data-action="pick-layout"
data-arg="dagre"
>
Dagre
</button>
<button
class="layout-switcher__item"
role="option"
aria-selected="false"
data-name="breadthfirst"
data-action="pick-layout"
data-arg="breadthfirst"
>
广度
</button>
<!-- §12.4: 默认布局 Euler (清单 §12.4) — HTML 默认 active 与 DEFAULT_LAYOUT 同步 -->
<button
class="layout-switcher__item active"
role="option"
aria-selected="true"
data-name="euler"
data-action="pick-layout"
data-arg="euler"
>
Euler
</button>
</div>
<!-- ── Main ───────────────────────────────────────────────────────── -->
<div id="main">
<div id="cy"></div>
<!-- ── Desktop sidebar ───────────────────────────────────────────── -->
<aside id="sidebar" class="glass-edge">
<!-- 图例说明 -->
<div class="sidebar-section" data-section="types" data-section-state="open">
<div
class="sidebar-section__head"
data-action="toggle-section"
data-arg="types"
aria-expanded="true"
aria-controls="body-types"
>
<span class="sidebar-section__title">图例说明</span>
<svg
class="sidebar-section__chevron open"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="9 18 15 12 9 6" />
</svg>
</div>
<div class="sidebar-section__body" id="body-types">
<div class="sidebar-section__body-inner">
<!-- 节点本质(形状 + 计数,动态) -->
<div
class="legend-block legend-section"
data-section="legend-essence"
data-section-state="open"
>
<div
class="legend-section__head"
data-action="toggle-section"
data-arg="legend-essence"
aria-expanded="true"
aria-controls="body-legend-essence"
>
<span class="legend-section__title">节点本质(形状)</span>
<svg
class="sidebar-section__chevron open"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="9 18 15 12 9 6" />
</svg>
</div>
<div class="legend-section__body" id="body-legend-essence">
<div class="legend-section__body-inner">
<div class="legend-grid legend-grid--2" id="legend-essence-grid">
<!-- 由 populateEssenceLegend() 动态填充 -->
</div>
</div>
</div>
</div>
<!-- 关联关系(边类型) -->
<div
class="legend-block legend-section"
data-section="legend-edge"
data-section-state="open"
>
<div
class="legend-section__head"
data-action="toggle-section"
data-arg="legend-edge"
aria-expanded="true"
aria-controls="body-legend-edge"
>
<span class="legend-section__title">关联关系(边类型)</span>
<svg
class="sidebar-section__chevron open"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="9 18 15 12 9 6" />
</svg>
</div>
<div class="legend-section__body" id="body-legend-edge">
<div class="legend-section__body-inner">
<div class="legend-grid legend-grid--2" id="legend-edge-grid">
<!-- 由 populateEdgeLegend() 动态填充 -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Stats -->
<!-- Stats + Layout description merged -->
<div class="sidebar-section" data-section="stats" data-section-state="open">
<div
class="sidebar-section__head"
data-action="toggle-section"
data-arg="stats"
aria-expanded="true"
aria-controls="body-stats"
>
<span class="sidebar-section__title">图谱状态</span>
<svg
class="sidebar-section__chevron open"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="9 18 15 12 9 6" />
</svg>
</div>
<div class="sidebar-section__body" id="body-stats">
<div class="sidebar-section__body-inner">
<div class="stat-list">
<div class="stat-card">
<span class="stat-card__label">节点</span>
<span class="stat-card__value stat-card__value--nodes" id="stat-nodes">—</span>
</div>
<div class="stat-card">
<span class="stat-card__label">边</span>
<span class="stat-card__value stat-card__value--edges" id="stat-edges">—</span>
</div>
<div class="stat-card">
<span class="stat-card__label">选中</span>
<span class="stat-card__value stat-card__value--selected" id="stat-selected"
>0</span
>
</div>
<div class="stat-card">
<span class="stat-card__label">高亮</span>
<span
class="stat-card__value stat-card__value--highlighted"
id="stat-highlighted"
>0</span
>
</div>
<div class="stat-card">
<span class="stat-card__label">FPS</span>
<span class="stat-card__value stat-card__value--fps" id="stat-fps">—</span>
</div>
<div class="stat-card">
<span class="stat-card__label">内存</span>
<span class="stat-card__value stat-card__value--memory" id="stat-memory"
>—</span
>
</div>
</div>
<div class="layout-info">
<div class="layout-info__header">
<span class="layout-info__label">布局</span>
<span class="layout-info__badge" id="stat-layout">EULER</span>
</div>
<!-- §12.6: 文案必须与 DEFAULT_LAYOUT='euler' 同步 -->
<span id="layout-desc" class="layout-info__desc"
>Euler — 基于图论力学的布局,优化边交叉和长度。</span
>
</div>
</div>
</div>
</div>
<!-- 高级设置 -->
<div class="sidebar-section" data-section="advanced" data-section-state="closed">
<div
class="sidebar-section__head"
data-action="toggle-section"
data-arg="advanced"
aria-expanded="false"
aria-controls="body-advanced"
>
<span class="sidebar-section__title">高级设置</span>
<svg
class="sidebar-section__chevron"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="9 18 15 12 9 6" />
</svg>
</div>
<div class="sidebar-section__body" id="body-advanced">
<div class="sidebar-section__body-inner">
<!-- 布局参数(高级设置的子项) -->
<div
class="sidebar-section"
data-section="layout-setting"
data-section-state="closed"
>
<div
class="sidebar-section__head"
data-action="toggle-section"
data-arg="layout-setting"
aria-expanded="false"
aria-controls="body-layout-setting"
>
<span class="sidebar-section__title">布局参数</span>
<svg
class="sidebar-section__chevron"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="9 18 15 12 9 6" />
</svg>
</div>
<div class="sidebar-section__body" id="body-layout-setting">
<div class="sidebar-section__body-inner">
<div id="layout-params">
<div id="layout-params-rows"></div>
<div class="param-actions">
<button
id="reset-params-btn"
class="btn btn--ghost btn--sm"
data-action="reset-layout-params"
title="恢复库默认参数"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="1 4 1 10 7 10" />
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10" />
</svg>
<span>恢复默认</span>
</button>
<button
id="apply-params-btn"
class="btn btn--apply"
data-action="apply-layout-params"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="20 6 9 17 4 12" />
</svg>
<span>应用参数</span>
</button>
</div>
</div>
</div>
</div>
</div>
<!-- 漫游设置(高级设置的子项) -->
<div
class="sidebar-section"
data-section="tour-setting"
data-section-state="closed"
>
<div
class="sidebar-section__head"
data-action="toggle-section"
data-arg="tour-setting"
aria-expanded="false"
aria-controls="body-tour-setting"
>
<span class="sidebar-section__title">漫游设置</span>
<svg
class="sidebar-section__chevron"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="9 18 15 12 9 6" />
</svg>
</div>
<div class="sidebar-section__body" id="body-tour-setting">
<div class="sidebar-section__body-inner">
<div class="speech-granularity-row">
<div class="param-label">朗读粒度</div>
<div class="seg-group" role="radiogroup" aria-label="朗读粒度">
<button class="seg-btn" type="button" data-speech-granularity="label">
仅标题
</button>
<button
class="seg-btn"
type="button"
data-speech-granularity="label-edges"
>
标题和关联
</button>
<button
class="seg-btn"
type="button"
data-speech-granularity="label-edges-tags"
>
标题和关联和标签
</button>
<button
class="seg-btn"
type="button"
data-speech-granularity="label-full-summary"
>
标题和摘要
</button>
</div>
</div>
<div class="speech-wait-row">
<label class="param-label" for="speech-wait-toggle">
<span>等读完再跳转</span>
<span class="param-label__hint">关闭 = 按固定间隔跳</span>
</label>
<button
id="speech-wait-toggle"
type="button"
class="bs-toggle"
data-speech-wait="1"
aria-pressed="true"
role="switch"
>
<span class="bs-toggle__track">
<span class="bs-toggle__thumb"></span>
</span>
</button>
</div>
<div class="speech-rate-row">
<label class="param-label" for="speech-rate">
<span>朗读速度</span>
<span class="param-label__val" id="speech-rate-val">1.0x</span>
</label>
<input
id="speech-rate"
type="range"
class="param-slider speech-rate-slider"
min="0.5"
max="2.0"
step="0.1"
value="1.0"
aria-label="朗读速度"
/>
</div>
<div class="speech-postdelay-row">
<label class="param-label" for="speech-postdelay">
<span>读完后停顿</span>
<span class="param-label__val" id="speech-postdelay-val">0ms</span>
</label>
<input
id="speech-postdelay"
type="range"
class="param-slider speech-postdelay-slider"
min="0"
max="2000"
step="100"
value="0"
aria-label="朗读后额外停顿"
/>
</div>
<!-- ── 遍历顺序(顺序 / 倒序 / 随机)───────────────────────
与底部抽屉的同一组控件对齐。data-tour-mode 在两个 DOM
树里都用,controller.syncModeButtons() 一次性扫两边。 -->
<div class="tour-mode-row">
<div class="param-label">遍历顺序</div>
<div class="seg-group" role="radiogroup" aria-label="遍历顺序">
<button class="seg-btn" type="button" data-tour-mode="sequential" aria-pressed="false">
顺序
</button>
<button class="seg-btn" type="button" data-tour-mode="reverse" aria-pressed="false">
倒序
</button>
<button class="seg-btn" type="button" data-tour-mode="random" aria-pressed="false">
随机
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>