mdj1412 commited on
Commit
2a479da
ยท
1 Parent(s): 8d21d0b
Files changed (6) hide show
  1. app.py +57 -11
  2. static/css/cal.css +135 -0
  3. static/css/style.css +394 -153
  4. static/js/index.js +55 -36
  5. static/js/utils.js +1 -4
  6. templates/index.html +4 -4
app.py CHANGED
@@ -129,16 +129,15 @@ def chart():
129
 
130
 
131
  # Show Ticker's Title and News's Title
132
- @app.route('/info', methods=['GET', 'POST'])
133
- def ticker_title():
134
- print("app.py : /info Start ")
135
-
136
  # Javascript ์—์„œ ๋ฐ›์€ ๋ฉ”์‹œ์ง€
137
  ticker = request.args.get('ticker')
138
  date = request.args.get('date')
139
  title = request.args.get('title')
140
  andSymbolInTitle = request.args.get('andSymbolInTitle')
141
 
 
142
 
143
  # Title ์—์„œ '&'๋กœ ํ‘œ์‹œ๋˜์–ด ์žˆ๋Š”๋ฐ ๋”ฐ๋กœ ๊ตฌ๋ณ„ํ•ด์•ผ ๋œ๋‹ค.
144
  # andSymbolInTitle ์—์„œ ๊ฐ€์ ธ์˜จ '&' ์œ„์น˜ index๋ฅผ title๊ณผ ํ•ฉ์ณ์ค€๋‹ค.
@@ -168,14 +167,61 @@ def ticker_title():
168
  else:
169
  url = url[0]
170
 
171
- example_embed1 = ticker
172
- example_embed2 = "Date: %s" % (date)
173
- example_embed3 = "Title: %s" % (title)
174
- example_embed4 = url
175
 
176
- return '''
177
- newsInit(example_embed1, example_embed2, example_embed3, example_embed4)
178
- '''
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  # return render_template('news.html', embed1=example_embed1, embed2=example_embed2, embed3=example_embed3, embed4=example_embed4)
180
 
181
 
 
129
 
130
 
131
  # Show Ticker's Title and News's Title
132
+ @app.route('/info_and_newsNER', methods=['GET', 'POST'])
133
+ def news_info_ner():
 
 
134
  # Javascript ์—์„œ ๋ฐ›์€ ๋ฉ”์‹œ์ง€
135
  ticker = request.args.get('ticker')
136
  date = request.args.get('date')
137
  title = request.args.get('title')
138
  andSymbolInTitle = request.args.get('andSymbolInTitle')
139
 
140
+ print(ticker, date, title, andSymbolInTitle)
141
 
142
  # Title ์—์„œ '&'๋กœ ํ‘œ์‹œ๋˜์–ด ์žˆ๋Š”๋ฐ ๋”ฐ๋กœ ๊ตฌ๋ณ„ํ•ด์•ผ ๋œ๋‹ค.
143
  # andSymbolInTitle ์—์„œ ๊ฐ€์ ธ์˜จ '&' ์œ„์น˜ index๋ฅผ title๊ณผ ํ•ฉ์ณ์ค€๋‹ค.
 
167
  else:
168
  url = url[0]
169
 
 
 
 
 
170
 
171
+
172
+ #######################################################
173
+
174
+ # ๋‰ด์Šค ๋ฐ์ดํ„ฐ ์œ„์น˜ ์ฐพ๊ธฐ ( in directory )
175
+ dir = os.path.join('./news', ticker, date, title+'.txt')
176
+ f = open(dir, 'r')
177
+ news_data = f.read()
178
+
179
+
180
+ # NER
181
+ nlp = spacy.load("en_core_web_sm")
182
+ doc = nlp(news_data) # News Data Analysis
183
+
184
+
185
+ # ํ•„์š”์—†๋Š” ์šฉ์–ด๋“ค ๋ฒ„๋ฆฌ๊ธฐ
186
+ print("=====================================================================")
187
+
188
+ ents = {'text': [], 'start_char': [], 'end_char': [], 'label_': []}
189
+ for ent in doc.ents:
190
+ # print(ent.text, ent.start_char, ent.end_char, ent.label_)
191
+
192
+ # ๋ฒ„๋ฆฌ๋Š” ์šฉ์–ด๋“ค
193
+ if ent.label_ == 'DATE':
194
+ continue
195
+ if ent.label_ == 'TIME':
196
+ continue
197
+ if ent.label_ == 'CARDINAL':
198
+ continue
199
+ if ent.label_ == 'MONEY':
200
+ continue
201
+ if ent.label_ == 'PERCENT':
202
+ continue
203
+ if ent.label_ == 'ORDINAL':
204
+ continue
205
+ if ent.label_ == 'PRODUCT':
206
+ continue
207
+
208
+
209
+ print(ent.text, ent.start_char, ent.end_char, ent.label_)
210
+
211
+ ents['text'].append(ent.text)
212
+ ents['start_char'].append(ent.start_char)
213
+ ents['end_char'].append(ent.end_char)
214
+ ents['label_'].append(ent.label_)
215
+
216
+ print("=====================================================================")
217
+
218
+ ents['news'] = news_data
219
+
220
+ # ents = {'text': [], 'start_char': [], 'end_char': [], 'label_': [], 'news': []}
221
+
222
+ print("ents : ", ents)
223
+
224
+ return jsonify(ticker=ticker, date=date, title=title, url=url, ents=ents)
225
  # return render_template('news.html', embed1=example_embed1, embed2=example_embed2, embed3=example_embed3, embed4=example_embed4)
226
 
227
 
