Skip to content

feat(eew): trim the intensity legend to the painted maximum - #37

Merged
lowrt merged 1 commit into
mainfrom
kitten/trim-the-intensity-legend-to-the-painted-mwdd9pcv
Nov 15, 2026
Merged

lowrt merged 1 commit into
mainfrom
kitten/trim-the-intensity-legend-to-the-painted-mwdd9pcv

Conversation

@exptech-kitten

Copy link
Copy Markdown
Contributor

改了什麼

地震速報把鄉鎮塗上顏色時,左側震度圖例只畫到地圖實際塗到的最高震度,不再固定從 1 級排到 7 級。

上限是各報 eewIntensityArea.max_i 的最大值(ML 模型算的鄉鎮震度,警報自帶的 area 更高時跟著提高),跟 drawEewArea 塗上去的是同一份。1 級留在最下面,只砍上面;每一格維持原來的高度(210px 除以 9 格,視窗矮於 660px 時是 185px 除以 9 格),所以下面的顏色不會整排位移。

速報結束、沒塗到任何有感震度、或被震度報告/長周期地表運動蓋掉時,回到完整色階。重播走同一條 drawEewArea。

沒改的

  • 圖例的顏色、字級、位置沒重做,也沒有「點開看完整色階」。
  • 左側震度排行、資訊卡沒動。資訊卡上的「預估最大震度」仍是警報回報的 eq.max,不是這次圖例的上限。
  • legacy/ 沒動。沒有速報時,圖例還是原來的 9 格。

怎麼驗

沒有速報時,圖例應跟現在一樣(9 格、210px)。

速報塗色後,最高一格應等於地圖上最深的那個顏色,且 1 級還在原來的位置。報次升高、最高震度變高時,只往上長出新的格子。速報結束後恢復 9 格。

這次沒在本機跑 typecheck、建置或畫面。請 review 時看 CI,並用一場速報(或重播)對一下圖例和地圖。

討論串:https://discord.com/channels/926545182407688273/1566483963550236863
對照 DPIP:ExpTechTW/DPIP#659


由 @lowrt(Discord 靈靈 ⇛ 臺南新營)透過 kitten 開的 PR,合併前請人工 review。
觸發訊息:https://discord.com/channels/926545182407688273/1566483963550236863/1570372904510824499

@lowrt
lowrt force-pushed the kitten/trim-the-intensity-legend-to-the-painted-mwdd9pcv branch from 1b90134 to 5a96ff4 Compare November 12, 2026 15:32

@whes1015 whes1015 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看過 head 5a96ff4 的 diff、著色與覆蓋的呼叫順序、圖例 CSS,CI 也全綠。

圖例上限用的是同一份 eewIntensityArea.max_i(0–9,跟 INTENSITY_LIST 和鄉鎮上色同一刻度)。有感才裁掉上面,1 級留在底部;每格高度仍是 210px(視窗矮於 660px 時 185px)除以 9。新的矮視窗規則比 globals.css 的固定 185px 更具體,裁過的色階不會被拉回去。震度報告、長周期覆蓋、沒塗到有感震度、速報結束清掉 cache 之後,都會回到 9 格。重播走同一條 drawEewArea。commit 有 Platform 和更新日誌。

合併前若方便,用一場速報或重播對一下最高格和地圖顏色。這次說明裡沒有畫面驗證。

Agent 代 whes1015 審核(Discord !YuYu1015 要求)

Platform: all

New(zh-Hant): 地震速報時,圖例只顯示到地圖上實際塗到的最高震度
New(en-US): during an early warning, the legend stops at the highest intensity painted on the map

Requested-on-Discord: 靈靈 ⇛ 臺南新營 (@liangliang5102, 452103762320949248) https://discord.com/channels/926545182407688273/1566483963550236863/1570372904510824499
Co-authored-by: lowrt <37591855+lowrt@users.noreply.github.com>
@bamboo0403
bamboo0403 force-pushed the kitten/trim-the-intensity-legend-to-the-painted-mwdd9pcv branch from 5a96ff4 to fdbaed6 Compare November 15, 2026 06:54
@lowrt
lowrt merged commit 1dd6f9b into main Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants