<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>chartjs</title>
<!-- chartjs cdn -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- bootstrap css -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6">
<canvas id="myChartOne"></canvas>
</div>
<div class="col-md-6">
<canvas id="myChartTwo"></canvas>
</div>
<div class="col-md-6">
<canvas id="myChartThree"></canvas>
</div>
<div class="col-md-6">
<canvas id="myChartFour"></canvas>
</div>
</div>
</div>
<script>
const labels = [
'1์',
'2์',
'3์',
'4์',
'5์',
'6์',
'7์',
];
const data = {
labels: labels,
datasets: [{
label: '๋งค์ถ์ก ํํฉ(์ต)',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [1, 2, 5, 2, 2, 3, 4],
}]
};
const data2 = {
labels: labels,
datasets: [{
label: '๋งค์ถ์ก ํํฉ(์ต)',
backgroundColor: ['#ff0000', 'green', 'blue'], // rgba(255, 0, 0, 0.5), #ff0000
borderColor: 'black',
borderWidth: 5,
hoverBorderWidth: 7,
data: [1, 2, 5, 2, 2, 3, 4],
}]
};
const data3 = {
labels: labels,
datasets: [{
label: '๋งค์ถ์ก ํํฉ(์ต)',
backgroundColor: ['#ff0000', 'green', 'blue'], // rgba(255, 0, 0, 0.5), #ff0000
borderColor: 'black',
borderWidth: 5,
hoverBorderWidth: 7,
data: [1, 2, 5, 2, 2, 3, 4],
}]
};
const data4 = {
labels: labels,
datasets: [{
label: '๋งค์ถ์ก ํํฉ(์ต)',
backgroundColor: ['red', 'green', 'blue', 'pink', 'dodgerblue', 'gray', 'hotpink'], // rgba(255, 0, 0, 0.5), #ff0000
// ๋ณดํต ์ปฌ๋ฌ๋ฅผ ํ๋ํ๋ ์
๋ ฅํ์ง์๊ณ function์ ์ฌ์ฉํจ
borderColor: 'black',
borderWidth: 5,
hoverBorderWidth: 7,
data: [1, 2, 5, 2, 2, 3, 4],
}]
};
const config = {
type: 'line', // pie, bar, line, doughnut, polarArea
data: data,
options: {}
};
const config2 = {
type: 'bar', // pie, bar, line, doughnut, polarArea
data: data2,
options: {}
};
const config3 = {
type: 'bar', // pie, bar, line, doughnut, polarArea
data: data3,
options: {
plugins:{
title:{
display: true,
text: '๋งค์ถ์ก!!!!',
color: 'red',
position: 'bottom',
padding: {
top: 10,
bottom: 10
}
},
legend: {
display: true,
position:'right',
labels:{
color:'blue'
}
}
}
}
};
const config4 = {
type: 'pie', // pie, bar, line, doughnut, polarArea
data: data4,
options: {}
};
</script>
<script>
const myChartOne = new Chart(
document.getElementById('myChartOne'),
config
);
const myChartTwo = new Chart(
document.getElementById('myChartTwo'),
config2
);
const myChartThree = new Chart(
document.getElementById('myChartThree'),
config3
);
const myChartFour = new Chart(
document.getElementById('myChartFour'),
config4
);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canvas tutorial</title>
</head>
<body>
<canvas id="canvas"></canvas>
<script>
// ํ๊ทธ ์ ํ
const canvas = document.getElementById('canvas');
// ์บ๋ฒ์ค์์ ์ด๋ป๊ฒ ๊ทธ๋ฆด์ง(๋ ๋๋ง) ์ปจํ
์คํธ๋ฅผ ๋ฐ์์ด
const ctx = canvas.getContext('2d');
// ๊ทธ๋ฆผ ๊ทธ๋ฆฌ๊ธฐ
function drawRect(ctx) {
// x, y : ์ข์ธก ์๋จ ๊ธฐ์ค x, y ์ขํ
// w๋ ๋๋น, h๋ ๋์ด
let x = 30,
y = 50,
w = 150,
h = 100;
ctx.fillStyle = 'pink';
ctx.fillRect(x, y, w, h);
}
// drawRect(ctx);
function ์ผ๊ฐํ(ctx){
// ์ ์ ํ๋์ฉ ์ฐ๋ ๋ฐฉ์
// moveTo, lineTo๋ฅผ ๋ฐ๊พธ๋ฉด ์ผ๊ฐํ ๋ชจ์์ด ๋ฐ๋
ctx.beginPath()
ctx.moveTo(25, 50);
ctx.lineTo(100, 75);
ctx.lineTo(100, 25);
ctx.fillStyle = 'red';
ctx.fill();
}
์ผ๊ฐํ(ctx);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>D3</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
</head>
<body>
<div class="canvas"></div>
<script>
const canvas = d3.select('.canvas');
const svg = canvas.append('svg') //์ถ๊ฐ
.attr('height', 1000) // ์์ฑ ์ง์
.attr('width', 1000);
svg.append('text') // ์ถ๊ฐ, text ํํ๋ก ์ถ๊ฐ
.attr('x', 200)
.attr('y', 200) // ์ข์ธก ์๋จ ๊ธฐ์ค ์ขํ
.attr('fill', 'black')
.text('hello world')
.style('font-weight', 'bold')
.style('font-size', '34px');
// .style('font-style', 'Nanum Pen Script');
// google font style์ ๋ฐ๋ก ์ ์ฉ ์๋จ (import๋ฅผ ์ฌ์ฉํด์ root์ ์ถ๊ฐํ๋ ๋ฐฉ๋ฒ์ผ๋ก ํด๊ฒฐ ๊ฐ๋ฅ)
svg.append('rect') // ์ถ๊ฐ, ์ฌ๊ฐํ ํํ๋ก ์ถ๊ฐ
// .attr('x', 10)
// .attr('y', 10)
.attr('width', 200)
.attr('height', 200)
.attr('fill', 'pink')
svg.append('circle') // ์ถ๊ฐ, ์ ํํ๋ก ์ถ๊ฐ
// .attr('x', 10)
// .attr('y', 10)
.attr('r', 50)
.attr('cx', 200) // x ์ถ
.attr('cy', 200) // y ์ถ
.attr('fill', 'hotpink')
svg.append('line')
.attr('x1', 200) // x์ถ ์์
.attr('y1', 200) // y์ถ ์์
.attr('x2', 300) // x์ถ ๋
.attr('y2', 300) // y์ถ ๋
.attr('stroke', 'black')
</script>
</body>
</html>
git add . : ๋ชจ๋ ๋ณ๊ฒฝ๋ด์ญ์ ์ ๋ก๋ (.์ all)
git commit -m '๋ฉ์์ง' : ์ปค๋ฐ ๋ฉ์ธ์ง ์ ๋ ฅ
git push : github์ ์ฌ๋ฆฌ๊ธฐ
git pull : pull ๋ก๊ฒจ์ค๊ธฐ
git diff : ์ด๋ค ์ปค๋ฐ์ด ์ถ๊ฐ๋์๋์ง ํ์ธ
rm -rf ๊ฐ๋ฆฌ : ๊ฐ๋ฆฌ ํด๋ ์ญ์
code . : vsc๋ฅผ ํ์ฌ ํด๋ ๊ธฐ์ค์ผ๋ก ์ด๊ธฐ
git log : ๋ก๊ทธ ํ์ธ
touch
vi > i > esc + :wq!
shift+insert : ๋ถ์ฌ๋ฃ๊ธฐ
git clone repo-link . : repo ๋ณต์ฌํด์ค๊ธฐ (ํ์ผ๋ง * ๊ฐ์ ธ์ค๊ธฐ, ๋ง์ง๋ง์ . ์์ฐ์ผ๋ฉด ์๋ก์ด ํด๋๊ฐ ์๊น)
Settings > Manage access > Add people: ์ ๊ทผ ๊ถํ ํ์ฉ๋
git branch : ๋ธ๋์น ๋ชฉ๋ก๊ณผ ํ์ฌ ๋ธ๋์น ํ์ธ
git branch ์ด๋ฆ : ๋ธ๋์น ๋ง๋ค๊ธฐ
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory (๋ฌด์ํด๋ ๋๋ warning)
์ธํฐ๋ ํฐ๋ธ ์น ๊ฐ๋ฐ,
์น์์ 3D๋ฅผ ๋ค๋ฃจ๋ ๋ฒ(Three.js)
WebGL์ ์น ๊ธฐ๋ฐ์ ๊ทธ๋ํฝ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค.
์๋ฐ์คํฌ๋ฆฝํธ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด๋ฅผ ํตํด์ ์ฌ์ฉํ ์ ์์ผ๋ฉฐ ํธํ์ฑ์ด ์๋ ์น ๋ธ๋ผ์ฐ์ ์์ ์ธํฐ๋ํฐ๋ธํ 3D ๊ทธ๋ํฝ์
์ฌ์ฉํ ์ ์๋๋ก ์ ๊ณต๋๋ค.
์ ์์ค์ธ์ด๋ผ Three.js๋ฑ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง๋ค.
Mesh = Geometry(๋ชจ์) + Material(์ฌ์ง)