@zakkzhang/tw5-graph 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/package.json +39 -0
- package/plugins/graph/DefaultColourMappings.multids +8 -0
- package/plugins/graph/ViewTemplateBodyFilter/graph.tid +5 -0
- package/plugins/graph/ViewTemplateBodyFilter/properties.tid +5 -0
- package/plugins/graph/edges/fields/list.tid +7 -0
- package/plugins/graph/edges/fields/tags.tid +7 -0
- package/plugins/graph/edges/functions/links.tid +8 -0
- package/plugins/graph/edges/functions/transcludes.tid +8 -0
- package/plugins/graph/fieldtypes/filter.js +212 -0
- package/plugins/graph/fieldtypes/list.js +31 -0
- package/plugins/graph/fieldtypes/title.js +27 -0
- package/plugins/graph/filterrunprefixes/cache.js +118 -0
- package/plugins/graph/filters/gettyped.js +26 -0
- package/plugins/graph/graphengine.js +38 -0
- package/plugins/graph/icon.tid +16 -0
- package/plugins/graph/images/drag.tid +13 -0
- package/plugins/graph/macros/action.addedge.tid +16 -0
- package/plugins/graph/macros/edges.typed.tid +54 -0
- package/plugins/graph/macros/graph.view.tid +24 -0
- package/plugins/graph/macros/node.default.tid +9 -0
- package/plugins/graph/macros/nodes.neighbors.tid +62 -0
- package/plugins/graph/macros/nodes.writable.tid +37 -0
- package/plugins/graph/macros/properties.persistent.tid +27 -0
- package/plugins/graph/macros/properties.popup.tid +76 -0
- package/plugins/graph/macros/properties.river.tid +27 -0
- package/plugins/graph/macros/properties.settings.tid +56 -0
- package/plugins/graph/macros/properties.stack.tid +17 -0
- package/plugins/graph/macros/tiddlywiki.files +17 -0
- package/plugins/graph/plugin.info +14 -0
- package/plugins/graph/presettypes/edges/fields.tid +18 -0
- package/plugins/graph/presettypes/edges/functions.tid +5 -0
- package/plugins/graph/presettypes/nodes/stack.tid +6 -0
- package/plugins/graph/propertytypes/actions.js +15 -0
- package/plugins/graph/propertytypes/boolean.js +23 -0
- package/plugins/graph/propertytypes/enum.js +25 -0
- package/plugins/graph/propertytypes/image.js +140 -0
- package/plugins/graph/propertytypes/number.js +24 -0
- package/plugins/graph/propertytypes/string.js +13 -0
- package/plugins/graph/propertytypes/tiddlywiki.files +17 -0
- package/plugins/graph/readme.tid +5 -0
- package/plugins/graph/relink/attributes.js +52 -0
- package/plugins/graph/relink/attributes.multids +19 -0
- package/plugins/graph/relink/configprefix.js +76 -0
- package/plugins/graph/relink/fieldedgeprefix.js +39 -0
- package/plugins/graph/relink/fields.multids +11 -0
- package/plugins/graph/relink/graphprefix.js +28 -0
- package/plugins/graph/relink/operators.multids +3 -0
- package/plugins/graph/relink/propertyfields.js +81 -0
- package/plugins/graph/relink/utils.js +99 -0
- package/plugins/graph/settings.tid +13 -0
- package/plugins/graph/startup/messages.js +46 -0
- package/plugins/graph/stylesheets/base.css.tid +263 -0
- package/plugins/graph/stylesheets/fullscreen/core.css +11 -0
- package/plugins/graph/stylesheets/fullscreen/core.css.meta +3 -0
- package/plugins/graph/stylesheets/fullscreen.css.tid +46 -0
- package/plugins/graph/stylesheets/popup.css.tid +107 -0
- package/plugins/graph/subfilters.tid +23 -0
- package/plugins/graph/tags/GraphToolbar.tid +2 -0
- package/plugins/graph/tags/SettingsTab.tid +2 -0
- package/plugins/graph/tags/Template.tid +2 -0
- package/plugins/graph/tags/ViewEditTemplate.tid +2 -0
- package/plugins/graph/templates/live-graph.tid +34 -0
- package/plugins/graph/templates/standard-graph.tid +40 -0
- package/plugins/graph/ui/Buttons/center.tid +38 -0
- package/plugins/graph/ui/Buttons/export.tid +65 -0
- package/plugins/graph/ui/Buttons/fullscreen.tid +35 -0
- package/plugins/graph/ui/Buttons/settings.tid +28 -0
- package/plugins/graph/ui/Buttons/tiddlywiki.files +16 -0
- package/plugins/graph/ui/EditTemplate/Edges.tid +22 -0
- package/plugins/graph/ui/EditTemplate/Neighbors.tid +35 -0
- package/plugins/graph/ui/EditTemplate/Nodes.tid +12 -0
- package/plugins/graph/ui/EditTemplate/Popups.tid +27 -0
- package/plugins/graph/ui/EditTemplate/Properties.tid +21 -0
- package/plugins/graph/ui/EditTemplate/tiddlywiki.files +16 -0
- package/plugins/graph/ui/Modals/NewPropertySet.tid +20 -0
- package/plugins/graph/ui/Modals/NewView.tid +20 -0
- package/plugins/graph/ui/Modals/Select.tid +72 -0
- package/plugins/graph/ui/Modals/SelectField.tid +21 -0
- package/plugins/graph/ui/Modals/SelectTiddler.tid +15 -0
- package/plugins/graph/ui/Modals/Tiddler.tid +22 -0
- package/plugins/graph/ui/Modals/TiddlerHeader.tid +15 -0
- package/plugins/graph/ui/PropertyTypes/boolean.tid +11 -0
- package/plugins/graph/ui/PropertyTypes/color.tid +5 -0
- package/plugins/graph/ui/PropertyTypes/enum.tid +15 -0
- package/plugins/graph/ui/PropertyTypes/number.tid +17 -0
- package/plugins/graph/ui/Settings/Engine.tid +23 -0
- package/plugins/graph/ui/Settings/Graphs/EditTemplate.tid +52 -0
- package/plugins/graph/ui/Settings/Graphs.tid +49 -0
- package/plugins/graph/ui/Settings/Properties/ObjectsTypeTemplate.tid +44 -0
- package/plugins/graph/ui/Settings/Properties.tid +14 -0
- package/plugins/graph/ui/Settings/Toolbar.tid +5 -0
- package/plugins/graph/ui/SideBar/Graph.tid +77 -0
- package/plugins/graph/ui/Toolbars/GraphToolbar.tid +15 -0
- package/plugins/graph/ui/ViewTemplate/graph-object.tid +13 -0
- package/plugins/graph/ui/ViewTemplate/graph.tid +11 -0
- package/plugins/graph/ui/ViewTemplate/properties.tid +80 -0
- package/plugins/graph/ui/grouped-tabs.tid +109 -0
- package/plugins/graph/ui/selector.tid +74 -0
- package/plugins/graph/utils.js +148 -0
- package/plugins/graph/widgets/action-delay.js +72 -0
- package/plugins/graph/widgets/action-modal.js +121 -0
- package/plugins/graph/widgets/action-typed.js +56 -0
- package/plugins/graph/widgets/action-with.js +70 -0
- package/plugins/graph/widgets/boundingbox.js +126 -0
- package/plugins/graph/widgets/fieldTranscriber.js +98 -0
- package/plugins/graph/widgets/fieldtranscriber/filter.js +93 -0
- package/plugins/graph/widgets/fieldtranscriber/json.js +34 -0
- package/plugins/graph/widgets/fieldtranscriber/plain.js +11 -0
- package/plugins/graph/widgets/graphobject.js +120 -0
- package/plugins/graph/widgets/messagerelay.js +115 -0
- package/plugins/graph/widgets/properties.js +131 -0
- package/plugins/graph/widgets/subclass/edge.js +47 -0
- package/plugins/graph/widgets/subclass/graph.js +424 -0
- package/plugins/graph/widgets/subclass/node.js +44 -0
- package/plugins/graph/widgets/tiddlywiki.files +43 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
title: $:/plugins/flibbles/graph/ui/SideBar
|
|
2
|
+
caption: Graph
|
|
3
|
+
tags: $:/tags/SideBar
|
|
4
|
+
|
|
5
|
+
\procedure fs-state() $:/state/flibbles/graph/fullscreen
|
|
6
|
+
|
|
7
|
+
\whitespace trim
|
|
8
|
+
|
|
9
|
+
\parameters (state: "$:/config/flibbles/graph/sidebar", defaultGraph: "$:/graph/Default")
|
|
10
|
+
|
|
11
|
+
\function graph() [<state>get[text]else<defaultGraph>]
|
|
12
|
+
|
|
13
|
+
<$keyboard key="escape" actions="""<%if [<fs-state>is[tiddler]] %><$action-deletetiddler $tiddler=<<fs-state>> />""" >
|
|
14
|
+
|
|
15
|
+
<div class="graph-sidebar-disabled graph-error tc-page-controls">
|
|
16
|
+
|
|
17
|
+
<!-- Sidebar only works in fullscreen during mobile mode.
|
|
18
|
+
Otherwise, it's taking up too much space. -->
|
|
19
|
+
|
|
20
|
+
<$transclude $tiddler="$:/plugins/flibbles/graph/ui/Buttons/fullscreen" class=tc-btn-invisible $mode=inline />
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
<$boundingbox
|
|
24
|
+
class={{{ graph-sidebar-enabled [<fs-state>get[text]] +[join[ ]] }}}
|
|
25
|
+
width="[<windowWidth>subtract<boundingLeft>subtract[15]addsuffix[px]]"
|
|
26
|
+
height="[<windowHeight>subtract<boundingTop>subtract[15]addsuffix[px]]">
|
|
27
|
+
|
|
28
|
+
<$vars
|
|
29
|
+
graph-sidebar=yes
|
|
30
|
+
relayState=<<qualify graph-toolbar->> >
|
|
31
|
+
|
|
32
|
+
<$messagerelay to=<<relayState>> >
|
|
33
|
+
|
|
34
|
+
<div class="graph-sidebar-banner">
|
|
35
|
+
|
|
36
|
+
<$slot $name="banner">
|
|
37
|
+
|
|
38
|
+
<$select tiddler=<<state>> default=<<defaultGraph>> >
|
|
39
|
+
|
|
40
|
+
<$list filter="[<state>get[text]] [prefix[$:/graph/]else<defaultGraph>]" >
|
|
41
|
+
|
|
42
|
+
<option value=<<currentTiddler>> >
|
|
43
|
+
|
|
44
|
+
<$view field=caption>
|
|
45
|
+
|
|
46
|
+
<$text text={{{ [{!!title}removeprefix[$:/graph/]] }}} />
|
|
47
|
+
|
|
48
|
+
</$view>
|
|
49
|
+
</option>
|
|
50
|
+
</$list>
|
|
51
|
+
</$select>
|
|
52
|
+
<$vars currentTiddler=<<graph>> >
|
|
53
|
+
|
|
54
|
+
<$list filter="[[$:/tags/flibbles/graph/GraphToolbar]tagging[]!is[draft]] :filter[{!!title}addprefix[$:/config/flibbles/graph/GraphToolbarButtons/Visibility/]!text[hide]]" variable=listItem>
|
|
55
|
+
|
|
56
|
+
<$transclude tiddler=<<listItem>> mode=inline />
|
|
57
|
+
|
|
58
|
+
</$list>
|
|
59
|
+
</$vars>
|
|
60
|
+
</$slot>
|
|
61
|
+
</div>
|
|
62
|
+
</$messagerelay>
|
|
63
|
+
<$linkcatcher actions="""\whitespace trim
|
|
64
|
+
<%if [<fs-state>is[tiddler]] %>
|
|
65
|
+
<$action-listops $tiddler='$:/state/flibbles/graph/modal' $filter='[<navigateTo>]' />
|
|
66
|
+
<$action-sendmessage $message=tm-modal $param='$:/plugins/flibbles/graph/ui/Modals/Tiddler' tv-story-list='$:/state/flibbles/graph/modal' />
|
|
67
|
+
<%else%>
|
|
68
|
+
<$action-navigate $to=<<navigateTo>> />""">
|
|
69
|
+
|
|
70
|
+
<$graph.view $tiddler=<<graph>> $mode=inline >
|
|
71
|
+
|
|
72
|
+
<$messagerelay name=<<relayState>> />
|
|
73
|
+
|
|
74
|
+
</$graph.view>
|
|
75
|
+
</$linkcatcher>
|
|
76
|
+
</$vars>
|
|
77
|
+
</$boundingbox>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
title: $:/plugins/flibbles/graph/ui/Toolbars/GraphToolbar
|
|
2
|
+
caption: Graph Toolbar
|
|
3
|
+
tags: $:/tags/ControlPanel/Toolbars
|
|
4
|
+
|
|
5
|
+
\procedure config-base() $:/config/flibbles/graph/GraphToolbarButtons/Visibility/
|
|
6
|
+
|
|
7
|
+
Choose which buttons are displayed on the sidebar graph's toolbar. Drag and drop to change the ordering
|
|
8
|
+
|
|
9
|
+
Buttons may not show up anyway if the assigned graph engine does not support them.
|
|
10
|
+
|
|
11
|
+
<$set name="tv-config-toolbar-icons" value="yes">
|
|
12
|
+
|
|
13
|
+
<$set name="tv-config-toolbar-text" value="yes">
|
|
14
|
+
|
|
15
|
+
<$macrocall $name="list-tagged-draggable" tag="$:/tags/flibbles/graph/GraphToolbar" itemTemplate="$:/core/ui/ControlPanel/Toolbars/ItemTemplate"/>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
title: $:/plugins/flibbles/graph/ui/ViewTemplate/graph-object
|
|
2
|
+
|
|
3
|
+
\whitespace trim
|
|
4
|
+
|
|
5
|
+
<$let
|
|
6
|
+
descriptors={{{[all[current]removeprefix[$:/config/flibbles/graph/]]}}}
|
|
7
|
+
type={{{ [<descriptors>split[/]nth[1]] }}}
|
|
8
|
+
category={{{ [<descriptors>split[/]nth[2]] }}} >
|
|
9
|
+
|
|
10
|
+
<$transclude $tiddler=`$:/plugins/flibbles/graph/presettypes/$(type)$/$(category)$` />
|
|
11
|
+
|
|
12
|
+
<$transclude $tiddler="$:/plugins/flibbles/graph/ui/ViewTemplate/properties"
|
|
13
|
+
type={{{ [all[current]removeprefix[$:/config/flibbles/graph/]splitbefore[/]removesuffix[/]] }}} />
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
title: $:/plugins/flibbles/graph/ui/ViewTemplate/graph
|
|
2
|
+
|
|
3
|
+
\whitespace trim
|
|
4
|
+
|
|
5
|
+
<$let graphengine={{{ [{!!engine}!is[blank]] ~[<graphengine>] }}}>
|
|
6
|
+
|
|
7
|
+
<$transclude tiddler={{{ [{!!template}!is[blank]] ~[[$:/tags/flibbles/graph/Template]tagging[]] }}} >
|
|
8
|
+
|
|
9
|
+
<$transclude tiddler="$:/language/MissingTiddler/Hint"/>
|
|
10
|
+
|
|
11
|
+
</$transclude></$let>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
title: $:/plugins/flibbles/graph/ui/ViewTemplate/properties
|
|
2
|
+
|
|
3
|
+
\procedure row(depth:0)
|
|
4
|
+
<$reveal tag=tr type="match" state=<<dropdownStateTitle>> text=open default=<<default>> >
|
|
5
|
+
<$let jsonEntry={{{ [<json>jsonextract<property>] }}}
|
|
6
|
+
propertyType={{{ [<jsonEntry>jsonget[type]] }}} >
|
|
7
|
+
<td class=graph-property-label>
|
|
8
|
+
<$list filter="[range<depth>]"> </$list>
|
|
9
|
+
<$text text=<<property>> />
|
|
10
|
+
</td>
|
|
11
|
+
<td class=`graph-property-input graph-property-input-$(propertyType)$`>
|
|
12
|
+
<$transclude
|
|
13
|
+
$tiddler=`$:/plugins/flibbles/graph/ui/PropertyTypes/$(propertyType)$`
|
|
14
|
+
$mode=inline>
|
|
15
|
+
<$edit-text tag=input index=<<property>> />
|
|
16
|
+
</$transclude>
|
|
17
|
+
</td>
|
|
18
|
+
<td class=graph-property-remove>
|
|
19
|
+
<%if [all[current]getindex<property>] %>
|
|
20
|
+
<$button class=tc-btn-invisible tooltip="Unset this property">
|
|
21
|
+
<$action-setfield $index=<<property>> />
|
|
22
|
+
<$transclude $tiddler="$:/core/images/delete-button" $mode=inline />
|
|
23
|
+
</$button>
|
|
24
|
+
<%endif%>
|
|
25
|
+
</td>
|
|
26
|
+
</$let>
|
|
27
|
+
</$reveal>
|
|
28
|
+
<$list variable=property filter="[<json>jsonindexes[]] :filter[<json>jsonextract<currentTiddler>jsonget[parent]match<property>]">
|
|
29
|
+
<$transclude $variable=row depth={{{ [<depth>add[1]] }}} />
|
|
30
|
+
\end
|
|
31
|
+
|
|
32
|
+
\procedure arrows(state, default)
|
|
33
|
+
\whitespace trim
|
|
34
|
+
<$reveal type="nomatch" state=<<state>> text=open default=<<default>> >
|
|
35
|
+
<$button class=tc-btn-invisible>
|
|
36
|
+
<$action-setfield $tiddler=<<state>> $value=open />
|
|
37
|
+
{{$:/core/images/right-arrow}}
|
|
38
|
+
</$button>
|
|
39
|
+
</$reveal>
|
|
40
|
+
<$reveal type="match" state=<<state>> text=open default=<<default>> >
|
|
41
|
+
<$button class="tc-btn-invisible">
|
|
42
|
+
<$action-setfield $tiddler=<<state>> $value=close default=<<default>> />
|
|
43
|
+
{{$:/core/images/down-arrow}}
|
|
44
|
+
</$button>
|
|
45
|
+
</$reveal>
|
|
46
|
+
\end
|
|
47
|
+
|
|
48
|
+
\procedure section(header, filter, default)
|
|
49
|
+
\whitespace trim
|
|
50
|
+
<$qualify name=dropdownStateTitle title=`$:/state/dropdown/$(header)$`>
|
|
51
|
+
<tr>
|
|
52
|
+
<th colspan=3 align=left>
|
|
53
|
+
<$transclude $variable=arrows state=<<dropdownStateTitle>> default=<<default>> />
|
|
54
|
+
 
