// npm package
@antv/g-plugin-rough-canvas-renderer
A G plugin of renderer implementation with rough.js
versions
210
maintainers
51
license
MIT
first publish
2022-05-07
publisher
wang1212
tarball
808,784 B
AUTO-PUBLISHED·1 version indexed·latest published 2025-12-24
// publisher campaignby wang1212
9 caught packages from this accountThis is not an isolated catch. The same publisher has shipped 8 other packages that our pipeline flagged — the shape of a coordinated campaign, not a one-off. Each link below opens that sibling's analysis.
// offending code· @2.1.1· 1 file flagged
llm: benign · 0.85→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s), 1 other host(s).
- @2.1.1··AUTO-PUBLISHED·publisher: wang1212heuristic 75/100static flags 1llm benign (0.85) via ollamamature-packageosv-flagged:MAL-2026-3951public-github-push
→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s), 1 other host(s).
// offending code· 1 file flaggedpatterns: 1
--- package/package.json (excerpt) --- { "name": "@antv/g-plugin-rough-canvas-renderer", "version": "2.1.1", "description": "A G plugin of renderer implementation with rough.js", "keywords": [ "antv", "g" ], "homepage": "https://github.com/antvis/g#readme", "bugs": { "url": "https://github.com/antvis/g/issues" }, "repository": { "type": "git", "url": "git+https://github.com/antvis/g.git" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "exports": { "types": "./types/index.d.ts", "import": "./dist/index.esm.js", "default": "./dist/index.js" }, "main": "dist/index.js", "unpkg": "dist/index.umd.min.js", "module": "dist/index.esm.js", "types": "types/index.d.ts", "files": [ "package.json", "dist", "types", "LICENSE", "README.md" ], "dependencies": { "@antv/util": "^3.3.5", "@babel/runtime": "^7.25.6", "roughjs": "^4.5.2", "tslib": "^2.5.3", "@antv/g-canvas": "2.2.0", "@antv/g-lite": "2.7.0" }, "publishConfig": { "access": "public" }, "scripts": { "build:js": "rimraf dist && rollup -c", "build:types": "rimraf types && tsc --emitDeclarationOnly --noCheck", "build": "npm run build:js && npm run build:types", "sync": "tnpm sync", "watch": "rollup -c -w" } } --- package.json (entry) --- { "name": "@antv/g-plugin-rough-canvas-renderer", "version": "2.1.1", "description": "A G plugin of renderer implementation with rough.js", "keywords": [ "antv", "g" ], "homepage": "https://github.com/antvis/g#readme", "bugs": { "url": "https://github.com/antvis/g/issues" }, "repository": { "type": "git", "url": "git+https://github.com/antvis/g.git" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "exports": { "types": "./types/index.d.ts", "import": "./dist/index.esm.js", "default": "./dist/index.js" }, "main": "dist/index.js", "unpkg": "dist/index.umd.min.js", "module": "dist/index.esm.js", "types": "types/index.d.ts", "files": [ "package.json", "dist", "types", "LICENSE", "README.md" ], "dependencies": { "@antv/util": "^3.3.5", "@babel/runtime": "^7.25.6", "roughjs": "^4.5.2", "tslib": "^2.5.3", "@antv/g-canvas": "2.2.0", "@antv/g-lite": "2.7.0" }, "publishConfig": { "access": "public" }, "scripts": { "build:js": "rimraf dist && rollup -c", "build:types": "rimraf types && tsc --emitDeclarationOnly --noCheck", "build" --- index.js (entry) --- /*! * @antv/g-plugin-rough-canvas-renderer * @description A G plugin of renderer implementation with rough.js * @version 2.1.1 * @date 12/24/2025, 11:57:56 AM * @author AntVis * @docs https://g.antv.antgroup.com/ */ 'use strict'; var _defineProperty = require('@babel/runtime/helpers/defineProperty'); var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); var _classCallCheck = require('@babel/runtime/helpers/classCallCheck'); var _createClass = require('@babel/runtime/helpers/createClass'); var _callSuper = require('@babel/runtime/helpers/callSuper'); var _inherits = require('@babel/runtime/helpers/inherits'); var gLite = require('@antv/g-lite'); var _slicedToArray = require('@babel/runtime/helpers/slicedToArray'); function mergeOpacity(color, opacity) { // since rough.js doesn't support fill/strokeOpacity var colorString = color.toString(); if (gLite.isCSSRGB(color)) { if (opacity !== 1) { var r = color.r, g = color.g, b = color.b, alpha = color.alpha; colorString = "rgba(".concat(r, ",").concat(g, ",").concat(b, ",").concat(Number(alpha) * opacity, ")"); } } return colorString; } /** * When the lineWidt --- bundled output (OSV-MAL flagged — LLM scope expansion) --- --- dist/index.esm.js (bundled) --- /*! * @antv/g-plugin-rough-canvas-renderer * @description A G plugin of renderer implementation with rough.js * @version 2.1.1 * @date 12/24/2025, 11:57:56 AM * @author AntVis * @docs https://g.antv.antgroup.com/ */ import _defineProperty from '@babel/runtime/helpers/defineProperty'; import _objectSpread from '@babel/runtime/helpers/objectSpread2'; import _classCallCheck from '@babel/runtime/helpers/classCallCheck'; import _createClass from '@babel/runtime/helpers/createClass'; import _callSuper from '@babel/runtime/helpers/callSuper'; import _inherits from '@babel/runtime/helpers/inherits'; import { isCSSRGB, translatePathToString, Shape, AbstractRendererPlugin } from '@antv/g-lite'; import _slicedToArray from '@babel/runtime/helpers/slicedToArray'; function mergeOpacity(color, opacity) { // since rough.js doesn't support fill/strokeOpacity var colorString = color.toString(); if (isCSSRGB(color)) { if (opacity !== 1) { var r = color.r, g = color.g, b = color.b, alpha = color.alpha; colorString = "rgba(".concat(r, ",").concat(g, ",").concat(b, ",").concat(Number(alpha) * opacity, ")"); } } return colorString; } /** * When the lineWidth is 0, the rough.js will render too many strokes which has a bad perf. */ var MIN_STROKE_WIDTH = 0.1; function generateRoughOptions(object) { var _ref = object.parsedStyle, fill = _ref.fill, stroke = _ref.stroke, _ref$fillOpacity = _ref.fillOpacity, fillOpacity = _ref$fillOpacity === void 0 ? 1 : _ref$fillOpacity, _ref$strokeOpacity = _ref.strokeOpacity, strokeOpacity = _ref$strokeOpacity === void 0 ? 1 : _ref$strokeOpacity, _ref$lineWidth = _ref.lineWidth, lineWidth = _ref$lineWidth === void 0 ? 1 : _ref$lineWidth, bowing = _ref.bowing, roughness = _ref.roughness, seed = _ref.seed, fillStyle = _ref.fillStyle, fillWeight = _ref.fillWeight, hachureAngle = _ref.hachureAngle, hachureGap = _ref.hachureGap, curv --- dist/index.js (bundled) --- /*! * @antv/g-plugin-rough-canvas-renderer * @description A G plugin of renderer implementation with rough.js * @version 2.1.1 * @date 12/24/2025, 11:57:56 AM * @author AntVis * @docs https://g.antv.antgroup.com/ */ 'use strict'; var _defineProperty = require('@babel/runtime/helpers/defineProperty'); var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); var _classCallCheck = require('@babel/runtime/helpers/classCallCheck'); var _createClass = require('@babel/runtime/helpers/createClass'); var _callSuper = require('@babel/runtime/helpers/callSuper'); var _inherits = require('@babel/runtime/helpers/inherits'); var gLite = require('@antv/g-lite'); var _slicedToArray = require('@babel/runtime/helpers/slicedToArray'); function mergeOpacity(color, opacity) { // since rough.js doesn't support fill/strokeOpacity var colorString = color.toString(); if (gLite.isCSSRGB(color)) { if (opacity !== 1) { var r = color.r, g = color.g, b = color.b, alpha = color.alpha; colorString = "rgba(".concat(r, ",").concat(g, ",").concat(b, ",").concat(Number(alpha) * opacity, ")"); } } return colorString; } /** * When the lineWidth is 0, the rough.js will render too many strokes which has a bad perf. */ var MIN_STROKE_WIDTH = 0.1; function generateRoughOptions(object) { var _ref = object.parsedStyle, fill = _ref.fill, stroke = _ref.stroke, _ref$fillOpacity = _ref.fillOpacity, fillOpacity = _ref$fillOpacity === void 0 ? 1 : _ref$fillOpacity, _ref$strokeOpacity = _ref.strokeOpacity, strokeOpacity = _ref$strokeOpacity === void 0 ? 1 : _ref$strokeOpacity, _ref$lineWidth = _ref.lineWidth, lineWidth = _ref$lineWidth === void 0 ? 1 : _ref$lineWidth, bowing = _ref.bowing, roughness = _ref.roughness, seed = _ref.seed, fillStyle = _ref.fillStyle, fillWeight = _ref.fillWeight, hachureAngle = _ref.hachureAngle, hachureGap = _ref.hachureGap, curveStepCount = _re --- dist/index.umd.min.js (bundled) --- /*! * @antv/g-plugin-rough-canvas-renderer * @description A G plugin of renderer implementation with rough.js * @version 2.1.1 * @date 12/24/2025, 11:57:56 AM * @author AntVis * @docs https://g.antv.antgroup.com/ */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.RoughCanvasRenderer={}),t.window.G)}(this,function(t,e){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function s(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var r=s.call(t,e||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}function r(t,e,n){return(e=s(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,s)}return n}function a(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0
