relation map

azivner 2018-11-19 20:10:10 +01:00
parent 2a44300165
commit e152032e2f
7 changed files with 49 additions and 4 deletions

@ -1,5 +1,8 @@
Trilium supports adding images to notes. Supported formats are JPEG, PNG and GIF.
Trilium supports storing and displaying images. Supported formats are JPEG, PNG and GIF.
Image is actually type of [[Tree concepts#note|note]] placed into the note tree. It's reference can be copied into text note so it is displayed in the text itself.
## Uploading images
To add image to the note, simply drag it from file explorer onto the note editor inside Trilium and image will be uploaded.
[[gifs/upload-image.gif]]
@ -8,6 +11,10 @@ Alternatively you can click on block toolbar and then on "Insert image":
[[images/block-toolbar-insert-image.png]]
You can also copy paste image from web - but beware that in such case only reference is copied and image copy won't be saved in Trilium. Image will not be available if it's deleted or moved from its original location (or you're offline). The workaround is to first save the image to your computer and then add it to Trilium with one of the methods mentioned above.
## Compression
Since Trilium isn't really meant to be primary storage for image data, it attempts to compress and resize (with pretty aggressive settings) uploaded images before storing them to the database. You may then notice some quality degradation.
If you want to save images in their original resolution, it is recommended to save them as attachment to note (top-right "Note actions -> Upload file").

@ -20,12 +20,12 @@ In the above picture you can see two labels - tag and todoDate with some values.
So there's one attribute for value and one for attribute. But notice how definition attribute is [[Inheritable|Attribute inheritance]], meaning that it's also applied to all descendant note. So in a way, this definition is used for the whole subtree while "value" attributes are applied only for this note.
### Mirror relation
### Inverse relation
Some relations always occur in pairs - my favorite example is on the family. If you have a note representing husband and note representing wife, then there might be a relation between those two of `isPartnerOf`. This is bidirectional relationship - meaning that if a relation is pointing from husband to wife then there should be always another relation pointing from wife to husband.
Another example is with parent - child relationship. Again these always occur in pairs, but in this case it's not exact same relation - the one going from parent to child might be called `isParentOf` and the other one going from child to parent might be called `isChildOf`.
Relation definition allows you to specify such "mirror relation" - for the relation you just define you specify which is the mirror relation. Note that in the second example we should have two relation definitions - one for `isParentOf` which defines `isChildOf` as mirror relation and then second relation definition for `isChildOf` which defines `isParentOf` as mirror relation.
Relation definition allows you to specify such "inverse relation" - for the relation you just define you specify which is the inverse relation. Note that in the second example we should have two relation definitions - one for `isParentOf` which defines `isChildOf` as inverse relation and then second relation definition for `isChildOf` which defines `isParentOf` as inverse relation.
What this does internally is that whenever we save a relation which has defined mirror relation, we check that this mirror relation exists on the relation target note. Similarly when we delete relation, we also delete mirror relation on the target note.
What this does internally is that whenever we save a relation which has defined inverse relation, we check that this inverse relation exists on the relation target note. Similarly when we delete relation, we also delete inverse relation on the target note.

22
Relation map.md Normal file

@ -0,0 +1,22 @@
Relation map is a type of [[Tree concepts#note|note]] which visualizes notes and their [[Attributes|relations]]. See an example:
[[images/relation-map.png]]
## Usage
First take a look at the demo:
[[gifs/relation-map-demo.gif]]
There are several steps here:
* we start with empty relation map and two existing notes representing Prince Philip and Queen Elizabeth II. These two notes already have "isPartnerOf" [[attributes|relations]] defined.
* There are actually two "inverse" relations (one from Philip to Elizabeth and one from Elizabeth to Philip)
* we drag both notes to relation map and place to suitable position. Notice how the existing "isPartnerOf" relations are displayed.
* now we create new note - we name it "Prince Charles" and place it on the relation map by clicking on the desired position. The note is by default created under the relation map note (visible in the note tree on the left).
* we create two new relations "isChildOf" targeting both Philip and Elizabeth
* now there's something unexpected - we can also see the relation to display another "hasChild" relation. This is because there's a [[Promoted attributes|relation definition]] which puts "isChildOf" as an "[[Promoted attributes#Inverse relation|inverse]]" relation of "hasChildOf" (and vice versa) and thus it is created automatically.
* we create another note for Princess Diana and create "isPartnerOf" relation from Charles. Again notice how the relation has arrows both ways - this is because "isPartnerOf" definition specifies its inverse relation as again "isPartnerOf" so the opposite relation is created automatically.
* as the last step we pan & zoom the map to fit better to window dimensions.
Relation definitions mentioned above come from "Person template" note which is assigned to any child of "My Family Tree" relation note. You can play with the whole thing in the [[Document#Demo document|demo document]].

@ -10,6 +10,10 @@ See [[Themes]].
This shows [[code note|code notes]] editor.
[[images/relation-map.png]]
See [[relation map]].
[[images/day-notes.png]]
See [[Day notes]].

@ -8,6 +8,18 @@ Importantly, note itself doesn't carry information on its placement in note tree
Tree structure of notes can resemble file system - but compared to that notes in Trilium can act as both file and directory - meaning that note can both have its own content and have children. "Leaf note" is a note which doesn't have any children.
### Note types
* text note - this is default note type which allows you to put rich text, images etc.
* [[code notes|code note]] - some kind of formal code, typically programming language (e.g. JavaScript) or data structure (e.g. XML)
* [[images|image note]] - represents single image
* file note - represents uploaded file (e.g. docx MS Word document).
* render HTML note - this works as an output screen of attached [[scripts]]
* saved search note - contains saved search query and dynamically displays result of the search as its sub-notes
* [[relation map]] note - visualizes notes and their relations
Remember there's no "folder" note type. Any note can be folder or "leaf" note.
### Root note
There's one special note called "root note" which is root of the note tree. All other notes are placed below it in the structure.

BIN
gifs/relation-map-demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
images/relation-map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB