@formicoidea/labre-framework-cynefin 0.23.1 → 0.23.2
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/package.json +6 -15
- package/src/cynefin/consts.ts +188 -0
- package/src/cynefin/element-renderer.ts +156 -0
- package/src/cynefin/element-view.ts +32 -0
- package/src/cynefin/toolbar/config.ts +60 -0
- package/{dist/descriptor.js → src/descriptor.ts} +1 -1
- package/src/effects.ts +20 -0
- package/src/estuarine/consts.ts +69 -0
- package/src/estuarine/element-renderer.ts +122 -0
- package/src/estuarine/element-view.ts +32 -0
- package/src/estuarine/toolbar/config.ts +65 -0
- package/src/index.ts +1 -0
- package/src/templates/index.ts +130 -0
- package/{dist/toolbar/icons.js → src/toolbar/icons.ts} +17 -14
- package/{dist/toolbar/menu.js → src/toolbar/menu.ts} +156 -133
- package/{dist/toolbar/senior-button.js → src/toolbar/senior-button.ts} +95 -90
- package/{dist/toolbar/senior-tool.js → src/toolbar/senior-tool.ts} +15 -12
- package/{dist/utils.js → src/utils.ts} +11 -11
- package/src/view.ts +44 -0
- package/dist/cynefin/consts.d.ts +0 -80
- package/dist/cynefin/consts.js +0 -142
- package/dist/cynefin/element-renderer.d.ts +0 -15
- package/dist/cynefin/element-renderer.js +0 -115
- package/dist/cynefin/element-view.d.ts +0 -15
- package/dist/cynefin/element-view.js +0 -24
- package/dist/cynefin/toolbar/config.d.ts +0 -32
- package/dist/cynefin/toolbar/config.js +0 -44
- package/dist/descriptor.d.ts +0 -7
- package/dist/effects.d.ts +0 -10
- package/dist/effects.js +0 -7
- package/dist/estuarine/consts.d.ts +0 -85
- package/dist/estuarine/consts.js +0 -55
- package/dist/estuarine/element-renderer.d.ts +0 -14
- package/dist/estuarine/element-renderer.js +0 -84
- package/dist/estuarine/element-view.d.ts +0 -15
- package/dist/estuarine/element-view.js +0 -24
- package/dist/estuarine/toolbar/config.d.ts +0 -38
- package/dist/estuarine/toolbar/config.js +0 -48
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/templates/index.d.ts +0 -4
- package/dist/templates/index.js +0 -95
- package/dist/toolbar/cynefin-menu.d.ts +0 -12
- package/dist/toolbar/cynefin-menu.js +0 -66
- package/dist/toolbar/cynefin-senior-button.d.ts +0 -13
- package/dist/toolbar/cynefin-senior-button.js +0 -90
- package/dist/toolbar/estuarine-menu.d.ts +0 -14
- package/dist/toolbar/estuarine-menu.js +0 -113
- package/dist/toolbar/estuarine-senior-button.d.ts +0 -13
- package/dist/toolbar/estuarine-senior-button.js +0 -90
- package/dist/toolbar/icons.d.ts +0 -9
- package/dist/toolbar/menu.d.ts +0 -18
- package/dist/toolbar/senior-button.d.ts +0 -13
- package/dist/toolbar/senior-tool.d.ts +0 -3
- package/dist/utils.d.ts +0 -12
- package/dist/view.d.ts +0 -7
- package/dist/view.js +0 -38
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ElementRenderer,
|
|
3
|
+
ElementRendererExtension,
|
|
4
|
+
} from '@formicoidea/labre-core/blocks/surface';
|
|
5
|
+
import type { EstuarineElementModel } from '@formicoidea/labre-core/model';
|
|
6
|
+
|
|
7
|
+
import { FONT_FAMILY, refScale } from '../utils';
|
|
8
|
+
import {
|
|
9
|
+
ARROWHEADS,
|
|
10
|
+
AXIS_LABELS,
|
|
11
|
+
AXIS_WIDTH,
|
|
12
|
+
COLORS,
|
|
13
|
+
COUNTERFACTUAL_PATH,
|
|
14
|
+
COUNTERFACTUAL_WIDTH,
|
|
15
|
+
E_AXIS,
|
|
16
|
+
LABEL_LETTER_SPACING,
|
|
17
|
+
LABELS,
|
|
18
|
+
LIMINAL_PATH,
|
|
19
|
+
LIMINAL_WIDTH,
|
|
20
|
+
REF_H,
|
|
21
|
+
REF_W,
|
|
22
|
+
T_AXIS,
|
|
23
|
+
VOLATILE_PATH,
|
|
24
|
+
VOLATILE_WIDTH,
|
|
25
|
+
} from './consts';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Canvas renderer for the Estuarine framework map — reproduces the official SVG:
|
|
29
|
+
* the e (vertical, double-headed) / t (horizontal, single-headed) axes and the
|
|
30
|
+
* three reference curves (Liminal / Volatile / Counter-factual), each with its
|
|
31
|
+
* legend and individually hideable. Drawn in the fixed reference space and
|
|
32
|
+
* scaled uniformly to the element bounds.
|
|
33
|
+
*/
|
|
34
|
+
export const estuarine: ElementRenderer<EstuarineElementModel> = (
|
|
35
|
+
model,
|
|
36
|
+
ctx,
|
|
37
|
+
matrix
|
|
38
|
+
) => {
|
|
39
|
+
const [, , w, h] = model.deserializedXYWH;
|
|
40
|
+
const cx = w / 2;
|
|
41
|
+
const cy = h / 2;
|
|
42
|
+
ctx.setTransform(
|
|
43
|
+
matrix.translateSelf(cx, cy).rotateSelf(model.rotate).translateSelf(-cx, -cy)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const { s, ox, oy } = refScale(w, h, REF_W, REF_H);
|
|
47
|
+
ctx.translate(ox, oy);
|
|
48
|
+
ctx.scale(s, s);
|
|
49
|
+
|
|
50
|
+
ctx.lineCap = 'round';
|
|
51
|
+
ctx.lineJoin = 'round';
|
|
52
|
+
|
|
53
|
+
// ── Axes ────────────────────────────────────────────────────────────
|
|
54
|
+
ctx.strokeStyle = COLORS.axis;
|
|
55
|
+
ctx.fillStyle = COLORS.axis;
|
|
56
|
+
ctx.lineWidth = AXIS_WIDTH;
|
|
57
|
+
ctx.beginPath();
|
|
58
|
+
ctx.moveTo(E_AXIS.x, E_AXIS.y1);
|
|
59
|
+
ctx.lineTo(E_AXIS.x, E_AXIS.y2);
|
|
60
|
+
ctx.moveTo(T_AXIS.x1, T_AXIS.y);
|
|
61
|
+
ctx.lineTo(T_AXIS.x2, T_AXIS.y);
|
|
62
|
+
ctx.stroke();
|
|
63
|
+
for (const [[tx, ty], [ax, ay], [bx, by]] of ARROWHEADS) {
|
|
64
|
+
ctx.beginPath();
|
|
65
|
+
ctx.moveTo(tx, ty);
|
|
66
|
+
ctx.lineTo(ax, ay);
|
|
67
|
+
ctx.lineTo(bx, by);
|
|
68
|
+
ctx.closePath();
|
|
69
|
+
ctx.fill();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Uppercase legend (centre-anchored, alphabetic baseline, letter-spaced).
|
|
73
|
+
const hasSpacing = 'letterSpacing' in ctx;
|
|
74
|
+
const legend = (l: { text: string; x: number; y: number; size: number; color: string }) => {
|
|
75
|
+
ctx.fillStyle = l.color;
|
|
76
|
+
ctx.font = `600 ${l.size}px ${FONT_FAMILY}`;
|
|
77
|
+
ctx.textAlign = 'center';
|
|
78
|
+
ctx.textBaseline = 'alphabetic';
|
|
79
|
+
if (hasSpacing) ctx.letterSpacing = `${LABEL_LETTER_SPACING}px`;
|
|
80
|
+
ctx.fillText(l.text, l.x, l.y);
|
|
81
|
+
if (hasSpacing) ctx.letterSpacing = '0px';
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// ── Liminal (green) ─────────────────────────────────────────────────
|
|
85
|
+
if (model.showLiminal) {
|
|
86
|
+
ctx.strokeStyle = COLORS.liminal;
|
|
87
|
+
ctx.lineWidth = LIMINAL_WIDTH;
|
|
88
|
+
ctx.stroke(new Path2D(LIMINAL_PATH));
|
|
89
|
+
legend(LABELS.liminal);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ── Volatile (red) ──────────────────────────────────────────────────
|
|
93
|
+
if (model.showVolatile) {
|
|
94
|
+
ctx.strokeStyle = COLORS.volatile;
|
|
95
|
+
ctx.lineWidth = VOLATILE_WIDTH;
|
|
96
|
+
ctx.stroke(new Path2D(VOLATILE_PATH));
|
|
97
|
+
legend(LABELS.volatile);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ── Counter-factual (dark) ──────────────────────────────────────────
|
|
101
|
+
if (model.showCounterfactual) {
|
|
102
|
+
ctx.strokeStyle = COLORS.counterfactual;
|
|
103
|
+
ctx.lineWidth = COUNTERFACTUAL_WIDTH;
|
|
104
|
+
ctx.stroke(new Path2D(COUNTERFACTUAL_PATH));
|
|
105
|
+
legend(LABELS.counterfactual);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ── Italic e / t axis letters ───────────────────────────────────────
|
|
109
|
+
if (model.showAxisLabels) {
|
|
110
|
+
ctx.fillStyle = COLORS.axisLabel;
|
|
111
|
+
ctx.font = `italic 700 ${AXIS_LABELS.size}px Georgia, serif`;
|
|
112
|
+
ctx.textAlign = 'left';
|
|
113
|
+
ctx.textBaseline = 'alphabetic';
|
|
114
|
+
ctx.fillText(AXIS_LABELS.e.text, AXIS_LABELS.e.x, AXIS_LABELS.e.y);
|
|
115
|
+
ctx.fillText(AXIS_LABELS.t.text, AXIS_LABELS.t.x, AXIS_LABELS.t.y);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const EstuarineRendererExtension = ElementRendererExtension(
|
|
120
|
+
'estuarine',
|
|
121
|
+
estuarine
|
|
122
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { EstuarineElementModel } from '@formicoidea/labre-core/model';
|
|
2
|
+
import {
|
|
3
|
+
GfxElementModelView,
|
|
4
|
+
GfxViewInteractionExtension,
|
|
5
|
+
} from '@formicoidea/labre-core/std/gfx';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* View for the Estuarine background. Registering it ensures `gfx.view.get(model)`
|
|
9
|
+
* returns a view (required so move / select interactions work).
|
|
10
|
+
*/
|
|
11
|
+
export class EstuarineView extends GfxElementModelView<EstuarineElementModel> {
|
|
12
|
+
static override type: string = 'estuarine';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Resize gating: the resize handles are hidden unless `model.resizeEnabled` is
|
|
17
|
+
* true (toggled from the toolbar). Moving / selecting stays available.
|
|
18
|
+
*/
|
|
19
|
+
export const EstuarineInteraction = GfxViewInteractionExtension<EstuarineView>(
|
|
20
|
+
EstuarineView.type,
|
|
21
|
+
{
|
|
22
|
+
handleResize({ model }) {
|
|
23
|
+
return {
|
|
24
|
+
beforeResize({ set }) {
|
|
25
|
+
if (!model.resizeEnabled) {
|
|
26
|
+
set({ allowedHandlers: [] });
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { EdgelessCRUDIdentifier } from '@formicoidea/labre-core/blocks/surface';
|
|
2
|
+
import { EstuarineElementModel } from '@formicoidea/labre-core/model';
|
|
3
|
+
import {
|
|
4
|
+
type ToolbarContext,
|
|
5
|
+
type ToolbarModuleConfig,
|
|
6
|
+
ToolbarModuleExtension,
|
|
7
|
+
} from '@formicoidea/labre-core/shared/services';
|
|
8
|
+
import { BlockFlavourIdentifier } from '@formicoidea/labre-core/std';
|
|
9
|
+
import { html, type TemplateResult } from 'lit';
|
|
10
|
+
|
|
11
|
+
const ResizeIcon = html`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M9 5H5v4M15 19h4v-4" /><path d="M5 5l6 6M19 19l-6-6" /></svg>`;
|
|
12
|
+
// All curve icons use currentColor so the toolbar can grey them when inactive;
|
|
13
|
+
// they are distinguished by shape (wave / arc / hooked curve).
|
|
14
|
+
const LiminalIcon = html`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 13c3-6 6 4 9 0s6-6 9 0" /></svg>`;
|
|
15
|
+
const VolatileIcon = html`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M7 4a9 9 0 0 1 0 18" /></svg>`;
|
|
16
|
+
const CounterfactualIcon = html`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 7c7 0 11 4 12 14" /></svg>`;
|
|
17
|
+
const AxisIcon = html`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3v18M6 12h15" /><path d="M3 6l3-3 3 3M18 9l3 3-3 3" /></svg>`;
|
|
18
|
+
|
|
19
|
+
type EstuarineToggleProp =
|
|
20
|
+
| 'resizeEnabled'
|
|
21
|
+
| 'showLiminal'
|
|
22
|
+
| 'showVolatile'
|
|
23
|
+
| 'showCounterfactual'
|
|
24
|
+
| 'showAxisLabels';
|
|
25
|
+
|
|
26
|
+
function booleanToggle(
|
|
27
|
+
id: string,
|
|
28
|
+
tooltip: string,
|
|
29
|
+
icon: TemplateResult,
|
|
30
|
+
prop: EstuarineToggleProp
|
|
31
|
+
) {
|
|
32
|
+
return {
|
|
33
|
+
id,
|
|
34
|
+
tooltip,
|
|
35
|
+
icon,
|
|
36
|
+
active(ctx: ToolbarContext) {
|
|
37
|
+
const models = ctx.getSurfaceModelsByType(EstuarineElementModel);
|
|
38
|
+
return models.length > 0 && models.every(model => model[prop]);
|
|
39
|
+
},
|
|
40
|
+
run(ctx: ToolbarContext) {
|
|
41
|
+
const models = ctx.getSurfaceModelsByType(EstuarineElementModel);
|
|
42
|
+
if (!models.length) return;
|
|
43
|
+
const enable = !models.every(model => model[prop]);
|
|
44
|
+
ctx.std.store.captureSync();
|
|
45
|
+
const crud = ctx.std.get(EdgelessCRUDIdentifier);
|
|
46
|
+
for (const model of models) crud.updateElement(model.id, { [prop]: enable });
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const estuarineToolbarConfig = {
|
|
52
|
+
actions: [
|
|
53
|
+
booleanToggle('a.toggle-resize', 'Enable / lock resizing', ResizeIcon, 'resizeEnabled'),
|
|
54
|
+
booleanToggle('b.toggle-liminal', 'Show / hide the Liminal line', LiminalIcon, 'showLiminal'),
|
|
55
|
+
booleanToggle('c.toggle-volatile', 'Show / hide the Volatile line', VolatileIcon, 'showVolatile'),
|
|
56
|
+
booleanToggle('d.toggle-counterfactual', 'Show / hide the Counter-factual line', CounterfactualIcon, 'showCounterfactual'),
|
|
57
|
+
booleanToggle('e.toggle-axis-labels', 'Show / hide axis labels (e / t)', AxisIcon, 'showAxisLabels'),
|
|
58
|
+
],
|
|
59
|
+
when: ctx => ctx.getSurfaceModelsByType(EstuarineElementModel).length > 0,
|
|
60
|
+
} as const satisfies ToolbarModuleConfig;
|
|
61
|
+
|
|
62
|
+
export const estuarineToolbarExtension = ToolbarModuleExtension({
|
|
63
|
+
id: BlockFlavourIdentifier('affine:surface:estuarine'),
|
|
64
|
+
config: estuarineToolbarConfig,
|
|
65
|
+
});
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeTemplateSnapshot,
|
|
3
|
+
type SurfaceElementsJSON,
|
|
4
|
+
surfaceText,
|
|
5
|
+
type Template,
|
|
6
|
+
type TemplateCategory,
|
|
7
|
+
} from '@formicoidea/labre-core/gfx/template';
|
|
8
|
+
import { FontFamily, ShapeStyle, TextAlign } from '@formicoidea/labre-core/model';
|
|
9
|
+
|
|
10
|
+
import { REF_H as CYN_H, REF_W as CYN_W } from '../cynefin/consts';
|
|
11
|
+
import { REF_H as EST_H, REF_W as EST_W } from '../estuarine/consts';
|
|
12
|
+
|
|
13
|
+
const HEX_SIZE = 60;
|
|
14
|
+
const HEX_FILL = '#34c724';
|
|
15
|
+
const HEX_STROKE = '#1f1f1f';
|
|
16
|
+
const HEX_VERTICES = [
|
|
17
|
+
[1, 0.5],
|
|
18
|
+
[0.75, 0.933],
|
|
19
|
+
[0.25, 0.933],
|
|
20
|
+
[0, 0.5],
|
|
21
|
+
[0.25, 0.067],
|
|
22
|
+
[0.75, 0.067],
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
function sticky(x: number, y: number, text: string) {
|
|
26
|
+
return {
|
|
27
|
+
type: 'shape',
|
|
28
|
+
shapeType: 'rect',
|
|
29
|
+
filled: true,
|
|
30
|
+
fillColor: '#fff3b0',
|
|
31
|
+
strokeColor: '#d9b740',
|
|
32
|
+
strokeWidth: 1.5,
|
|
33
|
+
shapeStyle: ShapeStyle.General,
|
|
34
|
+
roughness: 0,
|
|
35
|
+
radius: 8,
|
|
36
|
+
text: surfaceText(text),
|
|
37
|
+
color: '#1a1a1a',
|
|
38
|
+
fontFamily: FontFamily.Inter,
|
|
39
|
+
fontSize: 18,
|
|
40
|
+
textAlign: TextAlign.Center,
|
|
41
|
+
xywh: `[${x},${y},200,70]`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function hexagon(x: number, y: number) {
|
|
46
|
+
return {
|
|
47
|
+
type: 'shape',
|
|
48
|
+
shapeType: 'polygon',
|
|
49
|
+
vertices: HEX_VERTICES,
|
|
50
|
+
filled: true,
|
|
51
|
+
fillColor: HEX_FILL,
|
|
52
|
+
strokeColor: HEX_STROKE,
|
|
53
|
+
strokeWidth: 2,
|
|
54
|
+
shapeStyle: ShapeStyle.General,
|
|
55
|
+
roughness: 0,
|
|
56
|
+
xywh: `[${x},${y},${HEX_SIZE},${HEX_SIZE}]`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function caption(x: number, y: number, str: string) {
|
|
61
|
+
return {
|
|
62
|
+
type: 'text',
|
|
63
|
+
text: surfaceText(str),
|
|
64
|
+
color: '#1a1a1a',
|
|
65
|
+
fontFamily: FontFamily.Inter,
|
|
66
|
+
fontSize: 16,
|
|
67
|
+
textAlign: TextAlign.Center,
|
|
68
|
+
xywh: `[${x},${y},120,24]`,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function tpl(name: string, preview: string, elements: SurfaceElementsJSON): Template {
|
|
73
|
+
return { name, type: 'template', preview, content: makeTemplateSnapshot(elements, name) };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const ATTRS = 'width="100%" height="100%" viewBox="0 0 135 80" xmlns="http://www.w3.org/2000/svg"';
|
|
77
|
+
|
|
78
|
+
const cynefinBg = (xywh: string) => ({ type: 'cynefin', xywh });
|
|
79
|
+
const estuarineBg = (xywh: string) => ({ type: 'estuarine', xywh });
|
|
80
|
+
|
|
81
|
+
export const cynefinTemplateCategory: TemplateCategory = {
|
|
82
|
+
name: 'Cynefin',
|
|
83
|
+
templates: [
|
|
84
|
+
tpl(
|
|
85
|
+
'Decision sorting',
|
|
86
|
+
`<svg ${ATTRS} fill="none"><rect x="8" y="10" width="119" height="60" rx="4" stroke="#2a9d99" stroke-width="1.5"/><path d="M67 10 V70 M8 40 H127" stroke="#9aa0a6"/><rect x="18" y="18" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="83" y="18" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="18" y="48" width="34" height="14" rx="2" fill="#fff3b0"/><rect x="83" y="48" width="34" height="14" rx="2" fill="#fff3b0"/></svg>`,
|
|
87
|
+
{
|
|
88
|
+
bg: cynefinBg(`[0,0,${CYN_W},${CYN_H}]`),
|
|
89
|
+
s1: sticky(190, 175, 'Probe & learn'),
|
|
90
|
+
s2: sticky(690, 175, 'Expert analysis'),
|
|
91
|
+
s3: sticky(190, 505, 'Act now'),
|
|
92
|
+
s4: sticky(690, 505, 'Known issue'),
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
tpl(
|
|
96
|
+
'Cynefin framework',
|
|
97
|
+
`<svg ${ATTRS} fill="none"><rect x="14" y="12" width="107" height="56" rx="4" stroke="#2a9d99" stroke-width="1.6"/><path d="M67 12 V68 M14 40 H121" stroke="#9aa0a6"/></svg>`,
|
|
98
|
+
{ bg: cynefinBg(`[0,0,${CYN_W},${CYN_H}]`) }
|
|
99
|
+
),
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const estuarineTemplateCategory: TemplateCategory = {
|
|
104
|
+
name: 'Estuarine',
|
|
105
|
+
templates: [
|
|
106
|
+
tpl(
|
|
107
|
+
'Constraint map',
|
|
108
|
+
`<svg ${ATTRS} fill="none"><path d="M20 12 V70 M20 70 H120" stroke="#941253" stroke-width="2"/><g fill="#34c724" stroke="#1f1f1f"><path d="M44 28 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/><path d="M74 40 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/><path d="M56 52 l6 4 l0 8 l-6 4 l-6 -4 l0 -8 z"/></g></svg>`,
|
|
109
|
+
{
|
|
110
|
+
bg: estuarineBg(`[0,0,${EST_W},${EST_H}]`),
|
|
111
|
+
h1: hexagon(150, 220),
|
|
112
|
+
c1: caption(120, 284, 'Policy'),
|
|
113
|
+
h2: hexagon(330, 360),
|
|
114
|
+
c2: caption(300, 424, 'Habit'),
|
|
115
|
+
h3: hexagon(230, 520),
|
|
116
|
+
c3: caption(200, 584, 'Budget'),
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
tpl(
|
|
120
|
+
'Estuarine map',
|
|
121
|
+
`<svg ${ATTRS} fill="none"><path d="M24 10 V70 M24 70 H120" stroke="#941253" stroke-width="2.4"/><path d="M30 52 q40 -30 84 -34" stroke="#5ecc44" stroke-width="2" fill="none"/></svg>`,
|
|
122
|
+
{ bg: estuarineBg(`[0,0,${EST_W},${EST_H}]`) }
|
|
123
|
+
),
|
|
124
|
+
tpl(
|
|
125
|
+
'Hexagon constraint',
|
|
126
|
+
`<svg ${ATTRS} fill="none"><path d="M67 24 l18 11 l0 22 l-18 11 l-18 -11 l0 -22 z" fill="#34c724" stroke="#1f1f1f" stroke-width="2"/></svg>`,
|
|
127
|
+
{ hex: hexagon(0, 0) }
|
|
128
|
+
),
|
|
129
|
+
],
|
|
130
|
+
};
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { svg } from 'lit';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { svg } from 'lit';
|
|
2
|
+
|
|
3
|
+
/** Colored Cynefin glyph for the main toolbar button. */
|
|
4
|
+
export const cynefinToolbarIcon = svg`<svg width="100%" height="100%" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
5
|
<g stroke="#3f444a" stroke-width="3" stroke-linecap="round">
|
|
5
6
|
<path d="M30 8 C28 18 33 24 26 30 C20 35 14 33 9 33"/>
|
|
6
7
|
<path d="M26 30 C28 40 28 46 28 50"/>
|
|
7
8
|
<path d="M34 22 C40 23 46 24 50 25" stroke-dasharray="3 3"/>
|
|
8
9
|
</g>
|
|
9
10
|
<g stroke="#3f444a" stroke-width="1.4"><path d="M22 33 l-2 4M24 38 l-2 5M26 43 l-2 5"/></g>
|
|
10
|
-
</svg>`;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
</svg>`;
|
|
12
|
+
|
|
13
|
+
/** Menu icon — create the Cynefin diagram. */
|
|
14
|
+
export const cynefinMenuIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
13
15
|
<path d="M13 3 C12 8 14 11 11 13 C8 15 5 14 3 14" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
|
14
16
|
<path d="M11 13 C12 18 12 20 12 22" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
|
15
17
|
<path d="M15 10 C18 10.5 20 11 22 11.5" stroke="currentColor" stroke-width="1.6" stroke-dasharray="2.5 2.5" stroke-linecap="round"/>
|
|
16
|
-
</svg>`;
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
</svg>`;
|
|
19
|
+
|
|
20
|
+
/** Menu icon — create the Estuarine map. */
|
|
21
|
+
export const estuarineMenuIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
22
|
<path d="M5 3 V20 M5 17 H21" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
|
20
23
|
<path d="M3 6 l2-2 2 2 M3 17 l2 2 2 -2 M18 15 l3 2 -3 2" stroke="currentColor" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
|
|
21
24
|
<path d="M6 10 C11 6 14 13 21 9" stroke="currentColor" stroke-width="1.4" fill="none" stroke-linecap="round"/>
|
|
22
|
-
</svg>`;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
</svg>`;
|
|
26
|
+
|
|
27
|
+
/** Menu icon — hexagon constraint node. */
|
|
28
|
+
export const hexagonMenuIcon = svg`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
25
29
|
<polygon points="21,12 16.5,19.8 7.5,19.8 3,12 7.5,4.2 16.5,4.2" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
|
|
26
|
-
</svg>`;
|
|
27
|
-
//# sourceMappingURL=icons.js.map
|
|
30
|
+
</svg>`;
|