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

Frontend Game Map Setup #17

Open
wingtkw opened this issue Oct 25, 2023 · 11 comments
Open

Frontend Game Map Setup #17

wingtkw opened this issue Oct 25, 2023 · 11 comments
Labels
feature For those who propose to add new feature or modify existing features frontend dev For front-end development related to this codebase
Milestone

Comments

@wingtkw
Copy link
Collaborator

wingtkw commented Oct 25, 2023

Any suggestion in implementing the network-like map in frontend?
@sandytang886 @KalpasWang

@wingtkw wingtkw added feature For those who propose to add new feature or modify existing features frontend dev For front-end development related to this codebase labels Oct 25, 2023
@wingtkw wingtkw added this to the pending milestone Oct 25, 2023
@KalpasWang
Copy link
Collaborator

I've looked into it before, and I think it's easier to use data visualization libraries like D3, visx, nivo, because there are existing network charts, what do you think?

@sandytang886
Copy link
Member

i thought that we have to draw it by our own😅 , i have no idea but wecome to use any tools that can draw the map
I think D3 Connection map can help this

@KalpasWang
Copy link
Collaborator

KalpasWang commented Oct 27, 2023

sigma.js seems to be a good choice, too. It uses WebGL and performance is better than D3.
https://www.sigmajs.org/

@sandytang886
Copy link
Member

sandytang886 commented Oct 31, 2023

@KalpasWang
我嘗試了一下sigmajs 畫地圖,但sigmajs不能很好的固定地圖形狀,然後node是可以怎樣儲存下使用者資料,這部分也是我現階段不太能想像到怎樣做,想問下關於這個有沒有什麼建議?

@KalpasWang
Copy link
Collaborator

@sandytang886
sigma.js 我還沒試過,不過我試了 D3 跟 visx,可以參考看看我的 code
https://codesandbox.io/p/sandbox/game-map-myqxnh
個人覺得可能不需要用 sigma.js,D3 跟 visx 比較容易實作,有問題也比較容易解決。

@wingtkw
Copy link
Collaborator Author

wingtkw commented Nov 7, 2023

同意
d3 能做更多 customization
以前有用過d3 network graph
感覺不錯
visx 沒有使用過,這兩天看一看

@KalpasWang
Copy link
Collaborator

@wingtkw
visx 簡單講就是 react 版的 d3,客製化也很方便,寫法比 d3 更適合 react
缺點就是目前只支援 svg

@wingtkw
Copy link
Collaborator Author

wingtkw commented Nov 7, 2023

那可能d3 更好一點
因為我試過把map convert 成svg
效果沒有那麽好

@KalpasWang
Copy link
Collaborator

@wingtkw
意思是 map 要用 canvas 嗎?
那卡牌也要用 canvas 嗎?這樣感覺難度蠻高的…

@wingtkw
Copy link
Collaborator Author

wingtkw commented Nov 18, 2023

用 d3 + canvas 做了一個大致的map layout,
@KalpasWang @sandytang886 可以看一下
用canvas 的話performance 應該會好一些

卡牌未必需要用canvas

wingtkw added a commit that referenced this issue Nov 18, 2023
@metalalive
Copy link
Collaborator

用 d3 + canvas 做了一個大致的map layout, KalpasWang sandytang886 可以看一下 用canvas 的話performance 應該會好一些

卡牌未必需要用canvas

請問是否有可能為這部分添加單元測試案例?
或者 這個 commit 主要是數據,沒有太多應用程式邏輯

謝謝回覆

wingtkw added a commit that referenced this issue Nov 27, 2023
wingtkw added a commit that referenced this issue Nov 27, 2023
wingtkw added a commit that referenced this issue Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature For those who propose to add new feature or modify existing features frontend dev For front-end development related to this codebase
Projects
None yet
Development

No branches or pull requests

4 participants