Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- aliases:
- tags: ['sport']
- title: Statisktik Gehen
- date-created: 2022-10-31
- date-modified: 2022-11-02
- cssClass:
- - row-alt
- - table-nowrap
- ---
- %% [[2022-10-31]] %%
- ##### Statisktik "Gehen"
- ```dataview
- TABLE WITHOUT ID
- round(sum(rows.G.distanz),2) AS "∑ km",
- round(sum(rows.G.dauer)) AS "∑ Zeit",
- round(sum(rows.G.distanz)/length(rows), 2) AS "∅ km",
- round(sum(rows.G.dauer)/length(rows)) AS "∅ Zeit",
- round(sum(rows.G.geschwindigkeit)/length(rows), 1) AS "∅ km/h",
- round(max(rows.G.dauer)) AS "max Zeit",
- round(max(rows.G.distanz),2) AS "max km",
- round(max(rows.G.puls-max)) AS "max Puls",
- round(sum(rows.G.hf-schnitt)/length(rows)) AS "∅ HF"
- FROM "10 - Daily Notes"
- WHERE sport
- AND contains(sport.type, "Gehen")
- FLATTEN sport.gehen AS G
- GROUP BY true
- ```
- ##### An welchen Tagen bin ich gegangen ?
- ```dataviewjs
- const gruvRedToGreen = ['#FB4934','#F45432','#ED5F31','#E66B2F','#E0762E','#D9822D','#D28D2B','#CC982A','#C5A428','#BEAF27','#B8BB26'];
- const onlyBlue = ['#80bfff'];
- const AyuRedToGreen = ['#FF7383','#F07A7C','#E18276','#D2896F','#C49169','#B59963','#A6A05C','#98A856','#89AF4F','#7AB749','#6CBF43'];
- const colorScale1 = onlyBlue;
- const year = 2022;
- const showCurrentDayBorder = true;
- const gehen = {
- year: year,
- colors: {
- colorScale: colorScale1,
- },
- showCurrentDayBorder: showCurrentDayBorder,
- defaultEntryIntensity: 0,
- intensityScaleStart: 0,
- intensityScaleEnd: 1,
- entries: [],
- };
- // Gehen
- for (let page of dv.pages('"10 - Daily Notes"').where(p => p.sport?.gehen?.dauer).sort(p => p.file.name)) {
- gehen.entries.push({
- date: page.file.name,
- intensity: page.sport?.gehen?.dauer,
- content: "",
- color: "colorScale",
- })
- }
- this.container.style.width = "88%";
- this.container.style.margin = "auto";
- renderHeatmapCalendar(this.container, gehen)
- ```
- ##### Distanz und Dauer
- ```dataviewjs
- const rawData = await dv.query('TABLE WITHOUT ID file.name, G.distanz, G.dauer FROM "10 - Daily Notes" WHERE sport AND contains(sport.type, "Gehen") FLATTEN sport.gehen AS G');
- const rows = rawData.value.values;
- const chartData = {
- data: {
- labels: rows.map(x => x[0]),
- datasets: [{
- type: 'bar',
- label: 'km',
- data: rows.map(x => x[1]),
- barThickness: 7,
- pointStyle: 'cross',
- backgroundColor: ['#80bfff'],
- borderWidth: 1,
- borderColor: ['#80bfff'],
- fill: false,
- xAxisID: 'x2'
- },
- {
- type: 'bar',
- label: 'Minuten',
- data: rows.map(x => x[2]),
- barThickness: 7,
- backgroundColor: ['#707a8c'],
- borderWidth: 1,
- borderColor: ['#707a8c'],
- fill: false,
- xAxisID: 'x1',
- },
- ],
- },
- options: {
- responsive: true,
- animations: false,
- indexAxis: 'y',
- plugins: {
- legend: {
- display: true,
- position: 'bottom',
- },
- },
- scales: {
- x1: {
- type: 'linear',
- display: true,
- position: 'top',
- },
- x2: {
- type: 'linear',
- display: true,
- position: 'bottom',
- },
- },
- },
- }
- this.container.style.width = "80%";
- this.container.style.margin = "auto";
- window.renderChart(chartData, this.container);
- ```
- ##### Liste
- ``` dataview
- TABLE WITHOUT ID
- link(file.name) AS "Datum",
- round(G.distanz,1) AS "km",
- round(G.dauer) AS "Minuten",
- round(G.geschwindigkeit,1) AS "km/h",
- round(G.puls-max) as "max. Puls",
- round(G.hf-schnitt) as "∅ HF",
- G.memo AS "Notiz"
- FROM "10 - Daily Notes"
- WHERE sport
- AND contains(sport.type, "Gehen")
- FLATTEN sport.gehen AS G
- ```
- %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement