### Physics Initialization and Stabilization Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Handles the initial setup of the physics simulation. If stabilization is enabled, it calls the stabilize method; otherwise, it marks the simulation as ready and starts it. ```javascript initPhysics: function () { !0 === this.physicsEnabled && !0 === this.options.enabled ? !0 === this.options.stabilization.enabled ? this.stabilize() : (this.stabilized = !1, this.ready = !0, this.body.emitter.emit("fit", {}, this.layoutFailed), this.startSimulation()) : (this.ready = !0, this.body.emitter.emit("fit")) } ``` -------------------------------- ### Starting Physics Simulation Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Starts the physics simulation if it is enabled and configured. It emits events to prepare for rendering and begins the simulation loop. ```javascript startSimulation: function () { var t; !0 === this.physicsEnabled && !0 === this.options.enabled ? (this.stabilized = !1, this.adaptiveTimestep = !1, this.body.emitter.emit("_resizeNodes"), void 0 === this.viewFunction && (this.viewFunction = Z(t = this.simulationStep).call(t, this), this.body.emitter.on("initRedraw", this.viewFunction), this.body.emitter.emit("_startRendering"))) : this.body.emitter.emit("_redraw") } ``` -------------------------------- ### Secure Random Number Generation Setup Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Initializes the setup for secure random number generation using the Web Crypto API or msCrypto if available. Throws an error if crypto.getRandomValues() is not supported. ```javascript var cc = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto), uc = new Uint8Array(16); function fc() { if (!cc) throw new Error("crypto.getRandomValues() not su ``` -------------------------------- ### Install DependenSee Globally Source: https://github.com/madushans/dependensee/blob/main/README.md Installs the DependenSee .NET tool globally. Requires .NET 6 Runtime. ```bash dotnet tool install DependenSee --global ``` -------------------------------- ### Include Project Namespaces Source: https://github.com/madushans/dependensee/blob/main/docs/CommandLine.md Includes only projects starting with specified namespaces. Use the full or shorthand flag. ```bash DependenSee \Source\SolutionFolder -O ConsoleJson -IncludeProjectNamespaces MyApp.Extensions,MyApp.Core ``` ```bash DependenSee \Source\SolutionFolder -O ConsoleJson -IPrN MyApp.Extensions,MyApp.Core ``` -------------------------------- ### Handle Drag Start Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Initiates the drag operation for nodes or the view. It captures the starting pointer position, view translation, and checks for modifier keys to enable selection box functionality. ```javascript onDragStart: function (t) { if (!this.drag.dragging) { void 0 === this.drag.pointer && this.onTouch(t); var e = this.selectionHandler.getNodeAt(this.drag.pointer); if (this.drag.dragging = !0, this.drag.selection = [], this.drag.translation = mt({}, this.body.view.translation), this.drag.nodeId = void 0, t.srcEvent.shiftKey) { this.body.selectionBox.show = !0; var i = this.getPointer(t.center); this.body.selectionBox.position.start = { x: this.canvas._XconvertDOMtoCanvas(i.x), y: this.canvas._YconvertDOMtoCanvas(i.y) }, this.body.selectionBox.position.end = { x: this.canvas._XconvertDOMtoCanvas(i.x), y: this.canvas._YconvertDOMtoCanvas(i.y) } } if (void 0 !== e && !0 === this.options.dragNodes) { this.drag.nodeId = e.id, !1 === e.isSelected() && (this.selectionHa ``` -------------------------------- ### Edge Event Listeners Setup Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Sets up event listeners for edge additions, updates, and removals. ```javascript this.edgesListeners = { add: function (t, e) { r.add(e.items) }, update: function (t, e) { r.update(e.items) }, remove: function (t, e) { r.remove(e.items) } } ``` -------------------------------- ### Physics Initialization and Stabilization Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Handles the initial setup of the physics simulation, including stabilization if enabled, and emits events for fitting the view. ```javascript initPhysics: function () { !0 === this.physicsEnabled && !0 === this.options.enabled ? !0 === this.options.stabilization.enabled ? this.stabilize() : (this.stabilized = !1, this.ready = !0, this.body.emitter.emit("fit", {}, this.layoutFailed), this.startSimulation()) : (this.ready = !0, this.body.emitter.emit("fit")) } ``` -------------------------------- ### Hammer.js Recognizer Setup Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Array defining the default recognizers and their configurations. ```javascript sl = [ [nl, { enable: !1 }], [il, { enable: !1 }, ["rotate"]], [el, { direction: 6 }], [tl, { direction: 6 }, ["swipe"]], [Zh], [Zh, { event: "doubletap", taps: 2 }, ["tap"]], [ol] ] ``` -------------------------------- ### Include Package Namespaces Source: https://github.com/madushans/dependensee/blob/main/docs/CommandLine.md Includes only packages starting with specified namespaces. Use the full or shorthand flag. ```bash DependenSee \Source\SolutionFolder -O ConsoleJson -IncludePackageNamespaces Xamarin,Microsoft ``` ```bash DependenSee \Source\SolutionFolder -O ConsoleJson -IPaN Xamarin,Microsoft ``` -------------------------------- ### Handle Drag Start Event Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Initiates the drag operation, setting up drag state, translation, and selection box if the shift key is pressed. ```javascript onDragStart: function (t) { if (!this.drag.dragging) { void 0 === this.drag.pointer && this.onTouch(t); var e = this.selectionHandler.getNodeAt(this.drag.pointer); if (this.drag.dragging = !0, this.drag.selection = [], this.drag.translation = mt({}, this.body.view.translation), this.drag.nodeId = void 0, t.srcEvent.shiftKey) { this.body.selectionBox.show = !0; var i = this.getPointer(t.center); this.body.selectionBox.position.start = { x: this.canvas._XconvertDOMtoCanvas(i.x), y: this.canvas._YconvertDOMtoCanvas(i.y) }, this.body.selectionBox.position.end = { x: this.canvas._XconvertDOMtoCanvas(i.x), y: this.canvas._YconvertDOMtoCanvas(i.y) } } if (void 0 !== e && !0 === this.options.dragNodes) { this.drag.nodeId = e.id, !1 === e.isSelected() && (this.selectionHandler.u ``` -------------------------------- ### Display Help Information Source: https://github.com/madushans/dependensee/blob/main/docs/CommandLine.md Shows help descriptions for DependenSee. Help is also displayed if no arguments are provided. ```bash DependenSee -Help ``` ```bash DependenSee -H ``` ```bash DependenSee ``` -------------------------------- ### Setup and Display Configuration Popup Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Sets up a popup element with provided HTML content if configuration is allowed and within limits. The popup is positioned relative to a specific DOM element. ```javascript function (t, e) { var i = this; if (!0 === this.initialized && !0 === this.allowCreation && this.popupCounter < this.popupLimit) { var n = document.createElement("div"); n.id = "vis-configuration-popup", n.className = "vis-configuration-popup", n.innerHTML = t, n.onclick = function () { i._removePopup() }, this.popupCounter += 1, this.popupDiv = { html: n, index: e } } } ``` -------------------------------- ### Starting and Stopping the Simulation Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Controls the simulation's start and stop states, emitting relevant rendering events. Stops simulation and optionally emits a stabilized event. ```javascript startSimulation: function () { var t; !0 === this.physicsEnabled && !0 === this.options.enabled ? (this.stabilized = !1, this.adaptiveTimestep = !1, this.body.emitter.emit("_resizeNodes"), void 0 === this.viewFunction && (this.viewFunction = Z(t = this.simulationStep).call(t, this), this.body.emitter.on("initRedraw", this.viewFunction), this.body.emitter.emit("_startRendering"))) : this.body.emitter.emit("_redraw") } ``` ```javascript stopSimulation: function () { var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; this.stabilized = !0, !0 === t && this._emitStabilized(), void 0 !== this.viewFunction && (this.body.emitter.off("initRedraw", this.viewFunction), this.viewFunction = void 0, !0 === t && this.body.emitter.emit("_stopRendering")) } ``` -------------------------------- ### Crawl Network for Hierarchical Layout Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Recursively crawls the network to establish hierarchical relationships between nodes. It can start from a specific node or traverse the entire network if no starting node is provided. ```javascript this._crawlNetwork = function () { var t = this, e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : function () { }, i = arguments.length > 1 ? arguments[1] : void 0, n = {}, o = function i(o, r) { if (void 0 === n[o.id]) { var s; t.hierarchical.setTreeIndex(o, r), n[o.id] = !0; for (var a = t._getActiveEdges(o), h = 0; h < a.length; h++) { var l = a[h]; !0 === l.connected && (s = l.toId == o.id ? l.from : l.to, o.id != s.id && (e(o, s, l), i(s, r))) } } }; if (void 0 === i) for (var r = 0, s = 0; s < this.body.nodeIndices.length; s++) { var a = this.body.nodeIndices[s]; if (void 0 === n[a]) { var h = this.body.nodes[a]; o(h, r), r += 1 } } else { var l = this.body.nodes[i]; if (void 0 === l) return void console.error("Node not found:", i); o(l) } } ``` -------------------------------- ### Initialize and Configure UI Element Options Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Sets up default options and allows for custom configuration of UI element properties like margins and border styles. ```javascript var Sl = function (t, e) { for (var i = 0; i < e.length; i++) { var n = e[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n) } }, Vr = Object.getOwnPropertyDescriptors ? Object.getOwnPropertyDescriptors(e) : {}, fd = Object.create ? Object.create(null) : {}, Ad = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e }, Rd = Object.getPrototypeOf; var ou = function (t) { Ad(i, t); var e = nu(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o))._setMargins(o), r } return Sl(i, [{ key: "resize", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.selected, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.hover; if (this.needsRefresh(e, i)) { var n = this.getDimensionsFromLabel(t, e, i); this.width = n.width + this.margin.right + this.margin.left, this.height = n.height + this.margin.top + this.margin.bottom, this.radius = this.width / 2 } } }, { key: "draw", value: function (t, e, i, n, o, r) { this.resize(t, n, o), this.left = e - this.width / 2, this.top = i - this.height / 2, this.initContextForDraw(t, r), wt(t, this.left, this.top, this.width, this.height, r.borderRadius), this.performFill(t, r), this.updateBoundingBox(e, i, t, n, o), this.labelModule.draw(t, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, n, o) } }, { key: "upda" }]) return i }(); ``` -------------------------------- ### Get Scale Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Returns the current scale of the view. ```javascript return this.body.view.scale ``` -------------------------------- ### Initialize Collection with Options Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Initializes a new collection instance with optional data and configuration options. Supports adding initial data and setting options like queue management. ```javascript Mc = function (t) { Ad(i, t); var e = kc(i); function i(t, n) { var o; return El(this, i), (o = e.call(this))._queue = null, t && !ur(t) && (n = t, t = []), o._options = n || {}, o._data = new Yl, o.length = 0, o._idProp = o._options.fieldId || "id", t && t.length && o.add(t), o.setOptions(n), o } return Sl(i, [ { key: "setOptions", value: function (t) { t && void 0 !== t.queue && (!1 === t.queue ? this._queue && (this._queue.destroy(), this._queue = null) : (this._queue || (this._queue = Cc.extend(this, { replace: ["add", "update", "remove"] })), t.queue && "object" === vr(t.queue) && this._queue.setOptions(t.queue))) } }, { key: "add", value: function (t, e) { var i, n = this, o = []; if (ur(t)) { var r = cr(t).call(t, (function (t) { return t[n._idProp] })); if (nd(r).call(r, (function (t) { return n._data.has(t) }))) throw new Error("A duplicate id was found in the parameter array."); for (var s = 0, a = t.length; s < a; s++) i = this._addItem(t[s]), o.push(i) } else { if (!t || "object" !== vr(t)) throw new Error("Unknown dataType"); i = th ``` -------------------------------- ### Get Object Title Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Retrieves the title of the object from its options. ```javascript getTitle: function () { return this.options.title } ``` -------------------------------- ### View Controller Initialization Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Initializes the view controller, setting up event listeners for activation and keyboard bindings. ```javascript function t(e, i) { var n = this; El(this, t), this.body = e, this.canvas = i, this.iconsCreated = !1, this.navigationHammers = [], this.boundFunctions = {}, this.touchTime = 0, this.activated = !1, this.body.emitter.on("activate", (function () { n.activated = !0, n.configureKeyboardBindings() })), this.body.emitter.on("deactivate", ( ``` -------------------------------- ### Get Node Title Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Retrieves the title option of the node. ```javascript getTitle: function () { return this.options.title } ``` -------------------------------- ### Color Picker Initialization and Configuration Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Demonstrates the basic structure for initializing a Color Picker instance and setting up its core properties like pixel ratio and callbacks. This is typically used when integrating the color picker into an application. ```javascript function t() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1; El(this, t), this.pixelRatio = e, this.generated = !1, this.centerCoordinates = { x: 144.5, y: 144.5 }, this.r = 289 * .49, this.color = { r: 255, g: 255, b: 255, a: 1 }, this.hueCircle = void 0, this.initialColor = { r: 255, g: 255, b: 255, a: 1 }, this.previousColor = void 0, this.applied = !1, this.updateCallback = function () { }, this.closeCallback = function () { }, this._create() } ``` -------------------------------- ### Get Distance to Line Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Calculates the shortest distance from a point to a line segment. ```javascript value: function (t, e, i, n, o, r) { var s = i - t, a = n - e, h = ((o - t) * s + (r - e) * a) / (s * s + a * a); h > 1 ? h = 1 : h < 0 && (h = 0); var l = t + h * s - o, d = e + h * a - r; return Math.sqrt(l * l + d * d) } ``` -------------------------------- ### Start Rendering Process Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html Initiates the rendering process by requesting the next animation frame or timeout. Ensures that rendering steps are executed efficiently. Call this when rendering needs to begin or resume. ```javascript _startRendering: function() { var t; !0 === this.renderingActive && (void 0 === this.renderTimer && (this.renderTimer = this._requestNextFrame(Z(t = this._renderStep).call(t, this), this.simulationInterval))) } ``` -------------------------------- ### Setup Hierarchical Layout Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Initializes and configures the hierarchical layout for the network if enabled and if nodes have levels defined. It determines level distribution and node placement. ```javascript if (!0 === this.options.hierarchical.enabled && this.body.nodeIndices.length > 0) { var t, e, i = !1, n = !1; for (e in this.lastNodeOnLevel = {}, this.hierarchical = new dv, this.body.nodes) Object.prototype.hasOwnProperty.call(this.body.nodes, e) && (void 0 !== (t = this.body.nodes[e]).options.level ? (i = !0, this.hierarchical.levels[e] = t.options.level) : n = !0); if (!0 === n && !0 === i) throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes."); if (!0 === n) { var o = this.options.hierarchical.sortMethod; "hubsize" === o ? this._determineLevelsByHubsize() : "directed" === o ? this._determineLevelsDirected() : "custom" === o && this._determineLevelsCustomCallback() } for (var r in this.body.nodes) Object.prototype.hasOwnProperty.call(this.body.nodes, r) && this.hierarchical.ensureLevel(r); var s = this._getDistribution(); this._generateMap(), this._placeNodesByHierarchy(s), this._condenseHierarchy(), this._shiftToCenter() } ``` -------------------------------- ### Get Selected Edges Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Returns an array of the currently selected edge objects. ```javascript getSelectedEdges: function () { return this._selectionAccumulator.getEdges() } ``` -------------------------------- ### Print Options to HTML Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html Renders the current configuration options as a formatted JSON string within a `
` tag in the options container.
```javascript
value: function () {
var t = this.getOptions();
this.optionsContainer.innerHTML = "var options = " + Ed(t, null, 2) + "
"
}
```
--------------------------------
### Get Selected Nodes
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Returns an array of the currently selected node objects.
```javascript
getSelectedNodes: function () { return this._selectionAccumulator.getNodes() }
```
--------------------------------
### Get All Overlapping Edges
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Finds all edge IDs that overlap with the given bounding box.
```javascript
_getAllEdgesOverlappingWith: function (t) { var e = []; return this._getEdgesOverlappingWith(t, e), e }
```
--------------------------------
### Get All Overlapping Nodes
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Finds all node IDs that overlap with the given bounding box.
```javascript
_getAllNodesOverlappingWith: function (t) { for (var e = [], i = this.body.nodes, n = 0; n < this.body.nodeIndices.length; n++) { var o = this.body.nodeIndices[n]; i[o].isOverlappingWith(t) && e.push(o) } return e }
```
--------------------------------
### Get Node Distribution by Level
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Organizes nodes into levels based on their hierarchical depth.
```javascript
{ key: "_getDistribution", value: function () { var t, e, i = {}; for (t in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, t)) { e = this.body.nodes[t]; var n = void 0 === this.hierarchical.levels[t] ? 0 : this.hierarchical.levels[t]; this.direction.fix(e, n), void 0 === i[n] && (i[n] = {}), i[n][t] = e } return i } }
```
--------------------------------
### Get View Position
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Calculates and returns the center position of the canvas in DOM coordinates.
```javascript
return this.canvas.DOMtoCanvas({ x: .5 * this.canvas.frame.canvas.clientWidth, y: .5 * this.canvas.frame.canvas.clientHeight })
```
--------------------------------
### Create DependenSee UI Elements
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Builds the user interface based on configured options and available modules. It iterates through configuration, creates headers, items, and the main button, then pushes the changes.
```javascript
this._clean(), this.changedOptions = [];
var t = yo(this.options), e = 0, i = !1;
for (var n in this.configureOptions)
Object.prototype.hasOwnProperty.call(this.configureOptions, n) &&
(this.allowCreation = !1,
i = !1,
"function" == typeof t ? i = (i = t(n, [])) || this._handleObject(this.configureOptions[n], [n], !0) :
!0 !== t && -1 === To(t).call(t, n) || (i = !0),
!1 !== i && (this.allowCreation = !0, e > 0 && this._makeItem([]), this._makeHeader(n), this._handleObject(this.configureOptions[n], [n])), e++);
this._makeButton(), this._push()
```
--------------------------------
### Get Distinct Values
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Retrieves an array of distinct values for a specified property from all items.
```javascript
distinct: function (t) { for (var e = this._data, i = kr(Id(e).call(e)), n = [], o = 0, r = 0, s = i.length; r < s; r++) { for (var a = i[r], h = e.get(a)[t], l = !1, d = 0; d < o; d++)if (n[d] == h) { l = !0; break } l || void 0 === h || (n[o] = h, o++) } return n }
```
--------------------------------
### Handle Touch Start
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Records the initial touch point and scale for drag and pinch gestures. It ensures that gestures are only registered if a sufficient time has passed since the last touch event.
```javascript
onTouch: function (t) { (new Date).valueOf() - this.touchTime > 50 && (this.drag.pointer = this.getPointer(t.center), this.drag.pinched = !1, this.pinch.scale = this.body.view.scale, this.touchTime = (new Date).valueOf()) }
```
--------------------------------
### JavaScript __proto__ Helper
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
A helper function to get or set the __proto__ property of an object.
```javascript
var Rd = i((function (t) { function e(i) { return t.exports = e = zd ? jd : function (t) { return t.__proto__ || jd(t) }, e(i) } t.exports = e }));
```
--------------------------------
### Physics Initialization and Options
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Initializes physics simulation with default options and allows for custom option merging. Handles enabling/disabling physics and setting simulation parameters.
```javascript
startedStabilization = !1, this.stabilizationIterations = 0, this.ready = !1, this.options = {}, this.defaultOptions = { enabled: !0, barnesHut: { theta: .5, gravitationalConstant: -2e3, centralGravity: .3, springLength: 95, springConstant: .04, damping: .09, avoidOverlap: 0 }, forceAtlas2Based: { theta: .5, gravitationalConstant: -50, centralGravity: .01, springConstant: .08, springLength: 100, damping: .4, avoidOverlap: 0 }, repulsion: { centralGravity: .2, springLength: 200, springConstant: .05, nodeDistance: 100, damping: .09, avoidOverlap: 0 }, hierarchicalRepulsion: { centralGravity: 0, springLength: 100, springConstant: .01, nodeDistance: 120, damping: .09 }, maxVelocity: 50, minVelocity: .75, solver: "barnesHut", stabilization: { enabled: !0, iterations: 1e3, updateInterval: 50, onlyDynamicEdges: !1, fit: !0 }, timestep: .5, adaptiveTimestep: !0, wind: { x: 0, y: 0 } }, mt(this.options, this.defaultOptions), this.timestep = .5, this.layoutFailed = !1, this.bindEventListeners() }
```
--------------------------------
### Print Formatted Options
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Renders the current configuration options as a formatted JSON string within a tag for display.
```javascript
var t = this.getOptions();
this.optionsContainer.innerHTML = "var options = " + Ed(t, null, 2) + "
"
```
--------------------------------
### Get Selected Nodes and Edges
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Returns the actual node and edge objects that are currently selected.
```javascript
getSelectedNodes: function () {
return this._selectionAccumulator.getNodes()
},
getSelectedEdges: function () {
return this._selectionAccumulator.getEdges()
}
```
--------------------------------
### View Constructor
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Initializes the View object, setting up event listeners for activation and deactivation, and configuring keyboard bindings.
```javascript
function t(e, i) { var n = this; El(this, t), this.body = e, this.canvas = i, this.iconsCreated = !1, this.navigationHammers = [], this.boundFunctions = {}, this.touchTime = 0, this.activated = !1, this.body.emitter.on("activate", (function () { n.activated = !0, n.configureKeyboardBindings() })), this.body.emitter.on("deactivate", (fu
```
--------------------------------
### Get Edge at Pointer
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Retrieves the edge object at the specified pointer coordinates based on proximity.
```javascript
getEdgeAt: function (t) { for (var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.canvas.DOMtoCanvas(t), n = 10, o = null, r = this.body.edges, s = 0; s < this.body.edgeIndices.length; s++) { var a = this.body.edgeIndices[s], h = r[a]; if (h.connected) { var l = h.from.x, d = h.from.y, c = h.to.x, u = h.to.y, f = h.edgeType.getDistanceToEdge(l, d, c, u, i.x, i.y); f < n && (o = a, n = f) } } return null !== o ? !0 === e ? this.body.edges[o] : o : void 0 }
```
--------------------------------
### Get Nodes in Cluster
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Retrieves a list of node IDs that are contained within a specified cluster.
```javascript
getNodesInCluster: function (t) {
var e = [];
if (!0 === this.isCluster(t)) {
var i = this.body.nodes[t].containedNodes;
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.push(this.body.nodes[n].id)
}
return e
}
```
--------------------------------
### Color Picker Initialization and DOM Manipulation
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
This snippet demonstrates the creation and setup of various DOM elements that constitute the color picker UI. It includes setting up the canvas, input ranges for brightness and opacity, and action buttons.
```javascript
this.frame = document.createElement("div"), this.frame.className = "vis-color-picker", this.colorPickerDiv = document.createElement("div"), this.colorPickerSelector = document.createElement("div"), this.colorPickerSelector.className = "vis-selector", this.colorPickerDiv.appendChild(this.colorPickerSelector), this.colorPickerCanvas = document.createElement("canvas"), this.colorPickerDiv.appendChild(this.colorPickerCanvas), this.colorPickerCanvas.getContext) { var o = this.colorPickerCanvas.getContext("2d"); this.pixelRatio = (window.devicePixelRatio || 1) / (o.webkitBackingStorePixelRatio || o.mozBackingStorePixelRatio || o.msBackingStorePixelRatio || o.oBackingStorePixelRatio || o.backingStorePixelRatio || 1), this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0) } else { var r = document.createElement("DIV"); r.style.color = "red", r.style.fontWeight = "bold", r.style.padding = "10px", r.innerHTML = "Error: your browser does not support HTML canvas", this.colorPickerCanvas.appendChild(r) } this.colorPickerDiv.className = "vis-color", this.opacityDiv = document.createElement("div"), this.opacityDiv.className = "vis-opacity", this.brightnessDiv = document.createElement("div"), this.brightnessDiv.className = "vis-brightness", this.arrowDiv = document.createElement("div"), this.arrowDiv.className = "vis-arrow", this.opacityRange = document.createElement("input"); try { this.opacityRange.type = "range", this.opacityRange.min = "0", this.opacityRange.max = "100" } catch (t) { } this.opacityRange.value = "100", this.opacityRange.className = "vis-range", this.brightnessRange = document.createElement("input"); try { this.brightnessRange.type = "range", this.brightnessRange.min = "0", this.brightnessRange.max = "100" } catch (t) { } this.brightnessRange.value = "100", this.brightnessRange.className = "vis-range", this.opacityDiv.appendChild(this.opacityRange), this.brightnessDiv.appendChild(this.brightnessRange); var s = this; this.opacityRange.onchange = function () { s._setOpacity(this.value) }, this.opacityRange.oninput = function () { s._setOpacity(this.value) }, this.brightnessRange.onchange = function () { s._setBrightness(this.value) }, this.brightnessRange.oninput = function () { s._setBrightness(this.value) }, this.brightnessLabel = document.createElement("div"), this.brightnessLabel.className = "vis-label vis-brightness", this.brightnessLabel.innerHTML = "brightness:", this.opacityLabel = document.createElement("div"), this.opacityLabel.className = "vis-label vis-opacity", this.opacityLabel.innerHTML = "opacity:", this.newColorDiv = document.createElement("div"), this.newColorDiv.className = "vis-new-color", this.newColorDiv.innerHTML = "new", this.initialColorDiv = document.createElement("div"), this.initialColorDiv.className = "vis-initial-color", this.initialColorDiv.innerHTML = "initial", this.cancelButton = document.createElement("div"), this.cancelButton.className = "vis-button vis-cancel", this.cancelButton.innerHTML = "cancel", this.cancelButton.onclick = Z(t = this._hide).call(t, this, !1), this.applyButton = document.createElement("div"), this.applyButton.className = "vis-button vis-apply", this.applyButton.innerHTML = "apply", this.applyButton.onclick = Z(e = this._apply).call(e, this), this.saveButton = document.createElement("div"), this.saveButton.className = "vis-button vis-save", this.saveButton.innerHTML = "save", this.saveButton.onclick = Z(i = this._save).call(i, this), this.loadButton = document.createElement("div"), this.loadButton.className = "vis-button vis-load", this.loadButton.innerHTML = "load last", this.loadButton.onclick = Z(n = this._loadLast).call(n, this), this.frame.appendChild(this.colorPickerDiv), this.frame.appendChild(this.arrowDiv), this.frame.appendChild(this.brightnessLabel), this.frame.appendChild(this.brightnessDiv), this.frame.appendChild(this.opacityLabel), this.frame.appendChild(this.opacityDiv), this.frame.appendChild(this.newColorDiv), this.frame.appendChild(this.initialColorDiv), this.frame.appendChild(this.cancelButton), this.frame.appendChild(this.applyButton), this.frame.appendChild(this.saveButton), this.frame.appendChild(this.loadB
```
--------------------------------
### Create Node
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Creates a new node instance with provided data and options. Uses a default constructor if none is specified.
```javascript
create: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Xu; return new e(t, this.body, this.images, this.groups, this.options, this.defaultOptions) }
```
--------------------------------
### Get Data Set from Data View
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Retrieves the data set associated with the data view.
```javascript
return this._data.getDataSet()
```
--------------------------------
### Initialize and Configure Navigation
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Initializes navigation elements and configures keyboard bindings. This code is executed when options are set or the component is created.
```javascript
Sl(t, [{ key: "setOptions", value: function (t) { void 0 !== t && (this.options = t, this.create()) } }, { key: "create", value: function () { !0 === this.options.navigationButtons ? !1 === this.iconsCreated && this.loadNavigationElements() : !0 === this.iconsCreated && this.cleanNavigation(), this.configureKeyboardBindings() } }, { key: "cleanNavigation", value: function () { if (0 != this.navigationHammers.length) { for (var t = 0; t < this.navigationHammers.length; t++)this.navigationHammers[t].destroy(); this.navigationHammers = [] } this.navigationDOM && this.navigationDOM.wrapper && this.navigationDOM.wrapper.parentNode && this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper), this.iconsCreated = !1 } }, { key: "loadNavigationElements", value: function () { var t = this; this.cleanNavigation(), this.navigationDOM = {}; var e = ["up", "down", "left", "right", "zoomIn", "zoomOut", "zoomExtends"], i = ["_moveUp", "_moveDown", "_moveLeft", "_moveRight", "_zoomIn", "_zoomOut", "_fit" ]; this.navigationDOM.wrapper = document.createElement("div"), this.navigationDOM.wrapper.className = "vis-navigation", this.canvas.frame.appendChild(this.navigationDOM.wrapper); for (var n = 0; n < e.length; n++) { this.navigationDOM[e[n]] = document.createElement("div"), this.navigationDOM[e[n]].className = "vis-button vis-" + e[n], this.navigationDOM[e[n]].appendChild(this.navigationDOM[e[n]]), var o, r, s = new wl(this.navigationDOM[e[n]]); if ("_fit" === i[n]) dp(s, Z(o = this._fit).call(o, this)); else dp(s, Z(r = this.bindToRedraw).call(r, this, i[n])); this.navigationHammers.push(s) } var a = new wl(this.canvas.frame); cp(a, (function () { t._stopMovement() })), this.navigationHammers.push(a), this.iconsCreated = !0 } }, { key: "bindToRedraw", value: function (t) { var e; void 0 === this.boundFunctions[t] && (this.boundFunctions[t] = Z(e = this[t]).call(e, this), this.body.emitter.on("initRedraw", this.boundFunctions[t]), this.body.emitter.emit("_startRendering")) } }, { key: "unbindFromRedraw", value: function (t) { void 0 !== this.boundFunctions[t] && (this.body.emitter.off("initRedraw", this.boundFunctions[t]), this.body.emitter.emit("_stopRendering"), delete this.boundFunctions[t]) } }, { key: "_fit", value: function () { (new Date).valueOf() - this.touchTime > 700 && (this.body.emitter.emit("fit", { duration: 700 }), this.touchTime = (new Date).valueOf()) } }, { key: "_stopMovement", value: function () { for (var t in this.boundFunctions) Object.prototype.hasOwnProperty.call(this.boundFunctions, t) && (this.body.emitter.off("initRedraw", this.boundFunctions[t]), this.body.emitter.emit("_stopRendering")); this.boundFunctions = {} } }, { key: "_moveUp", value: function () { this.body.view.translation.y += this.options.keyboard.speed.y } }, { key: "_moveDown", value: function () { this.body.view.translation.y -= this.options.keyboard.speed.y } }, { key: "_moveLeft", value: function () { this.body.view.translation.x += this.options.keyboard.speed.x } }, { key: "_moveRight", value: function () { this.body.view.translation.x -= this.options.keyboard.speed.x } }, { key: "_zoomIn", value: function () { var t = this.body.view.scale, e = this.body.view.scale * (1 + this.options.keyboard.speed.zoom), i = this.body.view.translation, n = e / t, o = (1 - n) * this.canvas.canvasViewCenter.x + i.x * n, r = (1 - n) * this.canvas.canvasViewCenter.y + i.y * n; this.body.view.scale = e, this.body.view.translation = { x: o, y: r }, this.body.emitter.emit("zoom", { direction: "+", scale: this.body.view.scale, pointer: null }) } }, { key: "_zoomOut", value: function () { var t = this.body.view.scale, e = this.body.view.scale / (1 + this.options.keyboard.speed.zoom), i = this.body.view.translation, n = e / t, o = (1 - n) * this.canvas.canvasViewCenter.x + i.x * n, r = (1 - n) * this.canvas.canvasViewCenter.y + i.y * n; this.body.view.scale = e, this.body.view.translation = { x: o, y: r }, this.body.emitter.emit("zoom", { direction: "-", scale: this.body.view.scale, pointer: null }) } }, { key: "configureKeyboardBindings", value: function () { var t, e, i, n, o, r, s, a, h, l, d, c, u, f, p, v, g, y, m, b, w, k, _, x, E = this; (void 0 !== this.keycharm && this.keycharm.destroy(), !0 === this.options.keyboard.enabled) && (!0 === this.options.keyboard.bindToWindow ? this.keycharm = Ma({ container: window, preventDefault: !0 }) : this.keycharm = Ma({ container: this.canvas.frame, preventDefault: !0 })), this.keycharm.reset(), !0 === this.activated && (Z(t = this.keycharm).call(t, "up", (function () { E.bindToRedraw("_moveUp") }), "keydown"), Z(e = this.keycharm).call(e, "down", (function () { E.bindToRedraw("_moveDown") }), "keydown"), Z(i = this.keych
```
--------------------------------
### Getting Own Property Symbols
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Retrieves an array of all own property symbols of a given object using Object.getOwnPropertySymbols.
```javascript
var sym = Symbol('a');
var obj = { [sym]: 1 };
var symbols = Object.getOwnPropertySymbols(obj);
```
--------------------------------
### Get Active Edges for a Node
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Filters and returns only the active edges connected to a given node.
```javascript
{ key: "_getActiveEdges", value: function (t) { var e = this, i = []; return ss(t.edges, (function (t) { var n; -1 !== To(n = e.body.edgeIndices).call(n, t.id) && i.push(t) })), i } }
```
--------------------------------
### Run DependenSee Without Arguments
Source: https://github.com/madushans/dependensee/blob/main/README.md
Running DependenSee without any arguments will display the full CLI documentation.
```bash
DependenSee
```
--------------------------------
### Get Selected Edge IDs
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Extracts and returns an array of IDs for all currently selected edges.
```javascript
getSelectedEdgeIds: function () { var t; return cr(t = this._selectionAccumulator.getEdges()).call(t, (function (t) { return t.id })) }
```
--------------------------------
### Basic Usage of DependenSee
Source: https://github.com/madushans/dependensee/blob/main/README.md
Generates an HTML dependency graph. Specify the root directory of projects and the output HTML file path.
```bash
DependenSee root/of/projects path/to/output.html
```
--------------------------------
### Using Object.defineProperty with Symbols
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Demonstrates how to define a property on an object using a Symbol as the key with Object.defineProperty.
```javascript
var sym = Symbol('my_key');
var obj = {};
Object.defineProperty(obj, sym, { value: 'secret' });
```
--------------------------------
### Get Selected Node IDs
Source: https://github.com/madushans/dependensee/blob/main/DependenSee/HtmlResultTemplate.html
Extracts and returns an array of IDs for all currently selected nodes.
```javascript
getSelectedNodeIds: function () { var t; return cr(t = this._selectionAccumulator.getNodes()).call(t, (function (t) { return t.id })) }
```
--------------------------------
### Physics Solver Initialization
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Initializes the appropriate physics solver based on the selected options (e.g., forceAtlas2Based, repulsion, barnesHut).
```javascript
init: function () {
var t;
"forceAtlas2Based" === this.options.solver ? (t = this.options.forceAtlas2Based, this.nodesSolver = new Xf(this.body, this.physicsBody, t), this.edgesSolver = new qf(this.body, this.physicsBody, t), this.gravitySolver = new Kf(this.body, this.physicsBody, t)) :
"repulsion" === this.options.solver ? (t = this.options.repulsion, this.nodesSolver = new Hf(this.body, this.physicsBody, t), this.edgesSolver = new qf(this.body, this.physicsBody, t), this.gravitySolver = new Uf(this.body, this.physicsBody, t)) :
"hierarchicalRepulsion" === this.options.solver ? (t = this.options.hierarchicalRepulsion, this.nodesSolver = new Wf(this.body, this.physicsBody, t), this.edgesSolver = new Vf(this.body, this.physicsBody, t), this.gravitySolver = new Uf(this.body, this.physicsBody, t)) :
(t = this.options.barnesHut, this.nodesSolver = new Lf(this.body, this.physicsBody, t), this.edgesSolver = new qf(this.body, this.physicsBody, t), this.gravitySolver = new Uf(this.body, this.physicsBody, t)),
this.modelOptions = t
}
```
--------------------------------
### Using Object.defineProperties with Symbols
Source: https://github.com/madushans/dependensee/blob/main/sample-html-output.html
Shows how to define multiple properties on an object, including Symbol-keyed properties, using Object.defineProperties.
```javascript
var sym1 = Symbol('key1');
var sym2 = Symbol('key2');
var obj = {};
Object.defineProperties(obj, {
[sym1]: { value: 'value1' },
[sym2]: { value: 'value2' }
});
```
--------------------------------
### Exclude Project Namespaces
Source: https://github.com/madushans/dependensee/blob/main/docs/CommandLine.md
Excludes projects starting with specified namespaces. Use the full or shorthand flag.
```bash
DependenSee \Source\SolutionFolder -O ConsoleJson -ExcludeProjectNamespaces MyApp.Extensions, MyApp.Helpers
```
```bash
DependenSee \Source\SolutionFolder -O ConsoleJson -EPrN MyApp.Extensions, MyApp.Helpers
```