static/css/cal.css ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ [ CSS ๊ธฐ๋ณธ ๋ฌธ๋ฒ• ]
3
+ AND ์—ฐ์‚ฐ์ž : ์„ ํƒ์ž ์‚ฌ์ด์— ๊ณต๋ฐฑ์ด ์ œ๊ฑฐ๋˜๋Š” ๊ฒฝ์šฐ ์—ฌ๋Ÿฌ ์„ ํƒ์ž๋ฅผ ๋™์‹œ์— ๋งŒ์กฑํ•˜๋Š” ํƒœ๊ทธ์˜ ์Šคํƒ€์ผ์„ ์ ์šฉ
4
+ OR ์—ฐ์‚ฐ์ž : ๋‘ ์„ ํƒ์ž ์ค‘ ํ•˜๋‚˜๋ผ๋„ ๋งŒ์กฑ์‹œ ์ ์šฉ๋˜๋Š” ์กฐ๊ฑด (์‰ผํ‘œ๋ฅผ ํ†ตํ•ด ๋‘ ์„ ํƒ์ž ์ค‘ ํ•˜๋‚˜๋ผ๋„ ๋งŒ์กฑ์‹œ ์ ์šฉ)
5
+
6
+
7
+ ".a .b .c" : aํด๋ž˜์Šค ๋‚ด๋ถ€์˜ bํด๋ž˜์Šค ๋‚ด๋ถ€์˜ cํด๋ž˜์Šค ์š”์†Œ์—๋งŒ ์Šคํƒ€์ผ ์ ์šฉ
8
+ ".a.b.c" : ํด๋ž˜์Šค ์†์„ฑ ๋‚ด์— a, b, c ๋ชจ๋‘ ์„ค์ •๋œ ๋ชจ๋“  ์š”์†Œ๋“ค์„ ์„ ํƒ
9
+ ".a, .b, .c" : ์ผ์น˜ํ•˜๋Š” ๋ชจ๋“  ์š”์Šค๋“ค์„ ์„ ํƒ
10
+ */
11
+
12
+
13
+ .sec_cal {
14
+ width: 360px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
15
+ margin: 0 auto;
16
+ font-family: "NotoSansR";
17
+ }
18
+
19
+ /* ".a .b .c" : aํด๋ž˜์Šค ๋‚ด๋ถ€์˜ bํด๋ž˜์Šค ๋‚ด๋ถ€์˜ cํด๋ž˜์Šค ์š”์†Œ์—๋งŒ ์Šคํƒ€์ผ ์ ์šฉ */
20
+ .sec_cal .cal_nav {
21
+ display: flex;
22
+ justify-content: center; /* ๊ฐ€๋กœ ์ถ•์„ ๊ธฐ์ค€์œผ๋กœ ์ขŒ์šฐ์— ๋Œ€ํ•œ ์ •๋ ฌ */
23
+ align-items: center; /* ์„ธ๋กœ ์ถ•์„ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌ ์œ„์•„๋ž˜์— ๋Œ€ํ•œ ์ •๋ ฌ */
24
+ font-weight: 700; /* ํฐํŠธ(font)์˜ ๊ฐ€์ค‘์น˜(weight)๋‚˜ ๊ตต๊ธฐ(boldness)๋ฅผ ๋ช…์‹œ */
25
+ font-size: 48px; /* ํฐํŠธ(font)์˜ ํฌ๊ธฐ๋ฅผ ์ง€์ • */
26
+ line-height: 78px; /* Sets the height of a line box (์ค„๊ฐ„๊ฒฉ) */
27
+ }
28
+
29
+ .sec_cal .cal_nav .year-month {
30
+ width: 300px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
31
+ text-align: center;
32
+ line-height: 1;
33
+ }
34
+
35
+ .sec_cal .cal_nav .nav {
36
+ display: flex;
37
+ border: 1px solid #333333;
38
+ border-radius: 5px;
39
+ }
40
+
41
+ .sec_cal .cal_nav .go-prev,
42
+ .sec_cal .cal_nav .go-next {
43
+ display: block;
44
+ width: 50px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
45
+ height: 78px;
46
+ font-size: 0;
47
+ display: flex;
48
+ justify-content: center;
49
+ align-items: center;
50
+ }
51
+
52
+ .sec_cal .cal_nav .go-prev::before,
53
+ .sec_cal .cal_nav .go-next::before {
54
+ content: "";
55
+ display: block;
56
+ width: 20px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
57
+ height: 20px;
58
+ border: 3px solid #000;
59
+ border-width: 3px 3px 0 0;
60
+ transition: border 0.1s;
61
+ }
62
+
63
+ .sec_cal .cal_nav .go-prev:hover::before,
64
+ .sec_cal .cal_nav .go-next:hover::before {
65
+ border-color: #ed2a61;
66
+ }
67
+
68
+ .sec_cal .cal_nav .go-prev::before {
69
+ transform: rotate(-135deg);
70
+ }
71
+
72
+ .sec_cal .cal_nav .go-next::before {
73
+ transform: rotate(45deg);
74
+ }
75
+
76
+ .sec_cal .cal_wrap {
77
+ padding-top: 40px;
78
+ position: relative;
79
+ margin: 0 auto;
80
+ }
81
+
82
+ .sec_cal .cal_wrap .days {
83
+ display: flex;
84
+ margin-bottom: 20px; /* ์š”์†Œ ํ•˜๋‹จ์˜ margin ํ•˜๋‹จ์˜ ์˜์—ญ์„ ์„ค์ • (์—ฌ์œ  ๊ณต๊ฐ„ ์„ค์ •) */
85
+ padding-bottom: 20px; /* ์š”์†Œ์˜ ๋ฐ”๋‹ฅ์—์„œ ํŒจ๋”ฉ ์˜์—ญ์˜ ๋†’์ด๋ฅผ ์„ค์ • */
86
+ border-bottom: 1px solid #ddd;
87
+ }
88
+
89
+ .sec_cal .cal_wrap::after {
90
+ top: 368px;
91
+ }
92
+
93
+ .sec_cal .cal_wrap .day {
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ width: calc(100% / 7); /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
98
+ text-align: left;
99
+ color: #999;
100
+ font-size: 12px;
101
+ text-align: center;
102
+ border-radius: 5px;
103
+ }
104
+
105
+
106
+ /* <div class="day current today">1</div> */
107
+ .current.today {
108
+ /* background: rgb(3, 179, 65); */
109
+ background: rgb(242 242 242);
110
+ }
111
+
112
+ .sec_cal .cal_wrap .dates {
113
+ display: flex;
114
+ flex-flow: wrap;
115
+ height: 290px;
116
+ }
117
+
118
+ /* Pseduo-Classes ( ๊ทธ ์ค‘์—์„œ Structural pseudo-classes ) */
119
+ .sec_cal .cal_wrap .day:nth-child(7n -1) {
120
+ color: #3c6ffa;
121
+ }
122
+
123
+ /* Pseduo-Classes ( ๊ทธ ์ค‘์—์„œ Structural pseudo-classes ) */
124
+ .sec_cal .cal_wrap .day:nth-child(7n) {
125
+ color: #ed2a61;
126
+ }
127
+
128
+ .sec_cal .cal_wrap .day.disable {
129
+ color: #ddd;
130
+ }
131
+
132
+
133
+
134
+
135
+
static/css/style.css CHANGED
@@ -10,123 +10,256 @@
10
  */
11
 
12
 
13
- .sec_cal {
14
- width: 360px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
 
 
 
15
  margin: 0 auto;
16
  font-family: "NotoSansR";
17
  }
18
 
19
- /* ".a .b .c" : aํด๋ž˜์Šค ๋‚ด๋ถ€์˜ bํด๋ž˜์Šค ๋‚ด๋ถ€์˜ cํด๋ž˜์Šค ์š”์†Œ์—๋งŒ ์Šคํƒ€์ผ ์ ์šฉ */
20
- .sec_cal .cal_nav {
21
- display: flex;
22
- justify-content: center; /* ๊ฐ€๋กœ ์ถ•์„ ๊ธฐ์ค€์œผ๋กœ ์ขŒ์šฐ์— ๋Œ€ํ•œ ์ •๋ ฌ */
23
- align-items: center; /* ์„ธ๋กœ ์ถ•์„ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌ ์œ„์•„๋ž˜์— ๋Œ€ํ•œ ์ •๋ ฌ */
24
- font-weight: 700; /* ํฐํŠธ(font)์˜ ๊ฐ€์ค‘์น˜(weight)๋‚˜ ๊ตต๊ธฐ(boldness)๋ฅผ ๋ช…์‹œ */
25
- font-size: 48px; /* ํฐํŠธ(font)์˜ ํฌ๊ธฐ๋ฅผ ์ง€์ • */
26
- line-height: 78px; /* Sets the height of a line box (์ค„๊ฐ„๊ฒฉ) */
27
- }
28
 
29
- .sec_cal .cal_nav .year-month {
30
- width: 300px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
31
- text-align: center;
32
- line-height: 1;
 
33
  }
34
 
35
- .sec_cal .cal_nav .nav {
 
 
36
  display: flex;
37
- border: 1px solid #333333;
38
- border-radius: 5px;
 
39
  }
40
 
41
- .sec_cal .cal_nav .go-prev,
42
- .sec_cal .cal_nav .go-next {
43
- display: block;
44
- width: 50px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
45
- height: 78px;
46
- font-size: 0;
47
  display: flex;
48
- justify-content: center;
49
  align-items: center;
 
 
 
 
 
 
 
50
  }
51
 
52
- .sec_cal .cal_nav .go-prev::before,
53
- .sec_cal .cal_nav .go-next::before {
54
- content: "";
55
- display: block;
56
- width: 20px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
57
- height: 20px;
58
- border: 3px solid #000;
59
- border-width: 3px 3px 0 0;
60
- transition: border 0.1s;
61
- }
62
 
