simple-data-grapher icon indicating copy to clipboard operation
simple-data-grapher copied to clipboard

[WIP] Browsable time slider

Open IshaGupta18 opened this issue 5 years ago • 45 comments

@jywarren @Souravirus here's the code for #22. Lets work to resolve this bug or find a workaround for this

IshaGupta18 avatar May 28 '19 16:05 IshaGupta18

Hi, this caught my attention that actualType should be replaced with pie, line or bar. What do you think??

Souravirus avatar May 28 '19 18:05 Souravirus

actualType holds the actual type of the graph, which is returned by the function determineType, that function is just responsible for returning the type of the graph. Does that make sense?

On Wed, May 29, 2019, 12:05 AM Sourav Sahoo [email protected] wrote:

Hi, this caught my attention that actualType should be replaced with pie, line or bar. What do you think??

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/simple-data-grapher/pull/31?email_source=notifications&email_token=AJXHQZYFX6G2T6SCPII637TPXV3ODA5CNFSM4HQFE3T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWNBKLY#issuecomment-496637231, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXHQZ2AO2IX76TQE46VIYTPXV3ODANCNFSM4HQFE3TQ .

IshaGupta18 avatar May 28 '19 18:05 IshaGupta18

Hi @IshaGupta18 ! I had a feeling similar to @Souravirus . Maybe we could use graphType or something similar instead of actualType. What do you think?

IgorWilbert avatar May 29 '19 00:05 IgorWilbert

Yeah understood @IshaGupta18

Souravirus avatar May 29 '19 02:05 Souravirus

So anyone has any ideas?

IshaGupta18 avatar May 29 '19 12:05 IshaGupta18

I like graphType!

On Wed, May 29, 2019 at 8:46 AM Isha Gupta [email protected] wrote:

So anyone has any ideas?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/simple-data-grapher/pull/31?email_source=notifications&email_token=AAAF6J2ZYKHSHBEKRDNSFWTPXZ3JXA5CNFSM4HQFE3T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWPGVFQ#issuecomment-496921238, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAF6J746LNU2SH7ZXBECNLPXZ3JXANCNFSM4HQFE3TQ .

jywarren avatar May 29 '19 22:05 jywarren

Alright, the name of the variable is changed now. What do you all think might be causing the error?

IshaGupta18 avatar May 30 '19 07:05 IshaGupta18

I think it may be necessary to wrap your code (esp the line causing the error) in a function which can be run after all the prerequisites are loaded. I think it may be a load-time issue. You can wrap your code in:

$( document ).ready(function onReady() {
  // your code here; it'll run after jQuery is loaded!
});

If that doesn't work, a more basic way to do this is:

(function onReady() {
  // this code will be delayed in execution until the page is completely loaded
})()

Worth a try!

jywarren avatar May 31 '19 14:05 jywarren

I tried putting up the entire code, since its all co-dependent, but the error still persists, I feel it was something to with the initial variable, but I am not able to figure it out, since the code is very similar to this working fiddle here http://jsfiddle.net/schme16/xfyvvup8/. What do you think?

IshaGupta18 avatar May 31 '19 14:05 IshaGupta18

Does anyone have other ideas that could be tried on? @Souravirus. @sagarpreet-chadha @rexagod, could you have a glance here?

IshaGupta18 avatar Jun 02 '19 11:06 IshaGupta18

@IgorWilbert @geekychasser any suggestions?

IshaGupta18 avatar Jun 02 '19 14:06 IshaGupta18

@IshaGupta18 sorry, could you please recap? What is the error message you are getting now? I saw that on #22, you solved the carroussel problem.

IgorWilbert avatar Jun 02 '19 14:06 IgorWilbert

So basically, right now I am facing this error image Which is coming because of the range-slider CDN.

IshaGupta18 avatar Jun 02 '19 14:06 IshaGupta18

I tried putting up the entire code, since its all co-dependent, but the error still persists, I feel it was something to with the initial variable, but I am not able to figure it out, since the code is very similar to this working fiddle here http://jsfiddle.net/schme16/xfyvvup8/. What do you think?

Refer to this comment as well!

IshaGupta18 avatar Jun 02 '19 14:06 IshaGupta18

@IshaGupta18 I hope this does not sound obvious. Your CDN is trying to use splice of an undefined value, similar to this issue You should check the code in this link https://gitcdn.link/cdn/schme16/Chart.js-RangeSlider/677a7eb6c295772606d300697eaf552245e7f171/dist/RangeSlider-all.min.js , especially this line var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift']. I could not find the problem in the fiddle you mentioned, is it a different issue?

IgorWilbert avatar Jun 02 '19 14:06 IgorWilbert

@IgorWilbert , so the fiddle works fine, and my implementation is very similar to the fiddle, that is why, I am not able to understand, why this one is creating a problem. I think it was to do something with the initial variable, which is being undefined for splicing, or the entire thing could be wrong, the error occurs at the last line of the range slider file.

IshaGupta18 avatar Jun 02 '19 15:06 IshaGupta18

