PyDecisionGraph 0.3.2.post1__cp315-cp315-win_amd64.whl
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.
- decision_graph/__infra__.pxd +1 -0
- decision_graph/__init__.pxd +1 -0
- decision_graph/__init__.py +39 -0
- decision_graph/decision_tree/__init__.pxd +2 -0
- decision_graph/decision_tree/__init__.py +85 -0
- decision_graph/decision_tree/bake/__infra__.pxd +502 -0
- decision_graph/decision_tree/bake/__init__.pxd +502 -0
- decision_graph/decision_tree/bake/__init__.py +29 -0
- decision_graph/decision_tree/bake/c_action.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_action.h +324 -0
- decision_graph/decision_tree/bake/c_action.pxd +54 -0
- decision_graph/decision_tree/bake/c_action.pyi +126 -0
- decision_graph/decision_tree/bake/c_action.pyx +65 -0
- decision_graph/decision_tree/bake/c_allocator_protocol.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_allocator_protocol.pxd +24 -0
- decision_graph/decision_tree/bake/c_allocator_protocol.pyi +61 -0
- decision_graph/decision_tree/bake/c_allocator_protocol.pyx +109 -0
- decision_graph/decision_tree/bake/c_bake.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_bake.h +629 -0
- decision_graph/decision_tree/bake/c_bake.pxd +52 -0
- decision_graph/decision_tree/bake/c_bake.pyi +151 -0
- decision_graph/decision_tree/bake/c_bake.pyx +142 -0
- decision_graph/decision_tree/bake/c_collections.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_collections.h +692 -0
- decision_graph/decision_tree/bake/c_collections.pxd +52 -0
- decision_graph/decision_tree/bake/c_collections.pyi +193 -0
- decision_graph/decision_tree/bake/c_collections.pyx +161 -0
- decision_graph/decision_tree/bake/c_const.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_const.h +395 -0
- decision_graph/decision_tree/bake/c_const.pxd +56 -0
- decision_graph/decision_tree/bake/c_const.pyi +305 -0
- decision_graph/decision_tree/bake/c_const.pyx +278 -0
- decision_graph/decision_tree/bake/c_edge.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_edge.h +511 -0
- decision_graph/decision_tree/bake/c_edge.pxd +117 -0
- decision_graph/decision_tree/bake/c_edge.pyi +192 -0
- decision_graph/decision_tree/bake/c_edge.pyx +270 -0
- decision_graph/decision_tree/bake/c_eval.h +848 -0
- decision_graph/decision_tree/bake/c_eval.pxd +40 -0
- decision_graph/decision_tree/bake/c_expr.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_expr.h +1900 -0
- decision_graph/decision_tree/bake/c_expr.pxd +129 -0
- decision_graph/decision_tree/bake/c_expr.pyi +280 -0
- decision_graph/decision_tree/bake/c_expr.pyx +272 -0
- decision_graph/decision_tree/bake/c_hierarchy.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_hierarchy.h +731 -0
- decision_graph/decision_tree/bake/c_hierarchy.pxd +71 -0
- decision_graph/decision_tree/bake/c_hierarchy.pyi +409 -0
- decision_graph/decision_tree/bake/c_hierarchy.pyx +277 -0
- decision_graph/decision_tree/bake/c_logic_group.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_logic_group.h +1226 -0
- decision_graph/decision_tree/bake/c_logic_group.pxd +162 -0
- decision_graph/decision_tree/bake/c_logic_group.pyi +264 -0
- decision_graph/decision_tree/bake/c_logic_group.pyx +308 -0
- decision_graph/decision_tree/bake/c_node.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_node.h +2660 -0
- decision_graph/decision_tree/bake/c_node.pxd +381 -0
- decision_graph/decision_tree/bake/c_node.pyi +438 -0
- decision_graph/decision_tree/bake/c_node.pyx +639 -0
- decision_graph/decision_tree/bake/c_reconstruct.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_reconstruct.pxd +63 -0
- decision_graph/decision_tree/bake/c_reconstruct.pyi +60 -0
- decision_graph/decision_tree/bake/c_reconstruct.pyx +252 -0
- decision_graph/decision_tree/bake/c_var.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/bake/c_var.h +2054 -0
- decision_graph/decision_tree/bake/c_var.pxd +205 -0
- decision_graph/decision_tree/bake/c_var.pyi +271 -0
- decision_graph/decision_tree/bake/c_var.pyx +228 -0
- decision_graph/decision_tree/capi/__infra__.pxd +33 -0
- decision_graph/decision_tree/capi/__init__.pxd +33 -0
- decision_graph/decision_tree/capi/__init__.py +57 -0
- decision_graph/decision_tree/capi/c_abc.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/capi/c_abc.pxd +246 -0
- decision_graph/decision_tree/capi/c_abc.pyi +770 -0
- decision_graph/decision_tree/capi/c_abc.pyx +1532 -0
- decision_graph/decision_tree/capi/c_collection.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/capi/c_collection.pxd +22 -0
- decision_graph/decision_tree/capi/c_collection.pyi +245 -0
- decision_graph/decision_tree/capi/c_collection.pyx +138 -0
- decision_graph/decision_tree/capi/c_node.cp315-win_amd64.pyd +0 -0
- decision_graph/decision_tree/capi/c_node.pxd +95 -0
- decision_graph/decision_tree/capi/c_node.pyi +492 -0
- decision_graph/decision_tree/capi/c_node.pyx +551 -0
- decision_graph/decision_tree/exc.py +189 -0
- decision_graph/decision_tree/native/__init__.py +57 -0
- decision_graph/decision_tree/native/abc.py +1167 -0
- decision_graph/decision_tree/native/collection.py +134 -0
- decision_graph/decision_tree/native/node.py +521 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_action.c +16320 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_action.h +324 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_allocator_protocol.c +12473 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_bake.c +16485 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_bake.h +629 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_collections.c +17381 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_collections.h +692 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_const.c +20815 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_const.h +395 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_edge.c +20696 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_edge.h +511 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_eval.h +848 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_expr.c +22065 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_expr.h +1900 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_hierarchy.c +23267 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_hierarchy.h +731 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_logic_group.c +22434 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_logic_group.h +1226 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_node.c +28385 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_node.h +2660 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_reconstruct.c +15955 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_var.c +16881 -0
- decision_graph/includes/decision_graph/decision_tree/bake/c_var.h +2054 -0
- decision_graph/includes/decision_graph/decision_tree/capi/c_abc.c +59196 -0
- decision_graph/includes/decision_graph/decision_tree/capi/c_collection.c +19967 -0
- decision_graph/includes/decision_graph/decision_tree/capi/c_node.c +39229 -0
- decision_graph/logic_group/__init__.py +25 -0
- decision_graph/logic_group/base.py +100 -0
- decision_graph/logic_group/pending_request.py +384 -0
- decision_graph/webui/__init__.py +24 -0
- decision_graph/webui/bake/__init__.py +65 -0
- decision_graph/webui/bake/app.py +488 -0
- decision_graph/webui/bake/static/d3.v7.min.js +2 -0
- decision_graph/webui/bake/static/script.js +1440 -0
- decision_graph/webui/bake/static/style.css +920 -0
- decision_graph/webui/bake/templates/index.html +183 -0
- decision_graph/webui/bake/templates/offline.html +184 -0
- decision_graph/webui/capi/__init__.py +54 -0
- decision_graph/webui/capi/app.py +366 -0
- decision_graph/webui/capi/main.py +53 -0
- decision_graph/webui/capi/static/d3.v7.min.js +2 -0
- decision_graph/webui/capi/static/script.js +1026 -0
- decision_graph/webui/capi/static/style.css +656 -0
- decision_graph/webui/capi/templates/index.html +93 -0
- decision_graph/webui/capi/templates/offline.html +94 -0
- decision_graph/webui/native/__init__.py +54 -0
- decision_graph/webui/native/app.py +366 -0
- decision_graph/webui/native/main.py +53 -0
- decision_graph/webui/native/static/d3.v7.min.js +2 -0
- decision_graph/webui/native/static/script.js +1026 -0
- decision_graph/webui/native/static/style.css +656 -0
- decision_graph/webui/native/templates/index.html +93 -0
- decision_graph/webui/native/templates/offline.html +94 -0
- pydecisiongraph-0.3.2.post1.dist-info/METADATA +136 -0
- pydecisiongraph-0.3.2.post1.dist-info/RECORD +148 -0
- pydecisiongraph-0.3.2.post1.dist-info/WHEEL +5 -0
- pydecisiongraph-0.3.2.post1.dist-info/licenses/LICENSE +373 -0
- pydecisiongraph-0.3.2.post1.dist-info/top_level.txt +2 -0
- tests/bake_c_evaluator.cp315-win_amd64.pyd +0 -0
- tests/bake_eval_probe.cp315-win_amd64.pyd +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-theme="dark" data-orientation="top-down">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Bake Graph — Decision Graph</title>
|
|
7
|
+
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
|
8
|
+
<script src="{{ url_for('static', filename='d3.v7.min.js') }}"></script>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
|
|
12
|
+
<header id="titlebar">
|
|
13
|
+
<div class="brand">
|
|
14
|
+
<span class="brand-mark">⌞</span>
|
|
15
|
+
<span class="brand-name">Bake Graph</span>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="graph-title" id="title-name">—</div>
|
|
18
|
+
<div class="title-stats">
|
|
19
|
+
<span class="stat"><b id="stat-nodes">0</b> nodes</span>
|
|
20
|
+
<span class="stat"><b id="stat-walked">0</b> walked</span>
|
|
21
|
+
<span class="stat" id="stat-mode">unbaked</span>
|
|
22
|
+
</div>
|
|
23
|
+
</header>
|
|
24
|
+
|
|
25
|
+
<div id="shell">
|
|
26
|
+
<aside id="sidebar" role="region" aria-label="Controls">
|
|
27
|
+
<section class="panel">
|
|
28
|
+
<h2 class="panel-title">View</h2>
|
|
29
|
+
<div class="field">
|
|
30
|
+
<span class="field-label">Orientation</span>
|
|
31
|
+
<div class="segmented" id="ctl-orientation">
|
|
32
|
+
<button type="button" data-orientation="top-down" class="active">Top → Bottom</button>
|
|
33
|
+
<button type="button" data-orientation="left-right">Left → Right</button>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="field">
|
|
37
|
+
<span class="field-label">Theme</span>
|
|
38
|
+
<div class="segmented" id="ctl-theme">
|
|
39
|
+
<button type="button" data-theme="dark" class="active">Dark</button>
|
|
40
|
+
<button type="button" data-theme="light">Light</button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="field">
|
|
44
|
+
<span class="field-label">Zoom</span>
|
|
45
|
+
<div class="btn-row">
|
|
46
|
+
<button type="button" class="btn" id="btn-zoom-out" title="Zoom out">−</button>
|
|
47
|
+
<button type="button" class="btn" id="btn-zoom-reset" title="Fit the graph">Fit</button>
|
|
48
|
+
<button type="button" class="btn" id="btn-zoom-in" title="Zoom in">+</button>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</section>
|
|
52
|
+
|
|
53
|
+
<section class="panel">
|
|
54
|
+
<h2 class="panel-title">Walk</h2>
|
|
55
|
+
<label class="switch-row" id="row-highlight">
|
|
56
|
+
<input type="checkbox" id="ctl-highlight" checked>
|
|
57
|
+
<span class="switch-track"><span class="switch-knob"></span></span>
|
|
58
|
+
<span class="switch-text">Highlight the walked path</span>
|
|
59
|
+
</label>
|
|
60
|
+
<div class="btn-row">
|
|
61
|
+
<button type="button" class="btn btn-primary" id="btn-evaluate" title="Walk the graph now">Evaluate</button>
|
|
62
|
+
</div>
|
|
63
|
+
<dl class="readout">
|
|
64
|
+
<div><dt>code</dt><dd id="out-code">—</dd></div>
|
|
65
|
+
<div><dt>length</dt><dd id="out-length">—</dd></div>
|
|
66
|
+
<div><dt>leaf</dt><dd id="out-leaf">—</dd></div>
|
|
67
|
+
</dl>
|
|
68
|
+
</section>
|
|
69
|
+
|
|
70
|
+
<section class="panel">
|
|
71
|
+
<h2 class="panel-title">Logic Group</h2>
|
|
72
|
+
<div class="chips" id="ctl-groups"></div>
|
|
73
|
+
<p class="hint">A node carries the logic groups it was built inside. Picking one dims everything else.</p>
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<section class="panel">
|
|
77
|
+
<h2 class="panel-title">Clipboard</h2>
|
|
78
|
+
<div class="btn-row">
|
|
79
|
+
<button type="button" class="btn" id="btn-copy-path" title="Copy the walked path as JSON">Copy path</button>
|
|
80
|
+
<button type="button" class="btn" id="btn-paste-path" title="Read the clipboard into the box">Paste</button>
|
|
81
|
+
</div>
|
|
82
|
+
<textarea id="ctl-path" class="textarea" rows="3" spellcheck="false"
|
|
83
|
+
placeholder='["uid", "uid", …]'></textarea>
|
|
84
|
+
<div class="btn-row">
|
|
85
|
+
<button type="button" class="btn" id="btn-load-path" title="Highlight the ids in the box">Load</button>
|
|
86
|
+
<button type="button" class="btn" id="btn-clear-path" title="Drop the loaded ids">Clear</button>
|
|
87
|
+
</div>
|
|
88
|
+
<p class="hint" id="clipboard-hint"></p>
|
|
89
|
+
</section>
|
|
90
|
+
|
|
91
|
+
<section class="panel">
|
|
92
|
+
<h2 class="panel-title">Export</h2>
|
|
93
|
+
<div class="btn-row">
|
|
94
|
+
<button type="button" class="btn" id="btn-export-svg">SVG</button>
|
|
95
|
+
<button type="button" class="btn" id="btn-export-png">PNG</button>
|
|
96
|
+
</div>
|
|
97
|
+
</section>
|
|
98
|
+
<section class="panel" data-collapsed="true">
|
|
99
|
+
<h2 class="panel-title">Presentation</h2>
|
|
100
|
+
<label class="slider-row">
|
|
101
|
+
<span class="slider-label">Level gap</span>
|
|
102
|
+
<input type="range" id="pres-level" min="0" max="240" step="2" value="84">
|
|
103
|
+
<output class="slider-value" id="pres-level-out">84</output>
|
|
104
|
+
</label>
|
|
105
|
+
<label class="slider-row">
|
|
106
|
+
<span class="slider-label">Sibling gap</span>
|
|
107
|
+
<input type="range" id="pres-sibling" min="0" max="200" step="2" value="48">
|
|
108
|
+
<output class="slider-value" id="pres-sibling-out">48</output>
|
|
109
|
+
</label>
|
|
110
|
+
<label class="slider-row">
|
|
111
|
+
<span class="slider-label">Card width</span>
|
|
112
|
+
<input type="range" id="pres-width" min="140" max="440" step="4" value="232">
|
|
113
|
+
<output class="slider-value" id="pres-width-out">232</output>
|
|
114
|
+
</label>
|
|
115
|
+
<label class="slider-row">
|
|
116
|
+
<span class="slider-label">Card height</span>
|
|
117
|
+
<input type="range" id="pres-height" min="56" max="320" step="4" value="100">
|
|
118
|
+
<output class="slider-value" id="pres-height-out">100</output>
|
|
119
|
+
</label>
|
|
120
|
+
<label class="slider-row">
|
|
121
|
+
<span class="slider-label">Edge width</span>
|
|
122
|
+
<input type="range" id="pres-edge" min="10" max="60" step="5" value="16">
|
|
123
|
+
<output class="slider-value" id="pres-edge-out">1.6</output>
|
|
124
|
+
</label>
|
|
125
|
+
<label class="slider-row">
|
|
126
|
+
<span class="slider-label">Animation</span>
|
|
127
|
+
<input type="range" id="pres-anim" min="1" max="200" step="1" value="100">
|
|
128
|
+
<output class="slider-value" id="pres-anim-out">×1.00</output>
|
|
129
|
+
</label>
|
|
130
|
+
<p class="hint">Speed of the collapse animation. ×0.01 is a hundred times slower — slow enough to watch a card travel.</p>
|
|
131
|
+
<div class="btn-row">
|
|
132
|
+
<button type="button" class="btn" id="btn-pres-reset" title="Back to the defaults">Reset</button>
|
|
133
|
+
</div>
|
|
134
|
+
</section>
|
|
135
|
+
|
|
136
|
+
</aside>
|
|
137
|
+
|
|
138
|
+
<main id="stage">
|
|
139
|
+
<div id="canvas">
|
|
140
|
+
<svg id="graph" role="img" aria-label="Bake graph"></svg>
|
|
141
|
+
<div id="empty-note" hidden>Nothing to draw — the viewer is holding no graph.</div>
|
|
142
|
+
</div>
|
|
143
|
+
</main>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<aside id="inspector" hidden aria-label="Node details">
|
|
147
|
+
<div class="inspector-head">
|
|
148
|
+
<span class="inspector-type" id="ins-type">—</span>
|
|
149
|
+
<button type="button" class="icon-btn" id="ins-close" title="Close">✕</button>
|
|
150
|
+
</div>
|
|
151
|
+
<dl class="readout readout-wide">
|
|
152
|
+
<div><dt>repr</dt><dd id="ins-repr">—</dd></div>
|
|
153
|
+
<div><dt>id</dt><dd id="ins-id">—</dd></div>
|
|
154
|
+
<div><dt>address</dt><dd id="ins-address">—</dd></div>
|
|
155
|
+
<div><dt>family</dt><dd id="ins-family">—</dd></div>
|
|
156
|
+
<div><dt>labels</dt><dd id="ins-labels">—</dd></div>
|
|
157
|
+
<div><dt>out</dt><dd id="ins-out">—</dd></div>
|
|
158
|
+
<div><dt>value</dt><dd id="ins-self">—</dd></div>
|
|
159
|
+
<div><dt>hooks</dt><dd id="ins-hooks">—</dd></div>
|
|
160
|
+
<div><dt>subtree</dt><dd id="ins-size">—</dd></div>
|
|
161
|
+
<div><dt>autogen</dt><dd id="ins-autogen">—</dd></div>
|
|
162
|
+
</dl>
|
|
163
|
+
<div class="inspector-block">
|
|
164
|
+
<span class="field-label">arms</span>
|
|
165
|
+
<ul id="ins-arms"></ul>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="inspector-block">
|
|
168
|
+
<span class="field-label">operands <span class="field-note">(not children)</span></span>
|
|
169
|
+
<ul id="ins-operands"></ul>
|
|
170
|
+
</div>
|
|
171
|
+
</aside>
|
|
172
|
+
|
|
173
|
+
<script type="application/json" id="tree-data">{{ initial_tree_data | tojson }}</script>
|
|
174
|
+
<script>
|
|
175
|
+
window.bake_viewer = {
|
|
176
|
+
tree_id: {{ tree_id | tojson }},
|
|
177
|
+
with_eval: {{ 'true' if with_eval else 'false' }},
|
|
178
|
+
with_watch: {{ 'true' if with_watch else 'false' }}
|
|
179
|
+
};
|
|
180
|
+
</script>
|
|
181
|
+
<script src="{{ url_for('static', filename='script.js') }}"></script>
|
|
182
|
+
</body>
|
|
183
|
+
</html>
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-theme="dark" data-orientation="top-down">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Bake Graph — Decision Graph</title>
|
|
7
|
+
<style>{{ css_content }}</style>
|
|
8
|
+
<script>{{ d3_content }}</script>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
|
|
12
|
+
<header id="titlebar">
|
|
13
|
+
<div class="brand">
|
|
14
|
+
<span class="brand-mark">⌞</span>
|
|
15
|
+
<span class="brand-name">Bake Graph</span>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="graph-title" id="title-name">—</div>
|
|
18
|
+
<div class="title-stats">
|
|
19
|
+
<span class="stat"><b id="stat-nodes">0</b> nodes</span>
|
|
20
|
+
<span class="stat"><b id="stat-walked">0</b> walked</span>
|
|
21
|
+
<span class="stat" id="stat-mode">unbaked</span>
|
|
22
|
+
</div>
|
|
23
|
+
</header>
|
|
24
|
+
|
|
25
|
+
<div id="shell">
|
|
26
|
+
<aside id="sidebar" role="region" aria-label="Controls">
|
|
27
|
+
<section class="panel">
|
|
28
|
+
<h2 class="panel-title">View</h2>
|
|
29
|
+
<div class="field">
|
|
30
|
+
<span class="field-label">Orientation</span>
|
|
31
|
+
<div class="segmented" id="ctl-orientation">
|
|
32
|
+
<button type="button" data-orientation="top-down" class="active">Top → Bottom</button>
|
|
33
|
+
<button type="button" data-orientation="left-right">Left → Right</button>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="field">
|
|
37
|
+
<span class="field-label">Theme</span>
|
|
38
|
+
<div class="segmented" id="ctl-theme">
|
|
39
|
+
<button type="button" data-theme="dark" class="active">Dark</button>
|
|
40
|
+
<button type="button" data-theme="light">Light</button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="field">
|
|
44
|
+
<span class="field-label">Zoom</span>
|
|
45
|
+
<div class="btn-row">
|
|
46
|
+
<button type="button" class="btn" id="btn-zoom-out" title="Zoom out">−</button>
|
|
47
|
+
<button type="button" class="btn" id="btn-zoom-reset" title="Fit the graph">Fit</button>
|
|
48
|
+
<button type="button" class="btn" id="btn-zoom-in" title="Zoom in">+</button>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</section>
|
|
52
|
+
|
|
53
|
+
<section class="panel">
|
|
54
|
+
<h2 class="panel-title">Walk</h2>
|
|
55
|
+
<label class="switch-row" id="row-highlight">
|
|
56
|
+
<input type="checkbox" id="ctl-highlight" checked>
|
|
57
|
+
<span class="switch-track"><span class="switch-knob"></span></span>
|
|
58
|
+
<span class="switch-text">Highlight the walked path</span>
|
|
59
|
+
</label>
|
|
60
|
+
<div class="btn-row">
|
|
61
|
+
<button type="button" class="btn btn-primary" id="btn-evaluate" title="Walk the graph now">Evaluate</button>
|
|
62
|
+
</div>
|
|
63
|
+
<dl class="readout">
|
|
64
|
+
<div><dt>code</dt><dd id="out-code">—</dd></div>
|
|
65
|
+
<div><dt>length</dt><dd id="out-length">—</dd></div>
|
|
66
|
+
<div><dt>leaf</dt><dd id="out-leaf">—</dd></div>
|
|
67
|
+
</dl>
|
|
68
|
+
</section>
|
|
69
|
+
|
|
70
|
+
<section class="panel">
|
|
71
|
+
<h2 class="panel-title">Logic Group</h2>
|
|
72
|
+
<div class="chips" id="ctl-groups"></div>
|
|
73
|
+
<p class="hint">A node carries the logic groups it was built inside. Picking one dims everything else.</p>
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<section class="panel">
|
|
77
|
+
<h2 class="panel-title">Clipboard</h2>
|
|
78
|
+
<div class="btn-row">
|
|
79
|
+
<button type="button" class="btn" id="btn-copy-path" title="Copy the walked path as JSON">Copy path</button>
|
|
80
|
+
<button type="button" class="btn" id="btn-paste-path" title="Read the clipboard into the box">Paste</button>
|
|
81
|
+
</div>
|
|
82
|
+
<textarea id="ctl-path" class="textarea" rows="3" spellcheck="false"
|
|
83
|
+
placeholder='["uid", "uid", …]'></textarea>
|
|
84
|
+
<div class="btn-row">
|
|
85
|
+
<button type="button" class="btn" id="btn-load-path" title="Highlight the ids in the box">Load</button>
|
|
86
|
+
<button type="button" class="btn" id="btn-clear-path" title="Drop the loaded ids">Clear</button>
|
|
87
|
+
</div>
|
|
88
|
+
<p class="hint" id="clipboard-hint"></p>
|
|
89
|
+
</section>
|
|
90
|
+
|
|
91
|
+
<section class="panel">
|
|
92
|
+
<h2 class="panel-title">Export</h2>
|
|
93
|
+
<div class="btn-row">
|
|
94
|
+
<button type="button" class="btn" id="btn-export-svg">SVG</button>
|
|
95
|
+
<button type="button" class="btn" id="btn-export-png">PNG</button>
|
|
96
|
+
</div>
|
|
97
|
+
</section>
|
|
98
|
+
<section class="panel" data-collapsed="true">
|
|
99
|
+
<h2 class="panel-title">Presentation</h2>
|
|
100
|
+
<label class="slider-row">
|
|
101
|
+
<span class="slider-label">Level gap</span>
|
|
102
|
+
<input type="range" id="pres-level" min="0" max="240" step="2" value="84">
|
|
103
|
+
<output class="slider-value" id="pres-level-out">84</output>
|
|
104
|
+
</label>
|
|
105
|
+
<label class="slider-row">
|
|
106
|
+
<span class="slider-label">Sibling gap</span>
|
|
107
|
+
<input type="range" id="pres-sibling" min="0" max="200" step="2" value="48">
|
|
108
|
+
<output class="slider-value" id="pres-sibling-out">48</output>
|
|
109
|
+
</label>
|
|
110
|
+
<label class="slider-row">
|
|
111
|
+
<span class="slider-label">Card width</span>
|
|
112
|
+
<input type="range" id="pres-width" min="140" max="440" step="4" value="232">
|
|
113
|
+
<output class="slider-value" id="pres-width-out">232</output>
|
|
114
|
+
</label>
|
|
115
|
+
<label class="slider-row">
|
|
116
|
+
<span class="slider-label">Card height</span>
|
|
117
|
+
<input type="range" id="pres-height" min="56" max="320" step="4" value="100">
|
|
118
|
+
<output class="slider-value" id="pres-height-out">100</output>
|
|
119
|
+
</label>
|
|
120
|
+
<label class="slider-row">
|
|
121
|
+
<span class="slider-label">Edge width</span>
|
|
122
|
+
<input type="range" id="pres-edge" min="10" max="60" step="5" value="16">
|
|
123
|
+
<output class="slider-value" id="pres-edge-out">1.6</output>
|
|
124
|
+
</label>
|
|
125
|
+
<label class="slider-row">
|
|
126
|
+
<span class="slider-label">Animation</span>
|
|
127
|
+
<input type="range" id="pres-anim" min="1" max="200" step="1" value="100">
|
|
128
|
+
<output class="slider-value" id="pres-anim-out">×1.00</output>
|
|
129
|
+
</label>
|
|
130
|
+
<p class="hint">Speed of the collapse animation. ×0.01 is a hundred times slower — slow enough to watch a card travel.</p>
|
|
131
|
+
<div class="btn-row">
|
|
132
|
+
<button type="button" class="btn" id="btn-pres-reset" title="Back to the defaults">Reset</button>
|
|
133
|
+
</div>
|
|
134
|
+
</section>
|
|
135
|
+
|
|
136
|
+
</aside>
|
|
137
|
+
|
|
138
|
+
<main id="stage">
|
|
139
|
+
<div id="canvas">
|
|
140
|
+
<svg id="graph" role="img" aria-label="Bake graph"></svg>
|
|
141
|
+
<div id="empty-note" hidden>Nothing to draw — the viewer is holding no graph.</div>
|
|
142
|
+
</div>
|
|
143
|
+
</main>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<aside id="inspector" hidden aria-label="Node details">
|
|
147
|
+
<div class="inspector-head">
|
|
148
|
+
<span class="inspector-type" id="ins-type">—</span>
|
|
149
|
+
<button type="button" class="icon-btn" id="ins-close" title="Close">✕</button>
|
|
150
|
+
</div>
|
|
151
|
+
<dl class="readout readout-wide">
|
|
152
|
+
<div><dt>repr</dt><dd id="ins-repr">—</dd></div>
|
|
153
|
+
<div><dt>id</dt><dd id="ins-id">—</dd></div>
|
|
154
|
+
<div><dt>address</dt><dd id="ins-address">—</dd></div>
|
|
155
|
+
<div><dt>family</dt><dd id="ins-family">—</dd></div>
|
|
156
|
+
<div><dt>labels</dt><dd id="ins-labels">—</dd></div>
|
|
157
|
+
<div><dt>out</dt><dd id="ins-out">—</dd></div>
|
|
158
|
+
<div><dt>value</dt><dd id="ins-self">—</dd></div>
|
|
159
|
+
<div><dt>hooks</dt><dd id="ins-hooks">—</dd></div>
|
|
160
|
+
<div><dt>subtree</dt><dd id="ins-size">—</dd></div>
|
|
161
|
+
<div><dt>autogen</dt><dd id="ins-autogen">—</dd></div>
|
|
162
|
+
</dl>
|
|
163
|
+
<div class="inspector-block">
|
|
164
|
+
<span class="field-label">arms</span>
|
|
165
|
+
<ul id="ins-arms"></ul>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="inspector-block">
|
|
168
|
+
<span class="field-label">operands <span class="field-note">(not children)</span></span>
|
|
169
|
+
<ul id="ins-operands"></ul>
|
|
170
|
+
</div>
|
|
171
|
+
</aside>
|
|
172
|
+
|
|
173
|
+
<script type="application/json" id="tree-data">{{ initial_tree_data | tojson }}</script>
|
|
174
|
+
<script>
|
|
175
|
+
window.bake_viewer = {
|
|
176
|
+
tree_id: "offline",
|
|
177
|
+
with_eval: {{ 'true' if with_eval else 'false' }},
|
|
178
|
+
with_watch: false,
|
|
179
|
+
offline: true
|
|
180
|
+
};
|
|
181
|
+
</script>
|
|
182
|
+
<script>{{ js_content }}</script>
|
|
183
|
+
</body>
|
|
184
|
+
</html>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""The web UI of the C API layer (``decision_graph.decision_tree.capi``).
|
|
2
|
+
|
|
3
|
+
The tree it draws is a capi ``LogicNode`` tree, read through the capi surface
|
|
4
|
+
alone — see ``.app`` for the one place that surface is named.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
from .. import LOGGER
|
|
10
|
+
from decision_graph.decision_tree.capi import LogicNode, RootLogicNode
|
|
11
|
+
|
|
12
|
+
LOGGER = LOGGER.getChild('WebUI.CAPI')
|
|
13
|
+
|
|
14
|
+
from . import app
|
|
15
|
+
from .app import DecisionTreeWebUi
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def show(root: LogicNode, with_eval: bool = True, **kwargs):
|
|
19
|
+
_app = DecisionTreeWebUi(
|
|
20
|
+
host=kwargs.get('host', "127.0.0.1"),
|
|
21
|
+
port=kwargs.get('port', 5000),
|
|
22
|
+
debug=kwargs.get('debug', False)
|
|
23
|
+
)
|
|
24
|
+
_app.show(
|
|
25
|
+
node=root,
|
|
26
|
+
with_eval=with_eval
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def watch(root: RootLogicNode, interval: float = .5, block: bool = False, **kwargs):
|
|
31
|
+
_app = DecisionTreeWebUi(
|
|
32
|
+
host=kwargs.get('host', "127.0.0.1"),
|
|
33
|
+
port=kwargs.get('port', 5000),
|
|
34
|
+
debug=kwargs.get('debug', False)
|
|
35
|
+
)
|
|
36
|
+
_app.watch(
|
|
37
|
+
node=root,
|
|
38
|
+
interval=interval,
|
|
39
|
+
block=block
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_html(root: LogicNode, file_name: str, with_eval: bool = True):
|
|
44
|
+
DecisionTreeWebUi.to_html(
|
|
45
|
+
node=root,
|
|
46
|
+
file_name=file_name,
|
|
47
|
+
with_eval=with_eval
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def set_logger(logger: logging.Logger):
|
|
52
|
+
global LOGGER
|
|
53
|
+
LOGGER = logger.getChild('WebUI.CAPI')
|
|
54
|
+
app.LOGGER = LOGGER
|