@tsparticles/interaction-particles-links 3.0.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/356.min.js +2 -0
- package/356.min.js.LICENSE.txt +1 -0
- package/806.min.js +2 -0
- package/806.min.js.LICENSE.txt +1 -0
- package/838.min.js +2 -0
- package/838.min.js.LICENSE.txt +1 -0
- package/browser/CircleWarp.js +3 -2
- package/browser/LinkInstance.js +12 -9
- package/browser/Linker.js +18 -8
- package/browser/interaction.js +4 -2
- package/browser/plugin.js +2 -2
- package/cjs/CircleWarp.js +3 -2
- package/cjs/LinkInstance.js +12 -9
- package/cjs/Linker.js +41 -8
- package/cjs/interaction.js +27 -2
- package/cjs/plugin.js +26 -3
- package/dist_browser_CircleWarp_js.js +30 -0
- package/dist_browser_LinkInstance_js.js +40 -0
- package/dist_browser_Linker_js.js +30 -0
- package/esm/CircleWarp.js +3 -2
- package/esm/LinkInstance.js +12 -9
- package/esm/Linker.js +18 -8
- package/esm/interaction.js +4 -2
- package/esm/plugin.js +2 -2
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.interaction.particles.links.js +291 -620
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.interaction.particles.links.min.js.LICENSE.txt +1 -1
- package/types/LinkInstance.d.ts +1 -1
- package/types/Types.d.ts +4 -4
- package/umd/CircleWarp.js +3 -2
- package/umd/LinkInstance.js +12 -9
- package/umd/Linker.js +43 -9
- package/umd/interaction.js +29 -3
- package/umd/plugin.js +28 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.interaction.particles.links.min.js.LICENSE.txt */
|
|
2
|
-
!function(
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(this,(e=>(()=>{var t,i,r={515:(e,t,i)=>{i.d(t,{y:()=>a});var r=i(533),o=i(470),n=i(597);class a{constructor(){this.blink=!1,this.color=new r.OptionsColor,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new o.u,this.triangles=new n.e,this.width=1,this.warp=!1}load(e){e&&(void 0!==e.id&&(this.id=e.id),void 0!==e.blink&&(this.blink=e.blink),this.color=r.OptionsColor.create(this.color,e.color),void 0!==e.consent&&(this.consent=e.consent),void 0!==e.distance&&(this.distance=e.distance),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.frequency&&(this.frequency=e.frequency),void 0!==e.opacity&&(this.opacity=e.opacity),this.shadow.load(e.shadow),this.triangles.load(e.triangles),void 0!==e.width&&(this.width=e.width),void 0!==e.warp&&(this.warp=e.warp))}}},470:(e,t,i)=>{i.d(t,{u:()=>o});var r=i(533);class o{constructor(){this.blur=5,this.color=new r.OptionsColor,this.color.value="#000",this.enable=!1}load(e){e&&(void 0!==e.blur&&(this.blur=e.blur),this.color=r.OptionsColor.create(this.color,e.color),void 0!==e.enable&&(this.enable=e.enable))}}},597:(e,t,i)=>{i.d(t,{e:()=>o});var r=i(533);class o{constructor(){this.enable=!1,this.frequency=1}load(e){e&&(void 0!==e.color&&(this.color=r.OptionsColor.create(this.color,e.color)),void 0!==e.enable&&(this.enable=e.enable),void 0!==e.frequency&&(this.frequency=e.frequency),void 0!==e.opacity&&(this.opacity=e.opacity))}}},533:t=>{t.exports=e}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.m=r,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,i)=>(n.f[i](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},i="@tsparticles/interaction-particles-links:",n.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var s,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==i+o){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",i+o),s.src=e),t[e]=[r];var h=(i,r)=>{s.onerror=s.onload=null,clearTimeout(p);var o=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),i)return i(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),c&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var r=i.length-1;r>-1&&!e;)e=i[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={71:0};n.f.j=(t,i)=>{var r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)i.push(r[2]);else{var o=new Promise(((i,o)=>r=e[t]=[i,o]));i.push(r[2]=o);var a=n.p+n.u(t),s=new Error;n.l(a,(i=>{if(n.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,r[1](s)}}),"chunk-"+t,t)}};var t=(t,i)=>{var r,o,a=i[0],s=i[1],c=i[2],l=0;if(a.some((t=>0!==e[t]))){for(r in s)n.o(s,r)&&(n.m[r]=s[r]);if(c)c(n)}for(t&&t(i);l<a.length;l++)o=a[l],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0},i=this.webpackChunk_tsparticles_interaction_particles_links=this.webpackChunk_tsparticles_interaction_particles_links||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var a={};return(()=>{n.r(a),n.d(a,{Links:()=>t.y,LinksShadow:()=>i.u,LinksTriangle:()=>r.e,loadParticlesLinksInteraction:()=>o});class e{constructor(){this.id="links"}async getPlugin(e){const{LinkInstance:t}=await n.e(838).then(n.bind(n,838));return new t(e)}loadOptions(){}needsPlugin(){return!0}}var t=n(515),i=n(470),r=n(597);async function o(t,i=!0){await async function(e,t=!0){await e.addInteractor("particlesLinks",(async e=>{const{Linker:t}=await n.e(806).then(n.bind(n,806));return new t(e)}),t)}(t,i),await async function(t,i=!0){const r=new e;await t.addPlugin(r,i)}(t,i)}})(),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Links Particles Interaction v3.0
|
|
1
|
+
/*! tsParticles Links Particles Interaction v3.2.0 by Matteo Bruni */
|
package/types/LinkInstance.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare class LinkInstance implements IContainerPlugin {
|
|
|
4
4
|
private readonly container;
|
|
5
5
|
private readonly _freqs;
|
|
6
6
|
constructor(container: LinkContainer);
|
|
7
|
-
drawParticle(context: CanvasRenderingContext2D, particle: LinkParticle): void
|
|
7
|
+
drawParticle(context: CanvasRenderingContext2D, particle: LinkParticle): Promise<void>;
|
|
8
8
|
init(): Promise<void>;
|
|
9
9
|
particleCreated(particle: LinkParticle): void;
|
|
10
10
|
particleDestroyed(particle: LinkParticle): void;
|
package/types/Types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type LinkParticle = Particle & {
|
|
|
16
16
|
linksWidth?: number;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export interface LinkLineDrawParams {
|
|
20
20
|
backgroundMask: BackgroundMask;
|
|
21
21
|
begin: ICoordinates;
|
|
22
22
|
canvasSize: IDimension;
|
|
@@ -27,8 +27,8 @@ export type LinkLineDrawParams = {
|
|
|
27
27
|
maxDistance: number;
|
|
28
28
|
opacity: number;
|
|
29
29
|
width: number;
|
|
30
|
-
}
|
|
31
|
-
export
|
|
30
|
+
}
|
|
31
|
+
export interface LinkTriangleDrawParams {
|
|
32
32
|
backgroundMask: BackgroundMask;
|
|
33
33
|
colorTriangle: IRgb;
|
|
34
34
|
context: CanvasRenderingContext2D;
|
|
@@ -36,7 +36,7 @@ export type LinkTriangleDrawParams = {
|
|
|
36
36
|
pos1: ICoordinates;
|
|
37
37
|
pos2: ICoordinates;
|
|
38
38
|
pos3: ICoordinates;
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
export type IParticlesLinkOptions = IParticlesOptions & {
|
|
41
41
|
links?: ILinks;
|
|
42
42
|
};
|
package/umd/CircleWarp.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CircleWarp = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
+
const double = 2;
|
|
14
15
|
class CircleWarp extends engine_1.Circle {
|
|
15
16
|
constructor(x, y, radius, canvasSize) {
|
|
16
17
|
super(x, y, radius);
|
|
@@ -34,11 +35,11 @@
|
|
|
34
35
|
y: range.position.y - this.canvasSize.height,
|
|
35
36
|
};
|
|
36
37
|
if (circle.radius !== undefined) {
|
|
37
|
-
const biggerCircle = new engine_1.Circle(newPos.x, newPos.y, circle.radius *
|
|
38
|
+
const biggerCircle = new engine_1.Circle(newPos.x, newPos.y, circle.radius * double);
|
|
38
39
|
return super.intersects(biggerCircle);
|
|
39
40
|
}
|
|
40
41
|
else if (rect.size !== undefined) {
|
|
41
|
-
const rectSW = new engine_1.Rectangle(newPos.x, newPos.y, rect.size.width *
|
|
42
|
+
const rectSW = new engine_1.Rectangle(newPos.x, newPos.y, rect.size.width * double, rect.size.height * double);
|
|
42
43
|
return super.intersects(rectSW);
|
|
43
44
|
}
|
|
44
45
|
return false;
|
package/umd/LinkInstance.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
exports.LinkInstance = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const Utils_js_1 = require("./Utils.js");
|
|
15
|
+
const minOpacity = 0, minWidth = 0, minDistance = 0, half = 0.5;
|
|
15
16
|
class LinkInstance {
|
|
16
17
|
constructor(container) {
|
|
17
18
|
this.container = container;
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
if (!colorLine) {
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
|
-
const width = p1.retina.linksWidth ??
|
|
45
|
+
const width = p1.retina.linksWidth ?? minWidth, maxDistance = p1.retina.linksDistance ?? minDistance, { backgroundMask } = options;
|
|
45
46
|
(0, Utils_js_1.drawLinkLine)({
|
|
46
47
|
context: ctx,
|
|
47
48
|
width,
|
|
@@ -65,12 +66,12 @@
|
|
|
65
66
|
if (!triangleOptions.enable) {
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
const container = this.container, options = container.actualOptions, p2 = link1.destination, p3 = link2.destination, opacityTriangle = triangleOptions.opacity ?? (link1.opacity + link2.opacity)
|
|
69
|
-
if (opacityTriangle <=
|
|
69
|
+
const container = this.container, options = container.actualOptions, p2 = link1.destination, p3 = link2.destination, opacityTriangle = triangleOptions.opacity ?? (link1.opacity + link2.opacity) * half;
|
|
70
|
+
if (opacityTriangle <= minOpacity) {
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
73
|
container.canvas.draw((ctx) => {
|
|
73
|
-
const pos1 = p1.getPosition(), pos2 = p2.getPosition(), pos3 = p3.getPosition(), linksDistance = p1.retina.linksDistance ??
|
|
74
|
+
const pos1 = p1.getPosition(), pos2 = p2.getPosition(), pos3 = p3.getPosition(), linksDistance = p1.retina.linksDistance ?? minDistance;
|
|
74
75
|
if ((0, engine_1.getDistance)(pos1, pos2) > linksDistance ||
|
|
75
76
|
(0, engine_1.getDistance)(pos3, pos2) > linksDistance ||
|
|
76
77
|
(0, engine_1.getDistance)(pos3, pos1) > linksDistance) {
|
|
@@ -103,10 +104,10 @@
|
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
106
|
const vertices = p2.links?.filter((t) => {
|
|
106
|
-
const linkFreq = this._getLinkFrequency(p2, t.destination);
|
|
107
|
+
const linkFreq = this._getLinkFrequency(p2, t.destination), minCount = 0;
|
|
107
108
|
return (p2.options.links &&
|
|
108
109
|
linkFreq <= p2.options.links.frequency &&
|
|
109
|
-
p1Links.findIndex((l) => l.destination === t.destination) >=
|
|
110
|
+
p1Links.findIndex((l) => l.destination === t.destination) >= minCount);
|
|
110
111
|
});
|
|
111
112
|
if (!vertices?.length) {
|
|
112
113
|
return;
|
|
@@ -130,22 +131,24 @@
|
|
|
130
131
|
triangles: new Map(),
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
|
-
drawParticle(context, particle) {
|
|
134
|
+
async drawParticle(context, particle) {
|
|
134
135
|
const { links, options } = particle;
|
|
135
|
-
if (!links
|
|
136
|
+
if (!links?.length) {
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
139
|
const p1Links = links.filter((l) => options.links && this._getLinkFrequency(particle, l.destination) <= options.links.frequency);
|
|
139
140
|
for (const link of p1Links) {
|
|
140
141
|
this._drawTriangles(options, particle, link, p1Links);
|
|
141
|
-
if (link.opacity >
|
|
142
|
+
if (link.opacity > minOpacity && (particle.retina.linksWidth ?? minWidth) > minWidth) {
|
|
142
143
|
this._drawLinkLine(particle, link);
|
|
143
144
|
}
|
|
144
145
|
}
|
|
146
|
+
await Promise.resolve();
|
|
145
147
|
}
|
|
146
148
|
async init() {
|
|
147
149
|
this._freqs.links = new Map();
|
|
148
150
|
this._freqs.triangles = new Map();
|
|
151
|
+
await Promise.resolve();
|
|
149
152
|
}
|
|
150
153
|
particleCreated(particle) {
|
|
151
154
|
particle.links = [];
|
package/umd/Linker.js
CHANGED
|
@@ -1,18 +1,45 @@
|
|
|
1
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
+
if (k2 === undefined) k2 = k;
|
|
3
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
+
}
|
|
7
|
+
Object.defineProperty(o, k2, desc);
|
|
8
|
+
}) : (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
o[k2] = m[k];
|
|
11
|
+
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
1
24
|
(function (factory) {
|
|
2
25
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
26
|
var v = factory(require, exports);
|
|
4
27
|
if (v !== undefined) module.exports = v;
|
|
5
28
|
}
|
|
6
29
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./
|
|
30
|
+
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Links.js"], factory);
|
|
8
31
|
}
|
|
9
32
|
})(function (require, exports) {
|
|
10
33
|
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
36
|
exports.Linker = void 0;
|
|
13
37
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const CircleWarp_js_1 = require("./CircleWarp.js");
|
|
15
38
|
const Links_js_1 = require("./Options/Classes/Links.js");
|
|
39
|
+
const squarePower = 2, opacityOffset = 1, origin = {
|
|
40
|
+
x: 0,
|
|
41
|
+
y: 0,
|
|
42
|
+
}, minDistance = 0;
|
|
16
43
|
function getLinkDistance(pos1, pos2, optDistance, canvasSize, warp) {
|
|
17
44
|
const { dx, dy, distance } = (0, engine_1.getDistances)(pos1, pos2);
|
|
18
45
|
if (!warp || distance <= optDistance) {
|
|
@@ -25,7 +52,7 @@
|
|
|
25
52
|
x: Math.min(absDiffs.x, canvasSize.width - absDiffs.x),
|
|
26
53
|
y: Math.min(absDiffs.y, canvasSize.height - absDiffs.y),
|
|
27
54
|
};
|
|
28
|
-
return Math.sqrt(warpDistances.x **
|
|
55
|
+
return Math.sqrt(warpDistances.x ** squarePower + warpDistances.y ** squarePower);
|
|
29
56
|
}
|
|
30
57
|
class Linker extends engine_1.ParticlesInteractorBase {
|
|
31
58
|
constructor(container) {
|
|
@@ -64,12 +91,19 @@
|
|
|
64
91
|
}
|
|
65
92
|
p1.links = [];
|
|
66
93
|
const pos1 = p1.getPosition(), container = this.container, canvasSize = container.canvas.size;
|
|
67
|
-
if (pos1.x <
|
|
94
|
+
if (pos1.x < origin.x || pos1.y < origin.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
|
|
68
95
|
return;
|
|
69
96
|
}
|
|
70
|
-
const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ??
|
|
71
|
-
|
|
72
|
-
|
|
97
|
+
const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp;
|
|
98
|
+
let range;
|
|
99
|
+
if (warp) {
|
|
100
|
+
const { CircleWarp } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./CircleWarp.js"))) : new Promise((resolve_1, reject_1) => { require(["./CircleWarp.js"], resolve_1, reject_1); }).then(__importStar));
|
|
101
|
+
range = new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
range = new engine_1.Circle(pos1.x, pos1.y, optDistance);
|
|
105
|
+
}
|
|
106
|
+
const query = container.particles.quadTree.query(range);
|
|
73
107
|
for (const p2 of query) {
|
|
74
108
|
const linkOpt2 = p2.options.links;
|
|
75
109
|
if (p1 === p2 ||
|
|
@@ -83,14 +117,14 @@
|
|
|
83
117
|
continue;
|
|
84
118
|
}
|
|
85
119
|
const pos2 = p2.getPosition();
|
|
86
|
-
if (pos2.x <
|
|
120
|
+
if (pos2.x < origin.x || pos2.y < origin.y || pos2.x > canvasSize.width || pos2.y > canvasSize.height) {
|
|
87
121
|
continue;
|
|
88
122
|
}
|
|
89
123
|
const distance = getLinkDistance(pos1, pos2, optDistance, canvasSize, warp && linkOpt2.warp);
|
|
90
124
|
if (distance > optDistance) {
|
|
91
125
|
continue;
|
|
92
126
|
}
|
|
93
|
-
const opacityLine = (
|
|
127
|
+
const opacityLine = (opacityOffset - distance / optDistance) * optOpacity;
|
|
94
128
|
this._setColor(p1);
|
|
95
129
|
p1.links.push({
|
|
96
130
|
destination: p2,
|
package/umd/interaction.js
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
+
if (k2 === undefined) k2 = k;
|
|
3
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
+
}
|
|
7
|
+
Object.defineProperty(o, k2, desc);
|
|
8
|
+
}) : (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
o[k2] = m[k];
|
|
11
|
+
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
1
24
|
(function (factory) {
|
|
2
25
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
26
|
var v = factory(require, exports);
|
|
4
27
|
if (v !== undefined) module.exports = v;
|
|
5
28
|
}
|
|
6
29
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"
|
|
30
|
+
define(["require", "exports"], factory);
|
|
8
31
|
}
|
|
9
32
|
})(function (require, exports) {
|
|
10
33
|
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
36
|
exports.loadLinksInteraction = void 0;
|
|
13
|
-
const Linker_js_1 = require("./Linker.js");
|
|
14
37
|
async function loadLinksInteraction(engine, refresh = true) {
|
|
15
|
-
await engine.addInteractor("particlesLinks", (container) =>
|
|
38
|
+
await engine.addInteractor("particlesLinks", async (container) => {
|
|
39
|
+
const { Linker } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Linker.js"))) : new Promise((resolve_1, reject_1) => { require(["./Linker.js"], resolve_1, reject_1); }).then(__importStar));
|
|
40
|
+
return new Linker(container);
|
|
41
|
+
}, refresh);
|
|
16
42
|
}
|
|
17
43
|
exports.loadLinksInteraction = loadLinksInteraction;
|
|
18
44
|
});
|
package/umd/plugin.js
CHANGED
|
@@ -1,22 +1,46 @@
|
|
|
1
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
+
if (k2 === undefined) k2 = k;
|
|
3
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
+
}
|
|
7
|
+
Object.defineProperty(o, k2, desc);
|
|
8
|
+
}) : (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
o[k2] = m[k];
|
|
11
|
+
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
1
24
|
(function (factory) {
|
|
2
25
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
26
|
var v = factory(require, exports);
|
|
4
27
|
if (v !== undefined) module.exports = v;
|
|
5
28
|
}
|
|
6
29
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"
|
|
30
|
+
define(["require", "exports"], factory);
|
|
8
31
|
}
|
|
9
32
|
})(function (require, exports) {
|
|
10
33
|
"use strict";
|
|
34
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
36
|
exports.loadLinksPlugin = void 0;
|
|
13
|
-
const LinkInstance_js_1 = require("./LinkInstance.js");
|
|
14
37
|
class LinksPlugin {
|
|
15
38
|
constructor() {
|
|
16
39
|
this.id = "links";
|
|
17
40
|
}
|
|
18
|
-
getPlugin(container) {
|
|
19
|
-
|
|
41
|
+
async getPlugin(container) {
|
|
42
|
+
const { LinkInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./LinkInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./LinkInstance.js"], resolve_1, reject_1); }).then(__importStar));
|
|
43
|
+
return new LinkInstance(container);
|
|
20
44
|
}
|
|
21
45
|
loadOptions() {
|
|
22
46
|
}
|