@IshaGupta18 I see. I guess it is unlikely that there is a problem with the initial variable, unless if only a given range is allowed (you could test changing its value to [3, 10] for example). Are you able to print to the console the props of RangeSliderChart ? The values for chartData, chartOpts, chartType, chartCTX, class and initial are all valid? If yes, then it might be that the browser needs the graph before it is rendered. In this case, you could try assigning new RangeSliderChart to a variable and setting a timeout when calling the variable: Window.setTimeout(myVariable(), 3000);

IgorWilbert avatar Jun 02 '19 17:06 IgorWilbert

Let me try it out and get back to you, in the meantime, if you find anything else interesting, do let me know! Thanks a lot. Also, could you please look at a couple of issues like #30, #26 and #17? Thanks again!

On Sun, Jun 2, 2019, 10:38 PM igorwilbert [email protected] wrote:

@IshaGupta18 https://github.com/IshaGupta18 I see. I guess it is unlikely that there is a problem with the initial variable, unless if only a given range is allowed (you could test changing its value to [3, 10] for example). Are you able to print to the console the props of RangeSliderChart ? The values for chartData, chartOpts, chartType, chartCTX, class and initial are all valid? If yes, then it might be that the browser needs the graph before it is rendered. In this case, you could try assigning new RangeSliderChart to a variable and setting a timeout when calling the variable: Window.setTimeout(myVariable(), 3000);

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/simple-data-grapher/pull/31?email_source=notifications&email_token=AJXHQZ4JX4Y3J5KV6SUSCGDPYP475A5CNFSM4HQFE3T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWXZ4EQ#issuecomment-498048530, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXHQZ5LFJ2UWNK5L2DF7MDPYP475ANCNFSM4HQFE3TQ .

IshaGupta18 avatar Jun 02 '19 17:06 IshaGupta18

Okay so we have made some progress here, the bug is removed now, however, there is a new problem, which seems fixable but I can't seem to recall how: I think we are very close now, could someone tell why this might be happening, I even tried delaying the output, but to no use @jywarren @Souravirus @IgorWilbert error

IshaGupta18 avatar Jun 04 '19 09:06 IshaGupta18

Hi @IshaGupta18, in this line, just call the getContext function as is told in this answer: https://stackoverflow.com/a/48895731/7806855 https://github.com/publiclab/simple-data-grapher/blob/de6e40394f63a35f1fcb58f9ef72d011f91f8c7d/src/parsing.js#L175 See if this works.

Souravirus avatar Jun 04 '19 19:06 Souravirus

Hmm, can you describe the problem? I think what I'm seeing is the graph getting generated over and over.

jywarren avatar Jun 04 '19 21:06 jywarren

@Souravirus I think this didn't work out. @jywarren I think I have encountered this problem before but I think I don't know how I fixed it. Even I think the graph is loading over and over again. Any fix?

IshaGupta18 avatar Jun 05 '19 15:06 IshaGupta18

Okay, so before I could have started debugging this yet again, I found that the cdn link is broken, which was working fine till yesterday, but all of a sudden it has stopped working. @jywarren @Souravirus does anyone of you have an alternative for the slider thing? Thanks a ton!

IshaGupta18 avatar Jun 07 '19 15:06 IshaGupta18

Checking if I can get something @IshaGupta18.

Souravirus avatar Jun 07 '19 17:06 Souravirus

That would be great, thank you!

On Fri, Jun 7, 2019, 10:54 PM Sourav Sahoo [email protected] wrote:

Checking if I can get something @IshaGupta18 https://github.com/IshaGupta18.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/simple-data-grapher/pull/31?email_source=notifications&email_token=AJXHQZ4SVOP7RBJYTO7GSA3PZKKU5A5CNFSM4HQFE3T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXGO4PA#issuecomment-499969596, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXHQZ2POTNYXDLHUOLD4MDPZKKU5ANCNFSM4HQFE3TQ .

IshaGupta18 avatar Jun 07 '19 17:06 IshaGupta18

Hi @IshaGupta18, see if it can be downloaded from yarn because it is available in npm also, here is the link for npm: https://www.jsdelivr.com/package/npm/chart.js-rangeslider

Souravirus avatar Jun 07 '19 17:06 Souravirus

It doesn't work image I think there is some recent bug in their file itself

IshaGupta18 avatar Jun 07 '19 18:06 IshaGupta18

Any other alternatives for the slider?

IshaGupta18 avatar Jun 07 '19 18:06 IshaGupta18

See if this rangeslider will work: https://rangeslider.js.org/

Souravirus avatar Jun 07 '19 19:06 Souravirus

Oh will try this one! Thanks!

On Sat, Jun 8, 2019, 1:18 AM Sourav Sahoo [email protected] wrote:

See if this rangeslider will work: https://rangeslider.js.org/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/simple-data-grapher/pull/31?email_source=notifications&email_token=AJXHQZYEDTAQZV7AT4JV2OLPZK3PTA5CNFSM4HQFE3T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXG2HMI#issuecomment-500016049, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXHQZ4SY7YLCTJI6ARV7F3PZK3PTANCNFSM4HQFE3TQ .

IshaGupta18 avatar Jun 07 '19 20:06 IshaGupta18