|
|
55
|
+
<<header>>
|
|
56
|
+
</th>
|
|
57
|
+
</tr>
|
|
58
|
+
<$list variable=property filter=<<filter>> >
|
|
59
|
+
<<row>>
|
|
60
|
+
\end
|
|
61
|
+
|
|
62
|
+
\parameters (type)
|
|
63
|
+
\whitespace trim
|
|
64
|
+
|
|
65
|
+
<$list variable=json filter="[[graphengine]modules[]] :filter[moduleproperty[name]match<graphengine>] +[moduleproperty[properties]jsonextract<type>]" >
|
|
66
|
+
|
|
67
|
+
<table class=graph-property>
|
|
68
|
+
|
|
69
|
+
<$transclude $variable=section $mode=inline
|
|
70
|
+
header=Style
|
|
71
|
+
default=open
|
|
72
|
+
filter="""[<json>jsonindexes[]]
|
|
73
|
+
:filter[<json>jsonextract<currentTiddler>jsonget[type]!match[actions]]
|
|
74
|
+
:filter[<json>jsonextract<currentTiddler>jsonget[parent]count[]match[0]]
|
|
75
|
+
:filter[<json>jsonextract<currentTiddler>jsonget[hidden]else[false]!match[true]]""" />
|
|
76
|
+
|
|
77
|
+
<$transclude $variable=section $mode=inline
|
|
78
|
+
header=Actions
|
|
79
|
+
default=closed
|
|
80
|
+
filter="[<json>jsonindexes[]] :filter[<json>jsonextract<currentTiddler>jsonget[type]match[actions]]" />
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
title: $:/plugins/flibbles/graph/ui/grouped-tabs
|
|
2
|
+
code-body: yes
|
|
3
|
+
|
|
4
|
+
\procedure grouped-tabs-button()
|
|
5
|
+
\whitespace trim
|
|
6
|
+
<$button
|
|
7
|
+
class="group-tab-button"
|
|
8
|
+
set=<<tabsState>>
|
|
9
|
+
setTo=<<currentTab>>
|
|
10
|
+
dragTiddler=<<currentTab>>
|
|
11
|
+
default=<<default>>
|
|
12
|
+
selectedClass="tc-tab-selected"
|
|
13
|
+
tooltip={{!!tooltip}}
|
|
14
|
+
role="switch"
|
|
15
|
+
data-tab-title=<<currentTab>>
|
|
16
|
+
>
|
|
17
|
+
<%if [<orderable>match[yes]] %>
|
|
18
|
+
{{$:/plugins/flibbles/graph/images/drag}}
|
|
19
|
+
<%endif%>
|
|
20
|
+
<$tiddler tiddler=<<save-currentTiddler>>>
|
|
21
|
+
<$vars tv-wikilinks="no">
|
|
22
|
+
<span>
|
|
23
|
+
<$slot $name=button>
|
|
24
|
+
<$transclude tiddler=<<currentTab>> field="caption">
|
|
25
|
+
<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
|
|
26
|
+
</$transclude>
|
|
27
|
+
</$slot>
|
|
28
|
+
</span>
|
|
29
|
+
</$vars>
|
|
30
|
+
</$tiddler>
|
|
31
|
+
</$button>
|
|
32
|
+
\end
|
|
33
|
+
|
|
34
|
+
\define grouped-tabs-tab()
|
|
35
|
+
\whitespace trim
|
|
36
|
+
<$set name="save-currentTiddler" value=<<currentTiddler>>>
|
|
37
|
+
<$tiddler tiddler=<<currentTab>>>
|
|
38
|
+
<$transclude $variable=grouped-tabs-button $fillignore=yes />
|
|
39
|
+
</$tiddler>
|
|
40
|
+
</$set>
|
|
41
|
+
\end
|
|
42
|
+
|
|
43
|
+
\procedure grouped-tabs-tab-body()
|
|
44
|
+
\whitespace trim
|
|
45
|
+
<$list filter=<<groupsList>> variable="currentGroup">
|
|
46
|
+
<$list filter=<<tabsList>> variable="currentTab">
|
|
47
|
+
<$reveal type="match" state=<<tabsState>> text=<<currentTab>> default=<<default>> retain=<<retain>> tag="div">
|
|
48
|
+
<$slot $name=body />
|
|
49
|
+
</$reveal>
|
|
50
|
+
</$list>
|
|
51
|
+
</$list>
|
|
52
|
+
\end
|
|
53
|
+
|
|
54
|
+
\function sort.by(tiddler) [<tiddler>each:list-item[list]is[tiddler]] =[all[]] +[unique[]]
|
|
55
|
+
|
|
56
|
+
\procedure grouped-tabs-drop-actions()
|
|
57
|
+
<$action-log
|
|
58
|
+
actionTiddler=<<actionTiddler>>
|
|
59
|
+
currentTab=<<currentTiddler>>
|
|
60
|
+
/>
|
|
61
|
+
<$action-listops
|
|
62
|
+
$tiddler=<<orderTiddler>>
|
|
63
|
+
$field=list
|
|
64
|
+
$filter="[subfilter<tabsList>sort.by<orderTiddler>] +[insertbefore<actionTiddler>,<currentTab>]"/>
|
|
65
|
+
\end
|
|
66
|
+
|
|
67
|
+
\procedure grouped-tabs-tab-list()
|
|
68
|
+
\whitespace trim
|
|
69
|
+
<$list variable=currentGroup filter=<<groupsList>> >
|
|
70
|
+
<$let orderTiddler={{{ [<currentGroup>subfilter<orderFilter>] }}}
|
|
71
|
+
orderable={{{ [<orderTiddler>!is[blank]then[yes]else[no]] }}} >
|
|
72
|
+
<%if [<currentGroup>!is[blank]] %>
|
|
73
|
+
<div class="group-tab-header"><$text text={{{ [<currentGroup>titlecase[]] }}} /></div>
|
|
74
|
+
<%endif%>
|
|
75
|
+
<$list variable=currentTab filter="[subfilter<tabsList>sort.by<orderTiddler>]" >
|
|
76
|
+
<$droppable
|
|
77
|
+
actions=<<grouped-tabs-drop-actions>>
|
|
78
|
+
enable=<<orderable>> >
|
|
79
|
+
<div class="tc-droppable-placeholder"/>
|
|
80
|
+
<$transclude $variable=grouped-tabs-tab $fillignore=yes/>
|
|
81
|
+
</$droppable>
|
|
82
|
+
</$list>
|
|
83
|
+
<$tiddler tiddler="">
|
|
84
|
+
<$droppable
|
|
85
|
+
actions=<<grouped-tabs-drop-actions>>
|
|
86
|
+
enable=<<orderable>> >
|
|
87
|
+
<div class="tc-droppable-placeholder"/>
|
|
88
|
+
<$slot $name=addButton />
|
|
89
|
+
</$droppable>
|
|
90
|
+
</$tiddler>
|
|
91
|
+
</$let>
|
|
92
|
+
</$list>
|
|
93
|
+
\end
|
|
94
|
+
|
|
95
|
+
\parameters (tabsList, groupsList:"[[]]", state:"$:/state/flibbles/graph/grouped-tab", explicitState, default, class:"tc-vertical", retain, orderFilter)
|
|
96
|
+
|
|
97
|
+
<$qualify title=<<state>> name=qualifiedState>
|
|
98
|
+
<$let tabsState={{{ [<explicitState>minlength[1]] ~[<qualifiedState>] }}}>
|
|
99
|
+
<div class={{{ [[tc-tab-set]addsuffix[ ]addsuffix<class>] }}}>
|
|
100
|
+
<div class={{{ [[tc-tab-buttons]addsuffix[ ]addsuffix<class>] }}}>
|
|
101
|
+
<$transclude $variable=grouped-tabs-tab-list $fillignore=yes />
|
|
102
|
+
</div>
|
|
103
|
+
<div class={{{ [[tc-tab-divider]addsuffix[ ]addsuffix<class>] }}}/>
|
|
104
|
+
<div class={{{ [[tc-tab-content]addsuffix[ ]addsuffix<class>] }}}>
|
|
105
|
+
<$transclude $variable=grouped-tabs-tab-body $fillignore=yes />
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</$let>
|
|
109
|
+
</$qualify>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
title: $:/plugins/flibbles/graph/ui/selector
|
|
2
|
+
code-body: yes
|
|
3
|
+
|
|
4
|
+
\whitespace trim
|
|
5
|
+
\procedure select-accept-actions()
|
|
6
|
+
\whitespace trim
|
|
7
|
+
<$vars selectedTiddler={{$:/temp/graph/select/tiddler}}>
|
|
8
|
+
<$slot $name=action />
|
|
9
|
+
<$action-deletetiddler $filter="[[$:/temp/graph/select]] [[$:/temp/graph/select/tiddler]] [[$:/temp/graph/select/selected-item]] [[$:/temp/graph/select/refresh]]" />
|
|
10
|
+
</$vars>
|
|
11
|
+
\end
|
|
12
|
+
|
|
13
|
+
\procedure select-click-actions()
|
|
14
|
+
<$messagecatcher $completed="""<$transclude $variable=select-accept-actions $fillignore=yes />""" >
|
|
15
|
+
<$action-setfield $tiddler="$:/temp/graph/select/tiddler" text=<<navigateTo>> />
|
|
16
|
+
<$action-sendmessage $message=completed />
|
|
17
|
+
\end
|
|
18
|
+
|
|
19
|
+
\procedure select-close-actions()
|
|
20
|
+
\whitespace trim
|
|
21
|
+
<$slot $name=cancel />
|
|
22
|
+
<$action-deletetiddler $filter="[[$:/temp/graph/select]] [[$:/temp/graph/select/tiddler]] [[$:/temp/graph/select/selected-item]] [[$:/temp/graph/select/refresh]]" />
|
|
23
|
+
\end
|
|
24
|
+
|
|
25
|
+
\procedure select-cancel-actions()
|
|
26
|
+
\whitespace trim
|
|
27
|
+
<% if [{$:/temp/graph/select}match[]] %>
|
|
28
|
+
<$transclude $variable=select-close-actions $fillignore=yes />
|
|
29
|
+
<% elseif [{$:/temp/graph/select}!match{$:/temp/graph/select/tiddler}] %>
|
|
30
|
+
<$action-setfield $tiddler="$:/temp/graph/select/tiddler" text={{$:/temp/graph/select}}/>
|
|
31
|
+
<$action-deletetiddler $filter="$:/temp/graph/select/selected-item" />
|
|
32
|
+
<$action-setfield $tiddler="$:/temp/graph/select/refresh" text="yes"/>
|
|
33
|
+
<% else %>
|
|
34
|
+
<$action-deletetiddler $filter="[[$:/temp/graph/select]] [[$:/temp/graph/select/tiddler]] [[$:/temp/graph/select/selected-item]] [[$:/temp/graph/select/refresh]]" />
|
|
35
|
+
<% endif %>
|
|
36
|
+
\end
|
|
37
|
+
|
|
38
|
+
\parameters (configTiddler)
|
|
39
|
+
|
|
40
|
+
<$transclude
|
|
41
|
+
$variable=keyboard-driven-input
|
|
42
|
+
$fillignore=yes
|
|
43
|
+
$mode=inline
|
|
44
|
+
storeTitle="$:/temp/graph/select"
|
|
45
|
+
tiddler="$:/temp/graph/select/tiddler"
|
|
46
|
+
refreshTitle="$:/temp/graph/select/refresh"
|
|
47
|
+
selectionStateTitle="$:/temp/graph/select/selected-item"
|
|
48
|
+
configTiddlerFilter="[<configTiddler>]"
|
|
49
|
+
tag=input
|
|
50
|
+
placeholder="Type something"
|
|
51
|
+
class="tc-edit-texteditor graph-select"
|
|
52
|
+
focus=yes
|
|
53
|
+
inputCancelActions="<$transclude $variable=select-cancel-actions $fillignore=yes />"
|
|
54
|
+
inputAcceptActions="<$transclude $variable=select-accept-actions $fillignore=yes />"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<p>
|
|
58
|
+
|
|
59
|
+
<$linkcatcher actions=<<select-click-actions>> >
|
|
60
|
+
|
|
61
|
+
<$list filter={{{ [<configTiddler>get[first-search-filter]] }}} >
|
|
62
|
+
|
|
63
|
+
<$list-empty>
|
|
64
|
+
|
|
65
|
+
<$text text="New result" />
|
|
66
|
+
|
|
67
|
+
</$list-empty>
|
|
68
|
+
<$list-template>
|
|
69
|
+
|
|
70
|
+
<span class={{{[{$:/temp/graph/select/tiddler}match<currentTiddler>then[tc-list-item-selected]] }}}>
|
|
71
|
+
|
|
72
|
+
<$slot $name=list-item>
|
|
73
|
+
|
|
74
|
+
<$transclude tiddler="$:/core/ui/ListItemTemplate" mode=inline/>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*\
|
|
2
|
+
title: $:/plugins/flibbles/graph/utils.js
|
|
3
|
+
type: application/javascript
|
|
4
|
+
module-type: library
|
|
5
|
+
|
|
6
|
+
Utility methods used by the graphing widgets.
|
|
7
|
+
|
|
8
|
+
\*/
|
|
9
|
+
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
var Engines = $tw.modules.createClassesFromModules("graphengine");
|
|
13
|
+
var PropertyTypes = $tw.modules.getModulesByTypeAsHashmap("graphpropertytype");
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
Returns the window for flibbles/graph to use. I do this so that the testing
|
|
17
|
+
framework can mock it out on Node.JS.
|
|
18
|
+
*/
|
|
19
|
+
exports.window = function() { return window; };
|
|
20
|
+
|
|
21
|
+
exports.getEngineMap = function() {
|
|
22
|
+
return Engines;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.getEngine = function(name) {
|
|
26
|
+
var engineMap = exports.getEngineMap();
|
|
27
|
+
return engineMap[name] || null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
Checks if any property in an object needs to check for refresh, and returns
|
|
32
|
+
true if any do need to refresh.
|
|
33
|
+
*/
|
|
34
|
+
exports.refreshProperties = function(properties, widget, type, changedTiddlers) {
|
|
35
|
+
var engineName = widget.getVariable("graphengine");
|
|
36
|
+
var engine = Engines[engineName];
|
|
37
|
+
if (engine) {
|
|
38
|
+
var propInfos = engine.prototype.properties[type];
|
|
39
|
+
if (propInfos) {
|
|
40
|
+
for (var name in properties) {
|
|
41
|
+
var info = propInfos[name];
|
|
42
|
+
var type = PropertyTypes[info && info.type];
|
|
43
|
+
if (type && type.refresh) {
|
|
44
|
+
if (type.refresh(info, properties[name], changedTiddlers, widget)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Aren't we all eventually garbage?
|
|
55
|
+
var eventualGarbage = [];
|
|
56
|
+
var upkeepId;
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
Register an object for destruction. It's ready to pass on once its
|
|
60
|
+
isGarbage method returns true;
|
|
61
|
+
*/
|
|
62
|
+
exports.registerForGarbageCollection = function(object) {
|
|
63
|
+
var destroy = object.destroy;
|
|
64
|
+
if (destroy) {
|
|
65
|
+
// This object has a destroy method, which means it's probably
|
|
66
|
+
// a widget in ^v5.4.0 TiddlyWiki, which are capable of
|
|
67
|
+
// destruction. We'll use that system instead. It's better.
|
|
68
|
+
object.destroy = function() {
|
|
69
|
+
// Call the widget core destroy method
|
|
70
|
+
destroy.apply(object, arguments);
|
|
71
|
+
// And then our own method
|
|
72
|
+
object.garbageCollect();
|
|
73
|
+
};
|
|
74
|
+
} else {
|
|
75
|
+
// Otherwise, we'll need to keep tabs on this so we can check
|
|
76
|
+
// back in occasionally to see if it should be destroyed.
|
|
77
|
+
if (!upkeepId) {
|
|
78
|
+
upkeepId = setInterval(exports.upkeep, 5000);
|
|
79
|
+
}
|
|
80
|
+
eventualGarbage.push(object);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
exports.upkeep = function() {
|
|
85
|
+
var i = eventualGarbage.length;
|
|
86
|
+
while (i > 0) {
|
|
87
|
+
i--;
|
|
88
|
+
var object = eventualGarbage[i];
|
|
89
|
+
if (object.isGarbage()) {
|
|
90
|
+
eventualGarbage.splice(i, 1);
|
|
91
|
+
object.garbageCollect();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// No managed objects. Let's shut down for now.
|
|
95
|
+
if (eventualGarbage.length == 0) {
|
|
96
|
+
clearInterval(upkeepId);
|
|
97
|
+
upkeepId = null;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
exports.getParentProperties = function(widget, type) {
|
|
102
|
+
// For now, we hard-stop at the graph. We don't take properties outside
|
|
103
|
+
// We may some day, but for now, support for that would be frought with
|
|
104
|
+
// complications
|
|
105
|
+
while (widget.parentWidget && widget.graphObjectType !== "graph") {
|
|
106
|
+
widget = widget.parentWidget;
|
|
107
|
+
if (widget.graphPropertiesWidget && widget.type === type) {
|
|
108
|
+
return widget;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return null;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
exports.WidgetIterator = function(root) {
|
|
115
|
+
this.stack = [];
|
|
116
|
+
this.ptr = root;
|
|
117
|
+
while (this.ptr.children && this.ptr.children.length > 0) {
|
|
118
|
+
this.stack.push(0);
|
|
119
|
+
this.ptr = this.ptr.children[0];
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
exports.WidgetIterator.prototype.next = function() {
|
|
124
|
+
var rtn, ptr = this.ptr;
|
|
125
|
+
if (!ptr) {
|
|
126
|
+
rtn = {done: true};
|
|
127
|
+
} else {
|
|
128
|
+
rtn = {value: ptr, done: false};
|
|
129
|
+
ptr = ptr.parentWidget;
|
|
130
|
+
var index = this.stack.pop();
|
|
131
|
+
if (index !== undefined) {
|
|
132
|
+
index++;
|
|
133
|
+
if (ptr && ptr.children.length > index) {
|
|
134
|
+
ptr = ptr.children[index];
|
|
135
|
+
this.stack.push(index);
|
|
136
|
+
// Now dive to the lowest child
|
|
137
|
+
while (ptr.children && ptr.children.length > 0) {
|
|
138
|
+
this.stack.push(0);
|
|
139
|
+
ptr = ptr.children[0];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
ptr = null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
this.ptr = ptr;
|
|
147
|
+
return rtn;
|
|
148
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*\
|
|
2
|
+
|
|
3
|
+
Action widget that introduces a delay before executing any nested actions it contains.
|
|
4
|
+
|
|
5
|
+
\*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
|
10
|
+
|
|
11
|
+
var DelayWidget = function(parseTreeNode, options) {
|
|
12
|
+
this.initialise(parseTreeNode, options);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
DelayWidget.prototype = new Widget();
|
|
16
|
+
|
|
17
|
+
DelayWidget.prototype.render = function(parent, nextSibling) {
|
|
18
|
+
this.parentDomNode = parent;
|
|
19
|
+
this.computeAttributes();
|
|
20
|
+
this.execute();
|
|
21
|
+
this.renderChildren(parent, nextSibling);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
DelayWidget.prototype.execute = function() {
|
|
25
|
+
this.ms = this.getAttribute("$ms", 0);
|
|
26
|
+
this.state = this.getAttribute("$state");
|
|
27
|
+
this.makeChildWidgets();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
DelayWidget.prototype.refresh = function(changedTiddlers) {
|
|
31
|
+
var changedAttributes = this.computeAttributes();
|
|
32
|
+
if ($tw.utils.count(changedAttributes) > 0) {
|
|
33
|
+
this.refreshSelf();
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return this.refreshChildren(changedTiddlers);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var counter = 0;
|
|
40
|
+
|
|
41
|
+
DelayWidget.prototype.invokeAction = function(triggeringWidget, event) {
|
|
42
|
+
// The id is used to make sure the later timed invocation corresponds
|
|
43
|
+
// to this method call here.
|
|
44
|
+
var id = (counter++).toString();
|
|
45
|
+
if (this.state) {
|
|
46
|
+
this.wiki.addTiddler({title: this.state, text: id});
|
|
47
|
+
}
|
|
48
|
+
return setTimeout(execute, this.ms, this, triggeringWidget, event, id);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
DelayWidget.prototype.allowActionPropagation = function() {
|
|
52
|
+
return false;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function execute(delayWidget, triggeringWidget, event, id) {
|
|
56
|
+
var state = delayWidget.state;
|
|
57
|
+
if (state) {
|
|
58
|
+
var text = delayWidget.wiki.getTiddlerText(state);
|
|
59
|
+
if (text !== id) {
|
|
60
|
+
// The state tiddler was touched by another action.
|
|
61
|
+
// So we should not act. We're stale.
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
delayWidget.refreshChildren();
|
|
66
|
+
delayWidget.invokeActions(triggeringWidget, event);
|
|
67
|
+
if (state) {
|
|
68
|
+
delayWidget.wiki.deleteTiddler(state);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
exports["action-delay"] = DelayWidget;
|