신년에는 계획을 세워 봅시다! 옵시디언으로 대시보드 구성하기

소개

시도하고자 했던 것과 그 이유를 알려주세요.

새해가 되면 매년 새로운 결심을 합니다.

새회 계획을 실현하기 위한 할동을 정리하고 현황을 파악할 수 있는 대시보드를 구상해 보았습니다.

진행 방법

어떤 도구를 사용했고, 어떻게 활용하셨나요?

Tip: 사용한 프롬프트 전문을 꼭 포함하고, 내용을 짧게 소개해 주세요.

Tip: 활용 이미지나 캡처 화면을 꼭 남겨주세요.

Tip: 코드 전문은 코드블록에 감싸서 작성해주세요. ( / 을 눌러 '코드 블록'을 선택)

  1. 준비하기

워드 프로그램으로 체크리스트를 정리합니다. 

옵시디언은 마크다운 문서이기 때문에 한글에서 만든 표는 바로 사용이 힘들지요

pdf로 저장해주세요

PDF로 저장후 ChatGpt에게 마크다운 언어로 변환해 달라고하세요

  1. 옵시디언 준비하기

검은 색 배경이있는 검은 색 화면의 스크린 샷

두가지 확장프로그램이 필요 합니다.

  1. 위에서 변환한 것을 테스크를 이용해서 표를 만들기

    테스크는 아쉽게도 표 안에 체크박스 넣는 것을 지원하지 않아요. 그래서 강의별로 정리한 후 태그로 정리하였습니다. 정리 작업은 GPT를 활용했어요

  1. 데이터 뷰로 시각화 하기

    데이터뷰는 옵시디언의 볼트 내용을 테이블로 정리해 보았습니다.

코드 블럭

```dataview

TABLE

stageData.stage AS 단계,

length(filter(file.tasks, (t) => contains(t.tags, stageData.tag) AND t.completed)) + " / " + length(filter(file.tasks, (t) => contains(t.tags, stageData.tag))) AS 완료

FROM "챌린지/아이캔대학/수강진도 체크"

FLATTEN [

{ stage: "📚 준비운동 0단계", tag: "ican/stage0" },

{ stage: "📚 성장스타트 1단계", tag: "ican/stage1" },

{ stage: "📚 무소처럼 걷기 2단계", tag: "ican/stage2" },

{ stage: "📚 전문가 되기 3단계", tag: "ican/stage3" },

{ stage: "📚 나다움 완성 4단계", tag: "ican/stage4" },

{ stage: "✅ 선택 과제", tag: "ican/tasks" },

{ stage: "🎯 졸업 요건", tag: "ican/goals" },

{ stage: "🏆 장학 요건", tag: "ican/scholarship" }

] AS stageData

SORT stageData.tag ASC

```

  1. 시각화 하기

이번에는 차트 커뮤니티 플러그인을 활용했습니다.

한국의 사람들의 수를 보여주는 그래프

코드

```dataviewjs

// 단계별 데이터 정의

const stageConfigs = [

{ stage: "📚 준비운동 0단계", tag: "ican/stage0" },

{ stage: "📚 성장스타트 1단계", tag: "ican/stage1" },

{ stage: "📚 무소처럼 걷기 2단계", tag: "ican/stage2" },

{ stage: "📚 전문가 되기 3단계", tag: "ican/stage3" },

{ stage: "📚 나다움 완성 4단계", tag: "ican/stage4" },

{ stage: "✅ 선택 과제", tag: "ican/tasks" },

{ stage: "🎯 졸업 요건", tag: "ican/goals" },

{ stage: "🏆 장학 요건", tag: "ican/scholarship" }

];

let targetPage = dv.pages('"챌린지/아이캔대학/수강진도 체크"').first();

if (targetPage) {

const tasks = targetPage.file.tasks;

// 각 단계별 데이터 계산

const stageData = stageConfigs.map(config => {

const stageTasks = tasks.filter(t =>

t.tags && t.tags.some(tag => tag.includes(config.tag))

);

const completed = stageTasks.filter(t => t.completed).length;

const total = stageTasks.length;

const percent = total > 0 ? Math.round((completed / total) * 100) : 0;

return {

stage: config.stage,

completed,

total,

percent

};

});

const chartData = {

type: 'bar',

data: {

labels: stageData.map(d => d.stage),

datasets: [{

label: '진행률',

data: stageData.map(d => d.percent),

backgroundColor: '#d81b60',

borderColor: '#ff7043',

borderWidth: 1

}]

},

options: {

indexAxis: 'y',

plugins: {

title: {

display: true,

text: '단계별 진행률',

font: {

size: 16,

weight: 'bold'

}

},

tooltip: {

callbacks: {

label: function(context) {

const data = stageData[context.dataIndex];

return ${data.completed} / ${data.total} (${data.percent}%);

}

}

},

datalabels: {

align: 'end',

anchor: 'end',

formatter: (value, context) => {

const data = stageData[context.dataIndex];

return ${data.completed}/${data.total} (${value}%);

},

color: '#666',

font: {

weight: 'bold'

}

}

},

scales: {

x: {

beginAtZero: true,

max: 100,

title: {

display: true,

text: '진행률 (%)'

}

}

},

maintainAspectRatio: false

}

};

// 컨테이너 높이 설정

this.container.style.height = '400px';

window.renderChart(chartData, this.container);

}

```

결과와 배운 점

배운 점과 나만의 꿀팁을 알려주세요.

뭐가 되든지 적기 시작하면 그것이 데이터가 됩니다.

과정 중에 어떤 시행착오를 겪었나요?

코드를 수정하는 과정은 GPT와 함께 하세요

도움이 필요한 부분이 있나요?

앞으로의 계획이 있다면 들려주세요.

온라인 교무실 만들어 볼까해요 ^^

대시보드 파일 다운로드

https://drive.google.com/file/d/198MBRgPe40F3iUDS3BnXWxuzOnwkgNeJ/view?usp=sharing

👉 이 게시글도 읽어보세요