@tuprolog/arg2p-ui 0.0.0-stage → 0.1.0
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 +48 -2
- package/dist/components/arg2p-editor.d.ts +73 -0
- package/dist/components/arg2p-editor.js +244 -0
- package/dist/components/arg2p-editor.js.map +1 -0
- package/dist/components/arg2p-flags.d.ts +58 -0
- package/dist/components/arg2p-flags.js +358 -0
- package/dist/components/arg2p-flags.js.map +1 -0
- package/dist/components/arg2p-framework.d.ts +102 -0
- package/dist/components/arg2p-framework.js +513 -0
- package/dist/components/arg2p-framework.js.map +1 -0
- package/dist/components/arg2p-graph.d.ts +112 -0
- package/dist/components/arg2p-graph.js +577 -0
- package/dist/components/arg2p-graph.js.map +1 -0
- package/dist/components/arg2p-solutions.d.ts +75 -0
- package/dist/components/arg2p-solutions.js +391 -0
- package/dist/components/arg2p-solutions.js.map +1 -0
- package/dist/data.d.ts +9 -0
- package/dist/data.js +11 -0
- package/dist/data.js.map +1 -0
- package/dist/editor/language.d.ts +9 -0
- package/dist/editor/language.js +78 -0
- package/dist/editor/language.js.map +1 -0
- package/dist/engine.d.ts +94 -0
- package/dist/engine.js +2 -0
- package/dist/engine.js.map +1 -0
- package/dist/flags/schema.d.ts +50 -0
- package/dist/flags/schema.js +195 -0
- package/dist/flags/schema.js.map +1 -0
- package/dist/flags/text.d.ts +18 -0
- package/dist/flags/text.js +85 -0
- package/dist/flags/text.js.map +1 -0
- package/dist/formats/declarations.d.ts +9 -0
- package/dist/formats/declarations.js +193 -0
- package/dist/formats/declarations.js.map +1 -0
- package/dist/formats/frameworks.d.ts +23 -0
- package/dist/formats/frameworks.js +130 -0
- package/dist/formats/frameworks.js.map +1 -0
- package/dist/graph/canvas.d.ts +21 -0
- package/dist/graph/canvas.js +76 -0
- package/dist/graph/canvas.js.map +1 -0
- package/dist/graph/drawing.d.ts +24 -0
- package/dist/graph/drawing.js +64 -0
- package/dist/graph/drawing.js.map +1 -0
- package/dist/graph/layout.d.ts +28 -0
- package/dist/graph/layout.js +167 -0
- package/dist/graph/layout.js.map +1 -0
- package/dist/graph/levels.d.ts +6 -0
- package/dist/graph/levels.js +25 -0
- package/dist/graph/levels.js.map +1 -0
- package/dist/graph/positions.d.ts +24 -0
- package/dist/graph/positions.js +43 -0
- package/dist/graph/positions.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/js/engine.d.ts +35 -0
- package/dist/js/engine.js +110 -0
- package/dist/js/engine.js.map +1 -0
- package/dist/js/host.d.ts +75 -0
- package/dist/js/host.js +237 -0
- package/dist/js/host.js.map +1 -0
- package/dist/js/index.d.ts +2 -0
- package/dist/js/index.js +4 -0
- package/dist/js/index.js.map +1 -0
- package/dist/js/worker.d.ts +1 -0
- package/dist/js/worker.js +7 -0
- package/dist/js/worker.js.map +1 -0
- package/dist/theme.d.ts +5 -0
- package/dist/theme.js +48 -0
- package/dist/theme.js.map +1 -0
- package/package.json +65 -4
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { LitElement, css, html, nothing } from 'lit';
|
|
2
|
+
import { declaredFramework, redrawn } from '../formats/declarations.js';
|
|
3
|
+
import { NODE_FONT, drawing, fit, followSize, nodeSize, png } from '../graph/canvas.js';
|
|
4
|
+
import { MUTUAL_STYLE, markMutual, placeByName, positionsOf } from '../graph/positions.js';
|
|
5
|
+
import { labelColor, tokens } from '../theme.js';
|
|
6
|
+
const NAME = /^[a-z][a-zA-Z0-9_]*$/;
|
|
7
|
+
const STYLE = [
|
|
8
|
+
{
|
|
9
|
+
selector: 'node',
|
|
10
|
+
style: {
|
|
11
|
+
shape: 'ellipse',
|
|
12
|
+
'background-color': 'data(color)',
|
|
13
|
+
label: 'data(id)',
|
|
14
|
+
color: '#ffffff',
|
|
15
|
+
'font-family': NODE_FONT.family,
|
|
16
|
+
'font-size': NODE_FONT.size,
|
|
17
|
+
'text-valign': 'center',
|
|
18
|
+
'text-halign': 'center',
|
|
19
|
+
width: 'data(width)',
|
|
20
|
+
height: 'data(height)',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{ selector: 'node:selected, node.source', style: { 'border-width': 3, 'border-color': 'data(outline)' } },
|
|
24
|
+
{
|
|
25
|
+
selector: 'edge',
|
|
26
|
+
style: {
|
|
27
|
+
width: 2,
|
|
28
|
+
'line-color': 'data(color)',
|
|
29
|
+
'target-arrow-color': 'data(color)',
|
|
30
|
+
'target-arrow-shape': 'triangle',
|
|
31
|
+
'curve-style': 'bezier',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{ selector: 'edge:selected', style: { width: 4 } },
|
|
35
|
+
MUTUAL_STYLE,
|
|
36
|
+
// what the theory derives and does not declare: drawn, not edited by drawing
|
|
37
|
+
{ selector: 'node.derived', style: { 'border-width': 3, 'border-style': 'dashed', 'border-color': 'data(outline)', 'background-opacity': 0.8 } },
|
|
38
|
+
{
|
|
39
|
+
selector: 'edge.derived',
|
|
40
|
+
style: { 'line-style': 'dashed', 'line-dash-pattern': [9, 6], width: 2.5, 'arrow-scale': 1.4 },
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* An abstract framework drawn: the arguments and attacks its theory (of the profile abstract) declares, as nodes and
|
|
45
|
+
* arrows. Drawing writes the theory: an argument added is a fact `a.`, an attack `a -> b.`; deleting or renaming one
|
|
46
|
+
* changes its declaration, and every other clause of the theory (those that derive attacks, say) stays as it is.
|
|
47
|
+
* The theory edited as text is drawn again, the arguments kept where they were.
|
|
48
|
+
*
|
|
49
|
+
* Given the graph of a solution, the arguments take the colours of their labels, and what the theory derives without
|
|
50
|
+
* declaring it is drawn too, dashed: it changes with the clauses that derive it, not by drawing.
|
|
51
|
+
*
|
|
52
|
+
* Events: `arg2p-theory-change` with the theory, after every change made by drawing; `arg2p-export` with the picture
|
|
53
|
+
* of the framework, as for the graph.
|
|
54
|
+
*/
|
|
55
|
+
export class Arg2pFramework extends LitElement {
|
|
56
|
+
constructor() {
|
|
57
|
+
super(...arguments);
|
|
58
|
+
/** The theory drawn */
|
|
59
|
+
this.theory = '';
|
|
60
|
+
/** The graph of a solution of [theory], to show its labels and what it derives; null when there is none */
|
|
61
|
+
this.graph = null;
|
|
62
|
+
/** Where the arguments are, by name: shared with the graph of the framework (see arg2p-positions) */
|
|
63
|
+
this.positions = null;
|
|
64
|
+
this.readonly = false;
|
|
65
|
+
/** The name of the picture the framework is saved as, with no extension */
|
|
66
|
+
this.fileName = 'framework';
|
|
67
|
+
this.mode = 'select';
|
|
68
|
+
this.selected = false;
|
|
69
|
+
this.renaming = null;
|
|
70
|
+
// the attacker picked, in attack mode
|
|
71
|
+
this.source = null;
|
|
72
|
+
// whether the graph adds to the framework what the theory derives
|
|
73
|
+
this.derived = false;
|
|
74
|
+
this.cy = null;
|
|
75
|
+
this.unfollow = () => { };
|
|
76
|
+
// the framework of [theory], as drawn
|
|
77
|
+
this.drawn = { arguments: [], attacks: [] };
|
|
78
|
+
}
|
|
79
|
+
static { this.properties = {
|
|
80
|
+
theory: {},
|
|
81
|
+
graph: { attribute: false },
|
|
82
|
+
positions: { attribute: false },
|
|
83
|
+
readonly: { type: Boolean, reflect: true },
|
|
84
|
+
fileName: { attribute: 'file-name' },
|
|
85
|
+
mode: { state: true },
|
|
86
|
+
selected: { state: true },
|
|
87
|
+
renaming: { state: true },
|
|
88
|
+
source: { state: true },
|
|
89
|
+
derived: { state: true },
|
|
90
|
+
}; }
|
|
91
|
+
/** The arguments and attacks the theory declares */
|
|
92
|
+
framework() {
|
|
93
|
+
return this.drawn;
|
|
94
|
+
}
|
|
95
|
+
/** The drawing, for what the element does not do itself (and for tests) */
|
|
96
|
+
get drawing() {
|
|
97
|
+
return this.cy;
|
|
98
|
+
}
|
|
99
|
+
/** Fits the drawing to the element (after it was hidden, and so sized to nothing) */
|
|
100
|
+
fit() {
|
|
101
|
+
if (this.cy === null)
|
|
102
|
+
return;
|
|
103
|
+
this.cy.resize();
|
|
104
|
+
fit(this.cy);
|
|
105
|
+
}
|
|
106
|
+
/** The framework as a PNG picture, as a data URL */
|
|
107
|
+
png() {
|
|
108
|
+
if (this.cy === null)
|
|
109
|
+
return '';
|
|
110
|
+
return png(this.cy, getComputedStyle(this).getPropertyValue('--_surface').trim() || '#ffffff');
|
|
111
|
+
}
|
|
112
|
+
firstUpdated() {
|
|
113
|
+
const cy = drawing(this.renderRoot.querySelector('.canvas'), STYLE);
|
|
114
|
+
cy.on('tap', (event) => this.tap(event));
|
|
115
|
+
cy.on('dbltap', (event) => {
|
|
116
|
+
if (this.readonly)
|
|
117
|
+
return;
|
|
118
|
+
if (event.target === cy)
|
|
119
|
+
this.add(event.position);
|
|
120
|
+
else if (event.target.isNode())
|
|
121
|
+
this.startRename(event.target.id());
|
|
122
|
+
});
|
|
123
|
+
cy.on('dragfree', 'node', () => this.tellPositions());
|
|
124
|
+
cy.on('select unselect', () => {
|
|
125
|
+
this.selected = cy.$(':selected').nonempty();
|
|
126
|
+
});
|
|
127
|
+
cy.on('viewport position', () => this.placeRename());
|
|
128
|
+
this.cy = cy;
|
|
129
|
+
this.unfollow = followSize(cy, this.renderRoot.querySelector('.canvas'));
|
|
130
|
+
this.draw();
|
|
131
|
+
}
|
|
132
|
+
willUpdate(changed) {
|
|
133
|
+
// the graph of another theory: its labels no longer hold
|
|
134
|
+
if (changed.has('theory') && !changed.has('graph') && changed.get('theory') !== undefined)
|
|
135
|
+
this.graph = null;
|
|
136
|
+
}
|
|
137
|
+
updated(changed) {
|
|
138
|
+
if (changed.has('theory') || changed.has('graph'))
|
|
139
|
+
this.draw();
|
|
140
|
+
// placed elsewhere (by the graph of the framework): moved there
|
|
141
|
+
else if (changed.has('positions') && this.cy !== null && placeByName(this.cy, idOf, this.positions))
|
|
142
|
+
this.tellPositions();
|
|
143
|
+
if (changed.has('readonly')) {
|
|
144
|
+
if (this.readonly)
|
|
145
|
+
this.setMode('select');
|
|
146
|
+
this.cy?.autoungrabify(this.readonly);
|
|
147
|
+
}
|
|
148
|
+
if (changed.has('renaming') && this.renaming !== null && changed.get('renaming') === null) {
|
|
149
|
+
const box = this.renderRoot.querySelector('.rename');
|
|
150
|
+
this.placeRename();
|
|
151
|
+
box?.focus();
|
|
152
|
+
box?.select();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
disconnectedCallback() {
|
|
156
|
+
super.disconnectedCallback();
|
|
157
|
+
this.unfollow();
|
|
158
|
+
this.cy?.destroy();
|
|
159
|
+
this.cy = null;
|
|
160
|
+
}
|
|
161
|
+
connectedCallback() {
|
|
162
|
+
super.connectedCallback();
|
|
163
|
+
if (this.hasUpdated && this.cy === null)
|
|
164
|
+
this.firstUpdated();
|
|
165
|
+
}
|
|
166
|
+
// The declared framework, and what the graph adds to it, drawn: the arguments already drawn stay where they are,
|
|
167
|
+
// the new ones go around the middle of the view (all placed anew when there were none)
|
|
168
|
+
draw() {
|
|
169
|
+
const cy = this.cy;
|
|
170
|
+
if (cy === null)
|
|
171
|
+
return;
|
|
172
|
+
this.drawn = declaredFramework(this.theory);
|
|
173
|
+
const declared = new Set(this.drawn.arguments);
|
|
174
|
+
const named = this.graph?.profile === 'abstract' ? this.graph : null;
|
|
175
|
+
const labels = new Map((named?.arguments ?? []).map(it => [it.conclusion, it.label]));
|
|
176
|
+
const names = new Map((named?.arguments ?? []).map(it => [it.id, it.conclusion]));
|
|
177
|
+
const attacks = new Set(this.drawn.attacks.map(it => `${it.from}->${it.to}`));
|
|
178
|
+
const derivedAttacks = (named?.attacks ?? [])
|
|
179
|
+
.map(it => ({ from: names.get(it.from), to: names.get(it.to) }))
|
|
180
|
+
.filter((it) => it.from !== undefined && it.to !== undefined && !attacks.has(`${it.from}->${it.to}`));
|
|
181
|
+
const outline = getComputedStyle(this).getPropertyValue('--_accent').trim() || '#008080';
|
|
182
|
+
const nodes = [...this.drawn.arguments, ...[...labels.keys()].filter(it => !declared.has(it))].map(name => ({
|
|
183
|
+
data: { id: name, color: labelColor(this, labels.get(name)), outline, ...nodeSize(name) },
|
|
184
|
+
classes: declared.has(name) ? '' : 'derived',
|
|
185
|
+
}));
|
|
186
|
+
const attackColor = (from) => (labels.has(from) ? labelColor(this, labels.get(from)) : labelColor(this, null));
|
|
187
|
+
const edges = [
|
|
188
|
+
...this.drawn.attacks.map(it => ({ data: { id: `${it.from}->${it.to}`, source: it.from, target: it.to, color: attackColor(it.from) }, classes: '' })),
|
|
189
|
+
...derivedAttacks.map(it => ({ data: { id: `${it.from}->${it.to}`, source: it.from, target: it.to, color: attackColor(it.from) }, classes: 'derived' })),
|
|
190
|
+
];
|
|
191
|
+
this.derived = nodes.some(it => it.classes === 'derived') || derivedAttacks.length > 0;
|
|
192
|
+
const wanted = new Set([...nodes, ...edges].map(it => it.data.id));
|
|
193
|
+
const first = cy.nodes().empty();
|
|
194
|
+
// the arguments stay where they are, or go where the graph has them
|
|
195
|
+
const placed = { ...positionsOf(cy, idOf), ...this.positions };
|
|
196
|
+
cy.batch(() => {
|
|
197
|
+
cy.elements().filter(it => !wanted.has(it.id())).remove();
|
|
198
|
+
nodes.forEach(({ data, classes }) => {
|
|
199
|
+
const node = cy.getElementById(data.id);
|
|
200
|
+
if (node.nonempty())
|
|
201
|
+
node.data(data).classes(classes);
|
|
202
|
+
else
|
|
203
|
+
cy.add({ group: 'nodes', data, classes });
|
|
204
|
+
});
|
|
205
|
+
edges.forEach(({ data, classes }) => {
|
|
206
|
+
const edge = cy.getElementById(data.id);
|
|
207
|
+
if (edge.nonempty())
|
|
208
|
+
edge.data(data).classes(classes);
|
|
209
|
+
else
|
|
210
|
+
cy.add({ group: 'edges', data, classes });
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
markMutual(cy);
|
|
214
|
+
const laid = placeByName(cy, idOf, placed);
|
|
215
|
+
// what the graph does not know where to place yet (an argument added, laid out, renamed): told
|
|
216
|
+
const told = new Set(Object.keys(this.positions ?? {}));
|
|
217
|
+
if (laid || cy.nodes().some(it => !told.has(it.id())) || told.size !== cy.nodes().length)
|
|
218
|
+
this.tellPositions();
|
|
219
|
+
if (first && cy.nodes().nonempty())
|
|
220
|
+
fit(cy);
|
|
221
|
+
if (this.source !== null && cy.getElementById(this.source).empty())
|
|
222
|
+
this.source = null;
|
|
223
|
+
}
|
|
224
|
+
// Where the arguments are now, for the graph of the framework to place them alike
|
|
225
|
+
tellPositions() {
|
|
226
|
+
if (this.cy === null)
|
|
227
|
+
return;
|
|
228
|
+
this.positions = positionsOf(this.cy, idOf);
|
|
229
|
+
this.dispatchEvent(new CustomEvent('arg2p-positions', { detail: { positions: this.positions }, bubbles: true, composed: true }));
|
|
230
|
+
}
|
|
231
|
+
tap(event) {
|
|
232
|
+
const cy = this.cy;
|
|
233
|
+
if (this.readonly)
|
|
234
|
+
return;
|
|
235
|
+
const onNode = event.target !== cy && event.target.isNode();
|
|
236
|
+
if (this.mode === 'argument' && event.target === cy)
|
|
237
|
+
this.add(event.position);
|
|
238
|
+
else if (this.mode === 'attack') {
|
|
239
|
+
if (!onNode)
|
|
240
|
+
return this.pick(null);
|
|
241
|
+
const id = event.target.id();
|
|
242
|
+
if (this.source === null)
|
|
243
|
+
return this.pick(id);
|
|
244
|
+
const from = this.source;
|
|
245
|
+
this.pick(null);
|
|
246
|
+
const known = this.drawn.arguments.includes(from) && this.drawn.arguments.includes(id);
|
|
247
|
+
if (known && !this.drawn.attacks.some(it => it.from === from && it.to === id)) {
|
|
248
|
+
this.change({ arguments: this.drawn.arguments, attacks: [...this.drawn.attacks, { from, to: id }] });
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
// The attacker of the attack being drawn
|
|
253
|
+
pick(id) {
|
|
254
|
+
this.cy?.$('.source').removeClass('source');
|
|
255
|
+
this.source = id;
|
|
256
|
+
if (id !== null)
|
|
257
|
+
this.cy?.getElementById(id).addClass('source');
|
|
258
|
+
}
|
|
259
|
+
add(position) {
|
|
260
|
+
const name = this.suggestedName();
|
|
261
|
+
// placed where it was asked for before the theory draws it
|
|
262
|
+
this.cy?.add({ group: 'nodes', data: { id: name, color: labelColor(this, null), ...nodeSize(name) }, position: { ...position } });
|
|
263
|
+
this.change({ arguments: [...this.drawn.arguments, name], attacks: this.drawn.attacks });
|
|
264
|
+
}
|
|
265
|
+
// A change made by drawing: the theory rewritten, then drawn again from it
|
|
266
|
+
change(framework, renamed = new Map()) {
|
|
267
|
+
this.theory = redrawn(this.theory, framework, renamed);
|
|
268
|
+
// the labels were those of the theory before
|
|
269
|
+
this.graph = null;
|
|
270
|
+
this.dispatchEvent(new CustomEvent('arg2p-theory-change', { detail: { theory: this.theory }, bubbles: true, composed: true }));
|
|
271
|
+
}
|
|
272
|
+
// Only what is declared is deleted by drawing
|
|
273
|
+
deleteSelected() {
|
|
274
|
+
const cy = this.cy;
|
|
275
|
+
if (cy === null)
|
|
276
|
+
return;
|
|
277
|
+
const gone = new Set(cy.$('node:selected').map(it => it.id()).filter(it => this.drawn.arguments.includes(it)));
|
|
278
|
+
const goneAttacks = new Set(cy.$('edge:selected').map(it => it.id()));
|
|
279
|
+
this.change({
|
|
280
|
+
arguments: this.drawn.arguments.filter(it => !gone.has(it)),
|
|
281
|
+
attacks: this.drawn.attacks.filter(it => !gone.has(it.from) && !gone.has(it.to) && !goneAttacks.has(`${it.from}->${it.to}`)),
|
|
282
|
+
});
|
|
283
|
+
this.selected = cy.$(':selected').nonempty();
|
|
284
|
+
}
|
|
285
|
+
setMode(mode) {
|
|
286
|
+
this.mode = mode;
|
|
287
|
+
this.pick(null);
|
|
288
|
+
}
|
|
289
|
+
suggestedName() {
|
|
290
|
+
const taken = new Set(this.cy?.nodes().map(it => it.id()) ?? []);
|
|
291
|
+
for (let i = 1;; i++)
|
|
292
|
+
if (!taken.has(`a${i}`))
|
|
293
|
+
return `a${i}`;
|
|
294
|
+
}
|
|
295
|
+
isAvailable(name, current) {
|
|
296
|
+
return NAME.test(name) && (name === current || (this.cy?.getElementById(name).empty() ?? true));
|
|
297
|
+
}
|
|
298
|
+
startRename(name) {
|
|
299
|
+
if (this.drawn.arguments.includes(name))
|
|
300
|
+
this.renaming = { name, value: name };
|
|
301
|
+
}
|
|
302
|
+
// An invalid or taken name is dropped: the argument keeps its name
|
|
303
|
+
commitRename() {
|
|
304
|
+
const renaming = this.renaming;
|
|
305
|
+
this.renaming = null;
|
|
306
|
+
if (renaming === null)
|
|
307
|
+
return;
|
|
308
|
+
const wanted = renaming.value.trim();
|
|
309
|
+
if (wanted === renaming.name || !this.isAvailable(wanted, renaming.name))
|
|
310
|
+
return;
|
|
311
|
+
const node = this.cy?.getElementById(renaming.name);
|
|
312
|
+
// the renamed argument stays where it was
|
|
313
|
+
if (node?.nonempty())
|
|
314
|
+
this.cy?.add({ group: 'nodes', data: { ...node.data(), id: wanted, ...nodeSize(wanted) }, position: { ...node.position() } });
|
|
315
|
+
const rename = (it) => (it === renaming.name ? wanted : it);
|
|
316
|
+
this.change({
|
|
317
|
+
arguments: this.drawn.arguments.map(rename),
|
|
318
|
+
attacks: this.drawn.attacks.map(it => ({ from: rename(it.from), to: rename(it.to) })),
|
|
319
|
+
}, new Map([[renaming.name, wanted]]));
|
|
320
|
+
}
|
|
321
|
+
// The rename box stays on its node while the drawing moves
|
|
322
|
+
placeRename() {
|
|
323
|
+
const box = this.renderRoot.querySelector('.rename');
|
|
324
|
+
const node = this.renaming === null ? null : this.cy?.getElementById(this.renaming.name);
|
|
325
|
+
if (box === null || node == null || node.empty())
|
|
326
|
+
return;
|
|
327
|
+
const point = node.renderedPosition();
|
|
328
|
+
box.style.left = `${point.x}px`;
|
|
329
|
+
box.style.top = `${point.y}px`;
|
|
330
|
+
}
|
|
331
|
+
onKey(event) {
|
|
332
|
+
if (this.readonly || this.renaming !== null)
|
|
333
|
+
return;
|
|
334
|
+
if (event.key === 'Escape')
|
|
335
|
+
this.setMode('select');
|
|
336
|
+
else if ((event.key === 'Delete' || event.key === 'Backspace') && this.selected) {
|
|
337
|
+
event.preventDefault();
|
|
338
|
+
this.deleteSelected();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
export() {
|
|
342
|
+
const fileName = `${this.fileName}.png`;
|
|
343
|
+
const dataUrl = this.png();
|
|
344
|
+
const event = new CustomEvent('arg2p-export', { detail: { fileName, dataUrl }, bubbles: true, composed: true, cancelable: true });
|
|
345
|
+
if (!this.dispatchEvent(event))
|
|
346
|
+
return;
|
|
347
|
+
const link = document.createElement('a');
|
|
348
|
+
link.href = dataUrl;
|
|
349
|
+
link.download = fileName;
|
|
350
|
+
link.click();
|
|
351
|
+
}
|
|
352
|
+
render() {
|
|
353
|
+
const tool = (mode, text, title) => html `
|
|
354
|
+
<button type="button" class=${this.mode === mode ? 'active' : ''} aria-pressed=${this.mode === mode} title=${title} @click=${() => this.setMode(mode)}>${text}</button>
|
|
355
|
+
`;
|
|
356
|
+
const renaming = this.renaming;
|
|
357
|
+
const hint = this.mode === 'argument' ? 'Click where an argument goes'
|
|
358
|
+
: this.mode === 'attack' ? (this.source === null ? 'Click the attacker' : `Click the argument ${this.source} attacks`)
|
|
359
|
+
: 'Double click to add an argument, or to rename one';
|
|
360
|
+
return html `
|
|
361
|
+
<div class="bar" part="bar">
|
|
362
|
+
${this.readonly
|
|
363
|
+
? nothing
|
|
364
|
+
: html `
|
|
365
|
+
${tool('select', 'Select', 'Select and move arguments (Esc)')}
|
|
366
|
+
${tool('argument', '+ Argument', 'Add arguments')}
|
|
367
|
+
${tool('attack', '+ Attack', 'Add attacks: the attacker, then the argument it attacks')}
|
|
368
|
+
<button type="button" title="Delete what is selected (Del)" ?disabled=${!this.selected} @click=${() => this.deleteSelected()}>Delete</button>
|
|
369
|
+
<span class="hint">${hint}</span>
|
|
370
|
+
`}
|
|
371
|
+
<button type="button" class="png" title="Download the framework as a picture" @click=${() => this.export()}>PNG</button>
|
|
372
|
+
</div>
|
|
373
|
+
<div class="area" tabindex="0" @keydown=${(e) => this.onKey(e)}>
|
|
374
|
+
<div class="canvas"></div>
|
|
375
|
+
${this.derived
|
|
376
|
+
? html `<div class="legend" part="legend">
|
|
377
|
+
<span><span class="line"></span>declared in the theory: drawing changes it</span>
|
|
378
|
+
<span><span class="line derived"></span>derived by its rules: change the rules to change it</span>
|
|
379
|
+
</div>`
|
|
380
|
+
: nothing}
|
|
381
|
+
${renaming === null
|
|
382
|
+
? nothing
|
|
383
|
+
: html `<input
|
|
384
|
+
class="rename ${this.isAvailable(renaming.value.trim(), renaming.name) ? '' : 'invalid'}"
|
|
385
|
+
type="text"
|
|
386
|
+
aria-label="Argument name"
|
|
387
|
+
title="Argument name: a lowercase letter, then letters, digits or underscores"
|
|
388
|
+
.value=${renaming.value}
|
|
389
|
+
@input=${(e) => (this.renaming = { ...renaming, value: e.target.value })}
|
|
390
|
+
@keydown=${(e) => {
|
|
391
|
+
e.stopPropagation();
|
|
392
|
+
if (e.key === 'Enter')
|
|
393
|
+
this.commitRename();
|
|
394
|
+
else if (e.key === 'Escape')
|
|
395
|
+
this.renaming = null;
|
|
396
|
+
}}
|
|
397
|
+
@blur=${() => this.commitRename()}
|
|
398
|
+
/>`}
|
|
399
|
+
</div>
|
|
400
|
+
`;
|
|
401
|
+
}
|
|
402
|
+
static { this.styles = [
|
|
403
|
+
tokens,
|
|
404
|
+
css `
|
|
405
|
+
:host {
|
|
406
|
+
display: flex;
|
|
407
|
+
flex-direction: column;
|
|
408
|
+
min-height: 200px;
|
|
409
|
+
background: var(--_surface);
|
|
410
|
+
font-size: 13px;
|
|
411
|
+
}
|
|
412
|
+
.bar {
|
|
413
|
+
display: flex;
|
|
414
|
+
flex-wrap: wrap;
|
|
415
|
+
align-items: center;
|
|
416
|
+
gap: 6px;
|
|
417
|
+
padding: 6px 10px;
|
|
418
|
+
border-bottom: 1px solid var(--_border);
|
|
419
|
+
}
|
|
420
|
+
button {
|
|
421
|
+
font: inherit;
|
|
422
|
+
color: var(--_text);
|
|
423
|
+
background: var(--_surface);
|
|
424
|
+
border: 1px solid var(--_border);
|
|
425
|
+
border-radius: 4px;
|
|
426
|
+
padding: 2px 8px;
|
|
427
|
+
cursor: pointer;
|
|
428
|
+
}
|
|
429
|
+
button:hover:not(:disabled) {
|
|
430
|
+
background: var(--_hover);
|
|
431
|
+
}
|
|
432
|
+
button.active {
|
|
433
|
+
border-color: var(--_accent);
|
|
434
|
+
color: var(--_accent);
|
|
435
|
+
}
|
|
436
|
+
button:disabled {
|
|
437
|
+
opacity: 0.5;
|
|
438
|
+
cursor: default;
|
|
439
|
+
}
|
|
440
|
+
.hint {
|
|
441
|
+
margin-left: auto;
|
|
442
|
+
color: var(--_muted);
|
|
443
|
+
}
|
|
444
|
+
.png {
|
|
445
|
+
margin-left: auto;
|
|
446
|
+
}
|
|
447
|
+
.hint + .png {
|
|
448
|
+
margin-left: 0;
|
|
449
|
+
}
|
|
450
|
+
.area {
|
|
451
|
+
flex: 1;
|
|
452
|
+
min-height: 0;
|
|
453
|
+
position: relative;
|
|
454
|
+
overflow: hidden;
|
|
455
|
+
outline: none;
|
|
456
|
+
}
|
|
457
|
+
.canvas {
|
|
458
|
+
position: absolute;
|
|
459
|
+
inset: 0;
|
|
460
|
+
}
|
|
461
|
+
.legend {
|
|
462
|
+
position: absolute;
|
|
463
|
+
left: 8px;
|
|
464
|
+
bottom: 8px;
|
|
465
|
+
display: flex;
|
|
466
|
+
flex-direction: column;
|
|
467
|
+
gap: 2px;
|
|
468
|
+
padding: 6px 10px;
|
|
469
|
+
font-size: 12px;
|
|
470
|
+
color: var(--_muted);
|
|
471
|
+
background: color-mix(in srgb, var(--_surface) 88%, transparent);
|
|
472
|
+
border: 1px solid var(--_border);
|
|
473
|
+
border-radius: 6px;
|
|
474
|
+
pointer-events: none;
|
|
475
|
+
}
|
|
476
|
+
.legend > span {
|
|
477
|
+
display: inline-flex;
|
|
478
|
+
align-items: center;
|
|
479
|
+
gap: 8px;
|
|
480
|
+
}
|
|
481
|
+
.legend .line {
|
|
482
|
+
display: inline-block;
|
|
483
|
+
width: 28px;
|
|
484
|
+
border-top: 2.5px solid var(--_muted);
|
|
485
|
+
}
|
|
486
|
+
.legend .line.derived {
|
|
487
|
+
border-top-style: dashed;
|
|
488
|
+
}
|
|
489
|
+
.rename {
|
|
490
|
+
position: absolute;
|
|
491
|
+
transform: translate(-50%, -50%);
|
|
492
|
+
width: 9em;
|
|
493
|
+
font: 14px var(--_mono);
|
|
494
|
+
text-align: center;
|
|
495
|
+
color: var(--_text);
|
|
496
|
+
background: var(--_surface);
|
|
497
|
+
border: 2px solid var(--_accent);
|
|
498
|
+
border-radius: 4px;
|
|
499
|
+
padding: 2px 4px;
|
|
500
|
+
z-index: 10;
|
|
501
|
+
}
|
|
502
|
+
.rename.invalid {
|
|
503
|
+
border-color: var(--_error);
|
|
504
|
+
}
|
|
505
|
+
`,
|
|
506
|
+
]; }
|
|
507
|
+
}
|
|
508
|
+
// An argument drawn is called by its name
|
|
509
|
+
function idOf(node) {
|
|
510
|
+
return node.id();
|
|
511
|
+
}
|
|
512
|
+
customElements.define('arg2p-framework', Arg2pFramework);
|
|
513
|
+
//# sourceMappingURL=arg2p-framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arg2p-framework.js","sourceRoot":"","sources":["../../src/components/arg2p-framework.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAkB,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,IAAI,GAAG,sBAAsB,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C;qCAC1F,CAAC,CAAgB,EAAE,EAAE;gBAC5B,CAAC,CAAC,eAAe,EAAE,CAAC;gBACpB,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO;oBAAE,IAAI,CAAC,YAAY,EAAE,CAAC;qBACtC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;oBAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACtD,CAAC;kCACO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;yBAClC;;SAEhB,CAAC;IACN,CAAC;aAEe,WAAM,GAAG;QACrB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAqGF;KACJ,AAxGqB,CAwGpB;CACL;AAED,0CAA0C;AAC1C,SAAS,IAAI,CAAC,IAAkB;IAC5B,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC;AACrB,CAAC;AAED,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Core } from 'cytoscape';
|
|
2
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
3
|
+
import { type GraphData, type Run, type SolutionData } from '../engine.js';
|
|
4
|
+
import { type Positions } from '../graph/positions.js';
|
|
5
|
+
/** The stages of a computation the graph can be browsed back through: 0 to [last], the graph shown being the last */
|
|
6
|
+
export interface Stages {
|
|
7
|
+
readonly last: number;
|
|
8
|
+
graphAt(branch: number): Promise<GraphData>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The argument graph of a solution: every argument a node in the colour of its label, built on the arguments below it
|
|
12
|
+
* (facts at the bottom) and attacking others. Hovering an argument (or tapping it, the only way on touch screens)
|
|
13
|
+
* tells about it; the stages of the computation can be browsed back; the graph can be saved as a picture.
|
|
14
|
+
*
|
|
15
|
+
* An abstract framework (profile abstract) has no structure: its arguments go by the names the theory gives them and
|
|
16
|
+
* are placed by their attacks alone.
|
|
17
|
+
*
|
|
18
|
+
* Events: `arg2p-toggle` when supports or conclusions are shown or hidden (to remember it), and `arg2p-export` with
|
|
19
|
+
* the picture (cancel it to save the picture another way; otherwise it is downloaded).
|
|
20
|
+
*/
|
|
21
|
+
export declare class Arg2pGraph extends LitElement {
|
|
22
|
+
static properties: {
|
|
23
|
+
graph: {
|
|
24
|
+
attribute: boolean;
|
|
25
|
+
};
|
|
26
|
+
positions: {
|
|
27
|
+
attribute: boolean;
|
|
28
|
+
};
|
|
29
|
+
stages: {
|
|
30
|
+
attribute: boolean;
|
|
31
|
+
};
|
|
32
|
+
showSupports: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
attribute: string;
|
|
35
|
+
reflect: boolean;
|
|
36
|
+
};
|
|
37
|
+
showConclusions: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
attribute: string;
|
|
40
|
+
reflect: boolean;
|
|
41
|
+
};
|
|
42
|
+
fileName: {
|
|
43
|
+
attribute: string;
|
|
44
|
+
};
|
|
45
|
+
empty: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
reflect: boolean;
|
|
48
|
+
};
|
|
49
|
+
stage: {
|
|
50
|
+
state: boolean;
|
|
51
|
+
};
|
|
52
|
+
drawn: {
|
|
53
|
+
state: boolean;
|
|
54
|
+
};
|
|
55
|
+
shown: {
|
|
56
|
+
state: boolean;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/** The graph shown */
|
|
60
|
+
graph: GraphData;
|
|
61
|
+
/** The stages of the computation of [graph], if it can be browsed */
|
|
62
|
+
stages: Stages | null;
|
|
63
|
+
/** Where the arguments of an abstract framework are, by name: shared with its drawing (see arg2p-positions) */
|
|
64
|
+
positions: Positions | null;
|
|
65
|
+
showSupports: boolean;
|
|
66
|
+
showConclusions: boolean;
|
|
67
|
+
/** The name of the picture the graph is saved as, with no extension */
|
|
68
|
+
fileName: string;
|
|
69
|
+
/** Set when there is nothing to show: no arguments, and no stages to browse (a page may hide the graph) */
|
|
70
|
+
empty: boolean;
|
|
71
|
+
private stage;
|
|
72
|
+
private drawn;
|
|
73
|
+
private shown;
|
|
74
|
+
private pinned;
|
|
75
|
+
private cy;
|
|
76
|
+
private unfollow;
|
|
77
|
+
/** Shows the graph of [solution], its stages browsable through [run] */
|
|
78
|
+
showSolution(solution: SolutionData, run?: Pick<Run, 'graphAt'> | null): void;
|
|
79
|
+
clear(): void;
|
|
80
|
+
/** The graph as a PNG picture, as a data URL: the whole of it, on the background of the element */
|
|
81
|
+
png(): string;
|
|
82
|
+
/** Fits the drawing to the element */
|
|
83
|
+
fit(): void;
|
|
84
|
+
/** Draws the graph again, in the colours the page sets now (after a change of theme) */
|
|
85
|
+
restyle(): void;
|
|
86
|
+
/** The drawing, for what the element does not do itself (and for tests) */
|
|
87
|
+
get drawing(): Core | null;
|
|
88
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
89
|
+
protected firstUpdated(): void;
|
|
90
|
+
protected updated(changed: PropertyValues): void;
|
|
91
|
+
disconnectedCallback(): void;
|
|
92
|
+
connectedCallback(): void;
|
|
93
|
+
private draw;
|
|
94
|
+
private tellPositions;
|
|
95
|
+
private place;
|
|
96
|
+
private goTo;
|
|
97
|
+
private show;
|
|
98
|
+
private placePopup;
|
|
99
|
+
private toggle;
|
|
100
|
+
private export;
|
|
101
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
102
|
+
private popup;
|
|
103
|
+
private row;
|
|
104
|
+
private chips;
|
|
105
|
+
private chip;
|
|
106
|
+
static styles: import("lit").CSSResult[];
|
|
107
|
+
}
|
|
108
|
+
declare global {
|
|
109
|
+
interface HTMLElementTagNameMap {
|
|
110
|
+
'arg2p-graph': Arg2pGraph;
|
|
111
|
+
}
|
|
112
|
+
}
|