63
- .sec_cal .cal_nav .go-prev:hover::before,
64
- .sec_cal .cal_nav .go-next:hover::before {
65
- border-color: #ed2a61;
66
- }
67
 
68
- .sec_cal .cal_nav .go-prev::before {
69
- transform: rotate(-135deg);
 
 
 
 
 
 
70
  }
71
 
72
- .sec_cal .cal_nav .go-next::before {
73
- transform: rotate(45deg);
 
 
 
 
 
 
 
 
 
 
74
  }
75
 
76
- .sec_cal .cal_wrap {
77
- padding-top: 40px;
78
- position: relative;
79
- margin: 0 auto;
 
 
 
 
 
80
  }
81
 
82
- .sec_cal .cal_wrap .days {
 
 
 
83
  display: flex;
84
- margin-bottom: 20px; /* ์š”์†Œ ํ•˜๋‹จ์˜ margin ํ•˜๋‹จ์˜ ์˜์—ญ์„ ์„ค์ • (์—ฌ์œ  ๊ณต๊ฐ„ ์„ค์ •) */
85
- padding-bottom: 20px; /* ์š”์†Œ์˜ ๋ฐ”๋‹ฅ์—์„œ ํŒจ๋”ฉ ์˜์—ญ์˜ ๋†’์ด๋ฅผ ์„ค์ • */
86
- border-bottom: 1px solid #ddd;
87
  }
88
 
89
- .sec_cal .cal_wrap::after {
90
- top: 368px;
 
91
  }
92
 
93
- .sec_cal .cal_wrap .day {
94
- display: flex;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  align-items: center;
 
 
 
 
 
 
96
  justify-content: center;
97
- width: calc(100% / 7); /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
98
- text-align: left;
99
- color: #999;
100
- font-size: 12px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  text-align: center;
102
- border-radius: 5px;
 
 
103
  }
104
 
105
 
106
- /* <div class="day current today">1</div> */
107
- .current.today {
108
- /* background: rgb(3, 179, 65); */
109
- background: rgb(242 242 242);
110
  }
111
 
112
- .sec_cal .cal_wrap .dates {
113
- display: flex;
114
- flex-flow: wrap;
115
- height: 290px;
116
  }
117
 
118
- /* Pseduo-Classes ( ๊ทธ ์ค‘์—์„œ Structural pseudo-classes ) */
119
- .sec_cal .cal_wrap .day:nth-child(7n -1) {
120
- color: #3c6ffa;
 
 
 
 
 
 
 
121
  }
122
 
123
- /* Pseduo-Classes ( ๊ทธ ์ค‘์—์„œ Structural pseudo-classes ) */
124
- .sec_cal .cal_wrap .day:nth-child(7n) {
125
  color: #ed2a61;
126
  }
127
-
128
- .sec_cal .cal_wrap .day.disable {
129
- color: #ddd;
130
  }
131
 
132
 
@@ -143,27 +276,9 @@
143
 
144
 
145
 
146
- /* Model ๊ด€๋ จ */
147
 
148
- /* id : "#" */
149
- #model {
150
- text-align: center;
151
- }
152
 
153
- /* id : "#" */
154
- #text-input {
155
- width: calc(100% / 2); /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
156
- height: 78px;
157
- word-break: break-all;
158
- }
159
 
160
- .text-output {
161
- width: calc(100% / 2); /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
162
- min-height: 1.2rem;
163
- margin: 1rem;
164
- border: 0.5px solid grey;
165
- padding: 0.5rem 1rem;
166
- }
167
 
168
 
169
 
@@ -174,6 +289,10 @@
174
 
175
 
176
 
 
 
 
 
177
 
178
 
179
 
@@ -182,106 +301,228 @@
182
 
183
 
184
 
185
- /* Stocks ๊ด€๋ จ */
186
 
187
 
188
- /* .sec_cal { */
189
- .stocks_wrap {
190
- width: 580px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
191
- margin: 0 auto;
192
- font-family: "NotoSansR";
193
- }
194
 
195
 
196
- /* .sec_cal .cal_wrap { */
197
- .stocks_wrap {
198
- padding-top: 40px;
199
- position: relative;
200
- margin: 0 auto;
201
- }
202
 
203
 
204
- /* .sec_cal .cal_wrap .days { */
205
- .stocks_wrap .stocks_columns {
206
- display: flex;
207
- margin-bottom: 20px; /* ์š”์†Œ ํ•˜๋‹จ์˜ margin ํ•˜๋‹จ์˜ ์˜์—ญ์„ ์„ค์ • */
208
- padding-bottom: 20px; /* ์š”์†Œ์˜ ๋ฐ”๋‹ฅ์—์„œ ํŒจ๋”ฉ ์˜์—ญ์˜ ๋†’์ด๋ฅผ ์„ค์ • */
209
- border-bottom: 1px solid #ddd;
210
- }
211
 
212
 
213
- /* .sec_cal .cal_wrap .day { */
214
- .stocks_wrap .stocks_columns .column,
215
- .stocks_wrap .stocks .stock {
216
- display: flex;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  align-items: center;
 
 
 
 
 
 
218
  justify-content: center;
219
- width: 50px;
220
- text-align: left;
221
- color: #999;
222
- font-size: 12px;
 
 
 
 
 
 
223
  text-align: center;
224
- border-radius: 5px; /* rounds the corners of an element's outer border edge. */
225
- }
226
 
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
 
229
 
230
- .stocks_wrap .stocks_columns .column {
231
- font-size: 17px;
232
- /* width: 70px; */
233
  }
234
- .stocks_wrap .stocks .stock {
235
- font-size: 13px;
236
- /* width: 35px; */
 
 
 
237
  }
238
 
 
 
 
239
 
240
- .name {
241
- margin-right: 30px;
242
- margin-left: 30px;
243
  }
244
- .sector, .industry{
245
- margin-right: 18px;
246
- margin-left: 48px;
247
  }
248
- .dff, .open, .close {
249
- margin-right: 5px;
250
- margin-left: 5px;
251
  }
252
 
253
- .stocks_wrap .stocks .ticker {
254
- color: #04b70d;
255
- text-decoration: underline;
256
  }
257
- .stocks_wrap .stocks .up {
258
- color: #ed2a61;
 
 
259
  }
260
- .stocks_wrap .stocks .down {
261
- color: #3c6ffa;
 
 
 
 
 
262
  }
263
 
264
 
265
 
266
- /* .sec_cal .cal_wrap .dates { */
267
- .stocks_wrap .stocks {
268
- display: flex;
269
- flex-flow: wrap;
270
- height: 5000px; /* ๋†’์ด ๊ฐ„๊ฒฉ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  }
272
 
273
 
 
 
 
274
 
275
 
276
 
 
 
 
 
 
 
277
 
 
 
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
 
 
280
 
 
 
 
 
 
281
 
 
 
 
 
 
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
 
284
- /* h1 ํƒœ๊ทธ ๋ถ€๋ถ„ */
285
- .gohome {
 
 
286
  text-decoration: none;
287
  }
 
10
  */
11
 
12
 
13
+ /* Stocks ๊ด€๋ จ */
14
+
15
+ /* .sec_cal { */
16
+ #nasdaq-table-container .stocks_wrap {
17
+ width: 580px; /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
18
  margin: 0 auto;
19
  font-family: "NotoSansR";
20
  }
21
 
 
 
 
 
 
 
 
 
 
22
 
23
+ /* .sec_cal .cal_wrap { */
24
+ #nasdaq-table-container .stocks_wrap {
25
+ padding-top: 40px;
26
+ position: relative;
27
+ margin: 0 auto;
28
  }
29
 
