Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
I am having trouble understanding the Leader-Line js documentation

I am trying to create code that will draw a line from point a to point b using the leaderline library. https://github.com/anseki/leader-line

It looks like the section I need to reference is under Methods

self = line.show([showEffectName[, animOptions]])

where showEffectName: 'draw' and animOptions: {duration: 500, timing: [0.58, 0, 0.42, 1]}

Here is an example shown using a button to show/hide the line

var line = new LeaderLine(startElement, endElement, {hide: true});
showButton.addEventListener('click', function() { line.show(); }, false);
hideButton.addEventListener('click', function() { line.hide(); }, false);

How do I implement the self= code into the button? I'm not even sure what self= is supposed to mean. The below code does not work

var line = new LeaderLine(startElement, endElement, {hide: true});
line.show() = line.show({showEffectName:'draw'}, {animOptions: {duration: 3000, timing: 'linear'}});
startElement.addEventListener('click', function() { line.show(); });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Here is what you are looking for

line.show('draw', {
  animOptions: {
    duration: 3000,
    timing: [0.5, 0, 1, 0.42]
  }
})

And now you can call this in any function

button.addEventListener('click', function() {
  line.show('draw', {
    animOptions: {
      duration: 3000,
      timing: [0.5, 0, 1, 0.42]
    }
  })
});

about 4 years ago · Juan Pablo Isaza Report

0

Your code does not work because you have to put only value like below.

var line = new LeaderLine(startElement, endElement, {hide: true});

startElement.addEventListener("click", function () {
  line.show("draw", {duration: 3000, timing: 'linear'});
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!