-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LineDash and 0-width lines #68
base: master
Are you sure you want to change the base?
Conversation
Added support for 0 line width on series (they get skipped) Signed-off-by: johnvillar <[email protected]>
smoothie.js
Outdated
|
||
if (seriesOptions.lineWidth === 0) { | ||
context.restore(); | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you continue here, then the call to dropOldData
call below is skipped too, and the data will build up indefinitely in the time series object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch... in fact i've already changed it a bit, as the "lineDash" property doesn't gets saved in the context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also prohibit using a line width of zero and a fill style in order to have a filled curve with no line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, that would be the effect.
Just changed it to the line 783 where it makes more sense (i was setting lineWidth to 0 and stroke was still there). That should solve the problem of having 0 width lines with fillStyles.
Added a way to append data to a series via object instead of positional parameters Added a provision to add metadata to series points Metadata can control interpolation from point to point Added "jump" interpolation that just moves to the series' point without drawing Added a way to add text to a series point Signed-off-by: johnvillar <[email protected]>
Can you please give an example on how to use this? |
Very nice, thank you! |
Good thing is, i'm actively using it in one product i'm developing, so at least it will get maintained if it doesn't gets pulled. Ooh, also, another nifty thing, you can include text on the time series now, although i think i haven't pushed those changes yet, as it is a little rough around the edges atm. I use it to include fontawesome icons on my graphs to mark events. |
I would love that! Please push your changes when you get a chance. |
I'll push changes as soon as i fix some quirks. Responsiveness is pretty hard atm, as the charts are just a canvas with some line calls, but that could be fixed, although it isn't my priority right now (still some time before i implement the cloud server for my product which needs to be responsive). |
Fair enough. Please keep me posted on any improvements. I will probably be submitting some PRs soon as I have chosen this library to visualize EEG data for my project. |
Aaah EEG is a pretty nice fit for this project. Be sure to post links when it's up to peruse the goodies. |
I already have something up. You can check it out here: https://github.com/NeuroJS/openbci-dashboard |
@chiguireitor - were you ever able to make smoothiecharts responsive? |
Nope, didn't continue modifying it because the project didn't need anything El vie., 18 de nov. de 2016 a la(s) 22:43, mg1075 [email protected]
John Villar |
@chiguireitor - ok, thanks for the update. |
This follows on from #68. Unfortunately the dashes jump back and forth during rendering, which is quite visually annoying. Fixing this would be quite difficult I suspect.
@mg1075, smoothiecharts has been responsive for a few versions now. @chiguireitor I took a look at the dashed line code in isolation but unfortunately it creates jerkiness in the animation, which isn't very smoooooth. In your example you possibly don't notice that because it seems that your scroll rate is so low, but for high FPS animation the dashes appear to jump forwards and backwards along the line, which I think is probably unavoidable. I pushed code for that to the You have some other bits in this PR too which are worth separate review. |
Nice, maybe in the future i'll make a better PR... this whole year and a half i have got more git wisdom to understand my original PR was bs. About the dashes lines jerkiness, it's a common artifact from dashed lines in fast movement to do that, prolly not a good idea to use dashes/dotted stuff on fast moving charts. The rest of the PR whould be in it own PR, i concur.... maybe i'll get to this eventually this year as we have another project needing smooth graphs. |
Added setLineDash support to series drawing
Added support for 0 line width on series (they get skipped)
Signed-off-by: johnvillar [email protected]