Git Product home page Git Product logo

Comments (8)

anseki avatar anseki commented on June 2, 2024

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/ ?

from leader-line.

MDeus avatar MDeus commented on June 2, 2024

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/[email protected]/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.

from leader-line.

anseki avatar anseki commented on June 2, 2024

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".

from leader-line.

MDeus avatar MDeus commented on June 2, 2024

I have tried both:
<script> xlink:href="..." </script> and <script xlink:href="..."/> and neither seems to work.

from leader-line.

anseki avatar anseki commented on June 2, 2024

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.

from leader-line.

MDeus avatar MDeus commented on June 2, 2024

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!

from leader-line.

anseki avatar anseki commented on June 2, 2024

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?

from leader-line.

anseki avatar anseki commented on June 2, 2024

πŸ˜„ πŸ‘

from leader-line.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.