data-forge / data-forge-ts

The JavaScript data transformation and analysis toolkit inspired by Pandas and LINQ.
http://www.data-forge-js.com/
MIT License
1.34k stars 77 forks source link

IE 11 Compatibility? #13

Closed Joxch closed 6 years ago

Joxch commented 6 years ago

I was wondering if the data-forge 1.2.4 is compatible with IE 11? I've tried using polyfill io and importing the default, es5 and es5 to cover the Symbol usage but for some reason it hangs in iterable.js or iterator.js. Seems to never hit the iterator.prototype[Symbol.iterator] section. Using the polyfill io, I had no issues with putting the data into Dataframe but trying to run the subset function hangs.

ashleydavis commented 6 years ago

I use the TypeScript compiler to target JavaScript ES5.

Supposedly ES5 is supported by IE 11, although I haven't tested Data-Forge on IE 11.

es5 support

Please provide example code in GitHub that is ready to test in IE 11 and I'll investigate it for you.

Joxch commented 6 years ago

import React, { Component } from 'react'; import { DataFrame } from 'data-forge';

class App extends React.Component { constructor(props) { super(props); this.testData = [ {'a':1,'b':2,'c':3,'d':4}, {'a':5,'b':6,'c':7,'d':8}, {'a':9,'b':10,'c':11,'d':12}, {'a':1,'b':2,'c':3,'d':4}, {'a':5,'b':6,'c':7,'d':8}, {'a':9,'b':10,'c':11,'d':12}, {'a':1,'b':2,'c':3,'d':4}, {'a':5,'b':6,'c':7,'d':8}, {'a':9,'b':10,'c':11,'d':12}, {'a':1,'b':2,'c':3,'d':4}, {'a':5,'b':6,'c':7,'d':8}, {'a':9,'b':10,'c':11,'d':12}, {'a':1,'b':2,'c':3,'d':4}, {'a':5,'b':6,'c':7,'d':8}, {'a':9,'b':10,'c':11,'d':12} ] }

componentDidMount() { console.log(this.testData); let df = new DataFrame(this.testData); console.log(df); }

render() { return (

);

} }

export default App;

This is my first time using Github for questions so I'm sorry if I posted too much. That's a quick example on React just getting the data into dataforge. I've also used polyfill.io in the index html page: . I noticed when I don't use the polyfill, IE gives me ReferenceError: 'Symbol' is undefined. With Polyfill, I'm getting: image

Please let me know if there's something I missed out. Thanks!

ashleydavis commented 6 years ago

Thanks. Seems like a strange issue.

So the code works ok in Chrome?

If you want me to debug you'll need to provide me with a runnable copy of the code. You could do that by sharing a GitHub repo with me. Or you could email me a zip file containing the code.

My email is ashley@codecapers.com.au

If you can prep the code for me I'll be happy to run it under IE 11 and see what happens.

Joxch commented 6 years ago

Yeah the code seems to run successfully on Chrome with no issues. Let me see if I can get a file to you. ReactCreateApp-DataFrameTest.zip

I'll also email you a copy of the zip. Let me know if that doesn't work. Thanks!

Joxch commented 6 years ago

@ashleydavis I seemed to have received an error trying to send to that email address. Let me know if the attachment on here doesn't work.

ashleydavis commented 6 years ago

I download the zip file. Thanks for that. I'm just trying to download a VM with ie11 so I can test it!

ashleydavis commented 6 years ago

Sorry this is taking so long. I have ie11 but probably won't have a chance to look at it until Monday.

ashleydavis commented 6 years ago

I've been doing some research.

Unfortunately Symbol.iterator isn't supported by ie11. Data-Forge relies on this quite heavily and I'm not sure if there is anything I can do to fix the situation for you. Although, you can probably get by with loading a polyfill for ie11.

For example this library contains many polyfills including the one you need: https://github.com/zloirock/core-js

And here's another that just contains the Symbol polyfill: https://github.com/medikoo/es6-symbol

Thanks for reaching out and I'm sorry I can't be of much more help. Please let me know how it goes for you!