MCPcopy Create free account
hub / github.com/adobe/Marinus / wrap

Function wrap

web_server/public/javascripts/cert_graph.js:498–514  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

496 wrapChars = ' /_-.'.split('');
497
498function wrap(text) {
499 if (text.length <= maxLineChars) {
500 return [text];
501 } else {
502 for (var k = 0; k < wrapChars.length; k++) {
503 var c = wrapChars[k];
504 for (var i = maxLineChars; i >= 0; i--) {
505 if (text.charAt(i) === c) {
506 var line = text.substring(0, i + 1);
507 return [line].concat(wrap(text.substring(i + 1)));
508 }
509 }
510 }
511 return [text.substring(0, maxLineChars)]
512 .concat(wrap(text.substring(maxLineChars)));
513 }
514}
515
516function preventCollisions() {
517 var quadtree = d3.quadtree()

Callers 1

drawGraphFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected