tw5-graph 1.7.1

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.
Files changed (123) hide show
  1. package/README.md +65 -0
  2. package/package.json +39 -0
  3. package/plugins/graph/DefaultColourMappings.multids +8 -0
  4. package/plugins/graph/ViewTemplateBodyFilter/graph.tid +5 -0
  5. package/plugins/graph/ViewTemplateBodyFilter/properties.tid +5 -0
  6. package/plugins/graph/edges/fields/list.tid +7 -0
  7. package/plugins/graph/edges/fields/tags.tid +7 -0
  8. package/plugins/graph/edges/functions/links.tid +8 -0
  9. package/plugins/graph/edges/functions/transcludes.tid +8 -0
  10. package/plugins/graph/fieldtypes/filter.js +212 -0
  11. package/plugins/graph/fieldtypes/list.js +31 -0
  12. package/plugins/graph/fieldtypes/title.js +27 -0
  13. package/plugins/graph/filterrunprefixes/cache.js +118 -0
  14. package/plugins/graph/filters/gettyped.js +26 -0
  15. package/plugins/graph/graphengine.js +38 -0
  16. package/plugins/graph/icon.tid +16 -0
  17. package/plugins/graph/images/drag.tid +13 -0
  18. package/plugins/graph/macros/action.addedge.tid +16 -0
  19. package/plugins/graph/macros/edges.typed.tid +54 -0
  20. package/plugins/graph/macros/graph.view.tid +24 -0
  21. package/plugins/graph/macros/node.default.tid +9 -0
  22. package/plugins/graph/macros/nodes.neighbors.tid +62 -0
  23. package/plugins/graph/macros/nodes.writable.tid +37 -0
  24. package/plugins/graph/macros/properties.persistent.tid +27 -0
  25. package/plugins/graph/macros/properties.popup.tid +76 -0
  26. package/plugins/graph/macros/properties.river.tid +27 -0
  27. package/plugins/graph/macros/properties.settings.tid +54 -0
  28. package/plugins/graph/macros/properties.stack.tid +17 -0
  29. package/plugins/graph/macros/tiddlywiki.files +17 -0
  30. package/plugins/graph/nodes/neighbors/1.tid +8 -0
  31. package/plugins/graph/plugin.info +14 -0
  32. package/plugins/graph/presettypes/edges/fields.tid +18 -0
  33. package/plugins/graph/presettypes/edges/functions.tid +5 -0
  34. package/plugins/graph/presettypes/nodes/neighbors.tid +4 -0
  35. package/plugins/graph/presettypes/nodes/stack.tid +6 -0
  36. package/plugins/graph/propertytypes/actions.js +15 -0
  37. package/plugins/graph/propertytypes/boolean.js +23 -0
  38. package/plugins/graph/propertytypes/color.js +61 -0
  39. package/plugins/graph/propertytypes/enum.js +25 -0
  40. package/plugins/graph/propertytypes/filter.js +44 -0
  41. package/plugins/graph/propertytypes/image.js +185 -0
  42. package/plugins/graph/propertytypes/number.js +24 -0
  43. package/plugins/graph/propertytypes/string.js +13 -0
  44. package/plugins/graph/propertytypes/tiddlywiki.files +17 -0
  45. package/plugins/graph/readme.tid +5 -0
  46. package/plugins/graph/relink/attributes.js +52 -0
  47. package/plugins/graph/relink/attributes.multids +19 -0
  48. package/plugins/graph/relink/configprefix.js +76 -0
  49. package/plugins/graph/relink/fieldedgeprefix.js +39 -0
  50. package/plugins/graph/relink/fields.multids +11 -0
  51. package/plugins/graph/relink/graphprefix.js +28 -0
  52. package/plugins/graph/relink/operators.multids +3 -0
  53. package/plugins/graph/relink/propertyfields.js +81 -0
  54. package/plugins/graph/relink/utils.js +99 -0
  55. package/plugins/graph/settings.tid +13 -0
  56. package/plugins/graph/startup/messages.js +46 -0
  57. package/plugins/graph/stylesheets/base.css.tid +272 -0
  58. package/plugins/graph/stylesheets/fullscreen/core.css +11 -0
  59. package/plugins/graph/stylesheets/fullscreen/core.css.meta +3 -0
  60. package/plugins/graph/stylesheets/fullscreen.css.tid +48 -0
  61. package/plugins/graph/stylesheets/popup.css.tid +107 -0
  62. package/plugins/graph/subfilters.tid +23 -0
  63. package/plugins/graph/tags/GraphToolbar.tid +2 -0
  64. package/plugins/graph/tags/SettingsTab.tid +2 -0
  65. package/plugins/graph/tags/Template.tid +2 -0
  66. package/plugins/graph/tags/ViewEditTemplate.tid +2 -0
  67. package/plugins/graph/templates/live-graph.tid +34 -0
  68. package/plugins/graph/templates/standard-graph.tid +40 -0
  69. package/plugins/graph/ui/Buttons/center.tid +38 -0
  70. package/plugins/graph/ui/Buttons/export.tid +65 -0
  71. package/plugins/graph/ui/Buttons/fullscreen.tid +35 -0
  72. package/plugins/graph/ui/Buttons/settings.tid +28 -0
  73. package/plugins/graph/ui/Buttons/tiddlywiki.files +16 -0
  74. package/plugins/graph/ui/EditTemplate/Edges.tid +22 -0
  75. package/plugins/graph/ui/EditTemplate/Neighbors.tid +35 -0
  76. package/plugins/graph/ui/EditTemplate/Nodes.tid +12 -0
  77. package/plugins/graph/ui/EditTemplate/Popups.tid +27 -0
  78. package/plugins/graph/ui/EditTemplate/Properties.tid +21 -0
  79. package/plugins/graph/ui/EditTemplate/tiddlywiki.files +16 -0
  80. package/plugins/graph/ui/Modals/NewPropertySet.tid +20 -0
  81. package/plugins/graph/ui/Modals/NewView.tid +20 -0
  82. package/plugins/graph/ui/Modals/Select.tid +72 -0
  83. package/plugins/graph/ui/Modals/SelectField.tid +21 -0
  84. package/plugins/graph/ui/Modals/SelectTiddler.tid +15 -0
  85. package/plugins/graph/ui/Modals/Tiddler.tid +22 -0
  86. package/plugins/graph/ui/Modals/TiddlerHeader.tid +15 -0
  87. package/plugins/graph/ui/PropertyTypes/boolean.tid +11 -0
  88. package/plugins/graph/ui/PropertyTypes/color.tid +16 -0
  89. package/plugins/graph/ui/PropertyTypes/enum.tid +15 -0
  90. package/plugins/graph/ui/PropertyTypes/number.tid +17 -0
  91. package/plugins/graph/ui/Settings/Engine.tid +23 -0
  92. package/plugins/graph/ui/Settings/Graphs/EditTemplate.tid +52 -0
  93. package/plugins/graph/ui/Settings/Graphs.tid +49 -0
  94. package/plugins/graph/ui/Settings/Properties/ObjectsTypeTemplate.tid +46 -0
  95. package/plugins/graph/ui/Settings/Properties.tid +14 -0
  96. package/plugins/graph/ui/Settings/Toolbar.tid +5 -0
  97. package/plugins/graph/ui/SideBar/Graph.tid +77 -0
  98. package/plugins/graph/ui/Toolbars/GraphToolbar.tid +15 -0
  99. package/plugins/graph/ui/ViewTemplate/graph-object.tid +13 -0
  100. package/plugins/graph/ui/ViewTemplate/graph.tid +11 -0
  101. package/plugins/graph/ui/ViewTemplate/properties.tid +80 -0
  102. package/plugins/graph/ui/grouped-tabs.tid +109 -0
  103. package/plugins/graph/ui/selector.tid +74 -0
  104. package/plugins/graph/utils/propertyholder.js +80 -0
  105. package/plugins/graph/utils/widgetiterator.js +47 -0
  106. package/plugins/graph/utils.js +95 -0
  107. package/plugins/graph/widgets/action-delay.js +72 -0
  108. package/plugins/graph/widgets/action-modal.js +121 -0
  109. package/plugins/graph/widgets/action-typed.js +56 -0
  110. package/plugins/graph/widgets/action-with.js +70 -0
  111. package/plugins/graph/widgets/boundingbox.js +126 -0
  112. package/plugins/graph/widgets/fieldtranscriber/filter.js +93 -0
  113. package/plugins/graph/widgets/fieldtranscriber/json.js +34 -0
  114. package/plugins/graph/widgets/fieldtranscriber/plain.js +11 -0
  115. package/plugins/graph/widgets/fieldtranscriber.js +98 -0
  116. package/plugins/graph/widgets/graphobject.js +154 -0
  117. package/plugins/graph/widgets/messagerelay.js +115 -0
  118. package/plugins/graph/widgets/properties.js +130 -0
  119. package/plugins/graph/widgets/subclass/edge.js +55 -0
  120. package/plugins/graph/widgets/subclass/edit-color.js +52 -0
  121. package/plugins/graph/widgets/subclass/graph.js +380 -0
  122. package/plugins/graph/widgets/subclass/node.js +56 -0
  123. package/plugins/graph/widgets/tiddlywiki.files +43 -0
