lmgonzalves / segment Goto Github PK
View Code? Open in Web Editor NEWA JavaScript library to draw and animate SVG path strokes
Home Page: http://lmgonzalves.github.io/segment
License: MIT License
A JavaScript library to draw and animate SVG path strokes
Home Page: http://lmgonzalves.github.io/segment
License: MIT License
segment.min.js:7 Uncaught TypeError: Cannot read property 'getTotalLength' of null
how to fix this error
I have more than one path which i want to animate with TimelineLite plugin.
How can i add more paths in the following:
var s = document.getElementById("s"), // shield = document.getElementById('shield'), segment = new Segment(s);
Any solution for this please?
Scripts loaded as follows:
jquery-1.12.4.min.js
segment-js/1.0.8/segment.js
var myPath = document.getElementById("dvr"),
segment = new Segment(myPath);
segment.draw("25%", "75% - 10", 1);
I found the example use d3-ease as below:
ease.ease('elastic-out', 1, 0.3)
but according its documentation on github, the API seems different than your demo, something like:
d3.easeElasticOut(t, 1.00, 0.2)
since I'm not a d3 user, I really don't know which way I should follow. I use npm to install the latest version (I believe it is v1.0.0) and follow your demo, but it doesn't work. Later I change the syntax like:
import ease from 'd3-ease'
// somewhere
ease.easeElasticOut(1, 0.3)
it works...but it doesn't have any elastic-ish effect, very confusing.
Would you mind to explain a little more about how to use d3-ease with segment-js?
`$('.service-section').each(function() {
var el = $(this);
var topDistance =
if ( (topDistance) < scrollTop ) {
var myPath = document.getElementById("glob"),
segment = new Segment(myPath);
segment.draw("25%", "75% - 10", 1);
}
});`
this code showing me an error 'hasOwnProperty' of undefined
I would love to use this project in a small project of mine, currently built with webpack.
Using this project via NPM would require some changes, since the "main"
entry point (dist/segment.js
) isn't exporting any value. Would you consider either:
dist/segment.js
to export the class (and then using something like webpack or browserify to build the demo website)dist/segment.node.js
) by appending module.exports = Segment;
at the end of segment.js
, and changing the "main"
entry point to this?A new, trending way of distributing packages is to write ES6 code and add a "esnext:main"
entry point in the package.json
. This could be considered as well.
Also, for simplicity and visibility, it would be great to publish segment
to the NPM registry.
We are exactly looking for this kind of solution The only i couldnt find is the possibility to make the path, dashed. Is this possible?
Thanks
Dennis
Would be cool to be able to use with Typescript and Browserify.
Hello,
Adding tags for repo could specify points in history and mark release points.
It's helpful for user to know the version and status of repository, and would enable wider distribution of the library, for example it could be hosted by cdnjs (website)
Would you please consider on using tags?
Thanks for your great work!
I'm using segment to make a countdown, and if I skip the item before the animation end it still counting. If I come back to the item and try to start from zero the plugin ignores because the animationTimer still running.
I put the stop function visible to the object and use it to reset the counter... works perfectly :)
Keep getting this error, don't know how to solve it ?
here is my code.
testSegment.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.