Page MenuHomePhabricator

format=graph Graphviz attributes from Pages and Categories
Closed, DeclinedPublic

Description

Author: uncoolbob

Description:
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)
  1. 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.


Version: unspecified
Severity: enhancement

Details

Reference
bz22737

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:00 PM
bzimport set Reference to bz22737.

uncoolbob wrote:

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

@Denny: This issue has been assigned to you a while ago.
Could you please share a status update? Are you still working (or still plan to work) on this issue? Is there anything that others could help with?
Only in case you do not plan to work on this issue anymore, should you be removed as assignee (via 'Assign / Claim' in the 'Actions' dropdown menu)?

Kghbln removed Denny as the assignee of this task.
Kghbln added subscribers: Denny, Kghbln.

I believe this is an issue solely related to Semantic Result Formats. Related pull requests and issues should be made at GitHub.