Calendar view
Search
stacks
โข
Typescript
โฆ
ํ์
์ฒดํน
โข
React, gatsbyJS
โฆ
๊ฐ์ธ ๋น static site generation์ด next.js๋ณด๋ค ํผํฌ๋จผ์ค๊ฐ ๋ ์ข๋ค๊ณ ํด์ ์ฌ์ฉํด๋ด
โข
Tailwind-css, Emotion
โฆ
Atomic css ์จ๋ณด๊ณ ์ถ์ด์. ๋์ atomic css๋ ๊ฐ๋
์ฑ์ด ๋จ์ด์ ธ์ ์ฌ์ฌ์ฉํ๋ ์ปดํฌ๋ํธ๋ @emotion/styled ๋ก semanticํ๊ฒ ๊ด๋ฆฌ
โข
D3
โฆ
Network Graph ๋ ๋๋ง
โข
Jest
โฆ
์๊ณ ๋ฆฌ์ฆ ํ
์คํธ
TODO
BFS, DFS
BFS ์๊ณ ๋ฆฌ์ฆ, ํ
์คํธ ์ฝ๋ ์์ฑ
DFS ์๊ณ ๋ฆฌ์ฆ, ํ
์คํธ ์ฝ๋ ์์ฑ
Graph Visualization
D3๋ก network graph ๋ง๋ค๊ธฐ
Graph Search ์ ๋๋ฉ์ด์
์ถ๊ฐ (๋
ธ๋ ๋ฐฉ๋ฌธํ ๋๋ง๋ค ์๊น ๋ฐ๋๊ฒ)
D3 in React
d3์ react ๋ชจ๋ DOM์ ๋ ๋๋ง์ ์กฐ์ํ๋ค. d3๋ DOM์ ์๋ก์ด ์๋ฆฌ๋จผํธ๋ฅผ ์ถ๊ฐํ๊ฑฐ๋ ์์ฑ์ ๋ฐ๊พธ๋ ๋ฑ ์ง์ ์ ์ผ๋ก DOM์ ์กฐ์ํ๋ค. react๋ ๊ฐ์ DOM์ ๋ง๋ค์ด props๋ state๊ฐ ๋ฐ๋๋ฉด DOM์ ๋ณ๊ฒฝ์ฌํญ์ ์
๋ฐ์ดํธํ๋ค.
์ด ๊ธ์ ๊ธ์ด์ด ์๊ฒฌ์ ๋ฐ๋ฅด๋ฉด react, d3๋ฅผ ๊ฐ์ด ์ฐ๋ ๊ฐ์ฅ ์ข์ ๋ฐฉ๋ฒ์ react์์๋ ์ ์ ์ธ ์ปดํฌ๋ํธ, ์ฆ d3 ์ฐจํธ์ ๊ทธ๋ฆด ์ปดํฌ๋ํธ๋ค์ react์์ ๋ ๋๋งํ๊ณ d3๋ ์ ๋๋ฉ์ด์
์ ์กฐ์ํ๋๋ก ํ๋ ๊ฒ์ด๋ผ๊ณ ํ๋ค.
react๋ง ์ฐ๋ฉด ๊ฐ๋
์ฑ์ ์ข์ ๋์ ์ d3์ transition์ ์ฐ์ง ๋ชปํ๊ณ , d3๋ง ์ฐ๋ฉด ๊ฐ๋
์ฑ์ด ์ข์ง ๋ชปํ๊ณ ํ๋์ ํ๊ทธ ์์์ ๋ชจ๋ ๊ฒ์ ์กฐ์ํด์ผํ๊ธฐ ๋๋ฌธ์ ์ปดํฌ๋ํธ์ ๊ตฌ์กฐํ๋ฅผ ๊ธฐ๋ํ ์ ์๋ค. ๊ทธ๋ฌ๋ฏ๋ก ์ ๋๋ฉ์ด์
๋ถ๋ถ์ ์ ์ธํ ์ปดํฌ๋ํธ ๋ ๋๋ง์ react๋ก, ๊ทธ ์ธ์ ์๋ฆฌ๋จผํธ์ ์์น๋ฅผ ์
๋ฐ์ดํธํ๊ฑฐ๋ ํํ๋ฅผ ๋ณํ์ํค๋ ๋ฑ ํ์ํ ๋ถ๋ถ๋ง d3๋ก ์กฐ์ํ๋ค.
Typescript: type vs interface
1.
interface๋ Object ํ์
์ผ๋ก ์ ํ๋๋ค
โข
๋ฐ๋ฉด type์ ์์ ํ์
(string, null)๋ก ๋ฐ๋ก ํํ๋ ์ ์๋ค.
โข
type์ interface๋ type์ ์ฌ์ฉํด์ ์๋ก์ด ํ์
์ ๋ง๋ค ์ ์๋ค.
type info = string | { name: string };
TypeScript
๋ณต์ฌ
2. interface๋ ํฉ์ณ์ง ์ ์์ง๋ง type์ ๊ทธ๋ ์ง ์๋ค
โข
๊ฐ์ ์ด๋ฆ์ interface๋ฅผ ์ฌ๋ฌ๋ฒ ์ ์ธํ๋ฉด ํฉ์ณ์ง ์ ์๋ค.
โข
๊ฐ์ ์ด๋ฆ์ type์ ์ฌ๋ฌ๋ฒ ์ ์ธํ๋ฉด ์ปดํ์ผ ์๋ฌ๊ฐ ๋๋ค.
interface DudeInterface {
name: string;
}
interface DudeInterface {
age: number;
}
const pawel: DudeInterface = {
name: "Pawel Grzybek",
age: 31
};
TypeScript
๋ณต์ฌ
3. type์ computed type์ key๋ก ์ฌ์ฉํ ์ ์๋ค.
โข
computed type์ด๋ ํ๊ฐ๋ ํ์
์ ๋งํ๋ค. ์๋ฅผ ๋ค์ด [key in Keys] ๋ Keys ํ์
์ ํค๋ค ์ค ํ๋๋ก ํ๊ฐ๋๋ค. ๋์ ํ๊ฐ๋ ํ์
์ ํค๋ก ์ธ ๋๋ ๋๊ดํธ ์์ ์จ์ค์ผ ํ๋ค.
โข
interface์์๋ computed type์ ํค๋ก ์ธ ์ ์๋ค.
type Keys = "firstname" | "surname"
type DudeType = {
[key in Keys]: string
}
const test: DudeType = {
firstname: "Pawel",
surname: "Grzybek"
}
TypeScript
๋ณต์ฌ
References
โข
css-graph-node (Collatz Graph)
โข
์ํค: ์ฝ๋ผ์ธ ์ถ์ธก

