spyret 0.1.0 → 0.2.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 +78 -22
- package/THIRD_PARTY_NOTICES.txt +28 -1
- package/dist/spyret-browser.amd.js +61 -0
- package/dist/spyret-browser.d.mts +272 -0
- package/dist/spyret-browser.d.ts +272 -0
- package/dist/spyret-browser.global.js +57 -0
- package/dist/spyret-browser.js +57 -0
- package/dist/spyret-browser.mjs +57 -0
- package/dist/spyret.d.mts +29 -1
- package/dist/spyret.d.ts +29 -1
- package/dist/spyret.global.js +12 -6
- package/dist/spyret.js +12 -6
- package/dist/spyret.mjs +12 -6
- package/dist/spyret.pyret.js +66 -0
- package/docs/BROWSER_LIBRARY.md +97 -0
- package/docs/IDE_MIGRATION.md +38 -0
- package/docs/PYRET_CAPTURE.md +4 -2
- package/docs/RELEASING.md +18 -61
- package/docs/SPYTIAL_HOOKS.md +73 -0
- package/docs/SPYTIAL_RULES_REFERENCE.md +51 -0
- package/package.json +29 -8
- package/pyret/spytial.arr +527 -0
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
# Generated by scripts/generate-spytial.mjs; do not edit.
|
|
2
|
+
# Core 6.3.2; language 2026-09-18.
|
|
3
|
+
provide *
|
|
4
|
+
provide-types *
|
|
5
|
+
import option as O
|
|
6
|
+
import lists as L
|
|
7
|
+
|
|
8
|
+
data TextSize:
|
|
9
|
+
| text-size-small
|
|
10
|
+
| text-size-normal
|
|
11
|
+
| text-size-large
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
data LinePattern:
|
|
15
|
+
| line-pattern-solid
|
|
16
|
+
| line-pattern-dashed
|
|
17
|
+
| line-pattern-dotted
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
data IconPlacement:
|
|
21
|
+
| icon-placement-full
|
|
22
|
+
| icon-placement-badge
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
data Direction:
|
|
26
|
+
| direction-above
|
|
27
|
+
| direction-below
|
|
28
|
+
| direction-left
|
|
29
|
+
| direction-right
|
|
30
|
+
| direction-directly-above
|
|
31
|
+
| direction-directly-below
|
|
32
|
+
| direction-directly-left
|
|
33
|
+
| direction-directly-right
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
data Hold:
|
|
37
|
+
| hold-always
|
|
38
|
+
| hold-never
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
data Rotation:
|
|
42
|
+
| rotation-clockwise
|
|
43
|
+
| rotation-counterclockwise
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
data Alignment:
|
|
47
|
+
| alignment-horizontal
|
|
48
|
+
| alignment-vertical
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
data GroupEdgeDirection:
|
|
52
|
+
| group-edge-direction-none
|
|
53
|
+
| group-edge-direction-togroup
|
|
54
|
+
| group-edge-direction-fromgroup
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
data LayoutFlag:
|
|
58
|
+
| layout-flag-hide-disconnected
|
|
59
|
+
| layout-flag-hide-disconnected-built-ins
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
data TextStyle:
|
|
63
|
+
| text-style(size :: O.Option<TextSize>, color :: O.Option<String>) with:
|
|
64
|
+
method with-size(self, new-value :: TextSize) -> TextStyle:
|
|
65
|
+
text-style(O.some(new-value), self.color)
|
|
66
|
+
end,
|
|
67
|
+
method with-color(self, new-value :: String) -> TextStyle:
|
|
68
|
+
text-style(self.size, O.some(new-value))
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
default-text-style = text-style(O.none, O.none)
|
|
72
|
+
|
|
73
|
+
data LineStyle:
|
|
74
|
+
| line-style(color :: O.Option<String>, pattern :: O.Option<LinePattern>, weight :: O.Option<Number>, highlight :: O.Option<String>) with:
|
|
75
|
+
method with-color(self, new-value :: String) -> LineStyle:
|
|
76
|
+
line-style(O.some(new-value), self.pattern, self.weight, self.highlight)
|
|
77
|
+
end,
|
|
78
|
+
method with-pattern(self, new-value :: LinePattern) -> LineStyle:
|
|
79
|
+
line-style(self.color, O.some(new-value), self.weight, self.highlight)
|
|
80
|
+
end,
|
|
81
|
+
method with-weight(self, new-value :: Number) -> LineStyle:
|
|
82
|
+
line-style(self.color, self.pattern, O.some(new-value), self.highlight)
|
|
83
|
+
end,
|
|
84
|
+
method with-highlight(self, new-value :: String) -> LineStyle:
|
|
85
|
+
line-style(self.color, self.pattern, self.weight, O.some(new-value))
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
default-line-style = line-style(O.none, O.none, O.none, O.none)
|
|
89
|
+
|
|
90
|
+
data FillStyle:
|
|
91
|
+
| fill-style(color :: O.Option<String>) with:
|
|
92
|
+
method with-color(self, new-value :: String) -> FillStyle:
|
|
93
|
+
fill-style(O.some(new-value))
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
default-fill-style = fill-style(O.none)
|
|
97
|
+
|
|
98
|
+
data BorderStyle:
|
|
99
|
+
| border-style(color :: O.Option<String>, width :: O.Option<Number>) with:
|
|
100
|
+
method with-color(self, new-value :: String) -> BorderStyle:
|
|
101
|
+
border-style(O.some(new-value), self.width)
|
|
102
|
+
end,
|
|
103
|
+
method with-width(self, new-value :: Number) -> BorderStyle:
|
|
104
|
+
border-style(self.color, O.some(new-value))
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
default-border-style = border-style(O.none, O.none)
|
|
108
|
+
|
|
109
|
+
data IconStyle:
|
|
110
|
+
| icon-style(path :: O.Option<String>, placement :: O.Option<IconPlacement>, opacity :: O.Option<Number>) with:
|
|
111
|
+
method with-path(self, new-value :: String) -> IconStyle:
|
|
112
|
+
icon-style(O.some(new-value), self.placement, self.opacity)
|
|
113
|
+
end,
|
|
114
|
+
method with-placement(self, new-value :: IconPlacement) -> IconStyle:
|
|
115
|
+
icon-style(self.path, O.some(new-value), self.opacity)
|
|
116
|
+
end,
|
|
117
|
+
method with-opacity(self, new-value :: Number) -> IconStyle:
|
|
118
|
+
icon-style(self.path, self.placement, O.some(new-value))
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
default-icon-style = icon-style(O.none, O.none, O.none)
|
|
122
|
+
|
|
123
|
+
data RuleSource:
|
|
124
|
+
| rule-source(text :: String, location :: O.Option<String>) with:
|
|
125
|
+
method with-text(self, new-value :: String) -> RuleSource:
|
|
126
|
+
rule-source(new-value, self.location)
|
|
127
|
+
end,
|
|
128
|
+
method with-location(self, new-value :: String) -> RuleSource:
|
|
129
|
+
rule-source(self.text, O.some(new-value))
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
data GroupAddEdge:
|
|
134
|
+
| group-add-edge(points :: O.Option<GroupEdgeDirection>, line-style :: O.Option<LineStyle>, text-style :: O.Option<TextStyle>) with:
|
|
135
|
+
method with-points(self, new-value :: GroupEdgeDirection) -> GroupAddEdge:
|
|
136
|
+
group-add-edge(O.some(new-value), self.line-style, self.text-style)
|
|
137
|
+
end,
|
|
138
|
+
method with-line-style(self, new-value :: LineStyle) -> GroupAddEdge:
|
|
139
|
+
group-add-edge(self.points, O.some(new-value), self.text-style)
|
|
140
|
+
end,
|
|
141
|
+
method with-text-style(self, new-value :: TextStyle) -> GroupAddEdge:
|
|
142
|
+
group-add-edge(self.points, self.line-style, O.some(new-value))
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
default-group-add-edge = group-add-edge(O.none, O.none, O.none)
|
|
146
|
+
|
|
147
|
+
data OrientationOptions:
|
|
148
|
+
| orientation-options(hold :: O.Option<Hold>, source :: O.Option<RuleSource>) with:
|
|
149
|
+
method with-hold(self, new-value :: Hold) -> OrientationOptions:
|
|
150
|
+
orientation-options(O.some(new-value), self.source)
|
|
151
|
+
end,
|
|
152
|
+
method with-source(self, new-value :: RuleSource) -> OrientationOptions:
|
|
153
|
+
orientation-options(self.hold, O.some(new-value))
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
default-orientation-options = orientation-options(O.none, O.none)
|
|
157
|
+
|
|
158
|
+
data CyclicOptions:
|
|
159
|
+
| cyclic-options(direction :: O.Option<Rotation>, hold :: O.Option<Hold>, source :: O.Option<RuleSource>) with:
|
|
160
|
+
method with-direction(self, new-value :: Rotation) -> CyclicOptions:
|
|
161
|
+
cyclic-options(O.some(new-value), self.hold, self.source)
|
|
162
|
+
end,
|
|
163
|
+
method with-hold(self, new-value :: Hold) -> CyclicOptions:
|
|
164
|
+
cyclic-options(self.direction, O.some(new-value), self.source)
|
|
165
|
+
end,
|
|
166
|
+
method with-source(self, new-value :: RuleSource) -> CyclicOptions:
|
|
167
|
+
cyclic-options(self.direction, self.hold, O.some(new-value))
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
default-cyclic-options = cyclic-options(O.none, O.none, O.none)
|
|
171
|
+
|
|
172
|
+
data AlignOptions:
|
|
173
|
+
| align-options(hold :: O.Option<Hold>, source :: O.Option<RuleSource>) with:
|
|
174
|
+
method with-hold(self, new-value :: Hold) -> AlignOptions:
|
|
175
|
+
align-options(O.some(new-value), self.source)
|
|
176
|
+
end,
|
|
177
|
+
method with-source(self, new-value :: RuleSource) -> AlignOptions:
|
|
178
|
+
align-options(self.hold, O.some(new-value))
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
default-align-options = align-options(O.none, O.none)
|
|
182
|
+
|
|
183
|
+
data GroupOptions:
|
|
184
|
+
| group-options(add-edge :: O.Option<GroupAddEdge>, show-label :: O.Option<Boolean>, text-style :: O.Option<TextStyle>, hold :: O.Option<Hold>, source :: O.Option<RuleSource>) with:
|
|
185
|
+
method with-add-edge(self, new-value :: GroupAddEdge) -> GroupOptions:
|
|
186
|
+
group-options(O.some(new-value), self.show-label, self.text-style, self.hold, self.source)
|
|
187
|
+
end,
|
|
188
|
+
method with-show-label(self, new-value :: Boolean) -> GroupOptions:
|
|
189
|
+
group-options(self.add-edge, O.some(new-value), self.text-style, self.hold, self.source)
|
|
190
|
+
end,
|
|
191
|
+
method with-text-style(self, new-value :: TextStyle) -> GroupOptions:
|
|
192
|
+
group-options(self.add-edge, self.show-label, O.some(new-value), self.hold, self.source)
|
|
193
|
+
end,
|
|
194
|
+
method with-hold(self, new-value :: Hold) -> GroupOptions:
|
|
195
|
+
group-options(self.add-edge, self.show-label, self.text-style, O.some(new-value), self.source)
|
|
196
|
+
end,
|
|
197
|
+
method with-source(self, new-value :: RuleSource) -> GroupOptions:
|
|
198
|
+
group-options(self.add-edge, self.show-label, self.text-style, self.hold, O.some(new-value))
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
default-group-options = group-options(O.none, O.none, O.none, O.none, O.none)
|
|
202
|
+
|
|
203
|
+
data SizeOptions:
|
|
204
|
+
| size-options(selector :: O.Option<String>, source :: O.Option<RuleSource>) with:
|
|
205
|
+
method with-selector(self, new-value :: String) -> SizeOptions:
|
|
206
|
+
size-options(O.some(new-value), self.source)
|
|
207
|
+
end,
|
|
208
|
+
method with-source(self, new-value :: RuleSource) -> SizeOptions:
|
|
209
|
+
size-options(self.selector, O.some(new-value))
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
default-size-options = size-options(O.none, O.none)
|
|
213
|
+
|
|
214
|
+
data HideAtomOptions:
|
|
215
|
+
| hide-atom-options(source :: O.Option<RuleSource>) with:
|
|
216
|
+
method with-source(self, new-value :: RuleSource) -> HideAtomOptions:
|
|
217
|
+
hide-atom-options(O.some(new-value))
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
default-hide-atom-options = hide-atom-options(O.none)
|
|
221
|
+
|
|
222
|
+
data AtomStyleOptions:
|
|
223
|
+
| atom-style-options(selector :: O.Option<String>, fill-style :: O.Option<FillStyle>, border-style :: O.Option<BorderStyle>, icon-style :: O.Option<IconStyle>, text-style :: O.Option<TextStyle>, show-label :: O.Option<Boolean>, source :: O.Option<RuleSource>) with:
|
|
224
|
+
method with-selector(self, new-value :: String) -> AtomStyleOptions:
|
|
225
|
+
atom-style-options(O.some(new-value), self.fill-style, self.border-style, self.icon-style, self.text-style, self.show-label, self.source)
|
|
226
|
+
end,
|
|
227
|
+
method with-fill-style(self, new-value :: FillStyle) -> AtomStyleOptions:
|
|
228
|
+
atom-style-options(self.selector, O.some(new-value), self.border-style, self.icon-style, self.text-style, self.show-label, self.source)
|
|
229
|
+
end,
|
|
230
|
+
method with-border-style(self, new-value :: BorderStyle) -> AtomStyleOptions:
|
|
231
|
+
atom-style-options(self.selector, self.fill-style, O.some(new-value), self.icon-style, self.text-style, self.show-label, self.source)
|
|
232
|
+
end,
|
|
233
|
+
method with-icon-style(self, new-value :: IconStyle) -> AtomStyleOptions:
|
|
234
|
+
atom-style-options(self.selector, self.fill-style, self.border-style, O.some(new-value), self.text-style, self.show-label, self.source)
|
|
235
|
+
end,
|
|
236
|
+
method with-text-style(self, new-value :: TextStyle) -> AtomStyleOptions:
|
|
237
|
+
atom-style-options(self.selector, self.fill-style, self.border-style, self.icon-style, O.some(new-value), self.show-label, self.source)
|
|
238
|
+
end,
|
|
239
|
+
method with-show-label(self, new-value :: Boolean) -> AtomStyleOptions:
|
|
240
|
+
atom-style-options(self.selector, self.fill-style, self.border-style, self.icon-style, self.text-style, O.some(new-value), self.source)
|
|
241
|
+
end,
|
|
242
|
+
method with-source(self, new-value :: RuleSource) -> AtomStyleOptions:
|
|
243
|
+
atom-style-options(self.selector, self.fill-style, self.border-style, self.icon-style, self.text-style, self.show-label, O.some(new-value))
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
default-atom-style-options = atom-style-options(O.none, O.none, O.none, O.none, O.none, O.none, O.none)
|
|
247
|
+
|
|
248
|
+
data EdgeStyleOptions:
|
|
249
|
+
| edge-style-options(selector :: O.Option<String>, filter :: O.Option<String>, line-style :: O.Option<LineStyle>, text-style :: O.Option<TextStyle>, show-label :: O.Option<Boolean>, hidden :: O.Option<Boolean>, source :: O.Option<RuleSource>) with:
|
|
250
|
+
method with-selector(self, new-value :: String) -> EdgeStyleOptions:
|
|
251
|
+
edge-style-options(O.some(new-value), self.filter, self.line-style, self.text-style, self.show-label, self.hidden, self.source)
|
|
252
|
+
end,
|
|
253
|
+
method with-filter(self, new-value :: String) -> EdgeStyleOptions:
|
|
254
|
+
edge-style-options(self.selector, O.some(new-value), self.line-style, self.text-style, self.show-label, self.hidden, self.source)
|
|
255
|
+
end,
|
|
256
|
+
method with-line-style(self, new-value :: LineStyle) -> EdgeStyleOptions:
|
|
257
|
+
edge-style-options(self.selector, self.filter, O.some(new-value), self.text-style, self.show-label, self.hidden, self.source)
|
|
258
|
+
end,
|
|
259
|
+
method with-text-style(self, new-value :: TextStyle) -> EdgeStyleOptions:
|
|
260
|
+
edge-style-options(self.selector, self.filter, self.line-style, O.some(new-value), self.show-label, self.hidden, self.source)
|
|
261
|
+
end,
|
|
262
|
+
method with-show-label(self, new-value :: Boolean) -> EdgeStyleOptions:
|
|
263
|
+
edge-style-options(self.selector, self.filter, self.line-style, self.text-style, O.some(new-value), self.hidden, self.source)
|
|
264
|
+
end,
|
|
265
|
+
method with-hidden(self, new-value :: Boolean) -> EdgeStyleOptions:
|
|
266
|
+
edge-style-options(self.selector, self.filter, self.line-style, self.text-style, self.show-label, O.some(new-value), self.source)
|
|
267
|
+
end,
|
|
268
|
+
method with-source(self, new-value :: RuleSource) -> EdgeStyleOptions:
|
|
269
|
+
edge-style-options(self.selector, self.filter, self.line-style, self.text-style, self.show-label, self.hidden, O.some(new-value))
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
default-edge-style-options = edge-style-options(O.none, O.none, O.none, O.none, O.none, O.none, O.none)
|
|
273
|
+
|
|
274
|
+
data AttributeOptions:
|
|
275
|
+
| attribute-options(selector :: O.Option<String>, filter :: O.Option<String>, text-style :: O.Option<TextStyle>, source :: O.Option<RuleSource>) with:
|
|
276
|
+
method with-selector(self, new-value :: String) -> AttributeOptions:
|
|
277
|
+
attribute-options(O.some(new-value), self.filter, self.text-style, self.source)
|
|
278
|
+
end,
|
|
279
|
+
method with-filter(self, new-value :: String) -> AttributeOptions:
|
|
280
|
+
attribute-options(self.selector, O.some(new-value), self.text-style, self.source)
|
|
281
|
+
end,
|
|
282
|
+
method with-text-style(self, new-value :: TextStyle) -> AttributeOptions:
|
|
283
|
+
attribute-options(self.selector, self.filter, O.some(new-value), self.source)
|
|
284
|
+
end,
|
|
285
|
+
method with-source(self, new-value :: RuleSource) -> AttributeOptions:
|
|
286
|
+
attribute-options(self.selector, self.filter, self.text-style, O.some(new-value))
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
default-attribute-options = attribute-options(O.none, O.none, O.none, O.none)
|
|
290
|
+
|
|
291
|
+
data TagOptions:
|
|
292
|
+
| tag-options(text-style :: O.Option<TextStyle>, source :: O.Option<RuleSource>) with:
|
|
293
|
+
method with-text-style(self, new-value :: TextStyle) -> TagOptions:
|
|
294
|
+
tag-options(O.some(new-value), self.source)
|
|
295
|
+
end,
|
|
296
|
+
method with-source(self, new-value :: RuleSource) -> TagOptions:
|
|
297
|
+
tag-options(self.text-style, O.some(new-value))
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
default-tag-options = tag-options(O.none, O.none)
|
|
301
|
+
|
|
302
|
+
data HideFieldOptions:
|
|
303
|
+
| hide-field-options(selector :: O.Option<String>, filter :: O.Option<String>, source :: O.Option<RuleSource>) with:
|
|
304
|
+
method with-selector(self, new-value :: String) -> HideFieldOptions:
|
|
305
|
+
hide-field-options(O.some(new-value), self.filter, self.source)
|
|
306
|
+
end,
|
|
307
|
+
method with-filter(self, new-value :: String) -> HideFieldOptions:
|
|
308
|
+
hide-field-options(self.selector, O.some(new-value), self.source)
|
|
309
|
+
end,
|
|
310
|
+
method with-source(self, new-value :: RuleSource) -> HideFieldOptions:
|
|
311
|
+
hide-field-options(self.selector, self.filter, O.some(new-value))
|
|
312
|
+
end
|
|
313
|
+
end
|
|
314
|
+
default-hide-field-options = hide-field-options(O.none, O.none, O.none)
|
|
315
|
+
|
|
316
|
+
data InferredEdgeOptions:
|
|
317
|
+
| inferred-edge-options(draw :: O.Option<String>, line-style :: O.Option<LineStyle>, text-style :: O.Option<TextStyle>, color :: O.Option<String>, style :: O.Option<LinePattern>, weight :: O.Option<Number>, highlight :: O.Option<String>, source :: O.Option<RuleSource>) with:
|
|
318
|
+
method with-draw(self, new-value :: String) -> InferredEdgeOptions:
|
|
319
|
+
inferred-edge-options(O.some(new-value), self.line-style, self.text-style, self.color, self.style, self.weight, self.highlight, self.source)
|
|
320
|
+
end,
|
|
321
|
+
method with-line-style(self, new-value :: LineStyle) -> InferredEdgeOptions:
|
|
322
|
+
inferred-edge-options(self.draw, O.some(new-value), self.text-style, self.color, self.style, self.weight, self.highlight, self.source)
|
|
323
|
+
end,
|
|
324
|
+
method with-text-style(self, new-value :: TextStyle) -> InferredEdgeOptions:
|
|
325
|
+
inferred-edge-options(self.draw, self.line-style, O.some(new-value), self.color, self.style, self.weight, self.highlight, self.source)
|
|
326
|
+
end,
|
|
327
|
+
method with-color(self, new-value :: String) -> InferredEdgeOptions:
|
|
328
|
+
inferred-edge-options(self.draw, self.line-style, self.text-style, O.some(new-value), self.style, self.weight, self.highlight, self.source)
|
|
329
|
+
end,
|
|
330
|
+
method with-style(self, new-value :: LinePattern) -> InferredEdgeOptions:
|
|
331
|
+
inferred-edge-options(self.draw, self.line-style, self.text-style, self.color, O.some(new-value), self.weight, self.highlight, self.source)
|
|
332
|
+
end,
|
|
333
|
+
method with-weight(self, new-value :: Number) -> InferredEdgeOptions:
|
|
334
|
+
inferred-edge-options(self.draw, self.line-style, self.text-style, self.color, self.style, O.some(new-value), self.highlight, self.source)
|
|
335
|
+
end,
|
|
336
|
+
method with-highlight(self, new-value :: String) -> InferredEdgeOptions:
|
|
337
|
+
inferred-edge-options(self.draw, self.line-style, self.text-style, self.color, self.style, self.weight, O.some(new-value), self.source)
|
|
338
|
+
end,
|
|
339
|
+
method with-source(self, new-value :: RuleSource) -> InferredEdgeOptions:
|
|
340
|
+
inferred-edge-options(self.draw, self.line-style, self.text-style, self.color, self.style, self.weight, self.highlight, O.some(new-value))
|
|
341
|
+
end
|
|
342
|
+
end
|
|
343
|
+
default-inferred-edge-options = inferred-edge-options(O.none, O.none, O.none, O.none, O.none, O.none, O.none, O.none)
|
|
344
|
+
|
|
345
|
+
data IconOptions:
|
|
346
|
+
| icon-options(show-labels :: O.Option<Boolean>, source :: O.Option<RuleSource>) with:
|
|
347
|
+
method with-show-labels(self, new-value :: Boolean) -> IconOptions:
|
|
348
|
+
icon-options(O.some(new-value), self.source)
|
|
349
|
+
end,
|
|
350
|
+
method with-source(self, new-value :: RuleSource) -> IconOptions:
|
|
351
|
+
icon-options(self.show-labels, O.some(new-value))
|
|
352
|
+
end
|
|
353
|
+
end
|
|
354
|
+
default-icon-options = icon-options(O.none, O.none)
|
|
355
|
+
|
|
356
|
+
data AtomColorOptions:
|
|
357
|
+
| atom-color-options(source :: O.Option<RuleSource>) with:
|
|
358
|
+
method with-source(self, new-value :: RuleSource) -> AtomColorOptions:
|
|
359
|
+
atom-color-options(O.some(new-value))
|
|
360
|
+
end
|
|
361
|
+
end
|
|
362
|
+
default-atom-color-options = atom-color-options(O.none)
|
|
363
|
+
|
|
364
|
+
data EdgeColorOptions:
|
|
365
|
+
| edge-color-options(selector :: O.Option<String>, filter :: O.Option<String>, style :: O.Option<LinePattern>, weight :: O.Option<Number>, highlight :: O.Option<String>, show-label :: O.Option<Boolean>, hidden :: O.Option<Boolean>, source :: O.Option<RuleSource>) with:
|
|
366
|
+
method with-selector(self, new-value :: String) -> EdgeColorOptions:
|
|
367
|
+
edge-color-options(O.some(new-value), self.filter, self.style, self.weight, self.highlight, self.show-label, self.hidden, self.source)
|
|
368
|
+
end,
|
|
369
|
+
method with-filter(self, new-value :: String) -> EdgeColorOptions:
|
|
370
|
+
edge-color-options(self.selector, O.some(new-value), self.style, self.weight, self.highlight, self.show-label, self.hidden, self.source)
|
|
371
|
+
end,
|
|
372
|
+
method with-style(self, new-value :: LinePattern) -> EdgeColorOptions:
|
|
373
|
+
edge-color-options(self.selector, self.filter, O.some(new-value), self.weight, self.highlight, self.show-label, self.hidden, self.source)
|
|
374
|
+
end,
|
|
375
|
+
method with-weight(self, new-value :: Number) -> EdgeColorOptions:
|
|
376
|
+
edge-color-options(self.selector, self.filter, self.style, O.some(new-value), self.highlight, self.show-label, self.hidden, self.source)
|
|
377
|
+
end,
|
|
378
|
+
method with-highlight(self, new-value :: String) -> EdgeColorOptions:
|
|
379
|
+
edge-color-options(self.selector, self.filter, self.style, self.weight, O.some(new-value), self.show-label, self.hidden, self.source)
|
|
380
|
+
end,
|
|
381
|
+
method with-show-label(self, new-value :: Boolean) -> EdgeColorOptions:
|
|
382
|
+
edge-color-options(self.selector, self.filter, self.style, self.weight, self.highlight, O.some(new-value), self.hidden, self.source)
|
|
383
|
+
end,
|
|
384
|
+
method with-hidden(self, new-value :: Boolean) -> EdgeColorOptions:
|
|
385
|
+
edge-color-options(self.selector, self.filter, self.style, self.weight, self.highlight, self.show-label, O.some(new-value), self.source)
|
|
386
|
+
end,
|
|
387
|
+
method with-source(self, new-value :: RuleSource) -> EdgeColorOptions:
|
|
388
|
+
edge-color-options(self.selector, self.filter, self.style, self.weight, self.highlight, self.show-label, self.hidden, O.some(new-value))
|
|
389
|
+
end
|
|
390
|
+
end
|
|
391
|
+
default-edge-color-options = edge-color-options(O.none, O.none, O.none, O.none, O.none, O.none, O.none, O.none)
|
|
392
|
+
|
|
393
|
+
data Constraint:
|
|
394
|
+
| spytial-orientation(selector :: String, directions :: L.List<Direction>, options :: OrientationOptions)
|
|
395
|
+
| spytial-cyclic(selector :: String, options :: CyclicOptions)
|
|
396
|
+
| spytial-align(selector :: String, direction :: Alignment, options :: AlignOptions)
|
|
397
|
+
| spytial-group(selector :: String, name :: String, options :: GroupOptions)
|
|
398
|
+
| spytial-size(width :: Number, height :: Number, options :: SizeOptions)
|
|
399
|
+
| spytial-hide-atom(selector :: String, options :: HideAtomOptions)
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
data Directive:
|
|
403
|
+
| spytial-flag(name :: LayoutFlag)
|
|
404
|
+
| spytial-atom-style(options :: AtomStyleOptions)
|
|
405
|
+
| spytial-edge-style(field :: String, options :: EdgeStyleOptions)
|
|
406
|
+
| spytial-attribute(field :: String, options :: AttributeOptions)
|
|
407
|
+
| spytial-tag(to-tag :: String, name :: String, value :: String, options :: TagOptions)
|
|
408
|
+
| spytial-hide-field(field :: String, options :: HideFieldOptions)
|
|
409
|
+
| spytial-inferred-edge(name :: String, selector :: String, options :: InferredEdgeOptions)
|
|
410
|
+
| spytial-icon(selector :: String, path :: String, options :: IconOptions)
|
|
411
|
+
| spytial-atom-color(value :: String, selector :: String, options :: AtomColorOptions)
|
|
412
|
+
| spytial-edge-color(field :: String, value :: String, options :: EdgeColorOptions)
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
data SpytialRule:
|
|
416
|
+
| constraint(value :: Constraint)
|
|
417
|
+
| directive(value :: Directive)
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
fun orientation(selector :: String, directions :: L.List<Direction>) -> SpytialRule:
|
|
421
|
+
constraint(spytial-orientation(selector, directions, default-orientation-options))
|
|
422
|
+
end
|
|
423
|
+
fun orientation-with(selector :: String, directions :: L.List<Direction>, options :: OrientationOptions) -> SpytialRule:
|
|
424
|
+
constraint(spytial-orientation(selector, directions, options))
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
fun cyclic(selector :: String) -> SpytialRule:
|
|
428
|
+
constraint(spytial-cyclic(selector, default-cyclic-options))
|
|
429
|
+
end
|
|
430
|
+
fun cyclic-with(selector :: String, options :: CyclicOptions) -> SpytialRule:
|
|
431
|
+
constraint(spytial-cyclic(selector, options))
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
fun align(selector :: String, direction :: Alignment) -> SpytialRule:
|
|
435
|
+
constraint(spytial-align(selector, direction, default-align-options))
|
|
436
|
+
end
|
|
437
|
+
fun align-with(selector :: String, direction :: Alignment, options :: AlignOptions) -> SpytialRule:
|
|
438
|
+
constraint(spytial-align(selector, direction, options))
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
fun group(selector :: String, name :: String) -> SpytialRule:
|
|
442
|
+
constraint(spytial-group(selector, name, default-group-options))
|
|
443
|
+
end
|
|
444
|
+
fun group-with(selector :: String, name :: String, options :: GroupOptions) -> SpytialRule:
|
|
445
|
+
constraint(spytial-group(selector, name, options))
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
fun size(width :: Number, height :: Number) -> SpytialRule:
|
|
449
|
+
constraint(spytial-size(width, height, default-size-options))
|
|
450
|
+
end
|
|
451
|
+
fun size-with(width :: Number, height :: Number, options :: SizeOptions) -> SpytialRule:
|
|
452
|
+
constraint(spytial-size(width, height, options))
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
fun hide-atom(selector :: String) -> SpytialRule:
|
|
456
|
+
constraint(spytial-hide-atom(selector, default-hide-atom-options))
|
|
457
|
+
end
|
|
458
|
+
fun hide-atom-with(selector :: String, options :: HideAtomOptions) -> SpytialRule:
|
|
459
|
+
constraint(spytial-hide-atom(selector, options))
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
fun flag(name :: LayoutFlag) -> SpytialRule:
|
|
463
|
+
directive(spytial-flag(name))
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
fun atom-style() -> SpytialRule:
|
|
467
|
+
directive(spytial-atom-style(default-atom-style-options))
|
|
468
|
+
end
|
|
469
|
+
fun atom-style-with(options :: AtomStyleOptions) -> SpytialRule:
|
|
470
|
+
directive(spytial-atom-style(options))
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
fun edge-style(field :: String) -> SpytialRule:
|
|
474
|
+
directive(spytial-edge-style(field, default-edge-style-options))
|
|
475
|
+
end
|
|
476
|
+
fun edge-style-with(field :: String, options :: EdgeStyleOptions) -> SpytialRule:
|
|
477
|
+
directive(spytial-edge-style(field, options))
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
fun attribute(field :: String) -> SpytialRule:
|
|
481
|
+
directive(spytial-attribute(field, default-attribute-options))
|
|
482
|
+
end
|
|
483
|
+
fun attribute-with(field :: String, options :: AttributeOptions) -> SpytialRule:
|
|
484
|
+
directive(spytial-attribute(field, options))
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
fun tag(to-tag :: String, name :: String, value :: String) -> SpytialRule:
|
|
488
|
+
directive(spytial-tag(to-tag, name, value, default-tag-options))
|
|
489
|
+
end
|
|
490
|
+
fun tag-with(to-tag :: String, name :: String, value :: String, options :: TagOptions) -> SpytialRule:
|
|
491
|
+
directive(spytial-tag(to-tag, name, value, options))
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
fun hide-field(field :: String) -> SpytialRule:
|
|
495
|
+
directive(spytial-hide-field(field, default-hide-field-options))
|
|
496
|
+
end
|
|
497
|
+
fun hide-field-with(field :: String, options :: HideFieldOptions) -> SpytialRule:
|
|
498
|
+
directive(spytial-hide-field(field, options))
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
fun inferred-edge(name :: String, selector :: String) -> SpytialRule:
|
|
502
|
+
directive(spytial-inferred-edge(name, selector, default-inferred-edge-options))
|
|
503
|
+
end
|
|
504
|
+
fun inferred-edge-with(name :: String, selector :: String, options :: InferredEdgeOptions) -> SpytialRule:
|
|
505
|
+
directive(spytial-inferred-edge(name, selector, options))
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
fun icon(selector :: String, path :: String) -> SpytialRule:
|
|
509
|
+
directive(spytial-icon(selector, path, default-icon-options))
|
|
510
|
+
end
|
|
511
|
+
fun icon-with(selector :: String, path :: String, options :: IconOptions) -> SpytialRule:
|
|
512
|
+
directive(spytial-icon(selector, path, options))
|
|
513
|
+
end
|
|
514
|
+
|
|
515
|
+
fun atom-color(value :: String, selector :: String) -> SpytialRule:
|
|
516
|
+
directive(spytial-atom-color(value, selector, default-atom-color-options))
|
|
517
|
+
end
|
|
518
|
+
fun atom-color-with(value :: String, selector :: String, options :: AtomColorOptions) -> SpytialRule:
|
|
519
|
+
directive(spytial-atom-color(value, selector, options))
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
fun edge-color(field :: String, value :: String) -> SpytialRule:
|
|
523
|
+
directive(spytial-edge-color(field, value, default-edge-color-options))
|
|
524
|
+
end
|
|
525
|
+
fun edge-color-with(field :: String, value :: String, options :: EdgeColorOptions) -> SpytialRule:
|
|
526
|
+
directive(spytial-edge-color(field, value, options))
|
|
527
|
+
end
|