2

I have a page full of text with repetitive words, and I need to find a way to map the similar words together by drawing a line between them. (it doesn't matter if it crosses the word or if it goes around it). What is the best way/library to do that using javascript/jquery?

The text is fixed, and the line drawing is the dynamic part. (depending on the word you choose).

salouri
  • 760
  • 1
  • 8
  • 19
  • 1
    html isn't something you can "draw" on. you could use a canvas element, or float a transparent PICTURE of a line and stretch it appropriately – Marc B Dec 08 '15 at 17:34
  • See http://stackoverflow.com/questions/29904445/draw-continuous-lines-on-html-canvas-one-after-the-other/ , though may be able to use `hr` element with `position:absolute` set ? Can include `html` , `css`, `js` tried at Question ? – guest271314 Dec 08 '15 at 17:35
  • 1
    What have you tried? Does the line need to update if the browser is resized? I answered something similar very recently for [drawing lines between data in a table](http://stackoverflow.com/q/33988943/145346). – Mottie Dec 08 '15 at 17:53
  • Maybe try this [jQuery highlight](http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html) plugin instead of drawing lines? – Mottie Dec 08 '15 at 19:19
  • @Mottie, thanks for the responses. Actually I need to highlight the words too but I knew how to do that so I didn't ask about it. The table idea is interesting though. – salouri Dec 08 '15 at 23:56
  • @Mark B, it will come down to using canvases (probably) but even with that it's not easy. – salouri Dec 08 '15 at 23:58
  • It would help if you provided some HTML and some attempt at code or this question will get closed. – Mottie Dec 09 '15 at 00:49

0 Answers0