feat: 盘面洞察第四批 — 板块相关性热力图 + 异动雷达 + 量能仪表盘

- 相关性 /hotspots 页内新增「相关性」视图:/board-mac/hotspot-correlation
  复用热点历史矩阵缓存,对窗口内活跃板块(每日前 per_day 名并集,按上榜次数
  取前 N)两两算日涨跌幅 Pearson 相关;红=同涨同跌(抱团)、绿=跷跷板(轮动),
  ECharts 热力图 + 双向色阶 visualMap;无缓存时透传 building 状态
- 异动雷达 /radar:沪深异动流时间线(封板/炸板/大笔买入/逼近涨停…),
  每分钟异动密度柱 + 类型筛选 chips(带计数),行点击直达个股弹窗,15s 轮询
- 量能仪表盘并入市场情绪页:两市(上证+深成 5 分钟线)累计成交额曲线
  vs 近 5 日同期均值(虚线),标题给出偏离百分比——放量/缩量一眼可辨
- 热点缓存判定重构为 _hotspot_history_or_build 公共入口,correlation 与
  hotspot 共用同一构建状态机;新增相关性矩阵回归单测
This commit is contained in:
Justin Gu
2026-09-05 04:09:03 +08:00
parent 37c732fb30
commit 0a205ffbf3
11 changed files with 782 additions and 26 deletions
+18
View File
@@ -12,6 +12,7 @@ import type {
CcpmProductsResponse,
CcpmRankResponse,
DataFrameResponse,
HotspotCorrelationResp,
HotspotResp,
LimitUpEcologyResp,
LimitUpHistoryRow,
@@ -847,6 +848,23 @@ export async function fetchLimitUpEcology(): Promise<LimitUpEcologyResp> {
return body.data
}
/** 热点板块相关性矩阵(复用热点历史缓存;未构建时返回 building/error)。 */
export async function fetchHotspotCorrelation(
boardType: string,
days: number,
perDay = 5,
): Promise<HotspotCorrelationResp> {
const params = new URLSearchParams({
board_type: boardType,
days: String(days),
per_day: String(perDay),
})
const resp = await fetch(`${BASE}/board-mac/hotspot-correlation?${params}`)
if (!resp.ok) await throwError(resp)
const body = (await resp.json()) as { data: HotspotCorrelationResp }
return body.data
}
/** 当日情绪分钟曲线(采样器逐分钟落库;date=0 表示尚无采样)。 */
export async function fetchSentimentToday(): Promise<SentimentTodayResp> {
const resp = await fetch(`${BASE}/market/sentiment/today`)