Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
cytoscape-sbgn-stylesheet
Advanced tools
A Cytoscape.js package that provides SBGN specific glyph styles (demo)
To render SBGN-PD(Systems Biology Graphical Notation) graphs -- a visual language for representing biological processes.
Install via npm
npm install cytoscape-sbgn-stylesheet
Initialize cytoscape.js and call this module as a stylesheet parameter
var cytoscape = require('cytoscape');
var sbgnStylesheet = require('cytoscape-sbgn-stylesheet');
var cy = cytoscape({
container: container,
style: sbgnStylesheet(cytoscape),
// other arguments here
});
Input needs to be formatted Cytoscape.js graph JSON.
The following graph JSON structure is required:
{
nodes: [], // array of nodes
edges: [] // array of edges
}
The following node JSON structure is required:
"data": {
"id": "glyph23", // id of the node
"class": "simple chemical", // class of the node (see classes section for a list of supported sbgn glyphs
"label": "Ca2+", // label to be displayed on the node
"parent": "glyph2", // parent node id if any
"clonemarker": false, // whether the node has a clonemarker or not
"stateVariables": [], // an array of state variables
"unitsOfInformation": [], // an array of units of information
}
The following edge JSON structure is required:
"data": {
"id": "glyph19-glyph5", // id
"class": "production", // sbgn class
"cardinality": 0, // cardinality
"source": "glyph19", // source node id
"target": "glyph5", // target node id
"portSource": "glyph19", // port of the source
"portTarget": "glyph5" // port of the target
}
To get Cytoscape.js graph JSON, you need the following:
The following cytoscape.js style properties are used to render SBGN PD graphics. Overriding these entirely will produce unexpected behaviour:
shape
width
height
background-image
background-width
background-position-x
background-position-y
background-fit
background-clip
padding
border-width
npm run build
: build projectnpm run build-prod
: build the project for productionnpm run bundle-profile
: visualise the bundle dependenciesnpm run clean
: clean the projectnpm run watch
: watch mode (debug mode enabled, autorebuild, autoreload)npm test
: run testsnpm run lint
: lint the projectAll files /test
will be run by Mocha. You can npm test
to run all tests, or you can run mocha -g specific-test-name
(prerequisite: npm install -g mocha
) to run specific tests.
Chai is included to make the tests easier to read and write.
npm test
npm run build-prod
npm run lint
npm version
, in accordance with semver. The version
command in npm
updates both package.json
and git tags, but note that it uses a v
prefix on the tags (e.g. v1.2.3
).npm version patch
.npm version minor
.npm version major.
npm version 1.2.3
.git push origin --tags
npm publish .
FAQs
cytoscape.js stylesheet for sbgn PD glyphs
The npm package cytoscape-sbgn-stylesheet receives a total of 39 weekly downloads. As such, cytoscape-sbgn-stylesheet popularity was classified as not popular.
We found that cytoscape-sbgn-stylesheet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.