Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VIEWER-167] Heatmap Viewer 스펙 변경 #422

Merged
merged 10 commits into from
Oct 31, 2024
Merged

Conversation

LTakhyunKim
Copy link
Collaborator

@LTakhyunKim LTakhyunKim commented Oct 22, 2024

📝 Description

Heatmap 표현 방식이 변경됨에 따라 Viewer 내 Heatmap 로직도 업데이트합니다.

업데이트 이미지

스크린샷 2024-10-22 오후 1 03 16

확인 방법

  1. npm install script 를 실행해서 패키지를 설치합니다.
  2. npm run start script 를 실행해서 INSIGHT Viewer 문서를 확인합니다.
  3. 문서 좌측 navigation sidebar 에서 UseOveralayContext Tab 에서 변경된 Heatmap 을 확인합니다.

✔️ PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Chore (non-breaking change which does not affect codebase; Build related changes, version modification, etc.)
  • CI related changes
  • Test Case
  • Performance optimization
  • Site/documentation update
  • Other... Please describe:

🎯 Current behavior

구버전 Heatmap Viewer spec 을 사용합니다.

Issue Number: N/A

🚀 New behavior

최신 버전 Heatmap Viewer spec 을 사용합니다.

💣 Is this a breaking change?

  • Yes
  • No

@LTakhyunKim LTakhyunKim added the enhancement New feature or request label Oct 22, 2024
@LTakhyunKim LTakhyunKim requested review from deminoth and a team October 22, 2024 04:03
@LTakhyunKim LTakhyunKim self-assigned this Oct 22, 2024
Copy link

Copy link

github-actions bot commented Oct 22, 2024

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 93.02% 80/86
🟢 Branches 94.55% 52/55
🟡 Functions 77.78% 21/27
🟢 Lines 92.31% 72/78

Test suite run success

66 tests passing in 9 suites.

Report generated by 🧪jest coverage report action from c5634c7

@@ -53,10 +49,87 @@ export default function getHeatmapImageData({
pixels[offset] = pixVal[0]
pixels[offset + 1] = pixVal[1]
pixels[offset + 2] = pixVal[2]
pixels[offset + 3] = (thPosProb * 196) << 0
pixels[offset + 3] = Math.round(255 * 0.35)
Copy link
Member

Choose a reason for hiding this comment

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

반복문 내에서 사용되는 값이니 상수 사용하는 것이 좋겠습니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

상수로 선언 후 사용하는 방식으로 수정했습니다. 817ea51

return { heatmapData: heatmapImageData, heatmapCanvas }
}

function applyGaussianBlur(pixels: Uint8ClampedArray, width: number, height: number, sigma: number) {
Copy link
Member

Choose a reason for hiding this comment

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

직접 구현하기보다는 blur() 필터를 사용하는게 좋을 것 같습니다
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

말씀해주신 것처럼 직접 구현한 로직 삭제 후, blur 방식을 적용했습니다. b831f8f

blur 를 적용한 기준 디자인은 디자인팀에 검수까지 받은 상태입니다.

} else if (v < 0.75) {
r = 4 * (v - 0.5)
b = 0
// Between 0.25 and 0.5: linearly convert from 74,230,255 to 221,255,0
Copy link
Member

Choose a reason for hiding this comment

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

괄호를 넣어줘야 rbg임을 쉽게 알 수 있을 것 같습니다

Suggested change
// Between 0.25 and 0.5: linearly convert from 74,230,255 to 221,255,0
// Between 0.25 and 0.5: linearly convert from (74,230,255) to (221,255,0)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

말씀해주신 것처럼 괄호를 추가했습니다. 1160997

@deminoth
Copy link
Member

앗 그러고보니 이 PR을 v7에 머지한다면 기존 히트맵이 Legacy가 되면 breaking change에 해당하는 문제가 있네요

@LTakhyunKim
Copy link
Collaborator Author

앗 그러고보니 이 PR을 v7에 머지한다면 기존 히트맵이 Legacy가 되면 breaking change에 해당하는 문제가 있네요

중요한 부분 짚어주셔서 감사합니다 🙏
그럼 오히려 반대로 기존 히트맵은 그대로 두고, LastestHeatmap 과 같이 네이밍 해서 추가하는게 좋을까요?
v7 을 오래 유지할 것 같진 않아서요.

@deminoth
Copy link
Member

Lastest는 그때그때 상대적인 개념이니 더 명확한 네이밍이면 좋겠습니다(CXR4Heatmap 이라거나)

@LTakhyunKim
Copy link
Collaborator Author

Lastest는 그때그때 상대적인 개념이니 더 명확한 네이밍이면 좋겠습니다(CXR4Heatmap 이라거나)

넵, 명확한 네이밍 고려해서 수정하겠습니다. 🙏

@LTakhyunKim
Copy link
Collaborator Author

Lastest는 그때그때 상대적인 개념이니 더 명확한 네이밍이면 좋겠습니다(CXR4Heatmap 이라거나)

CXR4Heatmap 외에 좋은 네이밍이 없어보여 CXR4Heatmap 로 결정했습니다. 8c8496b
LegacyHeatmapViewer 는 HeatmapViewer 로 롤백했습니다. edf7dbf

@LTakhyunKim
Copy link
Collaborator Author

LTakhyunKim commented Oct 30, 2024

현재 Github Actions 서비스 자체에 문제가 생겨, 계속 Queued 상태입니다.
리뷰 시 참고 부탁드립니다. https://www.githubstatus.com/
cc. @deminoth

Welcome to GitHub's home for real-time and historical data on system performance.

<OverlayLayer viewport={viewport} />
</InsightViewer>
</Resizable>
<InsightViewer
Copy link
Member

Choose a reason for hiding this comment

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

각 뷰어 위에다 작게 이름(HeatmapViewer) 써주면 좋겠네요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

말씀해주신 것처럼 각 Heatmap 의 title 을 추가했습니다.

c5634c7
스크린샷 2024-10-31 오전 11 05 14

Copy link
Member

@deminoth deminoth left a comment

Choose a reason for hiding this comment

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

이전 히트맵과 새 히트맵 다 잘 나오는 것 확인했습니다. 머지하고 7.2.0 릴리스하면 되겠네요

@LTakhyunKim LTakhyunKim merged commit 8256e7c into develop Oct 31, 2024
5 checks passed
@LTakhyunKim LTakhyunKim deleted the VIEWER-167-feat-heatmap branch October 31, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants