Closed MDeus closed 2 years ago
Hi @MDeus, thank you for the comment. That error means that an element can't be accessed. To reproduce that, could you show an example by using e.g. https://jsfiddle.net/ ?
Hi, it works in js fiddle, link: jsfiddle. I am wondering what is the best way to import the library on my local code. because I do:
<script xlink:href="https://cdn.jsdelivr.net/npm/leader-line@1.0.5/leader-line.min.js"/>
inside the SVG and get that error locally. in jsfiddle I place the link in resources and it works as expected but that does not happen locally.
Your code (line#40) is wrong:
<script> xlink:href="..." </script>
If you want to load any script file, you have to write this:
<script xlink:href="..."/>
JSFiddle adds <script>
in to HTML (not SVG) if you specified "Resources".
I have tried both:
<script> xlink:href="..." </script>
and <script xlink:href="..."/>
and neither seems to work.
If you want to use LeaderLine in your web page, load LeaderLine into your web page.
https://anseki.github.io/leader-line/#usage
That is, you have to add <script>
element to <head>
element. Not SVG.
I was initially just creating a pure svg file not an HTML file but it looks like it is giving issues with that so I will just switch to creating an HTML file with an SVG tag. Thank you for your help!
Yes, you should use "Inline SVG" instead of stand alone SVG if you will use a script because some viewers may ignore all script in stand alone SVG. So, could you close this issue?
:smile: :thumbsup:
I have this graph and I want to have leader line arrows going from one element to the next but I am getting that error. I am working with an SVG file where I have stuff like:
I want to create a leader-line between node1 and node2. I call document.getelementbyID on each and pass it to leader-line but it does not work. Any help would be appreciated. Thanks!