fsprojects / IfSharp

F# for Jupyter Notebooks
Other
440 stars 71 forks source link

Dynamic Angara.Chart via AsyncSeq #190

Closed dgrechka closed 5 years ago

dgrechka commented 5 years ago

This PR (related to #104 ) contains one more Async printer which enables dynamic Angra.Chart.

The feature should be considered as proof of concept because it does not work on Mono now. This is an issue with Angara packages and Mono (for some reason Angara.Serialization.Json.dll does not load on Mono. I'll discuss it with @sergey-berezin) and is not related to IfSharp.

That's why I added usage example to different notebook, mentioning that it works only on Windows.

When the Mono issue is resolved, we can move the usage example to the main demo notebook.

cgravill commented 5 years ago

Looks good. Seems OK for the initial POC being .net only until resolved in the external library.

Would you be able to add a programmatic check for Mono? People using Azure Notebooks have previously been surprised that they're actually running Linux, so the comment might not be enough.

Perhaps also add a link to an issue on https://github.com/predictionmachines/InteractiveDataDisplay ? That way if people have older notebooks they can tell when it's resolved.

cgravill commented 5 years ago

Oh also, what's the motivation around the priority parameter? Is the script needing to intercept something that would otherwise be matched?

dgrechka commented 5 years ago

Yes. Now both AsyncSeq<_> and AsyncSeq<Chart> printers are capable of printing the AsyncSeq<Chart>. The first one updates the whole chart, the second only redraws the data.

To avoid printer registration order dependency I've introduced the priority.

dgrechka commented 5 years ago

The assembly load issue seems to be Mono issue as I can reproduce it with fharpi Linux f# interactive. I'll create a simple repro and post an issue to mono github to reference it in a Angara.Chart.Dynamic.fsx and in demo notebook.

cgravill commented 5 years ago

Great, thanks for the explanation. Might be worth prioritising the more specific later but a priority level seems a reasonable approach for now.

cgravill commented 5 years ago

This looks good, I'll merge now. Thanks for working around the Mono issue with Angara.

There is a strange error about IDynamicMetaObjectProvider missing on Angara.Charting.Dynamic.fsx but it doesn't seem to do any harm.

cgravill commented 5 years ago

For reference the IDynamicMetaObjectProvider intellisense error looks to be related to issues around netstandard - https://github.com/fsharp/FAKE/issues/1938#issuecomment-390960935

cgravill commented 5 years ago

@dgrechka is Angara using netstandard now?

dgrechka commented 5 years ago

@cgravill No. Right now it is not netstandard yet.

cgravill commented 5 years ago

Thanks, I've traced it through and it's NewtonSoft.Json targeting netstandard. Runtime it's all fine so not going to worry about this.

cgravill commented 5 years ago

I think I've resolved this by updating FSharp.Compiler.Service & FSharp.Compiler.Tools