@@ -0,0 +1,46 @@
1
+ /*\
2
+ title: $:/plugins/flibbles/graph/startup/messages.js
3
+ type: application/javascript
4
+ module-type: startup
5
+
6
+ Introduces some handling of custom messages that TW5-Graph needs.
7
+
8
+ DO NOT USE "tm-download-raw"! It's flimsy, poorly tested, and exists only
9
+ because there is no other way to download a binary file in Tiddlywiki.
10
+
11
+ As soon as I find a better way to do it, I'm deleting this file.
12
+
13
+ \*/
14
+
15
+ "use strict";
16
+
17
+ exports.name = "graph-messages";
18
+ exports.before = ["startup"];
19
+ exports.synchronous = true;
20
+
21
+ exports.startup = function() {
22
+ var CoreSaver = $tw.SaverHandler;
23
+ $tw.SaverHandler = function() {
24
+ CoreSaver.apply(this, arguments);
25
+ if ($tw.browser) {
26
+ var self = this;
27
+ $tw.rootWidget.addEventListener("tm-download-raw", function(event) {
28
+ return download(event, self);
29
+ });
30
+ }
31
+ }
32
+ $tw.SaverHandler.prototype = CoreSaver.prototype;
33
+ };
34
+
35
+ function download(event, saverHandler, variables) {
36
+ var title = event.param;
37
+ var wiki = event.widget.wiki;
38
+ var variables = event.paramObject;
39
+ const element = document.createElement("a");
40
+ var data = wiki.getTiddlerText(title);
41
+ element.setAttribute("download", variables.filename);
42
+ element.setAttribute("href", "data:" + variables.type + ";base64," + data);
43
+ var click = new MouseEvent("click");
44
+ element.dispatchEvent(click);
45
+ return true;
46
+ };
@@ -0,0 +1,272 @@
1
+ title: $:/plugins/flibbles/graph/stylesheets/base.css
2
+ tags: $:/tags/Stylesheet
3
+
4
+ \define sidebarbreakpoint()
5
+ <$text text={{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}/>
6
+ \end
7
+
8
+ \rules only macrocallinline
9
+ .graph-canvas {
10
+ position: relative;
11
+ border-style: solid;
12
+ border-width: 1px;
13
+ border-color: <<colour graph-border>>;
14
+ background-color: <<colour graph-background>>;
15
+ width: 100%;
16
+ }
17
+
18
+ .boundingbox {
19
+ display: flex;
20
+ flex-direction: column;
21
+ }
22
+
23
+ .boundingbox > .graph-canvas {
24
+ width: 100%;
25
+ height: 0%;
26
+ flex-grow: 1;
27
+ }
28
+
29
+ /*** Basic graph overlay options ***/
30
+
31
+ .graph-overlay {
32
+ position: absolute;
33
+ bottom: 0px;
34
+ left: 0px;
35
+ margin: 0px;
36
+ background: transparent;
37
+ border-width: 0px;
38
+ }
39
+
40
+ /*** Error-state graphs ***/
41
+
42
+ .graph-canvas.graph-error {
43
+ align-content: center;
44
+ text-align: center;
45
+ font-weight: bold;
46
+ color: <<colour alert-highlight>>;
47
+ }
48
+
49
+ .graph-canvas.graph-error span {
50
+ display: inline-block;
51
+ max-width: 80%;
52
+ background: <<colour alert-background>>;
53
+ padding: 1em;
54
+ border: medium solid <<colour alert-border>>;
55
+ border-radius: 1em;
56
+
57
+ }
58
+
59
+ /*** SideBar ***/
60
+
61
+ .tc-sidebar-scrollable .graph-sidebar-disabled {
62
+ display: none;
63
+ }
64
+
65
+ .tc-sidebar-scrollable .graph-sidebar-enabled {
66
+ position: absolute;
67
+ }
68
+
69
+ .graph-sidebar-banner {
70
+ background: <<colour graph-banner-background>>;
71
+ color: <<colour graph-banner-foreground>>;
72
+ padding: 4px;
73
+ }
74
+
75
+ .graph-sidebar-banner select, .graph-sidebar-banner button {
76
+ height: 28px;
77
+ min-width: 28px;
78
+ margin-left: 3px;
79
+ }
80
+
81
+ @media (max-width: <<sidebarbreakpoint>>) {
82
+ .tc-sidebar-scrollable .graph-sidebar-enabled {
83
+ display: none;
84
+ }
85
+
86
+ .tc-sidebar-scrollable .graph-sidebar-disabled {
87
+ display: flex;
88
+ }
89
+
90
+ .tc-sidebar-scrollable .graph-sidebar-disabled button {
91
+ margin: auto;
92
+ }
93
+
94
+ .tc-sidebar-scrollable .graph-sidebar-disabled button svg {
95
+ width: 2em;
96
+ height: 2em;
97
+ }
98
+ }
99
+
100
+ /*** Sidebar Center button ***/
101
+
102
+ .graph-center-button-dropdown {
103
+ padding-left: 6px;
104
+ padding-right: 6px;
105
+ }
106
+
107
+ .graph-center-button-dropdown input {
108
+ width: 100%;
109
+ }
110
+
111
+ /*** Engine toggle buttons ***/
112
+
113
+ .graph-engine-button-list {
114
+ display: flex;
115
+ justify-content: center;
116
+ }
117
+
118
+ .graph-engine-button {
119
+ margin: 1em;
120
+ width: 7em;
121
+ height: 124px;
122
+ border-radius: 1em;
123
+ vertical-align: top;
124
+ font-weight: bold;
125
+ text-align: center;
126
+ background-color: <<colour background>>;
127
+ border-color: <<colour table-footer-background>>;
128
+ }
129
+
130
+ .graph-engine-button .graph-icon {
131
+ height: 6em;
132
+ margin-bottom: 4px;
133
+ align-content: center;
134
+ }
135
+
136
+ .graph-engine-button.active {
137
+ background-color: <<colour table-header-background>>;
138
+ }
139
+
140
+ .graph-engine-button:hover {
141
+ background-color: <<colour table-header-background>>;
142
+ }
143
+
144
+ /*** grouped-tabs ***/
145
+
146
+ .group-tab-header {
147
+ font-weight: bold;
148
+ margin-right: 0.0em;
149
+ margin-top: 1em;
150
+ border: 1px solid <<color tab-border>>;
151
+ padding: 3px 5px 0px 5px;
152
+ border-top-left-radius: 1em;
153
+ }
154
+
155
+ .tc-tab-buttons.tc-vertical button.group-tab-button {
156
+ display: flex;
157
+ padding-left: 0px;
158
+ }
159
+
160
+ button.group-tab-button > svg {
161
+ margin-top: auto;
162
+ margin-bottom: auto;
163
+ }
164
+
165
+ button.group-tab-button > span {
166
+ margin-left: 5px;
167
+ flex-grow: 1;
168
+ }
169
+
170
+ .tc-tab-buttons.tc-vertical button.group-tab-new {
171
+ border-bottom-left-radius: 1em;
172
+ border-bottom-right-radius: 1em;
173
+ border-right: 1px solid <<color tab-border>>;
174
+ }
175
+
176
+ button.group-tab-new svg {
177
+ display: block;
178
+ margin-left: auto;
179
+ margin-right: auto;
180
+ }
181
+
182
+ /*** Settings: Graphs ***/
183
+
184
+ .graph-tiddlers-edgelist {
185
+ color: <<colour muted-foreground>>;
186
+ }
187
+
188
+ .graph-tiddlers-edgelist .active {
189
+ color: <<colour foreground>>;
190
+ }
191
+
192
+ /*** GraphTiddler Edit-template ***/
193
+
194
+ .graph-tiddler-edit-template {
195
+ border-top: 1px solid <<colour blockquote-bar>>;
196
+ }
197
+
198
+ .graph-tiddler-edit-template table,
199
+ .graph-tiddler-edit-template table textarea,
200
+ .graph-tiddler-edit-template table input {
201
+ width: 100%;
202
+ }
203
+
204
+ /*** Graph Property Table ***/
205
+
206
+ table.graph-property {
207
+ width: 100%;
208
+ padding: 3px;
209
+ }
210
+
211
+ table .graph-property-input {
212
+ min-width: 8em;
213
+ border-right-width: 0px;
214
+ }
215
+
216
+ table .graph-property-remove {
217
+ width: 2em;
218
+ border-left-width: 0px;
219
+ }
220
+
221
+ /*** Graph Property Table Types ***/
222
+
223
+ table.graph-property input {
224
+ width: 100%;
225
+ }
226
+
227
+ table.graph-property td {
228
+ padding: 4px;
229
+ }
230
+
231
+ table.graph-property td.graph-property-input-color {
232
+ display: flex;
233
+ gap: 4px;
234
+ width: 100%;
235
+ }
236
+
237
+ table.graph-property td.graph-property-input-color input {
238
+ flex: 1;
239
+ }
240
+
241
+ table.graph-property .graph-property-input-number {
242
+ display: flex;
243
+ gap: 2px;
244
+ width: 100%;
245
+ }
246
+
247
+ table.graph-property .graph-property-input-number input {
248
+ flex-grow: 1;
249
+ width: 60%;
250
+ }
251
+
252
+ table.graph-property .graph-property-input-number span {
253
+ flex: 1;
254
+ margin-left: 5px;
255
+ min-width: 2em;
256
+ vertical-align: top;
257
+ font-weight: lighter;
258
+ }
259
+
260
+ /*** Graph icon ***/
261
+
262
+ .graph-icon-node {
263
+ fill: <<colour graph-node-color>> !important;
264
+ }
265
+
266
+ a.tc-tiddlylink.tc-plugin-info:hover .graph-icon-splash {
267
+ fill: <<colour background>> !important;
268
+ }
269
+
270
+ a.tc-tiddlylink.tc-plugin-info:hover .graph-icon-node {
271
+ fill: <<colour muted-foreground>> !important;
272
+ }
@@ -0,0 +1,11 @@
1
+ /* CSS tweaks for core elements when fullscreen is active.
2
+ Make your own tiddler with $:/tags/flibbles/graph/FullscreenStylesheet
3
+ to add your own tweaks. */
4
+
5
+ .tc-topbar, .tc-story-river, .tc-sidebar-scrollable .graph-sidebar-disabled {
6
+ display: none !important;
7
+ }
8
+
9
+ .tc-dropzone > p {
10
+ margin: 0px;
11
+ }
@@ -0,0 +1,3 @@
1
+ title: $:/plugins/flibbles/graph/stylesheets/fullscreen/core.css
2
+ tags: $:/tags/flibbles/graph/FullscreenStylesheet
3
+ type: text/css
@@ -0,0 +1,48 @@
1
+ title: $:/plugins/flibbles/graph/stylesheets/fullscreen.css
2
+ tags: $:/tags/Stylesheet
3
+
4
+ <!--
5
+ If you need to tweak css for whenever fullscreen mode is active,
6
+ create a tiddler with the $:/tags/flibbles/graph/FullscreenStylesheet
7
+ tag rather than trying to test against the fullscreen state tiddler.
8
+ -->
9
+
10
+ .graph-sidebar-enabled.graph-fullscreen {
11
+ display: flex !important;
12
+ position: fixed !important;
13
+ height: 100% !important;
14
+ width: 100% !important;
15
+ top: 0 !important;
16
+ left: 0 !important;
17
+ // This puts us one below the modal at 900, which should still overlap fullscreen.
18
+ z-index: 899 !important;
19
+ }
20
+
21
+ .graph-modal-tiddler .tc-tiddler-frame {
22
+ margin-bottom: .5em;
23
+ padding: 14px;
24
+ padding-top: 0px;
25
+ width: inherit;
26
+ box-shadow: none;
27
+ }
28
+
29
+ .graph-modal-tiddler-breadcrumbs {
30
+ white-space: nowrap;
31
+ overflow: hidden;
32
+ min-height: 2em;
33
+ text-align: left;
34
+ direction: rtl;
35
+ }
36
+
37
+ .graph-modal-tiddler-breadcrumbs svg {
38
+ fill: <<colour foreground>>;
39
+ vertical-align: middle;
40
+ margin-left: 4px;
41
+ padding: 2px;
42
+ }
43
+
44
+ <%if [[$:/state/flibbles/graph/fullscreen]is[tiddler]] %>
45
+
46
+ <$list filter="[all[shadows+tiddlers]tag[$:/tags/flibbles/graph/FullscreenStylesheet]!is[draft]]">
47
+ <$transclude mode="block"/>
48
+ </$list><%endif%>
@@ -0,0 +1,107 @@
1
+ title: $:/plugins/flibbles/graph/stylesheets/popup.css
2
+ tags: $:/tags/Stylesheet
3
+
4
+ .graph-popup {
5
+ position: absolute;
6
+ z-index: 1000;
7
+ border: 1px solid <<colour dropdown-border>>;
8
+ color: <<colour foreground>>;
9
+ fill: <<colour foreground>>;
10
+ background-color: <<colour dropdown-background>>;
11
+ padding: 7px;
12
+ margin: 4px 0 0 0;
13
+ text-shadow: none;
14
+ line-height: 1.4;
15
+ overflow: scroll;
16
+ overscroll-behavior: contain;
17
+ }
18
+
19
+ .graph-popup .tc-drop-down {
20
+ margin-left: 14px;
21
+ }
22
+
23
+ .graph-popup button svg, .graph-popup a svg {
24
+ fill: <<colour foreground>>;
25
+ }
26
+
27
+ .graph-popup button:disabled svg {
28
+ fill: <<colour muted-foreground>>;
29
+ }
30
+
31
+ .graph-popup button.tc-btn-invisible:hover svg {
32
+ fill: <<colour background>>;
33
+ }
34
+
35
+ .graph-popup .tc-drop-down-info {
36
+ padding-left: 14px;
37
+ }
38
+
39
+ .graph-popup p {
40
+ padding: 0 7px 0 7px;
41
+ }
42
+
43
+ .graph-popup a.tc-tiddlylink {
44
+ color: <<colour tiddler-link-foreground>>;
45
+ }
46
+
47
+ .graph-popup svg {
48
+ width: 1em;
49
+ height: 1em;
50
+ }
51
+
52
+ .graph-popup img {
53
+ width: 1em;
54
+ }
55
+
56
+ .graph-popup .tc-tab-set .tc-tab-buttons button {
57
+ display: inline-block;
58
+ width: auto;
59
+ margin-bottom: 0px;
60
+ border-bottom-left-radius: 0;
61
+ border-bottom-right-radius: 0;
62
+ }
63
+
64
+ .graph-popup .tc-prompt {
65
+ padding: 0 14px;
66
+ }
67
+
68
+ .graph-popup .tc-chooser {
69
+ border: none;
70
+ }
71
+
72
+ .graph-popup .tc-chooser .tc-swatches-horiz {
73
+ font-size: 0.4em;
74
+ padding-left: 1.2em;
75
+ }
76
+
77
+ .graph-popup .tc-file-input-wrapper {
78
+ width: 100%;
79
+ }
80
+
81
+ .graph-popup .tc-file-input-wrapper button {
82
+ color: <<colour foreground>>;
83
+ }
84
+
85
+ .graph-popup a:hover, .graph-popup button:hover, .graph-popup .tc-file-input-wrapper:hover button {
86
+ color: <<colour tiddler-link-background>>;
87
+ background-color: <<colour tiddler-link-foreground>>;
88
+ text-decoration: none;
89
+ }
90
+
91
+ .graph-popup .tc-tab-buttons button {
92
+ background-color: <<colour dropdown-tab-background>>;
93
+ }
94
+
95
+ .graph-popup .tc-tab-buttons button.tc-tab-selected {
96
+ background-color: <<colour dropdown-tab-background-selected>>;
97
+ border-bottom: 1px solid <<colour dropdown-tab-background-selected>>;
98
+ }
99
+
100
+ .graph-popup .tc-drop-down-bullet {
101
+ display: inline-block;
102
+ width: 0.5em;
103
+ }
104
+
105
+ .graph-popup .tc-tab-contents a {
106
+ padding: 0 0.5em 0 0.5em;
107
+ }
@@ -0,0 +1,23 @@
1
+ title: $:/plugins/flibbles/graph/subfilters
2
+ type: application/x-tiddler-dictionary
3
+
4
+ # This tiddler contains a series of commonly used filters used by TW5-Graph. Putting them together in one dataTiddler like this helps optimize the :cache mechanism so this information only needs to be sought once. And it reduces repetition.
5
+
6
+ # Do not override this tiddler
7
+
8
+ edgetypes: :cache[all[shadows+tiddlers]removeprefix[$:/config/flibbles/graph/edges/]]
9
+ edgetypes.fields: :cache[subfilter{$:/plugins/flibbles/graph/subfilters##edgetypes}removeprefix[fields/]]
10
+ edgetypes.functions: :cache[subfilter{$:/plugins/flibbles/graph/subfilters##edgetypes}removeprefix[functions/]]
11
+
12
+ # This gets you the action context associated with a given graphObjectType, like "nodes" or "edges"
13
+ actioncontext: [all[]] :cache[subfilter{$:/plugins/flibbles/graph/subfilters##actioncontext.internal}]
14
+ actioncontext.internal: [[widget-subclass]modules[]] :filter[moduleproperty[graphObjectType]match<..currentTiddler>] +[moduleproperty[actionContext]jsonget[]]
15
+
16
+ # Returns the active engine in the current scope
17
+ engine: [[graphengine]modules[]] :filter[moduleproperty[name]match<graphengine>]
18
+ # Returns a list of available engine modules sorted by name
19
+ engine.list: [[graphengine]modules[]] :sort[all[current]moduleproperty[name]]
20
+ # This gets you the messages json of the currently active engine
21
+ messages: :cache[subfilter{$:/plugins/flibbles/graph/subfilters##engine}moduleproperty[messages]]
22
+ # This gets you the properties json of the currently active engine
23
+ properties: :cache[subfilter{$:/plugins/flibbles/graph/subfilters##engine}moduleproperty[properties]]
@@ -0,0 +1,2 @@
1
+ title: $:/tags/flibbles/graph/GraphToolbar
2
+ list: [[$:/plugins/flibbles/graph/ui/Buttons/settings]] [[$:/plugins/flibbles/graph/ui/Buttons/fullscreen]]
@@ -0,0 +1,2 @@
1
+ title: $:/tags/flibbles/graph/SettingsTab
2
+ list: [[$:/plugins/flibbles/graph/ui/Settings/Engine]] [[$:/plugins/flibbles/graph/ui/Settings/Graphs]]
@@ -0,0 +1,2 @@
1
+ title: $:/tags/flibbles/graph/Template
2
+ list: [[$:/plugins/flibbles/graph/templates/standard-graph]]
@@ -0,0 +1,2 @@
1
+ title: $:/tags/flibbles/graph/EditTemplate
2
+ list: [[$:/plugins/flibbles/graph/ui/EditTemplate/Nodes]] [[$:/plugins/flibbles/graph/ui/EditTemplate/Edges]]
@@ -0,0 +1,34 @@
1
+ caption: Live graph
2
+ title: $:/plugins/flibbles/graph/templates/live-graph
3
+ tags: $:/tags/flibbles/graph/Template
4
+
5
+ \whitespace trim
6
+
7
+ <!-- By having this unused "focusTiddler" value update when the nodes change,
8
+ we can enforce a refresh of the live-graph, rather than having it try
9
+ to update, which might result in a worse presentation for some engines. -->
10
+
11
+ <$set name="focusTiddler" filter="[subfilter{!!filter}]">
12
+
13
+ <$graph>
14
+
15
+ <$properties $for=nodes actions="<$action-navigate $to=<<nodeTiddler>> />" >
16
+
17
+ <$properties.settings>
18
+
19
+ <$properties physics=no>
20
+
21
+ <$slot $name=ts-raw $depth=5 />
22
+
23
+ <$list filter={{!!filter}} >
24
+
25
+ <$node.default />
26
+
27
+ <$edges.typed />
28
+
29
+ </$list>
30
+ </$properties>
31
+ </$properties.settings>
32
+ </$properties>
33
+ </$graph>
34
+ </$set>
@@ -0,0 +1,40 @@
1
+ caption: Standard editable graph
2
+ title: $:/plugins/flibbles/graph/templates/standard-graph
3
+ tags: $:/tags/flibbles/graph/Template
4
+
5
+ \whitespace trim
6
+
7
+ <$graph>
8
+
9
+ <%if [{!!filter}is[blank]] %>
10
+
11
+ <$node $tiddler="$:/plugins/flibbles/graph/settings"
12
+ label="Click on me to configure this graph"
13
+ image="$:/core/images/options-button"
14
+ actions="\import $:/plugins/flibbles/graph/ui/Buttons/settings
15
+ <<settingsActions>>" />
16
+
17
+ <%endif%>
18
+
19
+ <$properties physics=yes actions="<$action-navigate $to=<<nodeTiddler>> />">
20
+
21
+ <$properties $filter="[all[]] :filter[<..currentTiddler>getindex{!!title}]" physics=no>
22
+
23
+ <$properties.persistent $dataTiddler=<<currentTiddler>> >
24
+
25
+ <$properties.settings>
26
+
27
+ <$slot $name=ts-raw $depth=6 />
28
+
29
+ <$nodes.writable $field=filter>
30
+
31
+ <$node.default/>
32
+
33
+ <$edges.typed $editable=yes />
34
+
35
+ </$nodes.writable>
36
+ </$properties.settings>
37
+ </$properties.persistent>
38
+ </$properties>
39
+ </$properties>
40
+ </$graph>
@@ -0,0 +1,38 @@
1
+ description: Center on a graph node
2
+ caption: {{$:/core/images/advanced-search-button}} center node
3
+ first-search-filter: [subfilter{!!filter}search:title{$:/temp/graph/select}sort[title]limit[10]]
4
+
5
+ \whitespace trim
6
+
7
+ <%if [[graphengine]modules[]] :filter[moduleproperty[name]match<graphengine>] +[moduleproperty[messages]jsonextract[graph-center-node]] %>
8
+ <$vars state=<<qualify "$:/state/flibbles/graph/popup/center">> >
9
+ <$button
10
+ popup=<<state>>
11
+ tooltip="Center on a graph node"
12
+ class=graph-center-button>
13
+ <%if [<tv-config-toolbar-icons>match[yes]] %>
14
+ {{$:/core/images/advanced-search-button}}
15
+ <%endif%>
16
+ <%if [<tv-config-toolbar-text>match[yes]] %>
17
+ <span class="tc-btn-text">
18
+ <$text text="center node" />
19
+ </span>
20
+ <%endif%>
21
+ </$button>
22
+ <$reveal state=<<state>> type="popup" position="below" animate="yes">
23
+ <div class="tc-drop-down graph-center-button-dropdown">
24
+ <$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="tc-btn-invisible">
25
+ <$transclude $tiddler="$:/plugins/flibbles/graph/ui/selector" configTiddler="$:/plugins/flibbles/graph/ui/Buttons/center">
26
+ <$fill $name=action>
27
+ <$action-sendmessage $message=graph-center-node tiddler=<<selectedTiddler>> scale="1.5" />
28
+ <$action-deletetiddler $tiddler=<<state>> />
29
+ </$fill>
30
+ <$fill $name=cancel>
31
+ <$action-deletetiddler $tiddler=<<state>> />
32
+ </$fill>
33
+ </$transclude>
34
+ </$let>
35
+ </div>
36
+ </$reveal>
37
+ </$vars>
38
+ <%endif%>