30
+
31
+ /* .sec_cal .cal_wrap .days { */
32
+ #nasdaq-table-container .stocks_wrap .stocks_columns {
33
  display: flex;
34
+ margin-bottom: 20px; /* ์š”์†Œ ํ•˜๋‹จ์˜ margin ํ•˜๋‹จ์˜ ์˜์—ญ์„ ์„ค์ • */
35
+ padding-bottom: 20px; /* ์š”์†Œ์˜ ๋ฐ”๋‹ฅ์—์„œ ํŒจ๋”ฉ ์˜์—ญ์˜ ๋†’์ด๋ฅผ ์„ค์ • */
36
+ border-bottom: 1px solid #ddd;
37
  }
38
 
39
+
40
+ /* .sec_cal .cal_wrap .day { */
41
+ #nasdaq-table-container .stocks_wrap .stocks_columns .column,
42
+ #nasdaq-table-container .stocks_wrap .stocks .stock {
 
 
43
  display: flex;
 
44
  align-items: center;
45
+ justify-content: center;
46
+ width: 50px;
47
+ text-align: left;
48
+ color: #999;
49
+ font-size: 12px;
50
+ text-align: center;
51
+ border-radius: 5px; /* rounds the corners of an element's outer border edge. */
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
54
 
 
 
 
 
55
 
56
+
57
+ #nasdaq-table-container .stocks_wrap .stocks_columns .column {
58
+ font-size: 17px;
59
+ /* width: 70px; */
60
+ }
61
+ #nasdaq-table-container .stocks_wrap .stocks .stock {
62
+ font-size: 13px;
63
+ /* width: 35px; */
64
  }
65
 
66
+
67
+ #nasdaq-table-container .name {
68
+ margin-right: 30px;
69
+ margin-left: 30px;
70
+ }
71
+ #nasdaq-table-container .sector, .industry{
72
+ margin-right: 18px;
73
+ margin-left: 48px;
74
+ }
75
+ #nasdaq-table-container .dff, .open, .close {
76
+ margin-right: 5px;
77
+ margin-left: 5px;
78
  }
79
 
80
+ #nasdaq-table-container .stocks_wrap .stocks .ticker {
81
+ color: #04b70d;
82
+ text-decoration: underline;
83
+ }
84
+ #nasdaq-table-container .stocks_wrap .stocks .up {
85
+ color: #ed2a61;
86
+ }
87
+ #nasdaq-table-container .stocks_wrap .stocks .down {
88
+ color: #3c6ffa;
89
  }
90
 
91
+
92
+
93
+ /* .sec_cal .cal_wrap .dates { */
94
+ #nasdaq-table-container .stocks_wrap .stocks {
95
  display: flex;
96
+ flex-flow: wrap;
97
+ height: 5000px; /* ๋†’์ด ๊ฐ„๊ฒฉ */
 
98
  }
99
 
100
+ /* h1 ํƒœ๊ทธ ๋ถ€๋ถ„ */
101
+ #nasdaq-table-container .gohome {
102
+ text-decoration: none;
103
  }
104
 
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ /*
119
+ ์œ„ : nasdaq-table-container ๊ด€๋ จ CSS
120
+ ์•„๋ž˜ : chart-container ๊ด€๋ จ CSS
121
+ */
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ /* id : "#" */
139
+ #chart-container .myChart-container {
140
+ /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„๋ฅผ ์ง€์ • */
141
+ width: 60vw;
142
+
143
+ /* ์†์„ฑ์˜ ์š”์†Œ์˜ ๋†’์ด๋ฅผ ์ง€์ • */
144
+ height: 30vh;
145
+
146
+ /*
147
+ [ margin ํƒœ๊ทธ ]
148
+ margin-top (์ƒ๋‹จ ์—ฌ๋ฐฑ)
149
+ margin-right (์˜ค๋ฅธ์ชฝ ์—ฌ๋ฐฑ)
150
+ margin-bottom (์•„๋ž˜ ์—ฌ๋ฐฑ)
151
+ margin-left (์™ผ์ชฝ ์—ฌ๋ฐฑ)
152
+
153
+ ์ง€์ •๊ฐ’์€ px, cm, %๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
154
+ ์Œ์ˆ˜๊ฐ’๋„ ์ง€์ • ๊ฐ€๋Šฅ(ex. -10px)
155
+
156
+ * 4๋ฉด ํ•œ๊บผ๋ฒˆ์— margin ์ง€์ •ํ•˜๊ธฐ
157
+ ex) margin: 5px 7px 3px 0px;
158
+ (์œ„, ์˜ค๋ฅธ์ชฝ, ์•„๋ž˜, ์™ผ์ชฝ)
159
+ * 4๋ฉด์ด ๋ชจ๋‘ ๊ฐ™์„ ๋•Œ margin ์ง€์ •ํ•˜๊ธฐ
160
+ ex) margin: 5px;
161
+ * ์œ„, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ, ์•„๋ž˜ margin ์ง€์ •ํ•˜๊ธฐ
162
+ ex) margin: 5px 10px 0px;
163
+ * ์œ„&์•„๋ž˜, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ margin ์ง€์ •ํ•˜๊ธฐ
164
+ ex) margin: 5px 10px;
165
+ * margin ์ž๋™ ์ง€์ •ํ•˜๊ธฐ
166
+ ex) margin: auto 0;
167
+ (์œ„์•„๋ž˜ ๊ฐ’์ด ์ž๋™, ์ขŒ์šฐ๊ฐ€ 0px)
168
+ ex) margin-left: auto;
169
+
170
+ */
171
+ margin: 40px auto;
172
+ padding-bottom: 13%;
173
+ }
174
+
175
+ #chart-container .table {
176
+ /*
177
+ [ align-items ํƒœ๊ทธ ]
178
+ flex-box ์š”์†Œ์˜ ์ˆ˜์ง ๋ฐฉํ–ฅ ์ •๋ ฌ ๋ฐฉ์‹์„ ์„ค์ •
179
+ ex. flex-start, flex-end, center
180
+ */
181
  align-items: center;
182
+
183
+ /*
184
+ [ justify-content ํƒœ๊ทธ ]
185
+ flex-box ์š”์†Œ์˜ ์ˆ˜ํ‰ ๋ฐฉํ–ฅ ์ •๋ ฌ ๋ฐฉ์‹์„ ์„ค์ •
186
+ ex. flex-start, flex-end, center
187
+ */
188
  justify-content: center;
