Comments (9)
Starting to work on it.
from obsidian-tracker.
Hi Cito,
I'm really happy if this plugin could help you and other people.
In fact, the multiple targets feature was on the road map.
For the multiple targets data input, there are two kinds of usage.
The first case is like yours, display the input data separately in one diagram.
Another case is to merge the data then display only one curve. (e.g. thumb-up -> +1, thumb-down -> -1).
The hard part for me is the user interface.
I want the YAML block to keep clean and make people easy to use.
Any idea or suggestion is welcome. :)
from obsidian-tracker.
I think I have the same two kinds of usages in mind.
The first kind of usage is to allow value tuples, like #health/bp:120:80
. These tuples would then be automatically merged in diagrams. If you want to separate them, you could specify searchTarget: #health/bp[0]
or searchTarget: #health/bp[1]
. When merged, they will use the same line color, units etc. If you want to show the values in the tuples with different colors, you need to resort to the second kind of usage:
The second kind of usage is to allow merging several diagrams into one. Yes, this will make the YAML more complicated, but I fear this cannot be avoided. The advantage is that you can use e.g. different colors for the different values. The YAML could look like:
merge:
-
searchType: tag
searchTarget: exercise-pushup
folder: diary
line:
title: PushUp
yAxisLabel: Count
lineColor: "#d65d0e"
-
searchType: tag
searchTarget: exercise-plank
folder: diary
line:
title: Plank
yAxisLabel: Hold
yAxisUnit: sec
lineColor: "#458588"
pointColor: red
Maybe there are better ideas, this is just was came to my mind immediately.
from obsidian-tracker.
This looks good to me.
Regarding the problem that the y-axis cannot be shared between data from different tags. Yes, they may have different units, and even if they have the same unit, they may have different scales - imagine showing the atmospheric pressure and blood pressure in the same diagram, to examine the relation between weather and blood pressure. As the last example shows, showing different datasets in the same diagram can be very interesting. Another example is tracking your weight or pulse or glucose level together with the blood pressure to find correlations. You can either merge them in one diagram, or stack diagrams with the same x axis on top of each other, or do both, see examples here and here. If there are two different y-axes, you can draw one on the left and the other on the right side, see here. If there are more, we could show them next to each other, see here. There could be an option that specifies whether the y-axis will be shown on the left or on the right side, or not shown at all.
Stacking and merging diagrams can help to understand not only the development of the tracked values, but also how they maybe correlate, and therefore can be very interesting.
from obsidian-tracker.
For the multiple y-axis problem, I can add a key 'yAxisLocation' under 'line:'.
The value could be 'left' or 'right'.
In the case of multiple data sets, it will be
searchType: tag
searchTarget: health/blood-pressure
mergeDataSets: false
line:
title: Blood Pressure
yAxisLabel: BP
yAxisUnit: mmHg
lineColor: red/blue
yAxisLocation: left/right
Then it will be the user's choice which axis to use for each data set.
The same concept could apply to multiple targets but with ',' as a separator (instead of '/').
from obsidian-tracker.
Work in progress
from obsidian-tracker.
This feature was just released with the new version 1.3.0.
If you have any problem using it, don't hesitate to ask it here.
from obsidian-tracker.
Hi Cito,
Here are thoughts inspired by your "value tuples".
For the time being, I call it "multiple data sets".
Use Case 1 -- Multiple Data Sets
In Diary Files
#health/blood-pressure:120/80mmHg
In Tracker File
searchType: tag
searchTarget: health/blood-pressure
mergeDataSets: false
line:
title: Blood Pressure
yAxisLabel: BP
yAxisUnit: mmHg
lineColor: red/blue
Expected Behavior
- 100/80 will be parsed as an array of values ([100, 80]), that is, two sets of data
- The size of the array (number of data sets) will be determined after parsing all the files, missing values will be treated as null
- If mergeDataSets is set to false, data sets will be plotted separately, or value will be merged (sum or average ...)
- Separated data will be plotted according to the setting under key line
- All sets of data shared the same y unit and scale
- Use '/' to separate line attributes for different sets of data
- One code block will generate one and only one graph.
Use Case 2 -- Seleted Data Sets
In Diary Files
#health/blood-pressure:120/80mmHg
In Tracker File
searchType: tag
searchTarget: health/blood-pressure[0]
line:
title: Blood Pressure
yAxisLabel: Systolic
yAxisUnit: mmHg
lineColor: red
Expected Behavior
- Use #health/blood-pressure[0] to pick the first data set as the single target
P.S.
For the data from different tags or texts, they usually cannot share the same y-axis.
I am considering using multiple targets like
searchTargets: thumb-up, thumb-down
Any suggestion is welcome!
from obsidian-tracker.
Works nicely, thanks a lot!
from obsidian-tracker.
Related Issues (20)
- Syntax for checkboxes in frontmatter? HOT 10
- Can tracker gather data from multiple inline fields in the same note?
- Query nested values in frontmatter? HOT 1
- Does the plugin support UTF-8 characters?
- Example sleep tracker doesn't work for sleep times before and after 00:00 (midnight) HOT 1
- Can't use regex in searchTarget with searchType: frontmatter? HOT 1
- Is it possible to get a date from a file's name? HOT 2
- Month view "datasetName" doesn't function as a title when "mode: annotation" is set HOT 4
- maxStreak() doesn't work with frontmatter HOT 4
- Request: Data Processing Enhancements HOT 2
- Can I shift (move up/down) or scale (inc. or dec.) a line in a graph please? HOT 1
- ''No valid date as X value found in notes 40 files are not in the right format.'' and ''Error parsing YAML'' HOT 4
- Is it possible to render line graphs with a shaded reference band?
- Can't mix searchType frontmatter and text - results in either only the first target rendering or a YAML parse error HOT 1
- Track values selected in list fields
- Can I do math to calculate a y-axis value? HOT 4
- Average Calculation Error? HOT 3
- Summary cannot display in a line graph? HOT 2
- Bar Chart shows bars with different widths HOT 1
- Date format(YYYYMMDD) not working properly for start/end Date HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obsidian-tracker.