I hacked (ugly-ly) and extended the list formatter handler of TWc because I needed a tree-like diagram or something like cladograms found on Wikipedia species, to organize my notebook. For those who may be interested, it's published on a TiddlySpace plugin-space: http://treedg.tiddlyspace.com/
Pardon me for not being so sure how to build a plugin-space so to be safely included without messing up other spaces.
I hacked (ugly-ly) and extended the list formatter handler of TWc because I needed a tree-like diagram or something like cladograms found on Wikipedia species, to organize my notebook. For those who may be interested, it's published on a TiddlySpace plugin-space: http://treedg.tiddlyspace.com/Really Nice!
Pardon me for not being so sure how to build a plugin-space so to be safely included without messing up other spaces.As for plugins on TiddlySpace, I prefer to always create two spaces...* one for the plugin to be included, e.g. @TreeDiagramFormatterPlugin* one for the documentation, e.g. @treedgThe thing is, I don't think documentation or any of that should be inside a plugin *at all*. At least for my taste, many plugins are way too bloated like that. All it takes is a Documentation slice.Code is code and prose, examples, parameters, configuration, version history, etc... are a different thing. They perhaps require proper example tiddlers and something that looks better than plain nothingness.For an example perhaps see...
I think, the two following features could be interresting:
* Before any vertical bar, having an horizontal bar centered on the parent node,
* Having a syntax to do vertical diagrams instead of horizontal ones.
(d) right now I am playing with getting rid of images entirely and putting nothing but borders
(e) Seeing how you have included @White now, you should definetely create a plugin space outside of the treedg space or create a treedg-info space and then use the theme there.
* Having a syntax to do vertical diagrams instead of horizontal ones.That's may be neat, too, but...* it will result in a lot of horizontal scrolling* it will require more of a quote style left border with those branchy things* I guess, any second third level, etc... would have to be horizontal again for readability's sakeBest wishes, Tobias.
See you later :-)
Love and peace,
GJRobert
I'm really delighted to read all the posts above and see all the improvements you implemented. Thanks a lot for the help beyond my limitation and the new practices which I can learn from.
Mind if I leave the new plan for tomorrow of UTC+8 here? ;-) Here's my plan:
Create the two spaces with the proposed NodeTree name :) (So this is an acception to the GitHub comment :) )
actually I have already created "@treedgplugin" hours ago and was going to make it a pure plugin-space as you have instructed, but then I got diverted to PolyGlotPlugin...ha... Things you see were done half way and hung there. So the white theme I used on @treedg was to give the doc space a beautiful look.
host NodeTreePlugin 0.5.0 mod at @nodetreeplugin. Do you mind if I put your name on the author or contributor field, and normalize the mod as a new release based on your changes?
I have also been thinking about hosting all the plugin docs together at one space like @gjrobert-tw, so this way I do not create doc spaces each dedicated for every one plugin. How do you think of such practice? Feasible?
- See if the documentation needs more amendments
- Improve the demos and share how I use the trees with multiline contents
I'm finding that when I load my tiddlyspace page, it now displays the
SiteInfo tiddler by default, which wasn't the case last time I checked.
This interferes with the design of that particular page.
Hi,I must say Robert, I quite like this plugin! Has a lot of potential.(1) I have played a bit with it and made use of Base64...Like that it's all just one plugin, no additional images. ;-)
(2) By the way, I have added that parent indicator, too.
(3) I am all for expressive names. So, if it's not too much to ask, I'd recommend renaming your plugin to NodeTreePlugin and then create the following two spaces...for nothing but the pluginfor demo, documentation, release notes and all that stuff
(4) Finally I got the meaning of those question marks.
So, I have modified the example a bit to make it more clear and also added some @@color:grey;inline style@@
Best wishes, Tobias.
Best wishes, Tobias.
Some more things...(a) I see your space ships with these simplistic grahpics.I don't think you need those and so I think you should get rid of them. All you need is a bordera simplistic Base64 encoded 1x1 pixel held by a section or slice or variable in your plugin... which you then stretch either horizontally or vertically to the desired size. No resources external to the plugin are needed. You simply render this as...<img src="data:image/gif;base64,R0lGODlhAQABALMAAICAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABAALAAAAAABAAEAAAgEAAEEBAA7" style:"height:1px;width:100px:"/>...or the appropriate background image.background-image: url([[TreeDiagramFormatterPlugin::pixel]]);As before, this could be defined by the user to whatever he likes using css. Your ts:before would then need some defined width or height.(b) what on earth are <tp>, <tl>, <ts> elements?!?
I thought of using table cells and borders to make such a tree diagram in the first place, but I knew this would take too many markups. After searching on Stackoverflow, I found someone sharing about "display: table-row/table-cell", so I decided to combine this CSS trick with the TiddlyWiki list markup mechanism, creating new elements without using CSS classes, because I don't want to use {{css{wrappers}}} per item. Fortunately it worked with acceptable layouts (only that the bars were very ugly before v0.4).
(c) a tree should by default be wrapped into some span with a class .treedg
(d) right now I am playing with getting rid of images entirely and putting nothing but borders
Ha, there are actually:
- <tl> = tree lists, just like "ol" "ul" "dl"
- <ti> = tree items, just like "li"
- <tp> = tree parent nodes
- <ts> = tree separators/spacers
I thought of using table cells and borders to make such a tree diagram in the first place, but I knew this would take too many markups. After searching on Stackoverflow, I found someone sharing about "display: table-row/table-cell", so I decided to combine this CSS trick with the TiddlyWiki list markup mechanism, creating new elements without using CSS classes, because I don't want to use {{css{wrappers}}} per item. Fortunately it worked with acceptable layouts (only that the bars were very ugly before v0.4).
(c) a tree should by default be wrapped into some span with a class .treedg
In the first place I did design to use a class to wrap the whole tree, that was when I was still thinking of table markups and using CSS rules like ".treedg td/tr/th". But later when I changed to list model and new elements, I abandoned the overall class wrapper. It seems that we can do without it, how do you think?
(d) right now I am playing with getting rid of images entirely and putting nothing but borders
It's a pity that CSS does not offer "border: upper-half/lower half" :-p
MediaWiki cladograms use borders, but based on nested tables. The output is very clean, but I found it too hard and too complicated to implement with TiddlyWiki markups... (perhaps have to write another plugin like MediaWikiTableFormatterPlugin)
-- ♾ http://veminra.net ♾
Yes, I suppose it would be good if a fresh space would include a blank DefaultTiddlers to evade this issue. Or if for some reason this has downsides, something that warns the user.
Ha, there are actually:
- <tl> = tree lists, just like "ol" "ul" "dl"
- <ti> = tree items, just like "li"
- <tp> = tree parent nodes
- <ts> = tree separators/spacers
I thought of using table cells and borders to make such a tree diagram in the first place, but I knew this would take too many markups. After searching on Stackoverflow, I found someone sharing about "display: table-row/table-cell", so I decided to combine this CSS trick with the TiddlyWiki list markup mechanism, creating new elements without using CSS classes, because I don't want to use {{css{wrappers}}} per item. Fortunately it worked with acceptable layouts (only that the bars were very ugly before v0.4).
The bit I am missing is where I don't find TL, TI, TP, TS in an HTML spec. So, I presume this is markup you have invented yourself and for some reason the browser doesn't care (interprets it as a span) and applies some custom css to it? I never knew this was possible / allowed.
(c) a tree should by default be wrapped into some span with a class .treedg
In the first place I did design to use a class to wrap the whole tree, that was when I was still thinking of table markups and using CSS rules like ".treedg td/tr/th". But later when I changed to list model and new elements, I abandoned the overall class wrapper. It seems that we can do without it, how do you think?I think it is more intuitive to know there's a <span class="nodetree"/> wrapped around it and then be able to style that with paddings margins backgrounds and what not rather than to have to do this all the time...{{nodetree{&&parent&&%chilc%child}}}
Ah, actually I think I have mixed HTML up with XHTML... I have read that in XHTML 1.1 we can write any new element as we like, and then using CSS to style it. I am actually not aware when the tide changes to HTML5, so I thought using TiddlyWiki formatter extensions to generate new elements is a good way to avoid having to generate CSS classes on standard elements (because I don't know how to do it...) Fortunately the Firefox allows this... :-p
Would there be any bad potentials with this practice?
I think it is more intuitive to know there's a <span class="nodetree"/> wrapped around it and then be able to style that with paddings margins backgrounds and what not rather than to have to do this all the time...{{nodetree{&&parent&&%chilc%child}}}
Yeah, I get your point. Dedicated CSS wrapper is indeed good for styling. Besides of manually input the wrapper, Is there a way to let the plugin to generate the wrapper div automatically (without explicit codes or with them?)
For spaces created in the last year they won't "get" your SiteInfo as
every new space gets one created for it (as well as a GettingStarted).
So yours will be clobbered by the recipe cascade.
If your space has a DefaultTiddlers and theirs does not then they will
get that.
What I would suggest you do for a space designed for inclusion is:
* Not change DefaultTiddlers, use the existing shadow.
* Edit GettingStarted to include getting started info and transclude
SiteInfo
Then, visitors will see what your space is about but when they include
it they will not get SiteInfo, nor DefaultTiddlers nor GettingStarted.
> After all, a SiteInfo tiddler shouldn't be something more vital to a space
> than whatever is in some GettingStarted tiddler.
I don't undertand this statement. The SiteInfo is designed to be
exactly that: the description of the space, including tags which
indicate it's meaning[1].
> As for the latter, I
> believe a GettingStarted space is muuuuuch more appropriate and
> maintainable... seing how much false and irrelevant stuff is in the current
> GettingStarted. o.O
Could you elaborate and if possible provide improvements?
[1]: See http://tsiscover.tiddlyspace.com/tsiscover for some
experimentation on how SiteInfo and its tags could be used.
Things do evolve and change, quite often. In fact I've asked you to
provide me with a concrete alternative but I haven't been able to
understand it yet. If you do and/or I'm able to understand it and it
makes sense then perhaps we can change things. But first I (and
others) need to understand.
I'm still unclear on how GettingStarted is broken?
And it certainly isn't cemented: Everyone gets to change it however
they like. Or they can change DefaultTiddlers so it goes away. There
are options. It sounds like you want to make it so there are fewer?
So your issue with GettingStarted is that it provides a stand in for
applications that ought to exist but do not yet?
This is very true. It would be good for those applications to exist,
but they don't right now so we need something. GettingStarted is what
we've got.
So, right now (for a modern space) they won't get a SiteInfo and they
won't get a GettingStarted.
They'll only get a DefaultTiddlers. If
_you_ don't want one, don't use one in your space, or go ahead and
agree to my earlier question: Should we make DefaultTiddlers one of
the tiddlers that get automatically created during space creation?
So let me see if I can parse out what you are saying, please correct
me where I am wrong:
* DefaultTiddlers _should_ be created at space creation time.
* GettingStarted should be tiny and point elsewhere to info.
If this is the case, that seems fine, but there's no point doing the
second point until that content exists.
It is true that at the moment TiddlySpace's interface is predisposed
to the members of a space. This was by design. The plan was to then
move on to the non-member experience but, well, everyone left.
It is encouraging that you have such interest and so many ideas, but
what we need in addition is people making changes to the code, doing
the open source thing.
Hi GJRobert,Ah, actually I think I have mixed HTML up with XHTML... I have read that in XHTML 1.1 we can write any new element as we like, and then using CSS to style it. I am actually not aware when the tide changes to HTML5, so I thought using TiddlyWiki formatter extensions to generate new elements is a good way to avoid having to generate CSS classes on standard elements (because I don't know how to do it...) Fortunately the Firefox allows this... :-p
Would there be any bad potentials with this practice?For all I care (right now), all major browsers render it correctly, except IE which even at version 10 is too illiterate to translate :before and :after selectors. Chances are that TW in general or one with NodeTreePlugin in it won't pass a validator test, so perhaps it is more advisable to use all spans and give them corresponding classes, e.g. nt-parent, nt-list, nt-item, nt-separator, etc... and cuck all that in some outer nodetree wrapper.
I think it is more intuitive to know there's a <span class="nodetree"/> wrapped around it and then be able to style that with paddings margins backgrounds and what not rather than to have to do this all the time...{{nodetree{&&parent&&%chilc%child}}}
Yeah, I get your point. Dedicated CSS wrapper is indeed good for styling. Besides of manually input the wrapper, Is there a way to let the plugin to generate the wrapper div automatically (without explicit codes or with them?)To be honest, I do not fully comprehend how exactly the actual formatter code works. If you can walk me through that some time, I'd appreciate. In general, I would think that a <tl> would semantically be contained inside a <tp> rather than follow it... this would definetely remove the need for an additional class as we'd have our <tp> wrapping it all. But then the actual tree parent content would have to be wrapped again in some ".nt-parent" class so as to separate it from the adjacent <tl> in terms of being able to style it, i.e give it that background image and perhaps some other visual characteristics later on.
- tobias
I see. IE10 cannot even parse :before and :after correctly? That sounds horrible. If IE has this limitation, will it improves the situation on it if we change the custom elements <tl> <ti> <tp> <ts> to spans?
From the point of Web standard, I agree that safe elements are more feasible. Since all I did in sketching this plugin was just looking at the TiddlyWiki core list formatters and see if there is an easy door to extend and implement something simple in the similar way, I may need more studies in how other plugins handles to create more flexible and ideal elements. Hope that I can catch up soon :-)
Alright. I'll explain how my graffiti works soon and maybe we can see how this plugin may be re-written to meet a standard and better rationale.
Hi Tobias,
I think your test for the proposed 0.5.7 is quite good, almost the same as the original custom elements. If it is for better compatibility, I support to change <tl>, <ti> etc. to proper divs.
The only weird thing I found in my Firefox 23 is that one of the "nt-ti" is not recognized by the browser as "last-of-type", so the tree get a bit of flaw. See below (not sure if the picture can be displayed below. Google editor does not let me move it!):
I think your test for the proposed 0.5.7 is quite good, almost the same as the original custom elements. If it is for better compatibility, I support to change <tl>, <ti> etc. to proper divs.
The only weird thing I found in my Firefox 23 is that one of the "nt-ti" is not recognized by the browser as "last-of-type", so the tree get a bit of flaw. See below (not sure if the picture can be displayed below. Google editor does not let me move it!):
I have compared the codes of 0.5.6 vs. 0.5.7, but did not find clues why that item was rendered wrong. Do you see the same result in Firefox/Chrome or other browsers?
Hi,I think, the two following features could be interresting:
* Before any vertical bar, having an horizontal bar centered on the parent node,I second that, guess I'd like it to see it like this with rather small lines, just the slightes visual clue...* Having a syntax to do vertical diagrams instead of horizontal ones.That's may be neat, too, but...* it will result in a lot of horizontal scrolling* it will require more of a quote style left border with those branchy things* I guess, any second third level, etc... would have to be horizontal again for readability's sakeBest wishes, Tobias.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/bb7beb5a-bd52-45da-ad68-92fd11f6acb9%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Just for the fun of it: I found this by accident.
the code below leads also to results. Could be quite powerful...
Was that intended? @Mat
Or is it an "Easter egg" ?
Kind regards
Pit
<div class="family-tree">
*Tree
*Tree2
**<<list-links "[!is[system]search[child]]">>
</div>
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7e9a1a3f-5693-4e2a-b7b2-834cf6fa449c%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7e9a1a3f-5693-4e2a-b7b2-834cf6fa449c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/MrueYHk2j7U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b77c642f-d8c8-ddab-7977-04d33c394a98%40eclipso.ch.
Maybe I could email the author of the "family-tree" and consult him about this?
The only weakness is that it only creates vertical trees, which is not practical or handsome if you want to type in long texts or the hierarchies increase,
I agree it is no so useful as a family tree but it would be great if we could automatically visualize the tiddlers that share the same tag.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e8b8bc52-b886-4c8c-a1fe-dfd10bee46ce%40googlegroups.com.