Drawing arrows on an HTML page to visualize semantic links between textual spans

前端 未结 10 1553
轮回少年
轮回少年 2020-11-30 18:56

I have an HTML page with some textual spans marked up something like this:

...
p50
...


        
10条回答
  •  半阙折子戏
    2020-11-30 19:07

    I try to go with open web technologies wherever possible but the truth is that HTML & JavaScript (or jQuery) aren't the tools for this particular job (sad but true), especially as the diagrams you're drawing increase in complexity.

    On the other hand, Flash was made for this. Significantly less ActionScript 3.0 code would be required to parse that XML, layout your text (with more control over fonts & super/subscripts) and render the curves (see the flash.display.Graphics class methods like curveTo). Overall you'll be looking at less code, better maintainability, fewer hacks, wider compatibility and more stable drawing libraries.

    Good luck with the project.

提交回复
热议问题