flrs / visavail

A D3.js Time Data Availability Visualization
https://flrs.github.io/visavail/docs/samples/basic.html
MIT License
310 stars 59 forks source link

'find' method is not supporting in IE 11 #19

Closed snsnanda closed 6 years ago

snsnanda commented 7 years ago

Hi, Visavail plugin url (http://phatduino.com.w010a51b.kasserver.com/visavail/example.htm) is working in IE 11, but when I am using the Visavail libraries (resources and vendors) in my project folder and trying to load visavail chart, it is saying that 'find' method is not supported. In both the cases the same visavail.js library is used.

Can anyone help in this regard?

Regards, Shitikantha

vikrambansod commented 7 years ago

Hi, IE doesn’t support find method. Try using filter() method in place of find().

I have also faced the similar issue.

Thanks & Regards, Vikram

On Wed, 11 Oct 2017 at 12:56 PM, snsnanda notifications@github.com wrote:

Hi, Visavail plugin url ( http://phatduino.com.w010a51b.kasserver.com/visavail/example.htm) is working in IE 11, but when I am using the Visavail libraries (resources and vendors) in my project folder and trying to load visavail chart, it is saying that 'find' method is not supported. In both the cases the same visavail.js library is used.

Can anyone help in this regard?

Regards, Shitikantha

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/flrs/visavail/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/AdrBSWrdtDcvT96zyBXmBIfiGhyTpY3vks5srG2IgaJpZM4P1Blc .

-- Sent from MetroMail

snsnanda commented 7 years ago

On Using filter(), the data in the dataset is not reflecting, instead black rectangular bars are populating. Did filter() function work for you?

Regards, Shitikantha

flrs commented 7 years ago

Thanks @snsnanda and @vikrambansod for figuring out that find() is not supported in IE (see here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find ). I did not realize this before.

@snsnanda: Which example is it that shows the black bars after changing to filter()?

@vikrambansod: Do you have any experiences about how filter() is supported across browsers? I feel we might be on track here for an easy fix.

vikrambansod commented 7 years ago

Hi,

Yes, filter() method is supported by all the major browsers. Please refer the following link. https://www.w3schools.com/jsreF/jsref_filter.asp

@snsnanda https://github.com/snsnanda: I guess you are using custom categories to show the different categories with different color. When you replace the find method with the Filter method the error is gone but it wont able to get the color value from the array hence rectangles are drawn with the default color black.

Code causing issue var series = dataset.find( function(series) { return series.disp_data.indexOf(d) >= 0; } );

alternate solution

var series = dataset.filter( function (series) { return series.disp_data.indexOf(d) >= 0; } )[0];

Regards, Vikram.

On Wed, Oct 11, 2017 at 7:14 PM, Florian Roscheck notifications@github.com wrote:

Thanks @snsnanda https://github.com/snsnanda and @vikrambansod https://github.com/vikrambansod for figuring out that find() is not supported in IE (see here: https://developer.mozilla.org/ en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find ). I did not realize this before.

@snsnanda https://github.com/snsnanda: Which example is it that shows the black bars after changing to filter()?

@vikrambansod https://github.com/vikrambansod: Do you have any experiences about how filter() is supported across browsers? I feel we might be on track here for an easy fix.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/flrs/visavail/issues/19#issuecomment-335814261, or mute the thread https://github.com/notifications/unsubscribe-auth/AdrBSZo1d13edlLb_0BISplXo65DHeRlks5srMY8gaJpZM4P1Blc .

snsnanda commented 7 years ago

Hi Vikram,

Thanks a lot for the workaround...It really worked in IE

Regards, Shitikantha

flrs commented 6 years ago

Alright, just fixed this. Thanks again for your input @snsnanda and @vikrambansod!