Skip to content

Commit 43c2c8a

Browse files
authored
Merge pull request #264 from FunD-StockProject/develop
V2.1 배포 (키워드 제외)
2 parents 1cfac75 + 019f02e commit 43c2c8a

21 files changed

+5205
-337
lines changed

asconfig.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"targets": {
3+
"debug": {
4+
"outFile": "build/debug.wasm",
5+
"textFile": "build/debug.wat",
6+
"sourceMap": true,
7+
"debug": true
8+
},
9+
"release": {
10+
"outFile": "./assembly/build/release.wasm",
11+
"textFile": "./assembly/build/release.wat",
12+
"sourceMap": true,
13+
"optimizeLevel": 3,
14+
"shrinkLevel": 0,
15+
"converge": false,
16+
"noAssert": false
17+
}
18+
},
19+
"options": {
20+
"bindings": "esm"
21+
}
22+
}

command.bat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@emcc wasm/wordcloud.c -o src/utils/wasm/wordcloud.wasm -O3^
2+
-s STANDALONE_WASM^
3+
-s ENVIRONMENT=web^
4+
-s EXPORTED_FUNCTIONS=['_malloc','_free','_initSize','_initClear','_getPosition','_Update'] -g1^
5+
-s EXPORTED_RUNTIME_METHODS=['ccall','cwrap','getValue','UTF8ToString']^
6+
--no-entry^
7+
&& wasm2wat src/utils/wasm/wordcloud.wasm -o src/utils/wasm/wordcloud.wat
8+
9+
@REM @emcc --no-entry wasm/wordcloud.c -o src/utils/wasm/wordcloud.js -O3^
10+
@REM -s EXPORT_ES6=1^
11+
@REM -s ENVIRONMENT=web^
12+
@REM -s EXPORTED_FUNCTIONS=['_malloc','_free','_initSize','_initClear','_getPosition','_Update'] -g^
13+
@REM -s EXPORTED_RUNTIME_METHODS=['ccall','cwrap','getValue','UTF8ToString']
14+
15+
16+
@REM -s WASM=1^

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
as="style"
1919
/>
2020
<link href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" rel="stylesheet" />
21-
<title>인간지표</title>
21+
<title>인간지표 : 주식투자심리도우미</title>
2222
</head>
2323
<body>
2424
<div id="root" style="height: 100%; width: 100%; margin: 0 auto"></div>

package-lock.json

Lines changed: 62 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
"preview": "vite preview",
1111
"predeploy": "npm run build",
1212
"deploy": "gh-pages -d build",
13-
"gen-pwa": "pwa-assets-generator --preset minimal public/appLogo.svg"
13+
"gen-pwa": "pwa-assets-generator --preset minimal public/appLogo.svg",
14+
"asbuild:debug": "asc assembly/index.ts --target debug",
15+
"asbuild:release": "asc assembly/index.ts --target release",
16+
"asbuild": "npm run asbuild:debug && npm run asbuild:release",
17+
"test": "node tests",
18+
"start": "npx serve ."
1419
},
1520
"homepage": "https://humanzipyo.com",
1621
"dependencies": {
@@ -30,13 +35,15 @@
3035
"@eslint/js": "^9.13.0",
3136
"@svgr/rollup": "^8.1.0",
3237
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
38+
"@types/emscripten": "^1.39.13",
3339
"@types/node": "^22.10.1",
3440
"@types/react": "^18.3.10",
3541
"@types/react-dom": "^18.3.0",
3642
"@typescript-eslint/eslint-plugin": "^8.12.2",
3743
"@typescript-eslint/parser": "^8.12.2",
3844
"@vite-pwa/assets-generator": "^0.2.6",
3945
"@vitejs/plugin-react-swc": "^3.7.1",
46+
"assemblyscript": "^0.27.31",
4047
"concurrently": "^9.1.0",
4148
"eslint": "^8.57.1",
4249
"eslint-config-prettier": "^9.1.0",
@@ -57,6 +64,13 @@
5764
"vite": "^5.4.11",
5865
"vite-plugin": "^0.0.0",
5966
"vite-plugin-pwa": "^0.21.0",
60-
"vite-plugin-svgr": "^4.3.0"
67+
"vite-plugin-svgr": "^4.3.0",
68+
"vite-plugin-wasm": "^3.4.1"
69+
},
70+
"exports": {
71+
".": {
72+
"import": "./build/release.js",
73+
"types": "./build/release.d.ts"
74+
}
6175
}
6276
}

public/wasm/wordcloud.wasm

9.36 KB
Binary file not shown.

src/components/Component.style.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
import styled from '@emotion/styled';
2-
import { media } from '@styles/themes';
32

43
const Container = styled.div({
54
display: 'flex',
65
boxSizing: 'border-box',
76
width: '100%',
8-
height: '400px',
7+
height: '100%',
98
justifyContent: 'center',
109
alignItems: 'center',
1110
borderRadius: '16px',
11+
padding: '15%',
1212

13-
[media[0]]: {
14-
height: '200px',
15-
['svg']: {
16-
width: '30%',
17-
},
13+
['svg']: {
14+
width: '100%',
1815
},
1916
});
2017

src/components/StockChart/StockChart.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from './StockChart.Style';
1919
import { StockChartPriceCanvas, StockChartScoreCanvas } from './StockChartCanvas';
2020

21-
const [gridX, gridY] = [120, 50];
21+
const [gridX, gridY] = [120, 40];
2222

2323
const SCALE_RATIOS = [1, 2, 2.5, 4, 5];
2424
const PRICE_FIELD = {
@@ -786,11 +786,9 @@ const StockChartView = ({
786786
mousePosInfo={mousePosInfo}
787787
/>
788788
<StockChartInfoHeader>
789-
{!isMobile && (
790-
<StockChartInfoHeaderItem>
791-
<ChartBottomInfo trading={mousePosInfo?.trading} score={mousePosInfo?.score} />
792-
</StockChartInfoHeaderItem>
793-
)}
789+
<StockChartInfoHeaderItem>
790+
<ChartBottomInfo trading={mousePosInfo?.trading} score={mousePosInfo?.score} isMobile={isMobile} />
791+
</StockChartInfoHeaderItem>
794792
</StockChartInfoHeader>
795793
<StockChartCanvasRefContainer ref={scoreCanvasRef} />
796794
</StockChartItemContent>
@@ -899,13 +897,15 @@ const StockChartCanvasRefContainer = styled.div({
899897
const StockChartInfoHeaderItem = styled.div({
900898
background: '#00000088',
901899
display: 'flex',
900+
width: 'auto',
902901
gap: '4px',
903902
});
904903

905904
const StockChartInfoHeader = styled.div({
906905
position: 'absolute',
907906
display: 'flex',
908907
flexDirection: 'column',
908+
alignItems: 'start',
909909
gap: '8px',
910910
padding: '8px',
911911
});
@@ -931,18 +931,18 @@ const formatVolume = (volume: number) => {
931931
return a && (volume / a.num).toFixed(2) + a.type;
932932
};
933933

934-
const ChartBottomInfo = ({ trading, score }: { trading: any; score: any }) => {
934+
const ChartBottomInfo = ({ trading, score, isMobile }: { trading: any; score: any; isMobile: boolean }) => {
935935
return (
936936
<>
937937
거래량{' '}
938-
{trading && (
938+
{!isMobile && trading && (
939939
<>
940940
{formatVolume(trading.volume)}{' '}
941941
<StockInfoDeltaLabel delta={trading.delta}>{formatDeltaStr(trading.delta)}</StockInfoDeltaLabel>
942942
</>
943943
)}
944-
인간지표{' '}
945-
{score?.value && (
944+
/ 인간지표{' '}
945+
{!isMobile && score?.value && (
946946
<>
947947
{score.value}{' '}
948948
<StockInfoDeltaLabel delta={score.delta}>

src/components/StockWordCloud/StockWordCloud.Worker.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// import { WordFrequency } from './StockWordCloud.Type';
2-
31
export const testWorker = new Worker(new URL('../../utils/worker/GenerateWordCloud.ts', import.meta.url), {
42
type: 'module',
53
});

0 commit comments

Comments
 (0)