Difference between revisions of "Template:Catgraph"
From FollowTheScore
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | ''As an example try and select 'DPL Manual' in both category boxes ...'' | + | ''As an example try and select 'DPL Manual' in both category boxes ...''<br> |
− | {{#form: name= demo |action=/dpldemo/index.php| | + | or select namespace 'main' and 'category', use algorithm 'forcedir' and add "attraction=200" as a manual parameter. |
− | {{#input: name= title |type= hidden | value = | + | {{#dpl:execandexit=geturlargs}} |
+ | {{#form: name= demo |method=get |action=/dpldemo/index.php| | ||
+ | {{#input: name= title |type= hidden | value = Template:Catgraph }} | ||
<table cellpadding=0 cellspacing=0 margins=0> | <table cellpadding=0 cellspacing=0 margins=0> | ||
<tr><td> '''select'''</td><td> '''from'''</td><td> '''to'''</td></tr> | <tr><td> '''select'''</td><td> '''from'''</td><td> '''to'''</td></tr> | ||
<tr bgcolor="#ddddff"> | <tr bgcolor="#ddddff"> | ||
<td align="right"> namespace </td> | <td align="right"> namespace </td> | ||
− | <td> {{#input: name= namespace1 |type= select | value = {{ | + | <td> {{#input: name= namespace1 |type= select | value = {{#DPLvar:namespace1}} | |
*all | *all | ||
*main | *main | ||
Line 13: | Line 15: | ||
*Category | *Category | ||
*Image | *Image | ||
+ | *DPL | ||
}}</td> | }}</td> | ||
− | <td> {{#input: name= namespace2 |type= select | value = {{ | + | <td> {{#input: name= namespace2 |type= select | value = {{#DPLvar:namespace2}} | |
*all | *all | ||
*main | *main | ||
Line 21: | Line 24: | ||
*Category | *Category | ||
*Image | *Image | ||
+ | *DPL | ||
}}</td> | }}</td> | ||
</tr> | </tr> | ||
<tr bgcolor="#ddffff"> | <tr bgcolor="#ddffff"> | ||
<td align="right"> category </td> | <td align="right"> category </td> | ||
− | <td> {{#input: name= category1 | value = {{ | + | <td> {{#input: name= category1 | value = {{#DPLvar:category1}} |type= select |
| *? {{#dpl: namespace=Category | format=,\n*%TITLE%,, }} }} | | *? {{#dpl: namespace=Category | format=,\n*%TITLE%,, }} }} | ||
</td> | </td> | ||
− | <td> {{#input: name= category2 | value = {{ | + | <td> {{#input: name= category2 | value = {{#DPLvar:category2}} |type= select |
| *? {{#dpl: namespace=Category | format = ,\n*%TITLE%,, }} }} | | *? {{#dpl: namespace=Category | format = ,\n*%TITLE%,, }} }} | ||
</td> | </td> | ||
Line 34: | Line 38: | ||
<tr bgcolor="#ffddff"> | <tr bgcolor="#ffddff"> | ||
<td align="right"> uses </td> | <td align="right"> uses </td> | ||
− | <td> {{#input: name= uses1 | value = {{ | + | <td> {{#input: name= uses1 | value = {{#DPLvar:uses1}} |type= select |
| *? {{#dpl: namespace=Template | format=,\n*%TITLE%,, }} }} | | *? {{#dpl: namespace=Template | format=,\n*%TITLE%,, }} }} | ||
</td> | </td> | ||
− | <td> {{#input: name= uses2 | value = {{ | + | <td> {{#input: name= uses2 | value = {{#DPLvar:uses2}} |type= select |
| *? {{#dpl: namespace=Template | format=,\n*%TITLE%,, }} }} | | *? {{#dpl: namespace=Template | format=,\n*%TITLE%,, }} }} | ||
</td> | </td> | ||
Line 43: | Line 47: | ||
<tr bgcolor="#ddeeff"> | <tr bgcolor="#ddeeff"> | ||
<td align="right"> title like</td> | <td align="right"> title like</td> | ||
− | <td> {{#input: name= titlematch1 | value = {{ | + | <td> {{#input: name= titlematch1 | value = {{#DPLvar:titlematch1}} }} |
− | <td> {{#input: name= titlematch2 | value = {{ | + | <td> {{#input: name= titlematch2 | value = {{#DPLvar:titlematch2}} }} |
</td> | </td> | ||
<tr bgcolor="#ffffdd"> | <tr bgcolor="#ffffdd"> | ||
<td align="right"> links from </td> | <td align="right"> links from </td> | ||
− | <td> {{#input: name= linksfrom1 | value = {{ | + | <td> {{#input: name= linksfrom1 | value = {{#DPLvar:linksfrom1}} }} |
− | <td> {{#input: name= linksfrom2 | value = {{ | + | <td> {{#input: name= linksfrom2 | value = {{#DPLvar:linksfrom2}} }} |
</td> | </td> | ||
</tr> | </tr> | ||
<tr bgcolor="#ffffdd"> | <tr bgcolor="#ffffdd"> | ||
<td align="right"> links to </td> | <td align="right"> links to </td> | ||
− | <td> {{#input: name= linksto1 | value = {{ | + | <td> {{#input: name= linksto1 | value = {{#DPLvar:linksto1}} }} |
− | <td> {{#input: name= linksto2 | value = {{ | + | <td> {{#input: name= linksto2 | value = {{#DPLvar:linksto2}} }} |
</td> | </td> | ||
</tr> | </tr> | ||
Line 62: | Line 66: | ||
</table> | </table> | ||
show: namespace {{#input: name= shownamespace | show: namespace {{#input: name= shownamespace | ||
− | |type= select | value = {{ | + | |type= select | value = {{#DPLvar:shownamespace}} | |
*yes | *yes | ||
*no | *no | ||
}}graph {{#input: name= graph | }}graph {{#input: name= graph | ||
− | |type= select | value = {{ | + | |type= select | value = {{#DPLvar:graph}} | |
*svg | *svg | ||
*png | *png | ||
Line 72: | Line 76: | ||
*gdl | *gdl | ||
}}catlinks {{#input: name= catlinks | }}catlinks {{#input: name= catlinks | ||
− | |type= select | value = {{ | + | |type= select | value = {{#DPLvar:catlinks}} | |
*no | *no | ||
*yes | *yes | ||
Line 78: | Line 82: | ||
<small>[[:Template:Catgraph|reset]] [[:Template:Catlist|list]] [[Template:Wgraph defaults|layout]]</small><br> | <small>[[:Template:Catgraph|reset]] [[:Template:Catlist|list]] [[Template:Wgraph defaults|layout]]</small><br> | ||
layout {{#input: name= layout | layout {{#input: name= layout | ||
− | |type= select | value = {{ | + | |type= select | value = {{#DPLvar:layout}} | |
*normal | *normal | ||
*forcedir | *forcedir | ||
Line 92: | Line 96: | ||
*minoutdegree | *minoutdegree | ||
*tree | *tree | ||
− | }}userparm {{#input: name= userparm | size=80 | value = {{ | + | }}userparm {{#input: name= userparm | size=80 | value = {{#DPLvar:userparm}} |
}}}} | }}}} | ||
<!-------------------------------------------------------------------------------------------------------------> | <!-------------------------------------------------------------------------------------------------------------> | ||
− | {{#if:{{ | + | {{#if:{{#DPLvar:layout}}| |
− | {{#if:{{ | + | {{#if:{{#DPLvar:name}}| |
==== {{{name}}} ==== | ==== {{{name}}} ==== | ||
|}} | |}} | ||
− | {{#wgraph: | + | {{#wgraph:name=Catgraph|svg| |
− | {{ | + | {{Wgraph defaults}} |
{{#dpl: | {{#dpl: | ||
|debug=1 | |debug=1 | ||
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:namespace1}}|all||{{#if:{{#DPLvar:namespace1}}|{{#ifeq:{{#DPLvar:namespace1}}|main|namespace=|namespace={{#DPLvar:namespace1}}}}}}}} |
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:category1}}|?||{{#if:{{#DPLvar:category1}}|category={{#DPLvar:category1}}}}}} |
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:uses1}}|?||{{#if:{{#DPLvar:uses1}}|uses=Template:{{#DPLvar:uses1}}}}}} |
− | |titlematch={{ | + | |titlematch={{#DPLvar:titlematch1}} |
|linksto={{#dpl: | |linksto={{#dpl: | ||
|debug=1 | |debug=1 | ||
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:namespace2}}|all||{{#if:{{#DPLvar:namespace2}}|{{#ifeq:{{#DPLvar:namespace2}}|main|namespace=|namespace={{#DPLvar:namespace2}}}}}}}} |
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:category2}}|?||{{#if:{{#DPLvar:category2}}|category={{#DPLvar:category2}}}}}} |
− | |{{#ifeq:{{ | + | |{{#ifeq:{{#DPLvar:uses2}}|?||{{#if:{{#DPLvar:uses2}}|uses=Template:{{#DPLvar:uses2}}}}}} |
− | |titlematch={{ | + | |titlematch={{#DPLvar:titlematch2}} |
|format=,%PAGE%¦,,\n | |format=,%PAGE%¦,,\n | ||
}} | }} | ||
− | |addcategories={{ | + | |addcategories={{#DPLvar:catlinks}} |
− | |format=, edge "%PAGE%" to "%PAGESEL%" {type '%NAMESPACE%'}\n node "%PAGE%" {type '%CATNAMES% | + | |format=, edge "%PAGE%" to "%PAGESEL%" {type '%NAMESPACE%'}\n node "%PAGE%" {type '%CATNAMES%.%NAMESPACE%' href "%PAGE%" },\n, |
}} | }} | ||
− | layout={{ | + | layout={{#DPLvar:layout|dfs}} |
− | {{ | + | {{#DPLvar:userparm}} |
}} | }} | ||
}} | }} |
Latest revision as of 18:54, 19 August 2012
As an example try and select 'DPL Manual' in both category boxes ...
or select namespace 'main' and 'category', use algorithm 'forcedir' and add "attraction=200" as a manual parameter.
{{#form: name= demo |method=get |action=/dpldemo/index.php| {{#input: name= title |type= hidden | value = Template:Catgraph }}
select | from | to |
namespace | {{#input: name= namespace1 |type= select | value = |
|
{{#input: name= namespace2 |type= select | value = |
|
category | {{#input: name= category1 | value = |type= select
| *?
|
{{#input: name= category2 | value = |type= select
| *?
|
uses | {{#input: name= uses1 | value = |type= select
| *?
|
{{#input: name= uses2 | value = |type= select
| *?
|
title like | {{#input: name= titlematch1 | value = }} | {{#input: name= titlematch2 | value = }} |
links from | {{#input: name= linksfrom1 | value = }} | {{#input: name= linksfrom2 | value = }} |
links to | {{#input: name= linksto1 | value = }} | {{#input: name= linksto2 | value = }} |
show: namespace {{#input: name= shownamespace
|type= select | value = |
- yes
- no
}}graph {{#input: name= graph
|type= select | value = |
- svg
- png
- wgl
- gdl
}}catlinks {{#input: name= catlinks
|type= select | value = |
- no
- yes
}}{{#input: type = submit | value = create graph }}
reset list layout
layout {{#input: name= layout
|type= select | value = |
- normal
- forcedir
- dfs
- minbackward
- maxdepth
- mindepth
- maxdegree
- maxindegree
- maxoutdegree
- mindegree
- minindegree
- minoutdegree
- tree
}}userparm {{#input: name= userparm | size=80 | value = }}}}