
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Interactive visualization library for concept map

var cmap = Cmap();
var node0 = cmap.node({content: 'Rock', x: 100, y: 100});
var node1 = cmap.node({content: 'Paper', x: 180, y: 320});
var node2 = cmap.node({content: 'Scissors', x: 360, y: 180});
var link0 = cmap.link({content: 'beats'});
var link1 = cmap.link({content: 'beats'});
var link2 = cmap.link({content: 'beats'});
link0
.sourceNode(node0)
.targetNode(node2);
link1
.sourceNode(node1)
.targetNode(node0);
link2
.sourceNode(node2)
.targetNode(node1)
.attr({
cx: 356,
cy: 335
});
<script src="cmap.js"></script>
Works on IE10+, Firefox, Safari, Chrome
Create a element or wrap a existing element for drawing a concept map.
// create a element in document.body
var cmap = Cmap();
// wrap a existing element
var container = document.getElementById('container');
var cmap = Cmap(container);
Create and draw a node. You can set the attributes of the node (see node.attr()).
var cmap = Cmap();
// node with setting the text content, position and size
var node = cmap.node({
content: 'Rock',
x: 10,
y: 20,
width: 60,
height: 40
});
Create and draw a link. You can set the attributes of the link (see link.attr()).
var cmap = Cmap();
// link with setting the text content and center position
var link = cmap.link({
content: 'beats',
cx: 100,
cy: 200
});
Get or set given attributes of the node.
var node = cmap.node({
content: 'Rock',
x: 10,
y: 20
});
// get all attributes as object
var attr = node.attr();
// get the value of an attribute
var x = node.attr('x');
// set the value of an attribute
node.attr('x', 100);
// set multiple attributes
node.attr({
x: 20,
y: 30
});
Remove the node from the concept map.
Move the node on top of other nodes in the z-order.
Get the DOM element of the node.
Normally, creating and updating DOM elements of a concept map is along with the browser's normal redraw cycle (achieved by window.requestAnimationFrame).
You can force a synchronous redraw.
var node = cmap.node({
content: 'Rock'
});
console.log(node.element()); // null (not yet created)
node.redraw();
var element = node.element();
console.log(element); // [object HTMLDivElement]
console.log(element.textContent); // Rock
node.attr('content', 'Paper');
console.log(node.attr('content')); // Paper
console.log(element.textContent); // Rock (not yet updated)
node.redraw();
console.log(element.textContent); // Paper
Get or set whether or not to allow dragging the node (default: true).
Get or set given attributes of the link.
var link = cmap.link({
content: 'beats',
cx: 100,
cy: 200
});
// get all attributes as object
var attr = link.attr();
// get the value of an attribute
var cx = link.attr('cx');
// set the value of an attribute
link.attr('cx', 150);
// set multiple attributes
link.attr({
cx: 200,
cy: 300
});
Remove the link from the concept map.
Move the link on top of other links in the z-order.
Get the DOM element of the link.
Force a synchronous redraw of the link (same as node.redraw()).
Get or set whether or not to allow dragging the link (default: true).
Get or set the node which is connected to the starting point of the path.
var link = cmap.link();
var node = cmap.node();
console.log(link.sourceNode()); // null
// connect the node to the starting point of the path
link.sourceNode(node);
console.log(link.sourceNode() == node); // true
// disconnect the node
link.sourceNode(null);
console.log(link.sourceNode()); // null
Get or set the node which is connected to the ending point of the path.
var link = cmap.link();
var node = cmap.node();
console.log(link.targetNode()); // null
// connect the node to the ending point of the path
link.targetNode(node);
console.log(link.targetNode() == node); // true
// disconnect the node
link.targetNode(null);
console.log(link.targetNode()); // null
Get or set whether or not to enable a connector at the starting point of the path (default: true).
Get or set whether or not to enable a connector at the ending point of the path (default: true).
Clone the repository and install the developer dependencies:
git clone https://github.com/ionstage/cmap.git
cd cmap
npm install
Then:
npm test
Copyright © 2015 iOnStage Licensed under the MIT License.
FAQs
Interactive visualization library for concept map
The npm package cmap receives a total of 19 weekly downloads. As such, cmap popularity was classified as not popular.
We found that cmap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.