smoothie icon indicating copy to clipboard operation
smoothie copied to clipboard

LineDash and 0-width lines

Open chiguireitor opened this issue 8 years ago • 14 comments

Added setLineDash support to series drawing Added support for 0 line width on series (they get skipped)

Signed-off-by: johnvillar [email protected]

chiguireitor avatar Feb 24 '16 16:02 chiguireitor

@chiguireitor

Can you please give an example on how to use this?

alexcastillo avatar Apr 30 '16 01:04 alexcastillo

Yeah sure, it works wonders to create graphs like this: graph

To hide the dotted series i do:

style = ghsChart.getTimeSeriesOptions(seriesGhsAv[x])
style.lineWidth = 0

And to create them, as i create them dotted, i use this code:

ghsChart.addTimeSeries(serieAv, { strokeStyle: rgbCol, lineWidth:0, lineDash: [2, 3]})

chiguireitor avatar Apr 30 '16 02:04 chiguireitor

Very nice, thank you! I hope this PR gets merged soon.

alexcastillo avatar Apr 30 '16 02:04 alexcastillo

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.

chiguireitor avatar Apr 30 '16 02:04 chiguireitor

I would love that! Please push your changes when you get a chance. Also, how would you go about making the charts responsive?

alexcastillo avatar Apr 30 '16 02:04 alexcastillo

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

chiguireitor avatar Apr 30 '16 02:04 chiguireitor

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.

alexcastillo avatar Apr 30 '16 02:04 alexcastillo

Aaah EEG is a pretty nice fit for this project. Be sure to post links when it's up to peruse the goodies.

chiguireitor avatar Apr 30 '16 02:04 chiguireitor

I already have something up. You can check it out here: https://github.com/NeuroJS/openbci-dashboard

alexcastillo avatar Apr 30 '16 03:04 alexcastillo

@chiguireitor - were you ever able to make smoothiecharts responsive?

mg1075 avatar Nov 19 '16 02:11 mg1075

Nope, didn't continue modifying it because the project didn't need anything else besides what i achieved. However, making it responsive is kinda complicated because canvas is not responsive friendly at times. Gotta work it out a lot.

El vie., 18 de nov. de 2016 a la(s) 22:43, mg1075 [email protected] escribió:

@chiguireitor https://github.com/chiguireitor - were you ever able to make smoothiecharts responsive?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/joewalnes/smoothie/pull/68#issuecomment-261687983, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbqXjb3UqbgDv_qJ1keY8CwzPZ8fwpvks5q_mJMgaJpZM4Hh2ks .

John Villar

chiguireitor avatar Nov 19 '16 04:11 chiguireitor

@chiguireitor - ok, thanks for the update.

mg1075 avatar Nov 19 '16 04:11 mg1075

@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 linedash branch, and you can play around with it in the builder.

You have some other bits in this PR too which are worth separate review.

drewnoakes avatar Aug 25 '17 20:08 drewnoakes

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.

chiguireitor avatar Aug 28 '17 15:08 chiguireitor