@rxap/oauth 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 +15 -0
- package/compodoc/architecture.html +222 -0
- package/compodoc/changelog.html +60 -5
- package/compodoc/dependencies.html +104 -25
- package/compodoc/index.html +46 -5
- package/compodoc/injectables/AuthenticationService.html +83 -21
- 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 +39 -0
- package/compodoc/miscellaneous/functions.html +59 -15
- package/compodoc/miscellaneous/variables.html +52 -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/docs/documentation.json +107 -64
- 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/AuthenticationService.html +134 -8
- package/docs/html/functions/AuthenticationGuard.html +43 -1
- package/docs/html/functions/ProvideAuth.html +42 -1
- package/docs/html/functions/withAuthConfig.html +42 -1
- package/docs/html/hierarchy.html +29 -0
- package/docs/html/index.html +40 -4
- package/docs/html/modules.html +40 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/AuthenticationService.md +13 -13
- package/docs/markdown/functions/AuthenticationGuard.md +2 -2
- package/docs/markdown/functions/ProvideAuth.md +2 -2
- package/docs/markdown/functions/withAuthConfig.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/wiki/Class.AuthenticationService.md +12 -12
- package/docs/wiki/Function.AuthenticationGuard.md +1 -1
- package/docs/wiki/Function.ProvideAuth.md +1 -1
- package/docs/wiki/Function.withAuthConfig.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/package.json +12 -12
|
@@ -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" >AuthenticationService</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/authentication.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,33 +147,30 @@
|
|
|
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/authentication.service.ts</code>
|
|
119
|
-
</p>
|
|
120
150
|
|
|
121
151
|
|
|
122
152
|
|
|
123
153
|
|
|
124
154
|
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div class="tab-pane fade " id="api">
|
|
125
158
|
<section data-compodoc="block-index">
|
|
126
159
|
<h3 id="index">Index</h3>
|
|
127
|
-
|
|
128
|
-
|
|
160
|
+
<table class="table table-sm table-bordered index-table">
|
|
161
|
+
<tbody>
|
|
129
162
|
<tr>
|
|
130
|
-
<td class="col-md-
|
|
163
|
+
<td class="col-md-3">
|
|
131
164
|
<h6><b>Properties</b></h6>
|
|
132
165
|
</td>
|
|
133
|
-
|
|
134
|
-
<tr>
|
|
135
|
-
<td class="col-md-4">
|
|
166
|
+
<td class="col-md-9">
|
|
136
167
|
<ul class="index-list">
|
|
137
168
|
<li>
|
|
169
|
+
<span class="reference-badge reference-badge--property" aria-hidden="true">P</span>
|
|
138
170
|
<a href="#events$" >events$</a>
|
|
139
171
|
</li>
|
|
140
172
|
<li>
|
|
173
|
+
<span class="reference-badge reference-badge--property" aria-hidden="true">P</span>
|
|
141
174
|
<span class="modifier">Public</span>
|
|
142
175
|
<span class="modifier">Readonly</span>
|
|
143
176
|
<a href="#isAuthenticated$" >isAuthenticated$</a>
|
|
@@ -145,38 +178,44 @@
|
|
|
145
178
|
</ul>
|
|
146
179
|
</td>
|
|
147
180
|
</tr>
|
|
181
|
+
</tbody>
|
|
182
|
+
</table>
|
|
148
183
|
|
|
184
|
+
<table class="table table-sm table-bordered index-table">
|
|
185
|
+
<tbody>
|
|
149
186
|
<tr>
|
|
150
|
-
<td class="col-md-
|
|
187
|
+
<td class="col-md-3">
|
|
151
188
|
<h6><b>Methods</b></h6>
|
|
152
189
|
</td>
|
|
153
|
-
|
|
154
|
-
<tr>
|
|
155
|
-
<td class="col-md-4">
|
|
190
|
+
<td class="col-md-9">
|
|
156
191
|
<ul class="index-list">
|
|
157
192
|
<li>
|
|
193
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
158
194
|
<a href="#init" >init</a>
|
|
159
195
|
</li>
|
|
160
196
|
<li>
|
|
197
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
161
198
|
<a href="#isAuthenticated" >isAuthenticated</a>
|
|
162
199
|
</li>
|
|
163
200
|
<li>
|
|
201
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
164
202
|
<a href="#signIn" >signIn</a>
|
|
165
203
|
</li>
|
|
166
204
|
<li>
|
|
205
|
+
<span class="reference-badge reference-badge--method" aria-hidden="true">M</span>
|
|
167
206
|
<span class="modifier">Async</span>
|
|
168
207
|
<a href="#signOut" >signOut</a>
|
|
169
208
|
</li>
|
|
170
209
|
</ul>
|
|
171
210
|
</td>
|
|
172
211
|
</tr>
|
|
212
|
+
</tbody>
|
|
213
|
+
</table>
|
|
173
214
|
|
|
174
215
|
|
|
175
216
|
|
|
176
217
|
|
|
177
218
|
|
|
178
|
-
</tbody>
|
|
179
|
-
</table>
|
|
180
219
|
</section>
|
|
181
220
|
|
|
182
221
|
<section data-compodoc="block-constructor">
|
|
@@ -354,6 +393,7 @@
|
|
|
354
393
|
</tbody>
|
|
355
394
|
</table>
|
|
356
395
|
</section>
|
|
396
|
+
|
|
357
397
|
<section data-compodoc="block-properties">
|
|
358
398
|
|
|
359
399
|
<h3 id="inputs">
|
|
@@ -403,6 +443,12 @@
|
|
|
403
443
|
</span>
|
|
404
444
|
</td>
|
|
405
445
|
</tr>
|
|
446
|
+
<tr>
|
|
447
|
+
<td class="col-md-4">
|
|
448
|
+
<i>Type : </i> <code>unknown</code>
|
|
449
|
+
|
|
450
|
+
</td>
|
|
451
|
+
</tr>
|
|
406
452
|
<tr>
|
|
407
453
|
<td class="col-md-4">
|
|
408
454
|
<i>Default value : </i><code>new BehaviorSubject<boolean | null>(null)</code>
|
|
@@ -621,6 +667,24 @@ export class AuthenticationService implements IAuthenticationService {
|
|
|
621
667
|
|
|
622
668
|
<script>
|
|
623
669
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
670
|
+
var updateDarkModeSwitchOffset = function () {
|
|
671
|
+
var content = document.querySelector('.content');
|
|
672
|
+
var scrollbarWidth = 0;
|
|
673
|
+
|
|
674
|
+
if (content) {
|
|
675
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
document.documentElement.style.setProperty(
|
|
679
|
+
'--content-scrollbar-width',
|
|
680
|
+
scrollbarWidth + 'px'
|
|
681
|
+
);
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
updateDarkModeSwitchOffset();
|
|
685
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
686
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
687
|
+
|
|
624
688
|
checkToggle(darkModeState);
|
|
625
689
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
626
690
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -636,14 +700,12 @@ export class AuthenticationService implements IAuthenticationService {
|
|
|
636
700
|
<script src="../js/libs/lit-html.js"></script>
|
|
637
701
|
|
|
638
702
|
<script src="../js/menu-wc.js" defer></script>
|
|
639
|
-
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
640
703
|
|
|
641
704
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
642
705
|
|
|
643
706
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
644
707
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
645
708
|
<script src="../js/libs/promise.min.js"></script>
|
|
646
|
-
<script src="../js/libs/zepto.min.js"></script>
|
|
647
709
|
|
|
648
710
|
<script src="../js/compodoc.js"></script>
|
|
649
711
|
|
|
@@ -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
|
+
});
|