ihaskell-hvega 0.2.6.0 → 0.3.0.0
raw patch · 4 files changed
+27/−34 lines, 4 files
Files
- CHANGELOG.md +9/−1
- README.md +7/−7
- ihaskell-hvega.cabal +1/−1
- src/IHaskell/Display/Hvega.hs +10/−25
CHANGELOG.md view
@@ -1,7 +1,15 @@ For the latest version of this document, please see [https://github.com/DougBurke/hvega/blob/master/ihaskell-hvega/CHANGELOG.md](https://github.com/DougBurke/hvega/blob/master/ihaskell-hvega/CHANGELOG.md). -## 0.2.2.0 - 0.2.5.0+## 0.3.0.0++Support for the IHaskell notebook has been updated to version 4 of the+Vega-Lite schema. Finally.++Support for the Jupyter Lab interface remains stuck in a maze of+very-twisty paths...++## 0.2.2.0 - 0.2.6.0 Bump the maximum version of hvega.
README.md view
@@ -19,11 +19,11 @@ # Current status -If your visualization uses anything more modern than version 2 of the Vega-Lite-specification (and possibly even version 2 features) then there is a good chance-that it will not display correctly in IHaskell. This can differ depending on-whether you are using the notebook or lab interface.+The display should work correctly when using the IHaskell `notebook`+interface, supporting features included in Vega-Lite 4 (this is new to+version 0.3, as earlier versions were limited to features in Vega-Lite+3). -For the lab interface I am waiting for support for custom mime-types to be-released (it is in the master branch of IHaskell). For the notebook interface-I gave up on trying to work through the JavaScript issues I came across.+Support for the Jupyter lab interface is **very limited** since there+is a curious combination of IHaskell and Jupyter lab issues (including+whether you are using v1.2 or v2). This is very annoying.
ihaskell-hvega.cabal view
@@ -1,5 +1,5 @@ name: ihaskell-hvega-version: 0.2.6.0+version: 0.3.0.0 synopsis: IHaskell display instance for hvega types. description: Support Vega-Lite visualizations in IHaskell notebooks. homepage: https://github.com/DougBurke/hvega
src/IHaskell/Display/Hvega.hs view
@@ -3,7 +3,7 @@ {-| Module : IHaskell.Display.Hvega-Copyright : (c) Douglas Burke 2018, 2019+Copyright : (c) Douglas Burke 2018, 2019, 2020 License : BSD3 Maintainer : dburke.gw@gmail.com@@ -78,30 +78,15 @@ instance IHaskellDisplay VegaLite where display vl = - let -- Note: need to look in the package.json files for these packages- -- to find the "full name" (the contents of the jsdelivr key),- -- since requirejs does seem to like appending .js to everything.- --- jsname n v = "'https://cdn.jsdelivr.net/npm/"- <> n- <> "@" <> v- <> "/build/"- <> n <> ".min'"-- -- Should the config be set on require or requirejs?- --- -- These versions are known to work; later versions- -- do not work but I have not tried to work out the- -- latest version that does work.- --- config = "requirejs({paths:{vg:" <> jsname "vega" "3.2.1"- <> ",vl:" <> jsname "vega-lite" "2.3.0"- <> ",vge:" <> jsname "vega-embed" "3.5.2"- <> "},shim:{vge:{deps:['vg.global','vl.global']}"- <> ",vl:{deps:['vg']}"+ let -- does https://github.com/vega/vega-embed/issues/8 help?+ config = "requirejs.config({"+ <> "baseUrl: 'https://cdn.jsdelivr.net/npm/',"+ <> "paths: {"+ <> "'vega-embed': 'vega-embed@6?noext',"+ <> "'vega-lib': 'vega-lib?noext',"+ <> "'vega-lite': 'vega-lite@4?noext',"+ <> "'vega': 'vega@5?noext'" <> "}});"- <> "define('vg.global',['vg'],function(g){window.vega = g;});"- <> "define('vl.global',['vl'],function(g){window.vl = g;});" -- rely on the element variable being set up; it appears to be an array -- so use the first element to add the div to.@@ -115,7 +100,7 @@ -- Use the div element we have just created for the plot. -- More options could be passed to vegaEmbed. --- plot = "require(['vge'],function(vegaEmbed){"+ plot = "require(['vega-embed'],function(vegaEmbed){" <> "vegaEmbed(ndiv," <> js <> ").then(" <> "function (result) { console.log(result); }).catch(" <> "function (error) { ndiv.innerHTML = "