wiki-plugin-rcngraph 0.1.10 → 0.1.12
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/client/rcn-graph.js +51 -0
- package/client/rcngraph.js +51 -0
- package/package.json +1 -1
- package/pages/about-rcngraph-plugin +18 -8
package/client/rcn-graph.js
CHANGED
|
@@ -39,7 +39,37 @@
|
|
|
39
39
|
renderContent($item, item)
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
|
|
43
|
+
// ⓘ — this plugin's About page in one click. FedWiki opens it with Cmd/Ctrl-I,
|
|
44
|
+
// but only from the item's text editor, which people seldom open when the real
|
|
45
|
+
// work happens elsewhere. Redraws empty the item, so the mark puts itself back.
|
|
46
|
+
function aboutMark ($item, type) {
|
|
47
|
+
const el = $item.get(0)
|
|
48
|
+
if (!el || el.__aboutMark) return
|
|
49
|
+
el.__aboutMark = true
|
|
50
|
+
if (getComputedStyle(el).position === 'static') el.style.position = 'relative'
|
|
51
|
+
const add = () => {
|
|
52
|
+
if (el.querySelector(':scope > .rcn-about')) return
|
|
53
|
+
const a = document.createElement('a')
|
|
54
|
+
a.className = 'rcn-about'
|
|
55
|
+
a.href = '/view/about-' + type + '-plugin'
|
|
56
|
+
a.title = 'About this plugin'
|
|
57
|
+
a.textContent = 'ⓘ'
|
|
58
|
+
a.style.cssText = 'position:absolute;top:0;right:-18px;z-index:1000;font:15px/1 system-ui,sans-serif;color:#64748b;text-decoration:none;cursor:pointer;background:rgba(255,255,255,.75);border-radius:50%;padding:1px 2px'
|
|
59
|
+
a.addEventListener('click', e => {
|
|
60
|
+
e.preventDefault()
|
|
61
|
+
e.stopPropagation()
|
|
62
|
+
wiki.doInternalLink('about ' + type + ' plugin', $item.parents('.page:first'))
|
|
63
|
+
})
|
|
64
|
+
a.addEventListener('dblclick', e => e.stopPropagation())
|
|
65
|
+
el.appendChild(a)
|
|
66
|
+
}
|
|
67
|
+
add()
|
|
68
|
+
new MutationObserver(add).observe(el, { childList: true })
|
|
69
|
+
}
|
|
70
|
+
|
|
42
71
|
function bind($item, item) {
|
|
72
|
+
aboutMark($item, 'rcngraph')
|
|
43
73
|
$item.on('click', '.open-graph, .edit-graph', () => {
|
|
44
74
|
pendingItem = item
|
|
45
75
|
pending$item = $item
|
|
@@ -47,6 +77,18 @@
|
|
|
47
77
|
if (popup) popup.focus()
|
|
48
78
|
})
|
|
49
79
|
$item.on('dblclick', () => wiki.textEditor($item, item))
|
|
80
|
+
// Labels in the saved SVG are wrapped as <a class="internal" data-title=…>, but
|
|
81
|
+
// two things stopped a click reaching the page: the <text> keeps the canvas's
|
|
82
|
+
// pointer-events="none", so the click fell through to the box behind it; and
|
|
83
|
+
// FedWiki's own .internal handler names the page from the clicked <tspan>, so a
|
|
84
|
+
// two-line label would land on its first line. Follow data-title here instead.
|
|
85
|
+
// Namespaced and reset, because a save re-runs bind on the same element.
|
|
86
|
+
$item.off('click.rcnlink').on('click.rcnlink', 'svg a.internal', e => {
|
|
87
|
+
e.preventDefault()
|
|
88
|
+
e.stopPropagation()
|
|
89
|
+
const title = e.currentTarget.getAttribute('data-title')
|
|
90
|
+
if (title) wiki.doInternalLink(title, e.shiftKey ? null : $item.parents('.page:first'))
|
|
91
|
+
})
|
|
50
92
|
}
|
|
51
93
|
|
|
52
94
|
function graphListener(event) {
|
|
@@ -88,6 +130,15 @@
|
|
|
88
130
|
}
|
|
89
131
|
}
|
|
90
132
|
|
|
133
|
+
// CSS outranks SVG presentation attributes, so this re-enables clicks on labels
|
|
134
|
+
// in items saved before the Graph Tool stopped writing pointer-events="none".
|
|
135
|
+
if (typeof document !== 'undefined' && !document.getElementById('rcngraph-link-style')) {
|
|
136
|
+
const s = document.createElement('style')
|
|
137
|
+
s.id = 'rcngraph-link-style'
|
|
138
|
+
s.textContent = '.rcngraph svg a.internal text,.rcn-graph svg a.internal text{pointer-events:auto;cursor:pointer}'
|
|
139
|
+
document.head.appendChild(s)
|
|
140
|
+
}
|
|
141
|
+
|
|
91
142
|
if (typeof window !== 'undefined') {
|
|
92
143
|
window.plugins['rcn-graph'] = { emit, bind }
|
|
93
144
|
if (!window.rcnGraphLegacyListener) {
|
package/client/rcngraph.js
CHANGED
|
@@ -41,7 +41,37 @@
|
|
|
41
41
|
renderContent($item, item)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
|
|
45
|
+
// ⓘ — this plugin's About page in one click. FedWiki opens it with Cmd/Ctrl-I,
|
|
46
|
+
// but only from the item's text editor, which people seldom open when the real
|
|
47
|
+
// work happens elsewhere. Redraws empty the item, so the mark puts itself back.
|
|
48
|
+
function aboutMark ($item, type) {
|
|
49
|
+
const el = $item.get(0)
|
|
50
|
+
if (!el || el.__aboutMark) return
|
|
51
|
+
el.__aboutMark = true
|
|
52
|
+
if (getComputedStyle(el).position === 'static') el.style.position = 'relative'
|
|
53
|
+
const add = () => {
|
|
54
|
+
if (el.querySelector(':scope > .rcn-about')) return
|
|
55
|
+
const a = document.createElement('a')
|
|
56
|
+
a.className = 'rcn-about'
|
|
57
|
+
a.href = '/view/about-' + type + '-plugin'
|
|
58
|
+
a.title = 'About this plugin'
|
|
59
|
+
a.textContent = 'ⓘ'
|
|
60
|
+
a.style.cssText = 'position:absolute;top:0;right:-18px;z-index:1000;font:15px/1 system-ui,sans-serif;color:#64748b;text-decoration:none;cursor:pointer;background:rgba(255,255,255,.75);border-radius:50%;padding:1px 2px'
|
|
61
|
+
a.addEventListener('click', e => {
|
|
62
|
+
e.preventDefault()
|
|
63
|
+
e.stopPropagation()
|
|
64
|
+
wiki.doInternalLink('about ' + type + ' plugin', $item.parents('.page:first'))
|
|
65
|
+
})
|
|
66
|
+
a.addEventListener('dblclick', e => e.stopPropagation())
|
|
67
|
+
el.appendChild(a)
|
|
68
|
+
}
|
|
69
|
+
add()
|
|
70
|
+
new MutationObserver(add).observe(el, { childList: true })
|
|
71
|
+
}
|
|
72
|
+
|
|
44
73
|
function bind($item, item) {
|
|
74
|
+
aboutMark($item, 'rcngraph')
|
|
45
75
|
$item.on('click', '.open-graph, .edit-graph', () => {
|
|
46
76
|
pendingItem = item
|
|
47
77
|
pending$item = $item
|
|
@@ -49,6 +79,18 @@
|
|
|
49
79
|
if (popup) popup.focus()
|
|
50
80
|
})
|
|
51
81
|
$item.on('dblclick', () => wiki.textEditor($item, item))
|
|
82
|
+
// Labels in the saved SVG are wrapped as <a class="internal" data-title=…>, but
|
|
83
|
+
// two things stopped a click reaching the page: the <text> keeps the canvas's
|
|
84
|
+
// pointer-events="none", so the click fell through to the box behind it; and
|
|
85
|
+
// FedWiki's own .internal handler names the page from the clicked <tspan>, so a
|
|
86
|
+
// two-line label would land on its first line. Follow data-title here instead.
|
|
87
|
+
// Namespaced and reset, because a save re-runs bind on the same element.
|
|
88
|
+
$item.off('click.rcnlink').on('click.rcnlink', 'svg a.internal', e => {
|
|
89
|
+
e.preventDefault()
|
|
90
|
+
e.stopPropagation()
|
|
91
|
+
const title = e.currentTarget.getAttribute('data-title')
|
|
92
|
+
if (title) wiki.doInternalLink(title, e.shiftKey ? null : $item.parents('.page:first'))
|
|
93
|
+
})
|
|
52
94
|
}
|
|
53
95
|
|
|
54
96
|
function graphListener(event) {
|
|
@@ -92,6 +134,15 @@
|
|
|
92
134
|
}
|
|
93
135
|
}
|
|
94
136
|
|
|
137
|
+
// CSS outranks SVG presentation attributes, so this re-enables clicks on labels
|
|
138
|
+
// in items saved before the Graph Tool stopped writing pointer-events="none".
|
|
139
|
+
if (typeof document !== 'undefined' && !document.getElementById('rcngraph-link-style')) {
|
|
140
|
+
const s = document.createElement('style')
|
|
141
|
+
s.id = 'rcngraph-link-style'
|
|
142
|
+
s.textContent = '.rcngraph svg a.internal text,.rcn-graph svg a.internal text{pointer-events:auto;cursor:pointer}'
|
|
143
|
+
document.head.appendChild(s)
|
|
144
|
+
}
|
|
145
|
+
|
|
95
146
|
if (typeof window !== 'undefined') {
|
|
96
147
|
window.plugins['rcngraph'] = { emit, bind }
|
|
97
148
|
if (!window.rcnGraphListener) {
|
package/package.json
CHANGED
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
{
|
|
10
10
|
"type": "paragraph",
|
|
11
11
|
"id": "2e7c9f04a3b8d651",
|
|
12
|
-
"text": "Create an item using the factory. Click Open Graph Tool to open the tool. Use -> Item to save the diagram as an SVG preview back into the wiki item
|
|
12
|
+
"text": "Create an item using the factory. Click Open Graph Tool to open the tool. Use -> Item to save the diagram as an SVG preview back into the wiki item \u2014 node labels in that preview are clickable internal wiki links, and the graph JSON rides along so Edit in Graph Tool reopens the real model. Use -> Wiki to send the diagram to the lineup as a ghost page. Both follow Ward Cunningham's Enrich Any SVG pattern."
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"type": "paragraph",
|
|
16
16
|
"id": "c1d2e3f4a5b60001",
|
|
17
|
-
"text": "Diagram types
|
|
17
|
+
"text": "Diagram types \u2014 CLD (Causal Loop): map feedback loops and system dynamics. EIP (Enriched Influence Pattern): influence networks with stakeholders, flows, and interventions. NRM (Neighbourhood Risk Management): incident and risk analysis on the Tripod Beta pattern. Trace: follow a path through an existing graph. Wardley: Wardley mapping on an evolution/visibility canvas. OPM (Object-Process Methodology): system structure and process using Dov Dori's ISO 19450 standard, with OPL sentences and Cypher export. SFD (Stock and Flow): stocks, valves, auxiliaries and clouds in the Stella idiom, with XMILE export. LOP (Linkage of Processes): the Deming / API organization-as-a-system map. VSM (Value Stream Mapping): Cindy Jimmerson's healthcare value stream \u2014 four flows in lanes, storm bursts, and a computed sawtooth giving lead time, value-added time and the ratio between them, with a one-click handoff that seeds an A3. Triples: nodes and edges can link to other edges, enabling RDF-style triple referencing for knowledge graph authoring."
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"type": "paragraph",
|
|
21
21
|
"id": "d2e3f4a5b6c70002",
|
|
22
|
-
"text": "Import and export: MDL/Vensim CLD, Graphviz .dot, XMILE, Cypher, Wardley JSON, and CSV. A model can also be opened straight from a URL with ?url=, including an RCN Substrate subgraph projection. Multi-trace edges, node and edge layers, canvas legend, and Print are available in all modes. A mode
|
|
22
|
+
"text": "Import and export: MDL/Vensim CLD, Graphviz .dot, XMILE, Cypher, Wardley JSON, and CSV. A model can also be opened straight from a URL with ?url=, including an RCN Substrate subgraph projection. Multi-trace edges, node and edge layers, canvas legend, and Print are available in all modes. A mode\u2019s backdrop \u2014 EIP columns, Wardley grid, LOP bands, VSM lanes and sawtooth \u2014 is drawn inside the SVG, so it travels into the wiki item and out again; save while still in that mode, because the backdrop only draws there."
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"type": "rcngraph",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
{
|
|
30
30
|
"type": "paragraph",
|
|
31
31
|
"id": "4b6f8e3d9c2a1705",
|
|
32
|
-
"text": "Developed by Marc Pierson with Claude Sonnet 4.6 (Anthropic) for the ReLocalize Creativity Network. Source: [
|
|
32
|
+
"text": "Developed by Marc Pierson with Claude Sonnet 4.6 (Anthropic) for the ReLocalize Creativity Network. Source: [https://github.com/marpie1/wiki-plugin-rcngraph GitHub]. Published on npm as wiki-plugin-rcngraph."
|
|
33
33
|
}
|
|
34
34
|
],
|
|
35
35
|
"journal": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"item": {
|
|
58
58
|
"type": "paragraph",
|
|
59
59
|
"id": "2e7c9f04a3b8d651",
|
|
60
|
-
"text": "Create an item using the factory. Click Open Graph Tool to open the tool. Use -> Item to save the diagram as an SVG preview back into the wiki item
|
|
60
|
+
"text": "Create an item using the factory. Click Open Graph Tool to open the tool. Use -> Item to save the diagram as an SVG preview back into the wiki item \u2014 node labels in that preview are clickable internal wiki links, and the graph JSON rides along so Edit in Graph Tool reopens the real model. Use -> Wiki to send the diagram to the lineup as a ghost page. Both follow Ward Cunningham's Enrich Any SVG pattern."
|
|
61
61
|
},
|
|
62
62
|
"date": 1782864002000
|
|
63
63
|
},
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"item": {
|
|
69
69
|
"type": "paragraph",
|
|
70
70
|
"id": "c1d2e3f4a5b60001",
|
|
71
|
-
"text": "Diagram types
|
|
71
|
+
"text": "Diagram types \u2014 CLD (Causal Loop): map feedback loops and system dynamics. EIP (Enriched Influence Pattern): influence networks with stakeholders, flows, and interventions. NRM (Neighbourhood Risk Management): incident and risk analysis on the Tripod Beta pattern. Trace: follow a path through an existing graph. Wardley: Wardley mapping on an evolution/visibility canvas. OPM (Object-Process Methodology): system structure and process using Dov Dori's ISO 19450 standard, with OPL sentences and Cypher export. SFD (Stock and Flow): stocks, valves, auxiliaries and clouds in the Stella idiom, with XMILE export. LOP (Linkage of Processes): the Deming / API organization-as-a-system map. Triples: nodes and edges can link to other edges, enabling RDF-style triple referencing for knowledge graph authoring."
|
|
72
72
|
},
|
|
73
73
|
"date": 1782864003000
|
|
74
74
|
},
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"item": {
|
|
112
112
|
"type": "paragraph",
|
|
113
113
|
"id": "c1d2e3f4a5b60001",
|
|
114
|
-
"text": "Diagram types
|
|
114
|
+
"text": "Diagram types \u2014 CLD (Causal Loop): map feedback loops and system dynamics. EIP (Enriched Influence Pattern): influence networks with stakeholders, flows, and interventions. NRM (Neighbourhood Risk Management): incident and risk analysis on the Tripod Beta pattern. Trace: follow a path through an existing graph. Wardley: Wardley mapping on an evolution/visibility canvas. OPM (Object-Process Methodology): system structure and process using Dov Dori's ISO 19450 standard, with OPL sentences and Cypher export. SFD (Stock and Flow): stocks, valves, auxiliaries and clouds in the Stella idiom, with XMILE export. LOP (Linkage of Processes): the Deming / API organization-as-a-system map. VSM (Value Stream Mapping): Cindy Jimmerson's healthcare value stream \u2014 four flows in lanes, storm bursts, and a computed sawtooth giving lead time, value-added time and the ratio between them, with a one-click handoff that seeds an A3. Triples: nodes and edges can link to other edges, enabling RDF-style triple referencing for knowledge graph authoring."
|
|
115
115
|
},
|
|
116
116
|
"date": 1787712127315
|
|
117
117
|
},
|
|
@@ -121,9 +121,19 @@
|
|
|
121
121
|
"item": {
|
|
122
122
|
"type": "paragraph",
|
|
123
123
|
"id": "d2e3f4a5b6c70002",
|
|
124
|
-
"text": "Import and export: MDL/Vensim CLD, Graphviz .dot, XMILE, Cypher, Wardley JSON, and CSV. A model can also be opened straight from a URL with ?url=, including an RCN Substrate subgraph projection. Multi-trace edges, node and edge layers, canvas legend, and Print are available in all modes. A mode
|
|
124
|
+
"text": "Import and export: MDL/Vensim CLD, Graphviz .dot, XMILE, Cypher, Wardley JSON, and CSV. A model can also be opened straight from a URL with ?url=, including an RCN Substrate subgraph projection. Multi-trace edges, node and edge layers, canvas legend, and Print are available in all modes. A mode\u2019s backdrop \u2014 EIP columns, Wardley grid, LOP bands, VSM lanes and sawtooth \u2014 is drawn inside the SVG, so it travels into the wiki item and out again; save while still in that mode, because the backdrop only draws there."
|
|
125
125
|
},
|
|
126
126
|
"date": 1787712128315
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"type": "edit",
|
|
130
|
+
"id": "4b6f8e3d9c2a1705",
|
|
131
|
+
"item": {
|
|
132
|
+
"type": "paragraph",
|
|
133
|
+
"id": "4b6f8e3d9c2a1705",
|
|
134
|
+
"text": "Developed by Marc Pierson with Claude Sonnet 4.6 (Anthropic) for the ReLocalize Creativity Network. Source: [https://github.com/marpie1/wiki-plugin-rcngraph GitHub]. Published on npm as wiki-plugin-rcngraph."
|
|
135
|
+
},
|
|
136
|
+
"date": 1791164815533
|
|
127
137
|
}
|
|
128
138
|
]
|
|
129
139
|
}
|