Code Monkey home page Code Monkey logo

Comments (9)

pyrochlore avatar pyrochlore commented on June 5, 2024 3

Starting to work on it.

from obsidian-tracker.

pyrochlore avatar pyrochlore commented on June 5, 2024 1

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.

Cito avatar Cito commented on June 5, 2024 1

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.

Cito avatar Cito commented on June 5, 2024 1

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.

pyrochlore avatar pyrochlore commented on June 5, 2024 1

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.

pyrochlore avatar pyrochlore commented on June 5, 2024 1

Work in progress

wip

from obsidian-tracker.

pyrochlore avatar pyrochlore commented on June 5, 2024 1

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.

pyrochlore avatar pyrochlore commented on June 5, 2024

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

  1. 100/80 will be parsed as an array of values ([100, 80]), that is, two sets of data
  2. The size of the array (number of data sets) will be determined after parsing all the files, missing values will be treated as null
  3. If mergeDataSets is set to false, data sets will be plotted separately, or value will be merged (sum or average ...)
  4. Separated data will be plotted according to the setting under key line
  5. All sets of data shared the same y unit and scale
  6. Use '/' to separate line attributes for different sets of data
  7. 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

  1. 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.

Cito avatar Cito commented on June 5, 2024

Works nicely, thanks a lot!

from obsidian-tracker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.