@tsparticles/interaction-particles-links 3.0.0-beta.2 → 3.0.0-beta.4
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/browser/Utils.js +8 -1
- package/cjs/Utils.js +10 -2
- package/esm/Utils.js +8 -1
- package/package.json +3 -3
- package/report.html +4 -22
- package/tsparticles.interaction.particles.links.js +9 -2
- package/tsparticles.interaction.particles.links.min.js +1 -1
- package/tsparticles.interaction.particles.links.min.js.LICENSE.txt +1 -1
- package/types/Utils.d.ts +2 -0
- package/umd/Utils.js +10 -2
package/browser/Utils.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import { drawLine,
|
|
1
|
+
import { drawLine, getDistance, getDistances, getRandom, getStyleFromRgb, rangeColorToRgb, } from "@tsparticles/engine";
|
|
2
|
+
export function drawTriangle(context, p1, p2, p3) {
|
|
3
|
+
context.beginPath();
|
|
4
|
+
context.moveTo(p1.x, p1.y);
|
|
5
|
+
context.lineTo(p2.x, p2.y);
|
|
6
|
+
context.lineTo(p3.x, p3.y);
|
|
7
|
+
context.closePath();
|
|
8
|
+
}
|
|
2
9
|
export function drawLinkLine(params) {
|
|
3
10
|
let drawn = false;
|
|
4
11
|
const { begin, end, maxDistance, context, canvasSize, width, backgroundMask, colorLine, opacity, links } = params;
|
package/cjs/Utils.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setLinkFrequency = exports.getLinkKey = exports.drawLinkTriangle = exports.drawLinkLine = void 0;
|
|
3
|
+
exports.setLinkFrequency = exports.getLinkKey = exports.drawLinkTriangle = exports.drawLinkLine = exports.drawTriangle = void 0;
|
|
4
4
|
const engine_1 = require("@tsparticles/engine");
|
|
5
|
+
function drawTriangle(context, p1, p2, p3) {
|
|
6
|
+
context.beginPath();
|
|
7
|
+
context.moveTo(p1.x, p1.y);
|
|
8
|
+
context.lineTo(p2.x, p2.y);
|
|
9
|
+
context.lineTo(p3.x, p3.y);
|
|
10
|
+
context.closePath();
|
|
11
|
+
}
|
|
12
|
+
exports.drawTriangle = drawTriangle;
|
|
5
13
|
function drawLinkLine(params) {
|
|
6
14
|
let drawn = false;
|
|
7
15
|
const { begin, end, maxDistance, context, canvasSize, width, backgroundMask, colorLine, opacity, links } = params;
|
|
@@ -75,7 +83,7 @@ function drawLinkLine(params) {
|
|
|
75
83
|
exports.drawLinkLine = drawLinkLine;
|
|
76
84
|
function drawLinkTriangle(params) {
|
|
77
85
|
const { context, pos1, pos2, pos3, backgroundMask, colorTriangle, opacityTriangle } = params;
|
|
78
|
-
|
|
86
|
+
drawTriangle(context, pos1, pos2, pos3);
|
|
79
87
|
if (backgroundMask.enable) {
|
|
80
88
|
context.globalCompositeOperation = backgroundMask.composite;
|
|
81
89
|
}
|
package/esm/Utils.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import { drawLine,
|
|
1
|
+
import { drawLine, getDistance, getDistances, getRandom, getStyleFromRgb, rangeColorToRgb, } from "@tsparticles/engine";
|
|
2
|
+
export function drawTriangle(context, p1, p2, p3) {
|
|
3
|
+
context.beginPath();
|
|
4
|
+
context.moveTo(p1.x, p1.y);
|
|
5
|
+
context.lineTo(p2.x, p2.y);
|
|
6
|
+
context.lineTo(p3.x, p3.y);
|
|
7
|
+
context.closePath();
|
|
8
|
+
}
|
|
2
9
|
export function drawLinkLine(params) {
|
|
3
10
|
let drawn = false;
|
|
4
11
|
const { begin, end, maxDistance, context, canvasSize, width, backgroundMask, colorLine, opacity, links } = params;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-particles-links",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
4
4
|
"description": "tsParticles links particles interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"confettijs",
|
|
61
61
|
"fireworksjs",
|
|
62
62
|
"canvas-confetti",
|
|
63
|
-
"
|
|
63
|
+
"tsparticles-plugin",
|
|
64
64
|
"@tsparticles/interaction"
|
|
65
65
|
],
|
|
66
66
|
"author": "Matteo Bruni <matteo.bruni@me.com>",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "^3.0.0-beta.
|
|
90
|
+
"@tsparticles/engine": "^3.0.0-beta.4"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|