// npm 패키지
@antv/layout-gpu
graph layout algorithm implemented with GPGPU
버전
15
메인테이너
51
라이선스
MIT
최초 publish
2023-02-10
publisher
iaaron
tarball
1,140,270 B
AUTO-PUBLISHED·1개 버전 인덱싱됨·최근 publish: 2024-09-06
// publisher 캠페인by iaaron
이 계정에서 catch된 패키지 9건고립된 catch가 아닙니다. 동일 publisher가 8개의 다른 패키지를 추가로 발행했고, 모두 파이프라인이 catch했습니다 — 일회성이 아닌 조직적 캠페인의 형태. 아래 링크는 각 형제 catch의 분석으로 이동합니다.
// offending code· @1.1.7· 1 file flagged
llm: benign · 0.85→ 의심 전송지 없음, 원격 실행 형태 없음 — 2 known-vendor host(s).
- @1.1.7··AUTO-PUBLISHED·publisher: iaaronheuristic 75/100static flags 1llm benign (0.85) via ollamamature-packageosv-flagged:MAL-2026-4057install-path-npm-publish
→ 의심 전송지 없음, 원격 실행 형태 없음 — 2 known-vendor host(s).
// offending code· 1 file flaggedpatterns: 1
--- package/package.json (excerpt) --- { "name": "@antv/layout-gpu", "version": "1.1.7", "description": "graph layout algorithm implemented with GPGPU", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/antvis/layout", "directory": "packages/layout-gpu" }, "main": "dist/index.min.js", "module": "lib/index.js", "types": "lib/index.d.ts", "unpkg": "dist/index.min.js", "files": [ "package.json", "dist", "lib", "LICENSE", "README.md" ], "sideEffects": false, "keywords": [ "graph", "layout", "algorithm", "antv" ], "dependencies": { "@antv/g-webgpu": "0.7.2", "@antv/util": "^3.3.2", "tslib": "^2.5.0", "@antv/layout": "1.2.14-beta.7" }, "devDependencies": { "@antv/g-webgpu-compiler": "0.7.2", "@babel/core": "^7.7.7", "@babel/plugin-proposal-class-properties": "^7.1.0", "@babel/preset-react": "^7.7.4", "babel-loader": "^8.0.6", "ts-loader": "^7.0.3", "typescript": "^4.0.3", "webpack": "^5.38.1", "webpack-cli": "^5.0.2" }, "scripts": { "clean": "rimraf dist lib", "dev": "webpack --config webpack.dev.config.js --mode development", "build": "npm run clean && npm run build:esm && npm run build:umd", "ci": "npm run build", "build:esm": "tsc", "build:umd": "webpack --config webpack.config.js --mode production", "publish:alpha": "npm publish --tag alpha" } } --- package.json (entry) --- { "name": "@antv/layout-gpu", "version": "1.1.7", "description": "graph layout algorithm implemented with GPGPU", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/antvis/layout", "directory": "packages/layout-gpu" }, "main": "dist/index.min.js", "module": "lib/index.js", "types": "lib/index.d.ts", "unpkg": "dist/index.min.js", "files": [ "package.json", "dist", "lib", "LICENSE", "README.md" ], "sideEffects": false, "keywords": [ "graph", "layout", "algorithm", "antv" ], "dependencies": { "@antv/g-webgpu": "0.7.2", "@antv/util": "^3.3.2", "tslib": "^2.5.0", "@antv/layout": "1.2.14-beta.7" }, "devDependencies": { "@antv/g-webgpu-compiler": "0.7.2", "@babel/core": "^7.7.7", "@babel/plugin-proposal-class-properties": "^7.1.0", "@babel/preset-react": "^7.7.4", "babel-loader": "^8.0.6", "ts-loader": "^7.0.3", "typescript": "^4.0.3", "webpack": "^5.38.1", "webpack-cli": "^5.0.2" }, "scripts": { "clean": "rimraf dist lib", "dev": "webpack --config webpack.dev.config.js --mode development", "build": "npm run clean --- index.js (entry) --- export * from './fruchterman'; export * from './gforce'; //# sourceMappingURL=index.js.map --- bundled output (OSV-MAL flagged — LLM scope expansion) --- --- lib/fruchterman-shader.js (bundled) --- export var fruchtermanCode = "\nimport { globalInvocationID } from 'g-webgpu';\nconst MAX_EDGE_PER_VERTEX;\nconst VERTEX_COUNT;\n@numthreads(1, 1, 1)\nclass Fruchterman {\n @in @out\n u_Data: vec4[];\n @in\n u_K: float;\n @in\n u_K2: float;\n \n @in\n u_Center: vec2;\n @in\n u_Gravity: float;\n @in\n u_ClusterGravity: float;\n @in\n u_Speed: float;\n @in\n u_MaxDisplace: float;\n @in\n u_Clustering: float;\n @in\n u_AttributeArray: vec4[];\n @in\n u_ClusterCenters: vec4[];\n calcRepulsive(i: int, currentNode: vec4): vec2 {\n let dx = 0, dy = 0;\n for (let j = 0; j < VERTEX_COUNT; j++) {\n if (i != j) {\n const nextNode = this.u_Data[j];\n const xDist = currentNode[0] - nextNode[0];\n const yDist = currentNode[1] - nextNode[1];\n const dist = (xDist * xDist + yDist * yDist) + 0.01;\n let param = this.u_K2 / dist;\n \n if (dist > 0.0) {\n dx += param * xDist;\n dy += param * yDist;\n if (xDist == 0 && yDist == 0) {\n const sign = i < j ? 1 : -1;\n dx += param * sign;\n dy += param * sign;\n }\n }\n }\n }\n return [dx, dy];\n }\n calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { // \n let dx = 0, dy = 0;\n const vx = currentNode[0] - this.u_Center[0];\n const vy = currentNode[1] - this.u_Center[1];\n const gf = 0.01 * this.u_K * this.u_Gravity;\n dx = gf * vx;\n dy = gf * vy;\n if (this.u_Clustering == 1) {\n const clusterIdx = int(nodeAttributes[0]);\n const center = this.u_ClusterCenters[clusterIdx];\n const cvx = currentNode[0] - center[0];\n const cvy = currentNode[1] - center[1];\n const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;\n const parma = this.u_K * this.u_ClusterGravity / dist;\n dx += parma * cvx;\n dy += parma * cvy;\n }\n return [dx, dy];\n }\n calcAttractive(i: int, currentNode: vec4): vec2 {\n let dx --- lib/gforce-shader.js (bundled) --- export var gForceCode = "\nimport { globalInvocationID } from 'g-webgpu';\n\nconst MAX_EDGE_PER_VERTEX;\nconst VERTEX_COUNT;\nconst SHIFT_20 = 1048576;\n\n@numthreads(1, 1, 1)\nclass GGForce {\n @in @out\n u_Data: vec4[];\n\n @in\n u_damping: float;\n \n @in\n u_maxSpeed: float;\n\n @in\n u_minMovement: float;\n\n @in\n u_AveMovement: vec4[];\n\n @in\n u_coulombDisScale: float;\n\n @in\n u_factor: float;\n\n @in\n u_NodeAttributeArray1: vec4[];\n\n @in\n u_NodeAttributeArray2: vec4[];\n\n @in\n u_interval: float;\n\n unpack_float(packedValue: float): ivec2 {\n const packedIntValue = int(packedValue);\n const v0 = packedIntValue / SHIFT_20;\n return [v0, packedIntValue - v0 * SHIFT_20];\n }\n\n calcRepulsive(i: int, currentNode: vec4): vec2 {\n let ax = 0, ay = 0;\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\n if (i != j) {\n const nextNode = this.u_Data[j];\n const vx = currentNode[0] - nextNode[0];\n const vy = currentNode[1] - nextNode[1];\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\n const n_dist = (dist + 0.1) * this.u_coulombDisScale;\n const direx = vx / dist;\n const direy = vy / dist;\n const attributesi = this.u_NodeAttributeArray1[i];\n const attributesj = this.u_NodeAttributeArray1[j];\n const massi = attributesi[0];\n const nodeStrengthi = attributesi[2];\n const nodeStrengthj = attributesj[2];\n const nodeStrength = (nodeStrengthi + nodeStrengthj) / 2;\n // const param = nodeStrength * this.u_factor / (n_dist * n_dist * massi);\n const param = nodeStrength * this.u_factor / (n_dist * n_dist);\n ax += direx * param;\n ay += direy * param;\n }\n }\n return [ax, ay];\n }\n\n calcGravity(i: int, currentNode: vec4, attributes2: vec4): vec2 {\n // note: attributes2 = [centerX, centerY, gravity, 0]\n\n const vx = currentNode[0] - attributes2[0];\n const vy = currentNode[1] --- dist/index.min.js (bundled) --- /*! For license information please see index.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@antv/layout@alpha")):"function"==typeof define&&define.amd?define(["@antv/layout@alpha"],t):"object"==typeof exports?exports.LayoutGPU=t(require("@antv/layout@alpha")):e.LayoutGPU=t(e.Layout)}(self,(e=>(()=>{var t={6:(e,t,r)=>{var n=r(714).Symbol;e.exports=n},271:(e,t,r)=>{var n=r(6),a=r(650),o=r(881),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?a(e):o(e)}},550:(e,t,r)=>{var n=r(271),a=r(583),o=r(964),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&a(e.length)&&!!i[n(e)]}},232:e=>{e.exports=function(e){return function(t){return e(t)}}},603:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},556:(e,t,r)=>{var n=r(546)(Object.getPrototypeOf,Object);e.exports=n},650:(e,t,r)=>{var n=r(6),a=Object.prototype,o=a.hasOwnProperty,i=a.toString,u=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,u),r=e[u];try{e[u]=void 0;var n=!0}catch(e){}var a=i.call(e);return n&&(t?e[u]=r:delete e[u]),a}},574:(e,t,r)=>{e=r.nmd(e);var n=r(603),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,i=o&&o.exports===a&&n.process,u=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=u},881:e=>{var t=Object.prototype.toStrin
