Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- aliases:
- tags: ['health', 'selfImprovement']
- title: Statistik Gesundheit
- date-created: 2022-11-17
- date-modified: 2022-11-17
- cssClass:
- - wide-view
- ---
- %% [[2022-11-17]] %%
- ```dataviewjs
- const gruvRedToGreen = ['#FB4934','#F45432','#ED5F31','#E66B2F','#E0762E','#D9822D','#D28D2B','#CC982A','#C5A428','#BEAF27','#B8BB26'];
- const vibrantRedToGreen20 = ['#FF0000','#F10D00','#E41A00','#D62800','#C93500','#BB4300','#AE5000','#A15D00','#936B00','#867800','#788600','#6B9300','#5DA100','#50AE00','#43BB00','#35C900','#28D600','#1AE400','#0DF100','#00FF00'];
- const AyuRedToGreen = ['#FF7383','#F07A7C','#E18276','#D2896F','#C49169','#B59963','#A6A05C','#98A856','#89AF4F','#7AB749','#6CBF43'];
- const SimpleRedToGreen = ['#02ff0e','#daa500','#ff0018']
- const colorScale1 = gruvRedToGreen;
- const year = 2023;
- const showCurrentDayBorder = true;
- // Ziele
- const tSchritte = 5000;
- const tWasser = 4;
- const tSchlafDauer = 480;
- let SchlafDauerStunden = tSchlafDauer / 60
- const tSchlafDauerMin = 300
- let SchlafDauerMinStunden = tSchlafDauerMin / 60
- const tSchlafQuali = 75;
- const tSchlafQualiMin = 0;
- const schritte = {
- year: year,
- colors: {
- colorScale: colorScale1,
- },
- showCurrentDayBorder: showCurrentDayBorder,
- defaultEntryIntensity: 0,
- intensityScaleStart: 0,
- intensityScaleEnd: tSchritte,
- entries: [],
- };
- const schlafdauer = {
- year: year,
- colors: {
- colorScale: colorScale1,
- },
- showCurrentDayBorder: showCurrentDayBorder,
- defaultEntryIntensity: 0,
- intensityScaleStart: tSchlafDauerMin,
- intensityScaleEnd: tSchlafDauer,
- entries: [],
- };
- const schlafquali = {
- year: year,
- colors: {
- colorScale: colorScale1,
- },
- showCurrentDayBorder: showCurrentDayBorder,
- defaultEntryIntensity: 0,
- intensityScaleStart: 40,
- intensityScaleEnd: tSchlafQuali,
- entries: [],
- };
- // Schritte
- dv.el('small', '🦶 **' + tSchritte + '**');
- for (let page of dv.pages('"10 - Daily Notes"').where(p => p.gesundheit?.schritte).sort(p => p.file.name)) {
- schritte.entries.push({
- date: page.file.name,
- intensity: page.gesundheit?.schritte,
- content: "",
- color: "colorScale",
- })
- };
- dv.span('---')
- renderHeatmapCalendar(this.container, schritte);
- dv.span('---')
- // Schlafzeit
- dv.el('small', '😴-🕗 **' + SchlafDauerStunden + '**');
- for (let page of dv.pages('"10 - Daily Notes"').where(p => p.gesundheit?.schlafdauer).sort(p => p.file.name)) {
- schlafdauer.entries.push({
- date: page.file.name,
- intensity: page.gesundheit?.schlafdauer,
- content: "",
- color: "colorScale",
- })
- }
- dv.span('---')
- renderHeatmapCalendar(this.container, schlafdauer);
- dv.span('---')
- // Schlafqualität
- dv.el('small', '😴-📈 **' + tSchlafQuali + '**');
- for (let page of dv.pages('"10 - Daily Notes"').where(p => p.gesundheit?.schlafquali).sort(p => p.file.name)) {
- schlafquali.entries.push({
- date: page.file.name,
- intensity: page.gesundheit?.schlafquali,
- content: "",
- color: "colorScale",
- })
- }
- dv.span('---')
- renderHeatmapCalendar(this.container, schlafquali);
- dv.span('---')
- this.container.style.width = "80%";
- this.container.style.margin = "auto";
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement