Last modified: 2014-02-12 23:38:29 UTC
I submitted a half-baked patch here to allow styling of graphviz nodes from Page and Category properties ([[has graphviz node attribute::fillcolor=red]]) http://www.mediawiki.org/wiki/Extension_talk:Semantic_Result_Formats#Feature_request:_node_background_color_from_category However, I did not do a proper job in at least 2 ways: 1. I did not create a special SMW property (I just look through all properties until I find one with a suitable name) 2. I don't handle the Category hierarchy properly (at all, to be honest). The talk page has a suggestion of how best to handle Categories. It was my first attempt at MW programming and I am not a native PHP speaker, as you can probably tell. It would be great if you could provide this functionality robustly for the community. It's low priority though, because I have my patch working fine for our needs. Thanks for the excellent extension. cheers, Bob.
SRF graph is currently rendering non-Page type nodes with URLs to nonexistent pages (if graphlink=yes). I guess this is a bug. It also suggests another feature to me: A page might have a string or boolean property. You might want to color or style those nodes differently on the graph. Therefore if the property had a "graphviz node attribute" property, and the property's value was non-empty (and not false if boolean) you could apply the attributes to the node (*after* applying the category and page-based attributes). Even cooler (but open to injection-based attacks?) would be to enable the display of property values. I envisage something like this Property:Has supervisor [[Has type::string]] [[Has graphviz node attribute::label="\N (supervisor \P)"]] As described here http://www.graphviz.org/doc/info/attrs.html#k:escString \N is an existing graphviz escape sequence to insert the node name. \P could be intercepted by the SRF extension and be replaced with the property value. One problem with this approach is that I can't see how you would add text from more than one property to a node's label. An alternative might be to use my existing patch something like this: [[Has graphviz node attribute::label="{{PAGENAME}} (Supervisor {{#show:{{PAGENAME}}|?has supervisor|link=none}})"]] This works (but comes out all lowercase for some reason).