189
+
190
+
191
+ /*
192
+ [ margin ํƒœ๊ทธ ]
193
+ margin-top (์ƒ๋‹จ ์—ฌ๋ฐฑ)
194
+ margin-right (์˜ค๋ฅธ์ชฝ ์—ฌ๋ฐฑ)
195
+ margin-bottom (์•„๋ž˜ ์—ฌ๋ฐฑ)
196
+ margin-left (์™ผ์ชฝ ์—ฌ๋ฐฑ)
197
+
198
+ ์ง€์ •๊ฐ’์€ px, cm, %๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
199
+ ์Œ์ˆ˜๊ฐ’๋„ ์ง€์ • ๊ฐ€๋Šฅ(ex. -10px)
200
+
201
+ * 4๋ฉด ํ•œ๊บผ๋ฒˆ์— margin ์ง€์ •ํ•˜๊ธฐ
202
+ ex) margin: 5px 7px 3px 0px;
203
+ (์œ„, ์˜ค๋ฅธ์ชฝ, ์•„๋ž˜, ์™ผ์ชฝ)
204
+ * 4๋ฉด์ด ๋ชจ๋‘ ๊ฐ™์„ ๋•Œ margin ์ง€์ •ํ•˜๊ธฐ
205
+ ex) margin: 5px;
206
+ * ์œ„, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ, ์•„๋ž˜ margin ์ง€์ •ํ•˜๊ธฐ
207
+ ex) margin: 5px 10px 0px;
208
+ * ์œ„&์•„๋ž˜, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ margin ์ง€์ •ํ•˜๊ธฐ
209
+ ex) margin: 5px 10px;
210
+ * margin ์ž๋™ ์ง€์ •ํ•˜๊ธฐ
211
+ ex) margin: auto 0;
212
+ (์œ„์•„๋ž˜ ๊ฐ’์ด ์ž๋™, ์ขŒ์šฐ๊ฐ€ 0px)
213
+ ex) margin-left: auto;
214
+
215
+ */
216
+ margin: 20px auto;
217
+
218
+
219
+ /*
220
+ [ text-align ํƒœ๊ทธ ]
221
+ ํ…์ŠคํŠธ์˜ ์ •๋ ฌ ๋ฐฉํ–ฅ์„ ์„ค์ •
222
+
223
+ left: ์™ผ์ชฝ ์ •๋ ฌ
224
+ right: ์˜ค๋ฅธ์ชฝ ์ •๋ ฌ
225
+ center: ์ค‘์•™ ์ •๋ ฌ
226
+ justify: ์–‘์ชฝ ์ •๋ ฌ (์ž๋™ ์ค„๋ฐ”๊ฟˆ์‹œ ์˜ค๋ฅธ์ชฝ ๊ฒฝ๊ณ„์„  ๋ถ€๋ถ„ ์ •๋ฆฌ)
227
+ */
228
  text-align: center;
229
+
230
+
231
+ padding-top: 50px;
232
  }
233
 
234
 
235
+ #chart-container .table .title-width {
236
+ width: 10px;
237
+ text-align: center;
 
238
  }
239
 
240
+
241
+ #chart-container .table .table-title {
242
+ font-size: 50px;
 
243
  }
244
 
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+ /* h1, h2 ํƒœ๊ทธ ๋ถ€๋ถ„ */
253
+ #chart-container .gohome, .goticker {
254
+ text-decoration: none;
255
  }
256
 
257
+
258
+ #chart-container .table .news-table .news.diff.up {
259
  color: #ed2a61;
260
  }
261
+ #chart-container .table .news-table .news.diff.down {
262
+ color: #3c6ffa;
 
263
  }
264
 
265
 
 
276
 
277
 
278
 
 
279
 
 
 
 
 
280
 
 
 
 
 
 
 
281
 
 
 
 
 
 
 
 
282
 
283
 
284
 
 
289
 
290
 
291
 
292
+ /*
293
+ ์œ„ : chart-container ๊ด€๋ จ CSS
294
+ ์•„๋ž˜ : news-container ๊ด€๋ จ CSS
295
+ */
296
 
297
 
298
 
 
301
 
302
 
303
 
 
304
 
305
 
 
 
 
 
 
 
306
 
307
 
 
 
 
 
 
 
308
 
309
 
 
 
 
 
 
 
 
310
 
311
 
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+ /* ner ๊ด€๋ จ */
323
+
324
+ #news-container .ner-box {
325
+ width: calc(92%); /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„๋ฅผ ์ง€์ • */
326
+ height: 500px; /* ์†์„ฑ์˜ ์š”์†Œ์˜ ๋†’์ด๋ฅผ ์ง€์ • */
327
+
328
+
329
+ /*
330
+ [ align-items ํƒœ๊ทธ ]
331
+ flex-box ์š”์†Œ์˜ ์ˆ˜์ง ๋ฐฉํ–ฅ ์ •๋ ฌ ๋ฐฉ์‹์„ ์„ค์ •
332
+ ex. flex-start, flex-end, center
333
+ */
334
  align-items: center;
335
+
336
+ /*
337
+ [ justify-content ํƒœ๊ทธ ]
338
+ flex-box ์š”์†Œ์˜ ์ˆ˜ํ‰ ๋ฐฉํ–ฅ ์ •๋ ฌ ๋ฐฉ์‹์„ ์„ค์ •
339
+ ex. flex-start, flex-end, center
340
+ */
341
  justify-content: center;
342
+
343
+ /*
344
+ [ text-align ํƒœ๊ทธ ]
345
+ ํ…์ŠคํŠธ์˜ ์ •๋ ฌ ๋ฐฉํ–ฅ์„ ์„ค์ •
346
+
347
+ left: ์™ผ์ชฝ ์ •๋ ฌ
348
+ right: ์˜ค๋ฅธ์ชฝ ์ •๋ ฌ
349
+ center: ์ค‘์•™ ์ •๋ ฌ
350
+ justify: ์–‘์ชฝ ์ •๋ ฌ (์ž๋™ ์ค„๋ฐ”๊ฟˆ์‹œ ์˜ค๋ฅธ์ชฝ ๊ฒฝ๊ณ„์„  ๋ถ€๋ถ„ ์ •๋ฆฌ)
351
+ */
352
  text-align: center;
 
 
353
 
354
 
355
+ /*
356
+ [ margin ํƒœ๊ทธ ]
357
+ margin-top (์ƒ๋‹จ ์—ฌ๋ฐฑ)
358
+ margin-right (์˜ค๋ฅธ์ชฝ ์—ฌ๋ฐฑ)
359
+ margin-bottom (์•„๋ž˜ ์—ฌ๋ฐฑ)
360
+ margin-left (์™ผ์ชฝ ์—ฌ๋ฐฑ)
361
+
362
+ ์ง€์ •๊ฐ’์€ px, cm, %๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
363
+ ์Œ์ˆ˜๊ฐ’๋„ ์ง€์ • ๊ฐ€๋Šฅ(ex. -10px)
364
+
365
+ * 4๋ฉด ํ•œ๊บผ๋ฒˆ์— margin ์ง€์ •ํ•˜๊ธฐ
366
+ ex) margin: 5px 7px 3px 0px;
367
+ (์œ„, ์˜ค๋ฅธ์ชฝ, ์•„๋ž˜, ์™ผ์ชฝ)
368
+ * 4๋ฉด์ด ๋ชจ๋‘ ๊ฐ™์„ ๋•Œ margin ์ง€์ •ํ•˜๊ธฐ
369
+ ex) margin: 5px;
370
+ * ์œ„, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ, ์•„๋ž˜ margin ์ง€์ •ํ•˜๊ธฐ
371
+ ex) margin: 5px 10px 0px;
372
+ * ์œ„&์•„๋ž˜, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ margin ์ง€์ •ํ•˜๊ธฐ
373
+ ex) margin: 5px 10px;
374
+ * margin ์ž๋™ ์ง€์ •ํ•˜๊ธฐ
375
+ ex) margin: auto 0;
376
+ (์œ„์•„๋ž˜ ๊ฐ’์ด ์ž๋™, ์ขŒ์šฐ๊ฐ€ 0px)
377
+ ex) margin-left: auto;
378
+
379
+ */
380
+ margin: 1rem;
381
 
382
 
383
+ min-height: 1.2rem;
384
+ border: 0.5px solid grey;
385
+ padding: 0.5rem 1rem;
386
  }
387
+
388
+
389
+
390
+ /* NER label_ */
391
+ #news-container .entities .entity_person {
392
+ background-color: #aa9cfc;
393
  }
394
 
395
+ #news-container .entities .entity_org {
396
+ background-color: #7aecec;
397
+ }
398
 
399
+ #news-container .entities .entity_fac {
400
+ background-color: #9cc9cc;
 
401
  }
402
+
403
+ #news-container .entities .entity_gpe {
404
+ background-color: #feca74;
405
  }
406
+
407
+ #news-container .entities .entity_product {
408
+ background-color: #bfeeb7;
409
  }
