Comments (11)
That's a good point. I remembered that self was passed as attachment but nope. At first glance, it seems that passing the path always as third parameter would be good solution
from progressbar.js.
If I have time later I'll try and update the docs, but as it stands I spent a bit to much time on this... Thanks for the crash course in Mocha and Sinon though ;-)
from progressbar.js.
So i was just updating the docs, and I wonder, should we update the Shape
derived progress bars to pass an empty/merged object as attachment
and then let them pass this
as the third argument so that the API is consistent or are we ok with just allowing Path
do this since its a special case?
from progressbar.js.
Good question. I think the best would be to pass reference to Shape
or Path
as a separate parameter and leave attachments only for the library user. I have implemented it so that by default, reference to Shape
is passed as the attachment
. If user overrides the attachment
, they can't get reference to the Shape
inside step
function. That's not good. I think the attachment
should be left for only library users. That way the internal reference passing wouldn't be messed up if user wants to customize the attachment
.
I propose:
function step(state, self, attachment) { ... }
self
is reference to Path
or Shape
derived progress bar depending which was initialized. This changes the API a bit, but the parameter order makes sense in the way that state
and self
always contain a value, attachment might be undefined.
from progressbar.js.
@prodigitalson What do you think?
from progressbar.js.
@kimmobrunfeldt That sounds much more intuitive/proper to me. I'll go ahead and get started on those changes and doc updates. Should I also do the MAJOR version bump or will you handle that?
from progressbar.js.
Ok sounds good. I'll handle the version bumps and release specific stuff. Since we are below 1.0.0 version, I'll do a minor bump.
from progressbar.js.
@kimmobrunfeldt Ok updates pushed. See my note on the PR and commit for some additional changes I made to the test setup.
from progressbar.js.
I was about to release new version with this included. But I found out a couple of issues. I'll fix them and make the release.
from progressbar.js.
This is now released as 0.8.0 https://github.com/kimmobrunfeldt/progressbar.js/releases/tag/0.8.0
from progressbar.js.
Great, i've been waiting for this release so I can update my project with the official dist. Thanks @kimmobrunfeldt
from progressbar.js.
Related Issues (20)
- IE11 'Symbol' is undefined progressbar.js (3,4288) HOT 1
- Text inside circle doesn't center correctly if I place the circle inside cell of a CSS Grid.
- Progress bar around an image HOT 1
- Text not appearing HOT 1
- Wrong numbers in Safari 14 HOT 5
- Icon follow progressbar value
- Setting custom color variable
- Cannot read property 'map' of null
- How to change color gradient speed?
- Update Shifty dependency version to have RGBA-Colors support
- Progressbar.JS not loaded after AJAX refresh.
- Progress Bar, not animating on inactive tab.
- progressbar not working in classs
- JSdom causing Error: Uncaught [TypeError: this.path.getTotalLength is not a function]
- Prototype Pollution using extend() in utils.js HOT 6
- CVE-2023-26133 HOT 1
- trailColor set in Javascript
- bar.set(0) resets but if i again call bar.animate(1) the circle is not animating. HOT 1
- Is it possible to have multiple colour steps?
- self is not defined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from progressbar.js.