Closed KevinPoole closed 2 years ago
For now I have gone with the interpolation approach, and while not ideal, I am quite pleased to see how snappy it performs even with 43k + 15.6k data points. very impressive
Kevin, there isn't a way to do variable xdelta, but there is a way to provide a series of X/Y coordinate pairs. I'll dig up an example for you and respond here.
Also, if this is a work-related project, it might be nice to connect so that we can better understand your needs and requirements. Feel free to email me directly at mihde@spectric.com.
@maihde if there were a way to provide a series of X/Y coordinate points and have them plotted as a connected line then that would solve my dilemma perfectly!
Thanks very much!
@KevinPoole try this example: https://jsfiddle.net/68hkc0dx/1/
@KevinPoole I've added a new mode to layer1d this is more clearly for XY drawing. Historically, XY plots were done by sending in "complex" format data and rendering in "IR" mode. This new feature achieves the same effect without resorting to an esoteric method.
https://github.com/spectriclabs/sigplot/tree/feature/layer1d-xy-mode https://github.com/spectriclabs/sigplot/blob/9c7958a063762a369196cb8c2ec8cc28b00b56bf/test/tests.interactive-symbols.js#L175
@maihde I have been away from this particular issue for some time. I have been hesitant to adopt the above update in large part because up until now I have been utilizing the react-sigplot library and that is based on what I gather to be the original repo, LGSInnovations/sigplot.
However I am thinking I have gotten to the point where I can avoid this issue no longer, so I will need to adopt your above XY changes. I noticed that this feature branch is not merged even into the fork though at spectriclabs/sigplot - is there any reason for this? could it be? presently I am even contemplating just using the feature branch directly, but that does not seem ideal.
Thanks again for your help with these matters.
@maihde I can't complain seeing as you were just trying to help, but it seems there is something not quite right about the above XY mode. It works with the basic data set that is used in the test case you linked to, but it seems to be easier to find data sets that don't work than do 😢 for example, just multiplying each value by 10 is already enough to break it and have no data plotted.
If for some reason you are willing to revisit this, it would be greatly appreciated.
@KevinPoole I'm not sure if anyone is still maintaining the LGSInnovations/sigplot library anymore. The spectriclabs/sigplot library is probably the only version that will receive updates.
I'm happy to revisit this, but I cannot guarantee any particular schedule for when it will be completed. If this is an urgent need please reach out to me directly via e-mail and I would be happy to discuss options where we might be able to address your specific concern.
Sounds good @maihde , I totally understand. If you do get back to this at some point, the following may be of use to you. I forked from the branch you had linked, https://github.com/spectriclabs/sigplot/tree/feature/layer1d-xy-mode , and it seems that the following tweak got it to work:
diff --git a/js/sigplot.layer1d.js b/js/sigplot.layer1d.js
index c0c261e..f4764a0 100644
--- a/js/sigplot.layer1d.js
+++ b/js/sigplot.layer1d.js
@@ -243,7 +243,10 @@
var imin = 0;
var imax = 0;
- if (Gx.index) {
+ if(this.mode === 'XY'){
+ imin = 0;
+ imax = size - 1;
+ }else if (Gx.index) {
imin = Math.floor(xmin);
imax = Math.floor(xmax + 0.5);
} else if (HCB.xdelta >= 0.0) {
You may know better than I do whether this indicates other changes that would also be needed, or if this truly is sufficient, but it has seemed to do the trick for me.
Cheers.
@KevinPoole your fix looks good to me and works when I apply it to master baseline. I've added a unittest for this as well. Thanks for debugging that and providing a fix!
@maihde happy to help. perhaps at some point I will port the react-sigplot over to use spectriclabs/sigplot (I do not think it would take much effort). that way I would be able to utilize the latest and greatest. we'll see.
@KevinPoole there is also a react-sigplot here https://github.com/spectriclabs/react-sigplot which uses newer SigPlot as well.
Wonderful. Perhaps I will make the switch then.
On Wed, Feb 23, 2022 at 1:42 PM maihde @.***> wrote:
@KevinPoole https://github.com/KevinPoole there is also a react-sigplot here https://github.com/spectriclabs/react-sigplot which uses newer SigPlot as well.
— Reply to this email directly, view it on GitHub https://github.com/LGSInnovations/sigplot/issues/109#issuecomment-1049095251, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7PVSGUI3ZNCOQTIWGMHI3U4UTAXANCNFSM5DXF7VXA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
Hi Sigplot team,
You all have been very helpful helping me with a couple of other issues I have worked through, so I thought I might push my luck with my latest question...
I have a situation where I need to plot a set of values, and want them connected with a line, but the values are not guaranteed to have a consistent xdelta. To give a trivial illustration:
so x is guaranteed to monotonically increase, but the gaps from one value to the next vary. I was wondering if there is a way to accomplish this with sigplot? I have seen the
xdelta
andxstart
options which are all relevant to my problem space, but do not seem to aid this particular issue.A work around I have considered, is linearly interpolating the data so that it ends up having a constant
xdelta
but this would require inserting "fake data" and I would rather avoid this if at all possible.Your assistance is, as always, greatly appreciated!