[[What the fuck was I cooking]]
Move project to folder
<% tp.file.move("My Projects"+"/"+tp.file.title+"/"+tp.file.title) %>
## Habits query
```dataview
TABLE WITHOUT ID
file.link as Habit
from #habitNote
FLATTEN file.tasks As Tasks
WHERE !Tasks.completed
SORT date(Tasks.due.file.name)
```
## Habits Buttons
```button
name Add Task Tracker Addon
type command
action Hotkeys for templates: Insert from Templater: addons/Task Tracker Addon
remove [task-tracker,measurement-tracker]
```
^button-task-tracker
```button
name Add Measurement Tracker Addon
type command
action Hotkeys for templates: Insert from Templater: addons/Task Tracker Addon
remove [task-tracker,measurement-tracker]
```
^button-measurement-tracker
## Charts
```chart
type: polarArea
labels: [Body, Mind, Soul, Mission, Money, Growth, Romance, Family, Friends, Joy]
series:
- title:
data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
tension: 0.2
width: 80%
labelColors: true
fill: true
beginAtZero: true
rMax: 10
bestFit: false
bestFitTitle: undefined
bestFitNumber: 0
legendPosition: right
```
## 2023
```dataviewjs
const emojis = ["๐ช", "๐ง ", "โจ", "๐ฏ", "๐ธ", "๐", "๐", "๐จโ๐ฉโ๐งโ๐ฆ", "๐ค", "๐คฉ"];
const fields = ["Body", "Mind", "Soul", "Mission", "Money", "Growth", "Romance", "Family", "Friends", "Joy"];
let sums = {}, counts = {}, averages = {};
const combinedLabels = fields.map((field, index) => {
return `${field} ${emojis[index]}`
});
dv.paragraph(`\`\`\`chart
type: polarArea
labels: [${combinedLabels}]
series:
- title:
data: [7, 8, 7, 7, 8, 7, 8, 8, 9, 9]
tension: 0.2
width: 80%
labelColors: true
fill: true
beginAtZero: true
rMax: 10
bestFit: false
bestFitTitle: undefined
bestFitNumber: 0
legendPosition: right
\`\`\``)
```
## 2024
```dataviewjs
const emojis = ["๐ช", "๐ง ", "โจ", "๐ฏ", "๐ธ", "๐", "๐", "๐จโ๐ฉโ๐งโ๐ฆ", "๐ค", "๐คฉ"];
const fields = ["Body", "Mind", "Soul", "Mission", "Money", "Growth", "Romance", "Family", "Friends", "Joy"];
let sums = {}, counts = {}, averages = {};
const combinedLabels = fields.map((field, index) => {
return `${field} ${emojis[index]}`
});
dv.paragraph(`\`\`\`chart
type: polarArea
labels: [${combinedLabels}]
series:
- title:
data: [8, 9, 8, 9, 9, 9, 5, 8, 9, 10]
tension: 0.2
width: 80%
labelColors: true
fill: true
beginAtZero: true
rMax: 10
bestFit: false
bestFitTitle: undefined
bestFitNumber: 0
legendPosition: right
\`\`\``)
```
## Misc
Sure, here's how you can convert your properties into valid Chart.js properties for a polar area chart:
```dataviewjs
const data = dv.current()
const chartData = {
type: 'polarArea',
data: {
labels: ['Body', 'Mind', 'Soul', 'Mission', 'Money', 'Growth', 'Romance', 'Family', 'Friends', 'Joy'],
datasets: [
{
data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
tension: 0.2,
backgroundColor: [
'rgba(255, 99, 71, 0.2)', // Light Red with Opacity 0.5
'rgba(255, 0, 0, 0.2)', // Medium Red with Opacity 0.5
'rgba(139, 0, 0, 0.2)', // Dark Red with Opacity 0.5
'rgba(144, 238, 144, 0.2)', // Light Green with Opacity 0.5
'rgba(0, 128, 0, 0.2)', // Medium Green with Opacity 0.5
'rgba(0, 100, 0, 0.2)', // Dark Green with Opacity 0.5
'rgba(173, 216, 230, 0.2)', // Light Blue with Opacity 0.5
'rgba(40, 40, 255, 0.2)', // Medium Blue with Opacity 0.5
'rgba(0, 0, 128, 0.2)',
'rgba(255, 255, 255, 0.2)' // Dark Blue with Opacity 0.5
],
borderColor: [
'rgba(255, 99, 71, 0.7)', // Light Red with Opacity 0.7
'rgba(255, 0, 0, 0.7)', // Medium Red with Opacity 0.7
'rgba(139, 0, 0, 0.7)', // Dark Red with Opacity 0.7
'rgba(144, 238, 144, 0.7)', // Light Green with Opacity 0.7
'rgba(0, 128, 0, 0.7)', // Medium Green with Opacity 0.7
'rgba(0, 100, 0, 0.7)', // Dark Green with Opacity 0.7
'rgba(173, 216, 230, 0.7)', // Light Blue with Opacity 0.7
'rgba(0, 0, 255, 0.7)', // Medium Blue with Opacity 0.7
'rgba(0, 0, 128, 0.7)', // Dark Blue with Opacity 0.7
'rgba(255, 255, 255, 0.7)'
],
borderWidth: 1, // Border width for the segments
},
],
},
options: {
plugins: {
legend: {
position: 'right',
},
},
scales: {
r: {
beginAtZero: true, // Start the scale at zero
max: 10, // Maximum scale value
},
},
},
};
window.renderChart(chartData, this.container);
```
This code sets up a valid Chart.js configuration for a polar area chart with the specified properties. Note that I've added `backgroundColor`, `borderColor`, and `borderWidth` properties to the dataset to define the segment styling.
## Group by note tags
```dataview
table WITHOUT ID rows.file.frontmatter.Area as "Area", rows.file.link as "Notes"
from #project AND !"Hidden"
FLATTEN rows
sort file.mtime desc
GROUP BY file.frontmatter.Area
```