I so paint the direct graph, so I do paint the arrow to the line, I'm new with the pixi.js and the javascript and I want to learn it, can you help me how I can paint an arrow to it?
This is a demo and I want to add the arrow to the link.
This is the code for paint the link, inside this class
module.exports = function (link, ctx) {
ctx.lineStyle(link.width, 0x333333, 1);
ctx.moveTo(link.from.x, link.from.y);
ctx.lineTo(link.to.x, link.to.y);
}
This is the complete code
module.exports.main = function () {
var graph = require('ngraph.generators').balancedBinTree(5);
var createPixiGraphics = require('../');
var setting = {
rendererOptions: {
backgroundColor: 0xFFFFFF,
antialias: true,
}
}
var pixiGraphics = createPixiGraphics(graph, setting);
pixiGraphics.createLinkUI(require('./lib/createLinkUI'));
pixiGraphics.renderLink(require('./lib/renderLink'));
pixiGraphics.createNodeUI(require('./lib/createNodeUI'));
pixiGraphics.renderNode(require('./lib/renderNode'));
var layout = pixiGraphics.layout;
// just make sure first node does not move:
layout.pinNode(graph.getNode(1), true);
// begin animation loop:
pixiGraphics.run();
}
The link for reproducing the code is here
Thanks a lot