You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.
In the network, I want to add a function for a custom triangle shape by myself as #3418. For example,
// create an array with nodes
var nodes = new vis.DataSet([
{id: 1, label: 'Node 1', shape: customTriangle([0,0],[100,100],[100,0])}
]);
In the vis/lib/network/shapes.js, how to make such function? Is it possible to make such function as following?
/**
* Draw a custom triangle shape
* @param {Number} x horizontal center
* @param {Number} y vertical center
* @param {Number} r radius
* @param {Number} x1 first x-coordinate of a triangle
* @param {Number} y1 first y-coordinate of a triangle
* @param {Number} x2 second x-coordinate of a triangle
* @param {Number} y2 second y-coordinate of a triangle
* @param {Number} x3 third x-coordinate of a triangle
* @param {Number} y3 third y-coordinate of a triangle
*/
CanvasRenderingContext2D.prototype.customTriangle = function (x, y, r, x1, y1, x2, y2, x3, y3) {
...
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In the network, I want to add a function for a custom triangle shape by myself as #3418. For example,
In the vis/lib/network/shapes.js, how to make such function? Is it possible to make such function as following?
The text was updated successfully, but these errors were encountered: