Skip to content

Commit

Permalink
[check] conflict
Browse files Browse the repository at this point in the history
Former-commit-id: 2e488c276e6474c6e5693069209d71424e8a0655
  • Loading branch information
soncy0311 committed Dec 2, 2021
2 parents aa6cf66 + 4216683 commit 9780544
Show file tree
Hide file tree
Showing 28 changed files with 13 additions and 149,597 deletions.
3 changes: 2 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from flask import Flask
import pymysql
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()

app = Flask(__name__)

app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
# app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URI')
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+pymysql://root:[email protected]:3306/diet"
# app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+pymysql://root:111111@localhost:3306/diet"
app.config['JSON_AS_ASCII'] = False

db.init_app(app)
Expand Down
44 changes: 0 additions & 44 deletions app/schema.txt

This file was deleted.

107 changes: 0 additions & 107 deletions app/static/css/chart.css

This file was deleted.

12 changes: 0 additions & 12 deletions app/static/css/intro.css

This file was deleted.

136 changes: 0 additions & 136 deletions app/static/css/visual-main.css

This file was deleted.

23 changes: 1 addition & 22 deletions app/static/js/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,11 @@ let labels_common = ["에너지", "단백질", "지방", "탄수화물", "당",
"나트륨", "칼륨", "비타민 A", "비타민 B1", "비타민 B2", "엽산"];
let labels_important = [ "나이아신", "비타민 C", "셀레늄", "비타민 D2", "아연"]

// var article = document.getElementById('electriccars');

// flask jinja 로 받아오는 값 => nutrients = dict 으로 받으면,
// let input_data = {{ foods_nutrients }}
let input_data = $('#food-data').data().name;
// let input_data = article.dataset.food;

// let input_data1 = [{'사과': [10, 20, 30, 10, 15, 12, 30, 20, 11, 14, 53, 33, 10, 32, 11, 1, 30, 20, 11, 14]},
// {'배': [30, 20, 11, 14, 10, 20, 14, 53, 33, 10, 32, 11, 1, 30, 10, 15, 12, 30, 20, 11]},
// {'포도': [14, 53, 33, 10, 32, 11,10, 20, 30, 10, 15, 12, 30, 20, 11, 1, 30, 20, 11, 14]},
// {'바나나': [14, 53, 33, 10, 32, 11,10, 20, 30, 10, 15, 12, 30, 20, 11, 1, 30, 20, 11, 14]},
// {'멜론': [14, 53, 33, 10, 32, 11,10, 20, 30, 10, 15, 12, 30, 20, 11, 1, 30, 20, 11, 14]}
// ];
// flask에서 nutrients의 합계를 받아온다.
// let sum_nutrients = {{ sum_nutrients }}
// let sum_nutrients = $('#food-data').data().test;

let sum_nutrients = $('#food-data').data().test;
// let sum_nutrients = [82, 199, 140, 54, 121, 65, 74, 133, 134, 54, 130, 80, 101, 122, 54, 19, 132, 110, 64, 67]

// let data1 = {{ foods_nutrients }}

for(let i=0; i<14;i++) {
if (sum_nutrients[i]>120) {
Expand All @@ -47,8 +32,6 @@ for(let j=0;j<5;j++){
}
}

// console.log(labels_important)

// color list 만들기.
const color_lst = ['rgb(229, 139, 150)', 'rgb(240, 201, 78)', 'rgb(115, 188, 189)', 'rgb(60, 142, 14)',
'#ac9bdb', 'rgb(191, 33, 107)', 'rgb(66, 39, 0)', 'rgb(189,156,77)', 'rgb(21,119,143)'];
Expand All @@ -66,7 +49,6 @@ let lst_common = [];
let lst_important = [];
let i = 0
for (let data in input_data) {
// let key = Object.keys(input_data[data]).toString()
let values = input_data[data].slice(0,14);
let temp = {
label: data,
Expand All @@ -81,7 +63,6 @@ for (let data in input_data) {
data_common['datasets']=lst_common
let j = 0
for (let data in input_data) {
// let key = Object.keys(input_data[data]).toString()
let values = input_data[data].slice(-5);
let temp = {
label: data,
Expand Down Expand Up @@ -170,5 +151,3 @@ const config_common = {

const barChart_common = new Chart(ctx_common, config_common);
const barChart_important = new Chart(ctx_important, config_important);
// const barChart = new Chart(ctx, config_common);
// const radarChart = new Chart(ctx_radar, config_radar);
5 changes: 0 additions & 5 deletions app/static/js/checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@ $(function(){
});

});

//정상 실행 확인 용
// $( function () {
// alert('메시지를 띄웁니다.');
// });
4 changes: 0 additions & 4 deletions app/static/js/diet.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,3 @@ $(document).ready(function() {
});
});

// input 값이 있거나, 포커스 될 때 lable을 숨김
// $("input.input_chk").each(function(){
// var label = $(this).attr("class");
// })
Loading

0 comments on commit 9780544

Please sign in to comment.