@rxap/ngx-memory 22.0.0-dev.0 → 22.0.0-dev.1
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/CHANGELOG.md +10 -0
- package/compodoc/architecture.html +222 -0
- package/compodoc/changelog.html +55 -5
- package/compodoc/classes/MockStorage.html +114 -37
- package/compodoc/dependencies.html +80 -13
- package/compodoc/index.html +46 -5
- package/compodoc/injectables/EphemeralStorageService.html +107 -24
- package/compodoc/injectables/LocalStorageService.html +107 -24
- package/compodoc/injectables/SessionStorageService.html +107 -24
- package/compodoc/injectables/StorageService.html +96 -18
- package/compodoc/js/architecture-graph.js +288 -0
- package/compodoc/js/libs/bootstrap-native.js +4 -2
- package/compodoc/js/libs/jszip.min.js +13 -0
- package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
- package/compodoc/js/libs/tablesort.min.js +3 -3
- package/compodoc/js/libs/tablesort.number.min.js +3 -3
- package/compodoc/js/libs/vis-network.min.js +78 -0
- package/compodoc/js/menu-wc.js +25 -12
- package/compodoc/js/menu.js +10 -11
- package/compodoc/js/routes/routes_index.js +1 -0
- package/compodoc/js/routes.js +142 -34
- package/compodoc/js/search/search-lunr.js +6 -8
- package/compodoc/js/search/search.js +118 -66
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/js/tabs.js +98 -15
- package/compodoc/js/tree.js +44 -7
- package/compodoc/license.html +48 -6
- package/compodoc/llms.txt +106 -0
- package/compodoc/miscellaneous/functions.html +75 -23
- package/compodoc/miscellaneous/typealiases.html +46 -4
- package/compodoc/miscellaneous/variables.html +58 -5
- package/compodoc/modules.html +44 -3
- package/compodoc/overview.html +54 -3
- package/compodoc/properties.html +45 -4
- package/compodoc/routes.html +227 -0
- package/compodoc/styles/compodoc.css +365 -44
- package/compodoc/styles/dark.css +16 -0
- package/compodoc/template-playground/default-templates.json +192 -0
- package/compodoc/template-playground/hbs-render.service.ts +217 -0
- package/compodoc/template-playground/main.ts +9 -0
- package/compodoc/template-playground/template-editor.service.ts +173 -0
- package/compodoc/template-playground/template-playground.component.ts +614 -0
- package/compodoc/template-playground/template-playground.module.ts +29 -0
- package/compodoc/template-playground/zip-export.service.ts +86 -0
- package/compodoc/template-playground-app/app.js +1389 -0
- package/compodoc/template-playground-app/index.html +462 -0
- package/compodoc/todo.html +45 -60
- package/docs/documentation.json +484 -353
- package/docs/html/assets/highlight.css +1 -1
- package/docs/html/assets/icons.js +1 -1
- package/docs/html/assets/icons.svg +1 -1
- package/docs/html/assets/main.js +5 -5
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +265 -228
- package/docs/html/classes/EphemeralStorageService.html +151 -9
- package/docs/html/classes/LocalStorageService.html +151 -9
- package/docs/html/classes/MockStorage.html +185 -15
- package/docs/html/classes/SessionStorageService.html +151 -9
- package/docs/html/classes/StorageService.html +151 -9
- package/docs/html/functions/LocalStorage.html +52 -5
- package/docs/html/functions/SessionStorage.html +52 -5
- package/docs/html/functions/StorageGet.html +43 -1
- package/docs/html/functions/StorageHas.html +43 -1
- package/docs/html/functions/StorageKey.html +43 -1
- package/docs/html/functions/StorageRemove.html +43 -1
- package/docs/html/functions/StorageSet.html +46 -1
- package/docs/html/functions/WebStorage.html +45 -1
- package/docs/html/functions/getExpired.html +43 -1
- package/docs/html/functions/stringify.html +42 -1
- package/docs/html/hierarchy.html +35 -1
- package/docs/html/index.html +40 -4
- package/docs/html/modules.html +48 -1
- package/docs/html/types/ExpiredUnit.html +35 -2
- package/docs/html/variables/isBrowser.html +35 -2
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/EphemeralStorageService.md +17 -17
- package/docs/markdown/classes/LocalStorageService.md +17 -17
- package/docs/markdown/classes/MockStorage.md +16 -16
- package/docs/markdown/classes/SessionStorageService.md +17 -17
- package/docs/markdown/classes/StorageService.md +18 -18
- package/docs/markdown/functions/LocalStorage.md +4 -18
- package/docs/markdown/functions/SessionStorage.md +4 -18
- package/docs/markdown/functions/StorageGet.md +3 -3
- package/docs/markdown/functions/StorageHas.md +3 -3
- package/docs/markdown/functions/StorageKey.md +5 -5
- package/docs/markdown/functions/StorageRemove.md +3 -3
- package/docs/markdown/functions/StorageSet.md +6 -6
- package/docs/markdown/functions/WebStorage.md +5 -19
- package/docs/markdown/functions/getExpired.md +2 -2
- package/docs/markdown/functions/stringify.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/type-aliases/ExpiredUnit.md +3 -3
- package/docs/markdown/variables/isBrowser.md +2 -2
- package/docs/wiki/Class.EphemeralStorageService.md +16 -16
- package/docs/wiki/Class.LocalStorageService.md +16 -16
- package/docs/wiki/Class.MockStorage.md +15 -15
- package/docs/wiki/Class.SessionStorageService.md +16 -16
- package/docs/wiki/Class.StorageService.md +17 -17
- package/docs/wiki/Function.LocalStorage.md +3 -17
- package/docs/wiki/Function.SessionStorage.md +3 -17
- package/docs/wiki/Function.StorageGet.md +2 -2
- package/docs/wiki/Function.StorageHas.md +2 -2
- package/docs/wiki/Function.StorageKey.md +4 -4
- package/docs/wiki/Function.StorageRemove.md +2 -2
- package/docs/wiki/Function.StorageSet.md +5 -5
- package/docs/wiki/Function.WebStorage.md +4 -18
- package/docs/wiki/Function.getExpired.md +1 -1
- package/docs/wiki/Function.stringify.md +1 -1
- package/docs/wiki/TypeAlias.ExpiredUnit.md +2 -2
- package/docs/wiki/Variable.isBrowser.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/package.json +3 -3
|
@@ -61,6 +61,20 @@
|
|
|
61
61
|
}
|
|
62
62
|
toggleDarkMode(darkModeState);
|
|
63
63
|
</script>
|
|
64
|
+
<script>
|
|
65
|
+
// --- Iframe navigation tracking for Template Playground ---
|
|
66
|
+
function sendCurrentUrlToParent() {
|
|
67
|
+
if (window.parent && window.parent !== window) {
|
|
68
|
+
window.parent.postMessage({
|
|
69
|
+
type: 'compodoc-iframe-navigate',
|
|
70
|
+
url: window.location.pathname + window.location.hash
|
|
71
|
+
}, '*');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
window.addEventListener('hashchange', sendCurrentUrlToParent, false);
|
|
75
|
+
window.addEventListener('popstate', sendCurrentUrlToParent, false);
|
|
76
|
+
window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
|
|
77
|
+
</script>
|
|
64
78
|
|
|
65
79
|
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
80
|
<div class="d-flex">
|
|
@@ -70,7 +84,14 @@
|
|
|
70
84
|
</div>
|
|
71
85
|
|
|
72
86
|
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
-
<div id="book-search-input" role="search"
|
|
87
|
+
<div id="book-search-input" role="search">
|
|
88
|
+
<input type="text" placeholder="Type to search">
|
|
89
|
+
<button type="button"
|
|
90
|
+
class="search-input-clear"
|
|
91
|
+
aria-label="Clear search"
|
|
92
|
+
data-search-input-clear>×</button>
|
|
93
|
+
</div>
|
|
94
|
+
<compodoc-menu></compodoc-menu>
|
|
74
95
|
</div>
|
|
75
96
|
|
|
76
97
|
<div class="container-fluid main">
|
|
@@ -89,11 +110,20 @@
|
|
|
89
110
|
|
|
90
111
|
|
|
91
112
|
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
92
117
|
<ol class="breadcrumb">
|
|
93
118
|
<li class="breadcrumb-item">Injectables</li>
|
|
94
119
|
<li class="breadcrumb-item" >StorageService</li>
|
|
95
120
|
</ol>
|
|
96
121
|
|
|
122
|
+
<div class="io-file io-file-path" data-compodoc="entity-file-path">
|
|
123
|
+
<span class="icon ion-ios-document" aria-hidden="true"></span>
|
|
124
|
+
<code>src/lib/storage.service.ts</code>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
97
127
|
<ul class="nav nav-tabs" role="tablist">
|
|
98
128
|
<li class="nav-item">
|
|
99
129
|
<a href="#info"
|
|
@@ -101,6 +131,12 @@
|
|
|
101
131
|
class="nav-link active"
|
|
102
132
|
role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
|
|
103
133
|
</li>
|
|
134
|
+
<li class="nav-item">
|
|
135
|
+
<a href="#api"
|
|
136
|
+
class="nav-link"
|
|
137
|
+
|
|
138
|
+
role="tab" id="api-tab" data-bs-toggle="tab" data-link="api">API</a>
|
|
139
|
+
</li>
|
|
104
140
|
<li class="nav-item">
|
|
105
141
|
<a href="#source"
|
|
106
142
|
class="nav-link"
|
|
@@ -111,55 +147,80 @@
|
|
|
111
147
|
|
|
112
148
|
<div class="tab-content">
|
|
113
149
|
<div class="tab-pane fade active in" id="info">
|
|
114
|
-
<p class="comment">
|
|
115
|
-
<h3>File</h3>
|
|
116
|
-
</p>
|
|
117
|
-
<p class="comment">
|
|
118
|
-
<code>src/lib/storage.service.ts</code>
|
|
119
|
-
</p>
|
|
120
150
|
|
|
121
151
|
|
|
122
152
|
|
|
123
153
|
|
|
124
154
|
|
|
155
|
+
<section data-compodoc="block-relationships">
|
|
156
|
+
<h3>Relationships</h3>
|
|
157
|
+
|
|
158
|
+
<div class="row pt-3">
|
|
159
|
+
<div class="col-sm-6">
|
|
160
|
+
<h4>Used by</h4>
|
|
161
|
+
<ul class="list-unstyled relationships-list">
|
|
162
|
+
<li>
|
|
163
|
+
<code><a href="../injectables/EphemeralStorageService.html" target="_self" >EphemeralStorageService</a></code>
|
|
164
|
+
</li>
|
|
165
|
+
<li>
|
|
166
|
+
<code><a href="../injectables/LocalStorageService.html" target="_self" >LocalStorageService</a></code>
|
|
167
|
+
</li>
|
|
168
|
+
<li>
|
|
169
|
+
<code><a href="../injectables/SessionStorageService.html" target="_self" >SessionStorageService</a></code>
|
|
170
|
+
</li>
|
|
171
|
+
</ul>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div class="col-sm-6">
|
|
175
|
+
<h4>Depends on</h4>
|
|
176
|
+
<p class="comment"><i>No results matching.</i></p>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</section>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<div class="tab-pane fade " id="api">
|
|
125
183
|
<section data-compodoc="block-index">
|
|
126
184
|
<h3 id="index">Index</h3>
|
|
127
|
-
<table class="table table-sm table-bordered index-table">
|
|
128
|
-
<tbody>
|
|
129
185
|
|
|
186
|
+
<table class="table table-sm table-bordered index-table">
|
|
187
|
+
<tbody>
|
|
130
188
|
<tr>
|
|
131
|
-
<td class="col-md-
|
|
189
|
+
<td class="col-md-3">
|
|
132
190
|
<h6><b>Methods</b></h6>
|
|
133
191
|
</td>
|
|
134
|
-
|
|
135
|
-
<tr>
|
|
136
|
-
<td class="col-md-4">
|
|
192
|
+
<td class="col-md-9">
|
|
137
193
|
<ul class="index-list">
|
|
138
194
|
<li>
|
|
195
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
139
196
|
<a href="#clear" >clear</a>
|
|
140
197
|
</li>
|
|
141
198
|
<li>
|
|
199
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
142
200
|
<a href="#get" >get</a>
|
|
143
201
|
</li>
|
|
144
202
|
<li>
|
|
203
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
145
204
|
<a href="#has" >has</a>
|
|
146
205
|
</li>
|
|
147
206
|
<li>
|
|
207
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
148
208
|
<a href="#remove" >remove</a>
|
|
149
209
|
</li>
|
|
150
210
|
<li>
|
|
211
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
151
212
|
<a href="#set" >set</a>
|
|
152
213
|
</li>
|
|
153
214
|
</ul>
|
|
154
215
|
</td>
|
|
155
216
|
</tr>
|
|
217
|
+
</tbody>
|
|
218
|
+
</table>
|
|
156
219
|
|
|
157
220
|
|
|
158
221
|
|
|
159
222
|
|
|
160
223
|
|
|
161
|
-
</tbody>
|
|
162
|
-
</table>
|
|
163
224
|
</section>
|
|
164
225
|
|
|
165
226
|
<section data-compodoc="block-constructor">
|
|
@@ -479,7 +540,7 @@
|
|
|
479
540
|
</tr>
|
|
480
541
|
<tr>
|
|
481
542
|
<td class="col-md-4">
|
|
482
|
-
<code>set(key: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, expiredAt: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>, expiredUnit: <a href="../
|
|
543
|
+
<code>set(key: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, expiredAt: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>, expiredUnit: <a href="../miscellaneous/typealiases.html#ExpiredUnit" target="_self">ExpiredUnit</a>)</code>
|
|
483
544
|
</td>
|
|
484
545
|
</tr>
|
|
485
546
|
|
|
@@ -582,6 +643,7 @@
|
|
|
582
643
|
</table>
|
|
583
644
|
</section>
|
|
584
645
|
|
|
646
|
+
|
|
585
647
|
</div>
|
|
586
648
|
|
|
587
649
|
|
|
@@ -689,6 +751,24 @@ export abstract class StorageService {
|
|
|
689
751
|
|
|
690
752
|
<script>
|
|
691
753
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
754
|
+
var updateDarkModeSwitchOffset = function () {
|
|
755
|
+
var content = document.querySelector('.content');
|
|
756
|
+
var scrollbarWidth = 0;
|
|
757
|
+
|
|
758
|
+
if (content) {
|
|
759
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
document.documentElement.style.setProperty(
|
|
763
|
+
'--content-scrollbar-width',
|
|
764
|
+
scrollbarWidth + 'px'
|
|
765
|
+
);
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
updateDarkModeSwitchOffset();
|
|
769
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
770
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
771
|
+
|
|
692
772
|
checkToggle(darkModeState);
|
|
693
773
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
694
774
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -704,14 +784,12 @@ export abstract class StorageService {
|
|
|
704
784
|
<script src="../js/libs/lit-html.js"></script>
|
|
705
785
|
|
|
706
786
|
<script src="../js/menu-wc.js" defer></script>
|
|
707
|
-
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
708
787
|
|
|
709
788
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
710
789
|
|
|
711
790
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
712
791
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
713
792
|
<script src="../js/libs/promise.min.js"></script>
|
|
714
|
-
<script src="../js/libs/zepto.min.js"></script>
|
|
715
793
|
|
|
716
794
|
<script src="../js/compodoc.js"></script>
|
|
717
795
|
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
2
|
+
var container = document.getElementById("architecture-graph");
|
|
3
|
+
if (!container) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
if (
|
|
7
|
+
typeof ARCHITECTURE_DEP_GRAPH === "undefined" ||
|
|
8
|
+
!ARCHITECTURE_DEP_GRAPH ||
|
|
9
|
+
!ARCHITECTURE_DEP_GRAPH.nodes
|
|
10
|
+
) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (typeof vis === "undefined" || !vis.Network) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var typeColors = {
|
|
18
|
+
component: "#10b39c",
|
|
19
|
+
directive: "#6747dd",
|
|
20
|
+
pipe: "#de3b91",
|
|
21
|
+
module: "#2973f0",
|
|
22
|
+
injectable: "#b77006",
|
|
23
|
+
};
|
|
24
|
+
var isDarkMode = function () {
|
|
25
|
+
return !!(document.body && document.body.classList.contains("dark"));
|
|
26
|
+
};
|
|
27
|
+
var getNodeTextColor = function () {
|
|
28
|
+
return isDarkMode() ? "#f0f0f0" : "#2d2d2d";
|
|
29
|
+
};
|
|
30
|
+
var getEdgeColor = function () {
|
|
31
|
+
return isDarkMode() ? "#b5b5b5" : "#8b8b8b";
|
|
32
|
+
};
|
|
33
|
+
var getEdgeOpacity = function () {
|
|
34
|
+
return isDarkMode() ? 0.8 : 0.65;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var allNodes = ARCHITECTURE_DEP_GRAPH.nodes.map(function (node) {
|
|
38
|
+
return {
|
|
39
|
+
id: node.id,
|
|
40
|
+
label: node.name,
|
|
41
|
+
type: node.type,
|
|
42
|
+
url: node.url,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
var allEdges = ARCHITECTURE_DEP_GRAPH.edges.map(function (edge) {
|
|
46
|
+
return {
|
|
47
|
+
from: edge.source,
|
|
48
|
+
to: edge.target,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (!allNodes.length || !allEdges.length) {
|
|
53
|
+
container.innerHTML =
|
|
54
|
+
'<p class="alert alert-warning">No dependency links to render.</p>';
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var degreeByNodeId = {};
|
|
59
|
+
allEdges.forEach(function (edge) {
|
|
60
|
+
degreeByNodeId[edge.from] = (degreeByNodeId[edge.from] || 0) + 1;
|
|
61
|
+
degreeByNodeId[edge.to] = (degreeByNodeId[edge.to] || 0) + 1;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
allNodes = allNodes.map(function (node) {
|
|
65
|
+
var degree = degreeByNodeId[node.id] || 1;
|
|
66
|
+
return {
|
|
67
|
+
id: node.id,
|
|
68
|
+
label: node.label,
|
|
69
|
+
title: node.label + " (" + node.type + ")",
|
|
70
|
+
type: node.type,
|
|
71
|
+
url: node.url,
|
|
72
|
+
color: typeColors[node.type] || typeColors.module,
|
|
73
|
+
size: Math.min(30, 10 + degree * 1.3),
|
|
74
|
+
font: { color: getNodeTextColor(), size: 12 },
|
|
75
|
+
borderWidth: 1,
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
var activeTypes = {};
|
|
80
|
+
var knownTypes = ["component", "directive", "pipe", "module", "injectable"];
|
|
81
|
+
knownTypes.forEach(function (type) {
|
|
82
|
+
activeTypes[type] = true;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var nodeById = {};
|
|
86
|
+
allNodes.forEach(function (node) {
|
|
87
|
+
nodeById[node.id] = node;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
var network;
|
|
91
|
+
var currentScale = 1;
|
|
92
|
+
|
|
93
|
+
var applyGraphTheme = function () {
|
|
94
|
+
var textColor = getNodeTextColor();
|
|
95
|
+
var edgeColor = getEdgeColor();
|
|
96
|
+
var edgeOpacity = getEdgeOpacity();
|
|
97
|
+
|
|
98
|
+
for (var i = 0; i < allNodes.length; i++) {
|
|
99
|
+
allNodes[i].font = allNodes[i].font || {};
|
|
100
|
+
allNodes[i].font.color = textColor;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (network) {
|
|
104
|
+
network.setOptions({
|
|
105
|
+
edges: {
|
|
106
|
+
color: { color: edgeColor, opacity: edgeOpacity },
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
var getFilteredGraphData = function () {
|
|
113
|
+
var visibleNodes = allNodes.filter(function (node) {
|
|
114
|
+
return activeTypes[node.type];
|
|
115
|
+
});
|
|
116
|
+
var visibleNodeIds = {};
|
|
117
|
+
visibleNodes.forEach(function (node) {
|
|
118
|
+
visibleNodeIds[node.id] = true;
|
|
119
|
+
});
|
|
120
|
+
var visibleEdges = allEdges.filter(function (edge) {
|
|
121
|
+
return visibleNodeIds[edge.from] && visibleNodeIds[edge.to];
|
|
122
|
+
});
|
|
123
|
+
return { nodes: visibleNodes, edges: visibleEdges };
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var renderFilteredGraph = function () {
|
|
127
|
+
var filtered = getFilteredGraphData();
|
|
128
|
+
network.setData({
|
|
129
|
+
nodes: new vis.DataSet(filtered.nodes),
|
|
130
|
+
edges: new vis.DataSet(filtered.edges),
|
|
131
|
+
});
|
|
132
|
+
network.stabilize(120);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
var options = {
|
|
136
|
+
autoResize: true,
|
|
137
|
+
layout: {
|
|
138
|
+
improvedLayout: true,
|
|
139
|
+
},
|
|
140
|
+
interaction: {
|
|
141
|
+
hover: true,
|
|
142
|
+
dragView: true,
|
|
143
|
+
zoomView: true,
|
|
144
|
+
},
|
|
145
|
+
physics: {
|
|
146
|
+
enabled: true,
|
|
147
|
+
stabilization: {
|
|
148
|
+
enabled: true,
|
|
149
|
+
iterations: 180,
|
|
150
|
+
fit: true,
|
|
151
|
+
},
|
|
152
|
+
barnesHut: {
|
|
153
|
+
gravitationalConstant: -6000,
|
|
154
|
+
centralGravity: 0.35,
|
|
155
|
+
springLength: 130,
|
|
156
|
+
springConstant: 0.02,
|
|
157
|
+
damping: 0.2,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
edges: {
|
|
161
|
+
arrows: { to: { enabled: true, scaleFactor: 0.6 } },
|
|
162
|
+
color: { color: getEdgeColor(), opacity: getEdgeOpacity() },
|
|
163
|
+
smooth: {
|
|
164
|
+
enabled: true,
|
|
165
|
+
type: "dynamic",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
nodes: {
|
|
169
|
+
shape: "dot",
|
|
170
|
+
scaling: {
|
|
171
|
+
min: 9,
|
|
172
|
+
max: 32,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
var initialData = getFilteredGraphData();
|
|
178
|
+
network = new vis.Network(
|
|
179
|
+
container,
|
|
180
|
+
{
|
|
181
|
+
nodes: new vis.DataSet(initialData.nodes),
|
|
182
|
+
edges: new vis.DataSet(initialData.edges),
|
|
183
|
+
},
|
|
184
|
+
options,
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
network.on("click", function (params) {
|
|
188
|
+
if (!params.nodes || params.nodes.length === 0) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
var node = nodeById[params.nodes[0]];
|
|
192
|
+
if (node && node.url) {
|
|
193
|
+
document.location.href = node.url;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
network.once("stabilizationIterationsDone", function () {
|
|
198
|
+
network.fit({ animation: { duration: 250, easingFunction: "easeOutQuad" } });
|
|
199
|
+
currentScale = 1;
|
|
200
|
+
});
|
|
201
|
+
applyGraphTheme();
|
|
202
|
+
|
|
203
|
+
var legendButtons = document.querySelectorAll("[data-architecture-filter]");
|
|
204
|
+
var updateLegendState = function () {
|
|
205
|
+
for (var i = 0; i < legendButtons.length; i++) {
|
|
206
|
+
var button = legendButtons[i];
|
|
207
|
+
var type = button.getAttribute("data-architecture-filter");
|
|
208
|
+
var active = !!activeTypes[type];
|
|
209
|
+
button.setAttribute("aria-pressed", active ? "true" : "false");
|
|
210
|
+
if (active) {
|
|
211
|
+
button.classList.remove("is-disabled");
|
|
212
|
+
} else {
|
|
213
|
+
button.classList.add("is-disabled");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
for (var i = 0; i < legendButtons.length; i++) {
|
|
219
|
+
legendButtons[i].addEventListener("click", function (event) {
|
|
220
|
+
event.preventDefault();
|
|
221
|
+
var type = this.getAttribute("data-architecture-filter");
|
|
222
|
+
if (!type) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
activeTypes[type] = !activeTypes[type];
|
|
227
|
+
|
|
228
|
+
var activeCount = 0;
|
|
229
|
+
knownTypes.forEach(function (entry) {
|
|
230
|
+
if (activeTypes[entry]) {
|
|
231
|
+
activeCount += 1;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
if (activeCount === 0) {
|
|
235
|
+
knownTypes.forEach(function (entry) {
|
|
236
|
+
activeTypes[entry] = true;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
updateLegendState();
|
|
241
|
+
renderFilteredGraph();
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
updateLegendState();
|
|
245
|
+
|
|
246
|
+
var zoomIn = document.getElementById("architecture-zoom-in");
|
|
247
|
+
var zoomOut = document.getElementById("architecture-zoom-out");
|
|
248
|
+
var reset = document.getElementById("architecture-reset");
|
|
249
|
+
|
|
250
|
+
if (zoomIn) {
|
|
251
|
+
zoomIn.addEventListener("click", function (ev) {
|
|
252
|
+
ev.preventDefault();
|
|
253
|
+
currentScale = Math.min(4, currentScale * 1.25);
|
|
254
|
+
network.moveTo({
|
|
255
|
+
scale: currentScale,
|
|
256
|
+
animation: { duration: 160, easingFunction: "easeOutQuad" },
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (zoomOut) {
|
|
261
|
+
zoomOut.addEventListener("click", function (ev) {
|
|
262
|
+
ev.preventDefault();
|
|
263
|
+
currentScale = Math.max(0.2, currentScale / 1.25);
|
|
264
|
+
network.moveTo({
|
|
265
|
+
scale: currentScale,
|
|
266
|
+
animation: { duration: 160, easingFunction: "easeOutQuad" },
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
if (reset) {
|
|
271
|
+
reset.addEventListener("click", function (ev) {
|
|
272
|
+
ev.preventDefault();
|
|
273
|
+
network.fit({ animation: { duration: 180, easingFunction: "easeOutQuad" } });
|
|
274
|
+
currentScale = 1;
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (window.MutationObserver && document.body) {
|
|
279
|
+
var bodyThemeObserver = new MutationObserver(function () {
|
|
280
|
+
applyGraphTheme();
|
|
281
|
+
renderFilteredGraph();
|
|
282
|
+
});
|
|
283
|
+
bodyThemeObserver.observe(document.body, {
|
|
284
|
+
attributes: true,
|
|
285
|
+
attributeFilter: ["class"],
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
});
|