New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cytoscape-node-html-label

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cytoscape-node-html-label - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

demo/index.css

8

dist/cytoscape-node-html-label.d.ts

@@ -1,5 +0,1 @@

declare const require: any;
declare const module: any;
declare const define: any;
declare const cytoscape: any;
declare type IHAlign = "left" | "center" | "right";

@@ -16,5 +12,1 @@ declare type IVAlign = "top" | "center" | "bottom";

}
declare namespace cytoscape {
type CytoscapeNodeHtmlLabel = CytoscapeNodeHtmlParams;
function nodeHtmlLabel(o: CytoscapeNodeHtmlLabel[]): any;
}

52

dist/cytoscape-node-html-label.js
(function () {
"use strict";
var $$find = function (arr, predicate) {
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
if (typeof predicate !== "function") {
throw new TypeError("predicate must be a function");
}

@@ -90,4 +90,4 @@ var length = arr.length >>> 0;

this._node = node;
this._cssWrap = 'cy-node-html-' + (+new Date());
this._cssElem = this._cssWrap + '__e';
this._cssWrap = "cy-node-html-" + (+new Date());
this._cssElem = this._cssWrap + "__e";
this.addCssToDocument();

@@ -106,3 +106,3 @@ this._node.className = this._cssWrap;

else {
var nodeElem = document.createElement('div');
var nodeElem = document.createElement("div");
this._node.appendChild(nodeElem);

@@ -133,3 +133,3 @@ this._elements[id] = new LabelElement({

var stl = this._node.style;
var origin = 'top left';
var origin = "top left";
stl.webkitTransform = val;

@@ -143,5 +143,5 @@ stl.msTransform = val;

LabelContainer.prototype.addCssToDocument = function () {
var stylesWrap = 'position:absolute;z-index:10;width:500px;pointer-events:none;margin:0;padding:0;border:0;outline:0';
var stylesElem = 'position:absolute';
document.querySelector('head').innerHTML +=
var stylesWrap = "position:absolute;z-index:10;width:500px;pointer-events:none;margin:0;padding:0;border:0;outline:0";
var stylesElem = "position:absolute";
document.querySelector("head").innerHTML +=
"<style>." + this._cssWrap + "{" + stylesWrap + "} ." + this._cssElem + "{" + stylesElem + "}</style>";

@@ -154,18 +154,18 @@ };

var _lc = createLabelContainer();
_cy.one('render', function (e) {
_cy.one("render", function (e) {
createNodesCyHandler(e);
wrapCyHandler(e);
});
_cy.on('add', addCyHandler);
_cy.on('layoutstop', layoutstopHandler);
_cy.on('remove', removeCyHandler);
_cy.on('data', updateDataCyHandler);
_cy.on('pan zoom', wrapCyHandler);
_cy.on('drag', moveCyHandler);
_cy.on("add", addCyHandler);
_cy.on("layoutstop", layoutstopHandler);
_cy.on("remove", removeCyHandler);
_cy.on("data", updateDataCyHandler);
_cy.on("pan zoom", wrapCyHandler);
_cy.on("drag", moveCyHandler);
return _cy;
function createLabelContainer() {
var _cyContainer = _cy.container();
var _titlesContainer = document.createElement('div');
var _cyCanvas = _cyContainer.querySelector('canvas');
var cur = _cyContainer.querySelector('[class^="cy-node-html"]');
var _titlesContainer = document.createElement("div");
var _cyCanvas = _cyContainer.querySelector("canvas");
var cur = _cyContainer.querySelector("[class^='cy-node-html']");
if (cur) {

@@ -242,4 +242,4 @@ _cyCanvas.parentNode.removeChild(cur);

h: node.height(),
x: node.position('x'),
y: node.position('y')
x: node.position("x"),
y: node.position("y")
};

@@ -252,7 +252,7 @@ }

}
cy('core', 'nodeHtmlLabel', function (optArr) {
cy("core", "nodeHtmlLabel", function (optArr) {
return cyNodeHtmlLabel(this, optArr);
});
};
if (typeof module !== 'undefined' && module.exports) {
if (typeof module !== "undefined" && module.exports) {
module.exports = function (cy) {

@@ -263,4 +263,4 @@ register(cy);

else {
if (typeof define !== 'undefined' && define.amd) {
define('cytoscape-nodeHtmlLabel', function () {
if (typeof define !== "undefined" && define.amd) {
define("cytoscape-nodeHtmlLabel", function () {
return register;

@@ -270,3 +270,3 @@ });

}
if (typeof cytoscape !== 'undefined') {
if (typeof cytoscape !== "undefined") {
register(cytoscape);

@@ -273,0 +273,0 @@ }

{
"name": "cytoscape-node-html-label",
"version": "1.0.5",
"version": "1.0.6",
"description": "labels for cytoscape nodes",
"author": "Kalugin Sergey <kalugin.perm@gmail.com> (https://github.com/kaluginserg)",
"main": "./dist/cytoscape-node-html-label.js",
"typings": "./dist/cytoscape-node-html-label.d.ts",
"spm": {

@@ -13,2 +12,3 @@ "main": "./dist/cytoscape-node-html-label.js"

"test": "gulp test",
"build": "tsc --declaration",
"start": "tsc --watch --declaration"

@@ -32,2 +32,5 @@ },

"devDependencies": {
"@types/cytoscape": "^3.1.7",
"@types/node": "^9.6.0",
"@types/requirejs": "^2.1.31",
"gulp": "^3.9.1",

@@ -34,0 +37,0 @@ "gulp-bump": "^2.7.0",

cytoscape-node-html-label
================================================================================
#### Brief instruction
1) `npm install cytoscape-node-html-label`
2) `cyInstance.nodeHtmlLabel( [{ tpl: d => '<div>' + d + '</div>' }] );`
## Description
This extension provide ability adding labels for Cytoscape nodes.
This extension provide ability adding labels for Cytoscape nodes. Simple example:
`cyInstance.nodeHtmlLabel( [{ tpl: d => '<div>' + d + '</div>' }] );`
Demo: https://kaluginserg.github.io/cytoscape-node-html-label/

@@ -14,0 +12,0 @@

@@ -1,10 +0,5 @@

declare const require: any;
declare const module: any;
declare const define: any;
declare const cytoscape: any;
type IHAlign = "left" | "center" | "right";
type IVAlign = "top" | "center" | "bottom";
declare type IHAlign = "left" | "center" | "right";
declare type IVAlign = "top" | "center" | "bottom";
declare interface CytoscapeNodeHtmlParams {
interface CytoscapeNodeHtmlParams {
query ?: string;

@@ -19,14 +14,7 @@ halign ?: IHAlign;

declare namespace cytoscape {
export type CytoscapeNodeHtmlLabel = CytoscapeNodeHtmlParams;
export function nodeHtmlLabel(o: CytoscapeNodeHtmlLabel[]): any;
}
(function () {
"use strict";
const $$find = function <T>(arr: T[], predicate: (a: T) => boolean) {
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
if (typeof predicate !== "function") {
throw new TypeError("predicate must be a function");
}

@@ -178,4 +166,4 @@ let length = arr.length >>> 0;

this._node = node;
this._cssWrap = 'cy-node-html-' + (+new Date());
this._cssElem = this._cssWrap + '__e';
this._cssWrap = "cy-node-html-" + (+new Date());
this._cssElem = this._cssWrap + "__e";
this.addCssToDocument();

@@ -193,3 +181,3 @@ this._node.className = this._cssWrap;

} else {
let nodeElem = document.createElement('div');
let nodeElem = document.createElement("div");
this._node.appendChild(nodeElem);

@@ -223,3 +211,3 @@

const stl = <any>this._node.style;
const origin = 'top left';
const origin = "top left";

@@ -235,5 +223,5 @@ stl.webkitTransform = val;

private addCssToDocument() {
let stylesWrap = 'position:absolute;z-index:10;width:500px;pointer-events:none;margin:0;padding:0;border:0;outline:0';
let stylesElem = 'position:absolute';
document.querySelector('head').innerHTML +=
let stylesWrap = "position:absolute;z-index:10;width:500px;pointer-events:none;margin:0;padding:0;border:0;outline:0";
let stylesElem = "position:absolute";
document.querySelector("head").innerHTML +=
`<style>.${this._cssWrap}{${stylesWrap}} .${this._cssElem}{${stylesElem}}</style>`;

@@ -247,12 +235,12 @@ }

_cy.one('render', (e: any) => {
_cy.one("render", (e: any) => {
createNodesCyHandler(e);
wrapCyHandler(e);
});
_cy.on('add', addCyHandler);
_cy.on('layoutstop', layoutstopHandler);
_cy.on('remove', removeCyHandler);
_cy.on('data', updateDataCyHandler);
_cy.on('pan zoom', wrapCyHandler);
_cy.on('drag', moveCyHandler);
_cy.on("add", addCyHandler);
_cy.on("layoutstop", layoutstopHandler);
_cy.on("remove", removeCyHandler);
_cy.on("data", updateDataCyHandler);
_cy.on("pan zoom", wrapCyHandler);
_cy.on("drag", moveCyHandler);

@@ -263,6 +251,6 @@ return _cy;

let _cyContainer = _cy.container();
let _titlesContainer = document.createElement('div');
let _titlesContainer = document.createElement("div");
let _cyCanvas = _cyContainer.querySelector('canvas');
let cur = _cyContainer.querySelector('[class^="cy-node-html"]');
let _cyCanvas = _cyContainer.querySelector("canvas");
let cur = _cyContainer.querySelector("[class^='cy-node-html']");
if (cur) {

@@ -344,4 +332,4 @@ _cyCanvas.parentNode.removeChild(cur);

h: node.height(),
x: node.position('x'),
y: node.position('y')
x: node.position("x"),
y: node.position("y")
};

@@ -358,3 +346,3 @@ }

cy('core', 'nodeHtmlLabel', function (optArr: any) {
cy("core", "nodeHtmlLabel", function (optArr: any) {
return cyNodeHtmlLabel(this, optArr);

@@ -364,3 +352,3 @@ });

if (typeof module !== 'undefined' && module.exports) { // expose as a commonjs module
if (typeof module !== "undefined" && module.exports) { // expose as a commonjs module
module.exports = function (cy: any) {

@@ -370,4 +358,4 @@ register(cy);

} else {
if (typeof define !== 'undefined' && define.amd) { // expose as an amd/requirejs module
define('cytoscape-nodeHtmlLabel', function () {
if (typeof define !== "undefined" && define.amd) { // expose as an amd/requirejs module
define("cytoscape-nodeHtmlLabel", function () {
return register;

@@ -378,3 +366,3 @@ });

if (typeof cytoscape !== 'undefined') { // expose to global cytoscape (i.e. window.cytoscape)
if (typeof cytoscape !== "undefined") { // expose to global cytoscape (i.e. window.cytoscape)
register(cytoscape);

@@ -381,0 +369,0 @@ }

@@ -18,3 +18,4 @@ {

"removeComments": true,
"outDir": "dist"
"outDir": "dist",
"skipLibCheck": true
},

@@ -21,0 +22,0 @@ "files": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc