Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add org-brain category color feature #329

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tumashu
Copy link
Contributor

@tumashu tumashu commented Jul 27, 2020

截图_2020-07-27_11-01-53

Hello:

I want to let different entries have different color, so I add org-brain group (maybe other name) feature.
any suggestion?

* org-brain.el (org-brain-title-max-width): New function.
(org-brain-insert-visualize-button): Add max-width argument.
(org-brain--vis-parents-siblings, org-brain--vis-friends)
(org-brain--vis-children): use org-brain-title-max-width function.
@tumashu tumashu force-pushed the group branch 5 times, most recently from 34cf692 to 6ae91e6 Compare July 27, 2020 08:00
@Kungsgeten
Copy link
Owner

I could see a use-case for this if you want different faces for different topics or similar. Maybe though instead of creating a new org-brain-group thing we could use the built-in org-mode category feature? org-brain already supports adding icons depending on category.

@tumashu
Copy link
Contributor Author

tumashu commented Jul 27, 2020

截图_2020-07-27_16-20-41

@tumashu
Copy link
Contributor Author

tumashu commented Jul 27, 2020

Maybe though instead of creating a new org-brain-group thing we could use the built-in org-mode category feature

The category has a problem, it is hard code inheritance, can it be controled by org-use-property-inheritance ?

Org mode has a few properties for which inheritance is hard-coded, at least for the special applications for which they are used:

CATEGORY

    For agenda view, a category set through a ‘CATEGORY’ property applies to the entire subtree.

@Kungsgeten
Copy link
Owner

I don't know, but isn't inheritance usually what you want in this case? To me it seems a bit confusing if there's one thing called a "category" and another called a "group". I the only purpose of the group feature is to add colors, then maybe it should be named accordingly (like "color props" or something similar).

@tumashu
Copy link
Contributor Author

tumashu commented Jul 27, 2020

to me it seems a bit confusing if there's one thing called a "category" and another called a "group".

the name "group" is a temp name, for I do not find a better name at the moment :-)

but isn't inheritance usually what you want in this case? 

I will try to test CATEGORY property.

@tumashu
Copy link
Contributor Author

tumashu commented Jul 27, 2020

I have found a way to disable category's inheritance, I will rename group to category

@tumashu tumashu force-pushed the group branch 2 times, most recently from 3c8826a to 8ffa515 Compare July 27, 2020 12:36
* org-brain.el (org-brain-category-face-alist): New variable.
(org-brain-display-face): Handle org-brain category.
(org-brain-get-category): New function.
(org-brain-set-selected-category): New function.
(org-brain-set-category): new function.
(org-brain-category-and-title<): New function.
(org-brain-visualize-mode-map, org-brain-select-map): Handle keybindings of group commands
(org-brain-insert-visualize-button): use max-width when org-brain-category-face-alist non-nil.
@tumashu tumashu changed the title [WIP] Add org-brain group feature Add org-brain category color feature Jul 27, 2020
@tumashu
Copy link
Contributor Author

tumashu commented Jul 27, 2020

@Kungsgeten I have rename group to category, please review again, thanks.

@tumashu
Copy link
Contributor Author

tumashu commented Sep 15, 2020

@Kungsgeten ping

@michaelsjackson
Copy link

michaelsjackson commented Jul 12, 2021

Two more ideas:

  1. obvz is using entries starting with "cls_" as category entries which are only used for selection, thus are not used in any other later visualizations. See its examples on obvz github page.
  2. header tags like :mytag: could be used for coloring, like is done in org-mind-map-write in its .dot export. I like this style as well. So if org-brain could use different faces based on such tags, could be nice. Alone a fixed set of 12 tags would be already better than nothing.

One more extra thought, because related:
3. Different faces could be used for input / output links as well. (Input / output links do not exist in current org-brain yet.)

@michaelsjackson
Copy link

How is the coloring caused in above examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants