MCPcopy
hub / github.com/anvaka/VivaGraphJS / webglGraphics

Function webglGraphics

src/View/webglGraphics.js:27–586  ·  view source on GitHub ↗

* Performs webgl-based graph rendering. This module does not perform * layout, but only visualizes nodes and edges of the graph. * * @param options - to customize graphics behavior. Currently supported parameter * enableBlending - true by default, allows to use transparency in node/links c

(options)

Source from the content-addressed store, hash-verified

25 */
26
27function webglGraphics(options) {
28 options = merge(options, {
29 enableBlending : true,
30 preserveDrawingBuffer : false,
31 clearColor: false,
32 clearColorValue : {
33 r : 1,
34 g : 1,
35 b : 1,
36 a : 1
37 }
38 });
39
40 var container,
41 graphicsRoot,
42 gl,
43 width,
44 height,
45 nodesCount = 0,
46 linksCount = 0,
47 transform = [
48 1, 0, 0, 0,
49 0, 1, 0, 0,
50 0, 0, 1, 0,
51 0, 0, 0, 1
52 ],
53 userPlaceNodeCallback,
54 userPlaceLinkCallback,
55 nodes = [],
56 links = [],
57 initCallback,
58
59 allNodes = {},
60 allLinks = {},
61 linkProgram = webglLinkProgram(),
62 nodeProgram = webglNodeProgram(),
63/*jshint unused: false */
64 nodeUIBuilder = function (node) {
65 return webglSquare(); // Just make a square, using provided gl context (a nodeProgram);
66 },
67
68 linkUIBuilder = function (link) {
69 return webglLine(0xb3b3b3ff);
70 },
71/*jshint unused: true */
72 updateTransformUniform = function () {
73 linkProgram.updateTransform(transform);
74 nodeProgram.updateTransform(transform);
75 },
76
77 resetScaleInternal = function () {
78 transform = [1, 0, 0, 0,
79 0, 1, 0, 0,
80 0, 0, 1, 0,
81 0, 0, 0, 1];
82 },
83
84 updateSize = function () {

Callers

nothing calls this directly

Calls 9

webglLinkProgramFunction · 0.85
webglNodeProgramFunction · 0.85
updateTransformUniformFunction · 0.85
linkUIBuilderFunction · 0.85
nodeUIBuilderFunction · 0.85
resetScaleInternalFunction · 0.85
preciseCheckFunction · 0.85
fireRescaledFunction · 0.70
updateSizeFunction · 0.70

Tested by

no test coverage detected