410
 
411
+ #news-container .entities .none {
412
+ background-color: transparent;
 
413
  }
414
+
415
+ /* ๋งˆ์šฐ์Šค ์˜ฌ๋ ธ์„ ๋•Œ, ๋ณด์ด๊ฒŒ ํ•˜๋Š” ๊ฒƒ */
416
+ #news-container .entities .show-label {
417
+ display: none;
418
  }
419
+
420
+ #news-container .entities .entity_person:hover .show-label,
421
+ #news-container .entities .entity_org:hover .show-label,
422
+ #news-container .entities .entity_fac:hover .show-label,
423
+ #news-container .entities .entity_gpe:hover .show-label,
424
+ #news-container .entities .entity_product:hover .show-label {
425
+ display: block;
426
  }
427
 
428
 
429
 
430
+
431
+
432
+ /* Model ๊ด€๋ จ */
433
+
434
+ /* id : "#" */
435
+ #news-container #model {
436
+ /*
437
+ [ text-align ํƒœ๊ทธ ]
438
+ ํ…์ŠคํŠธ์˜ ์ •๋ ฌ ๋ฐฉํ–ฅ์„ ์„ค์ •
439
+
440
+ left: ์™ผ์ชฝ ์ •๋ ฌ
441
+ right: ์˜ค๋ฅธ์ชฝ ์ •๋ ฌ
442
+ center: ์ค‘์•™ ์ •๋ ฌ
443
+ justify: ์–‘์ชฝ ์ •๋ ฌ (์ž๋™ ์ค„๋ฐ”๊ฟˆ์‹œ ์˜ค๋ฅธ์ชฝ ๊ฒฝ๊ณ„์„  ๋ถ€๋ถ„ ์ •๋ฆฌ)
444
+ */
445
+ text-align: center;
446
+ }
447
+
448
+ /* id : "#" */
449
+ #news-container #text-input {
450
+ width: calc(100% / 2); /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
451
+ height: 78px; /* ์†์„ฑ์˜ ์š”์†Œ์˜ ๋†’์ด๋ฅผ ์ง€์ • */
452
+ word-break: break-all;
453
  }
454
 
455
 
456
+ #news-container .text-output {
457
+ width: calc(100% * (2/3)); /* ์†์„ฑ์˜ ์š”์†Œ ๋„ˆ๋น„ */
458
+ min-height: 10rem;
459
 
460
 
461
 
462
+ /*
463
+ [ margin ํƒœ๊ทธ ]
464
+ margin-top (์ƒ๋‹จ ์—ฌ๋ฐฑ)
465
+ margin-right (์˜ค๋ฅธ์ชฝ ์—ฌ๋ฐฑ)
466
+ margin-bottom (์•„๋ž˜ ์—ฌ๋ฐฑ)
467
+ margin-left (์™ผ์ชฝ ์—ฌ๋ฐฑ)
468
 
469
+ ์ง€์ •๊ฐ’์€ px, cm, %๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
470
+ ์Œ์ˆ˜๊ฐ’๋„ ์ง€์ • ๊ฐ€๋Šฅ(ex. -10px)
471
 
472
+ * 4๋ฉด ํ•œ๊บผ๋ฒˆ์— margin ์ง€์ •ํ•˜๊ธฐ
473
+ ex) margin: 5px 7px 3px 0px;
474
+ (์œ„, ์˜ค๋ฅธ์ชฝ, ์•„๋ž˜, ์™ผ์ชฝ)
475
+ * 4๋ฉด์ด ๋ชจ๋‘ ๊ฐ™์„ ๋•Œ margin ์ง€์ •ํ•˜๊ธฐ
476
+ ex) margin: 5px;
477
+ * ์œ„, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ, ์•„๋ž˜ margin ์ง€์ •ํ•˜๊ธฐ
478
+ ex) margin: 5px 10px 0px;
479
+ * ์œ„&์•„๋ž˜, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ margin ์ง€์ •ํ•˜๊ธฐ
480
+ ex) margin: 5px 10px;
481
+ * margin ์ž๋™ ์ง€์ •ํ•˜๊ธฐ
482
+ ex) margin: auto 0;
483
+ (์œ„์•„๋ž˜ ๊ฐ’์ด ์ž๋™, ์ขŒ์šฐ๊ฐ€ 0px)
484
+ ex) margin-left: auto;
485
 
486
+ */
487
+ margin: 20px auto;
488
 
489
+ /*
490
+ [ border ํƒœ๊ทธ ]
491
+ ํ•ด๋‹น ํƒœ๊ทธ์˜ ํ…Œ๋‘๋ฆฌ๋ฅผ ์„ค์ •
492
+ width - style - color
493
+ border-width - border-style - border-color
494
 
495
+ border-width : ํ…Œ๋‘๋ฆฌ์˜ ๋‘๊ป˜๋กœ, ์ฃผ๋กœ px ๋‹จ์œ„๋ฅผ ์‚ฌ์šฉ
496
+ border-style : ํ…Œ๋‘๋ฆฌ์˜ ์Šคํƒ€์ผ๋กœ ์‹ค์„ , ์ ์„ , ์ด์ค‘์„  ๋“ฑ์˜ ์˜ต์…˜์ด ์กด์žฌ
497
+ border-color : ํ…Œ๋‘๋ฆฌ์˜ ์ƒ‰์ƒ์œผ๋กœ, ๊ฐ’์€ color ์†์„ฑ์˜ ํฌ๋งท์„ ์‚ฌ์šฉ
498
+ */
499
+ border: 0.5px solid grey;
500
 
501
+ /*
502
+ [ padding ํƒœ๊ทธ ]
503
+ ์ง€์ •๊ฐ’์€ px, cm, %๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
504
+ margin์€ ์Œ์ˆ˜๊ฐ’์ด ์ง€์ • ๊ฐ€๋Šฅํ•˜์ง€๋งŒ padding์€ ์Œ์ˆ˜๊ฐ’ ์ง€์ •์ด ์•ˆ๋œ๋‹ค.
505
+
506
+ padding ํƒœ๊ทธ์™€ ๋น„์Šทํ•œ ํƒœ๊ทธ
507
+ : padding-top, padding-right, padding-bottom, padding-left
508
+
509
+ * 4๋ฉด ํ•œ๊บผ๋ฒˆ์— padding ์ง€์ •ํ•˜๊ธฐ
510
+ ex) padding: 5px, 7px, 3px, 0px;
511
+ (์œ„, ์˜ค๋ฅธ์ชฝ, ์•„๋ž˜, ์™ผ์ชฝ)
512
+ * 4๋ฉด ๋ชจ๋‘ ๊ฐ™์„ ๋•Œ padding ์ง€์ •ํ•˜๊ธฐ
513
+ ex) padding: 5px;
514
+ * ์œ„, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ, ์•„๋ž˜ padding ์ง€์ •ํ•˜๊ธฐ
515
+ ex) padding: 5px 10px 0px;
516
+ * ์œ„&์•„๋ž˜, ์˜ค๋ฅธ์ชฝ&์™ผ์ชฝ padding ์ง€์ •ํ•˜๊ธฐ
517
+ ex) padding: 5px, 10px;
518
+
519
+ */
520
+ padding: 0.5rem 1rem;
521
+ }
522
 
523
+
524
+
525
+ /* h1, h2 ํƒœ๊ทธ ๋ถ€๋ถ„ */
526
+ #news-container .gohome, .goticker {
527
  text-decoration: none;
528
  }
static/js/index.js CHANGED
@@ -137,9 +137,6 @@ function chartInit(ticker) {
137
 
138
  // Javascript -> Flask (Python) -> Javascript
139
  let [chart_data, news_articles] = sendAjax_sync_about_chartData_and_newsArticles("/chart", {"ticker": ticker}, "json", handle_two_return);
140
- // console.log(chart_data, news_articles);
141
- // console.log(chart_data);
142
- // console.log(Object.keys(chart_data.Close));
143
 
144
 
145
  // x์ถ•๊ณผ data ์„ค์ •
@@ -178,8 +175,8 @@ function chartInit(ticker) {
178
  // Javascript๋ฅผ ์ด์šฉํ•ด HTML์— ๋™์ ์œผ๋กœ ํƒœ๊ทธ ์ถ”๊ฐ€
179
 
180
  // a ํƒœ๊ทธ onclick ์ ์šฉ
181
- execution_function = String('javascript:chartInit(\''.concat(ticker, '\');'));
182
- const goTicker = document.querySelector('.goticker');
183
  goTicker.setAttribute('href', execution_function);
184
 
185
  //////////////////////////////////////////////////////////////////
@@ -235,15 +232,23 @@ function chartInit(ticker) {
235
  }
236
  // console.log(key_list);
237
 
 
 
 
 
 
 
 
238
  // List ์•ˆ์˜ value๋ฅผ ๋ฝ‘์„ ๋•Œ, (Python) => for item in list:
239
  Object.keys(sorted_news).forEach(key => {
240
- var idx = key_list.indexOf(String(key));
 
241
 
242
- if (idx != -1) { var diff = ((open_list[idx]-close_list[idx-1])/(open_list[idx]) * 100.0).toFixed(2); }
243
  else { var diff = '.'; }
244
 
245
  if (diff == '.') {
246
- var diff_html = '<th class="news diff">' + diff + '</th>';
247
  }
248
  else if (diff > 0) {
249
  var diff_html = '<th class="news diff up">+' + diff + ' %</th>';
@@ -251,12 +256,11 @@ function chartInit(ticker) {
251
  else {
252
  var diff_html = '<th class="news diff down">' + diff + ' %</th>';
253
  }
254
- var html = '<tr align="center" bgcolor="white"><th>+</th><th>' + key + '</th>' + diff_html + '<td style="text-align: left;">';
255
 
256
  for (var i = 0; i < sorted_news[key].length; i++) {
257
  var title = sorted_news[key][i].substring(0, sorted_news[key][i].length-4);
258
  var sendTitle = title; // Javascript -> Python ๋ณด๋‚ด๊ธฐ ์œ„ํ•œ title
259
- console.log("title : ", title);
260
 
261
 
262
  // title์—์„œ & ํ‘œ์‹œ๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ์Œ.
@@ -274,26 +278,43 @@ function chartInit(ticker) {
274
  // console.log(sendTitle);
275
  andSymbolInTitle.push(idx + andSymbolInTitle.length);
276
  }
277
- // console.log("title : ", title);
278
- // console.log("sendTitle : ", sendTitle);
279
- // console.log("andSymbolInTitle : ", andSymbolInTitle);
280
 
281
- var link = String('"/info?ticker='.concat(ticker, '&date=', key, '&title=', sendTitle, '&andSymbolInTitle=', andSymbolInTitle, '"'));
 
282
  // console.log(link);
283
-
284
- var execution_function = String(`javascript:newsInit(\'${ticker}\',\'${key}\',\'${sendTitle}\',\'${andSymbolInTitle}\');`);
 
285
  // console.log("execution_function : ", execution_function);
286
- html = html + '<a href=' + link + '>' + title + '</a><br>';
 
287
  }
288
  html = html + '</td>';
289
-
290
  news_table.innerHTML = news_table.innerHTML + html;
291
  });
292
  }
293
 
294
 
295
 
 
 
 
 
296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
 
298
 
299
 
@@ -311,23 +332,16 @@ function chartInit(ticker) {
311
  *
312
  *
313
  */
314
- function newsInit(ticker1, date1, title1, andSymbolInTitle1) {
315
- console.log("newsInit start");
316
  // HTML ์ˆ˜์ •
317
  $("#nasdaq-table-container").hide();
318
  $("#chart-container").hide();
319
  $("#news-container").show();
320
 
321
- spaceIndex_inTitle = andSymbolInTitle1.split(',');
322
- var list_length = spaceIndex_inTitle.length;
323
- for (var i=0; i<list_length; i++) {
324
- title1 = title1.substring(0, i) + ' ' + title1.substring(i, title1.length);
325
- }
326
-
327
- console.log(ticker1);
328
- console.log(date1);
329
- console.log(title1);
330
- console.log(andSymbolInTitle1);
331
 
332
 
333
 
@@ -335,29 +349,34 @@ function newsInit(ticker1, date1, title1, andSymbolInTitle1) {
335
 
336
  // Javascript๋ฅผ ์ด์šฉํ•ด HTML์— ๋™์ ์œผ๋กœ ํƒœ๊ทธ ์ถ”๊ฐ€
337
 
 
 
 
 
338
 
339
 
340
  // a ํƒœ๊ทธ onclick ์ ์šฉ
341
- execution_function = String('javascript:chartInit(\''.concat(ticker, '\');'));
342
- const goTicker = document.querySelector('.goticker');
 
343
  goTicker.setAttribute('href', execution_function);
344
 
345
 
346
  // a ํƒœ๊ทธ์— URL ์ ์šฉ
347
- const addURL = document.querySelector('.NewsURL .input-News-URL');
348
  addURL.setAttribute('href', url);
349
 
350
 
351
  // ๋ชจ๋ธ์—์„œ ์งˆ๋ฌธ ์˜ˆ์‹œ Ticker์— ์•Œ๋งž๊ฒŒ ์ž‘์„ฑํ•˜๊ธฐ
352
- const example_value = document.querySelector('#model .text-form #text-input');
353
  example = "Why did " + ticker + "'s stock go down?";
354
- example_value.setAttribute('value', example);
355
 
356
 
357
  //////////////////////////////////////////////////////////////////////
358
  // NER ๊ด€๋ จ
359
 
360
- ents = sendAjax_sync('/ner', {'ticker': ticker, 'date': date, 'title': title}, dataType="json", handle=handle_one_return);
361
  // ents = {'text': [], 'start_char': [], 'end_char': [], 'label_': [], 'news': []}
362
  console.log(ents);
363
 
 
137
 
138
  // Javascript -> Flask (Python) -> Javascript
139
  let [chart_data, news_articles] = sendAjax_sync_about_chartData_and_newsArticles("/chart", {"ticker": ticker}, "json", handle_two_return);
 
 
 
140
 
141
 
142
  // x์ถ•๊ณผ data ์„ค์ •
 
175
  // Javascript๋ฅผ ์ด์šฉํ•ด HTML์— ๋™์ ์œผ๋กœ ํƒœ๊ทธ ์ถ”๊ฐ€
176
 
177
  // a ํƒœ๊ทธ onclick ์ ์šฉ
178
+ var execution_function = `javascript:chartInit('${ticker}')`;
179
+ const goTicker = document.querySelector('#chart-container .goticker');
180
  goTicker.setAttribute('href', execution_function);
181
 
182
  //////////////////////////////////////////////////////////////////
 
232
  }
233
  // console.log(key_list);
234
 
235
+
236
+
237
+
238
+
239
+
240
+ var link_list_idx = 0;
241
+
242
  // List ์•ˆ์˜ value๋ฅผ ๋ฝ‘์„ ๋•Œ, (Python) => for item in list:
243
  Object.keys(sorted_news).forEach(key => {
244
+ var date_idx_in_key_list = key_list.indexOf(String(key));
245
+ // console.log(key, key_list, date_idx_in_key_list);
246
 
247
+ if (date_idx_in_key_list != -1) { var diff = ((open_list[date_idx_in_key_list]-close_list[date_idx_in_key_list-1])/(open_list[date_idx_in_key_list]) * 100.0).toFixed(2); }
248
  else { var diff = '.'; }
249
 
250
  if (diff == '.') {
251
+ var diff_html = '<th class="news diff">0.0 %</th>';
252
  }
253
  else if (diff > 0) {
254
  var diff_html = '<th class="news diff up">+' + diff + ' %</th>';
 
256
  else {
257
  var diff_html = '<th class="news diff down">' + diff + ' %</th>';
258
  }
259
+ var html = `<tr align="center" bgcolor="white"><th>+</th><th>${key}</th>${diff_html}<td style="text-align: left;">`;
260
 
261
  for (var i = 0; i < sorted_news[key].length; i++) {
262
  var title = sorted_news[key][i].substring(0, sorted_news[key][i].length-4);
263
  var sendTitle = title; // Javascript -> Python ๋ณด๋‚ด๊ธฐ ์œ„ํ•œ title
 
264
 
265
 
266
  // title์—์„œ & ํ‘œ์‹œ๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ์Œ.
 
278
  // console.log(sendTitle);
279
  andSymbolInTitle.push(idx + andSymbolInTitle.length);
280
  }
 
 
 
281
 
282
+
283
+ var link = String(`/info_and_newsNER?ticker=${ticker}&date=${key}&title=${sendTitle}&andSymbolInTitle=${andSymbolInTitle}`);
284
  // console.log(link);
285
+ linkList.push(link);
286
+
287
+ var execution_function = String(`javascript:getData(linkList[${link_list_idx}]);`);
288
  // console.log("execution_function : ", execution_function);
289
+ html = html + '<a href="' + execution_function + '">' + title + '</a><br>';
290
+ link_list_idx = link_list_idx + 1;
291
  }
292
  html = html + '</td>';
 
293
  news_table.innerHTML = news_table.innerHTML + html;
294
  });
295
  }
296
 
297
 
298
 
299
+ linkList = [];
300
+ async function getData(link) {
301
+ try {
302
+ console.log("link : ", link);
303
 
304
+ await $.getJSON(link, function(data)
305
+ {
306
+ console.log("ticker : ", data.ticker);
307
+ console.log("date : ", data.date);
308
+ console.log("title : ", data.title);
309
+ console.log("url : ", data.url);
310
+ console.log("ents : ", data.ents);
311
+
312
+ newsInit(data.ticker, data.date, data.title, data.url, data.ents);
313
+ });
314
+ } catch (error) {
315
+ console.log("Error : ", error);
316
+ }
317
+ }
318
 
319
 
320
 
 
332
  *
333
  *
334
  */
335
+ function newsInit(ticker, date, title, url, ents) {
336
+ console.log("newsInit start !!!");
337
  // HTML ์ˆ˜์ •
338
  $("#nasdaq-table-container").hide();
339
  $("#chart-container").hide();
340
  $("#news-container").show();
341
 
342
+ console.log(ticker);
343
+ console.log(date);
344
+ console.log(title);
 
 
 
 
 
 
 
345
 
346
 
347
 
 
349
 
350
  // Javascript๋ฅผ ์ด์šฉํ•ด HTML์— ๋™์ ์œผ๋กœ ํƒœ๊ทธ ์ถ”๊ฐ€
351
 
352
+ document.querySelector('#news-container .goticker .tickerName').textContent = "Ticker : " + ticker;
353
+ document.querySelector('#news-container .titleDate').textContent = "Date : " + date;
354
+ document.querySelector('#news-container .titleName').textContent = "Article : " + title;
355
+ document.querySelector('#news-container .newsURL .input-News-URL').textContent = "URL : " + url;
356
 
357
 
358
  // a ํƒœ๊ทธ onclick ์ ์šฉ
359
+ var execution_function = `javascript:chartInit('${ticker}')`;
360
+ const goTicker = document.querySelector('#news-container .goticker');
361
+ console.log(goTicker);
362
  goTicker.setAttribute('href', execution_function);
363
 
364
 
365
  // a ํƒœ๊ทธ์— URL ์ ์šฉ
366
+ const addURL = document.querySelector('.newsURL .input-News-URL');
367
  addURL.setAttribute('href', url);
368
 
369
 
370
  // ๋ชจ๋ธ์—์„œ ์งˆ๋ฌธ ์˜ˆ์‹œ Ticker์— ์•Œ๋งž๊ฒŒ ์ž‘์„ฑํ•˜๊ธฐ
371
+ const model_input_example = document.querySelector('#model .text-form #text-input');
372
  example = "Why did " + ticker + "'s stock go down?";
373
+ model_input_example.setAttribute('value', example);
374
 
375
 
376
  //////////////////////////////////////////////////////////////////////
377
  // NER ๊ด€๋ จ
378
 
379
+ // ents = sendAjax_sync('/ner', {'ticker': ticker, 'date': date, 'title': title}, dataType="json", handle=handle_one_return);
380
  // ents = {'text': [], 'start_char': [], 'end_char': [], 'label_': [], 'news': []}
381
  console.log(ents);
382
 
static/js/utils.js CHANGED
@@ -42,11 +42,8 @@ function sendAjax(url, data, handle) {
42
  */
43
  function sendAjax_sync(url, data, dataType, handle) {
44
  /*
45
- jQuery.ajax(url, [, settings])
46
-
47
  jQuery.getJSON => Asynchronous (๋น„๋™๊ธฐ์‹)
48
-
49
- Synchronous => ๋™๊ธฐ์‹ : ์ฝ”๋“œ ์ˆœ์„œ๋Œ€๋กœ ์ง„ํ–‰
50
  */
51
  var search_var;
52
  $.ajax(url=url, settings={data: data, dataType: dataType, async: false,
 
42
  */
43
  function sendAjax_sync(url, data, dataType, handle) {
44
  /*
45
+ jQuery.ajax(url, [, settings]) => Synchronous ( ๋™๊ธฐ์‹ : ์ฝ”๋“œ ์ˆœ์„œ๋Œ€๋กœ ์ง„ํ–‰ )
 
46
  jQuery.getJSON => Asynchronous (๋น„๋™๊ธฐ์‹)
 
 
47
  */
48
  var search_var;
49
  $.ajax(url=url, settings={data: data, dataType: dataType, async: false,
templates/index.html CHANGED
@@ -138,10 +138,10 @@
138
  <!-- block = show, none = hide -->
139
  <div id="news-container" style="display: block">
140
  <h1><a class="gohome" style="text-decoration: none;" href="/">Stock News Summaries AI</a></h1>
141
- <a class="goticker" style="text-decoration: none;"><h2 class="tickerName">{{embed1}}</h2></a>
142
- <h3 class="titleDate">{{embed2}}</h2>
143
- <h3 class="titleName">{{embed3}}</h2>
144
- <h3 class="NewsURL">URL: <a class="input-News-URL" target=โ€_blankโ€>{{embed4}}</a></h2>
145
 
146
  <!-- named entity recognition (NER) -->
147
  <figure style="margin-bottom: 6rem">
 
138
  <!-- block = show, none = hide -->
139
  <div id="news-container" style="display: block">
140
  <h1><a class="gohome" style="text-decoration: none;" href="/">Stock News Summaries AI</a></h1>
141
+ <a class="goticker" style="text-decoration: none;"><h2 class="tickerName"></h2></a>
142
+ <h3 class="titleDate"></h2>
143
+ <h3 class="titleName"></h2>
144
+ <h3 class="newsURL"><a class="input-News-URL" target=โ€_blankโ€></a></h2>
145
 
146
  <!-- named entity recognition (NER) -->
147
  <figure style="margin-bottom: 6rem">