vega-view 0.3.1.7 → 0.4.0.0
raw patch · 4 files changed
+29/−3 lines, 4 filesdep ~aeson
Dependency ranges changed: aeson
Files
- ChangeLog.md +9/−0
- README.md +3/−0
- app/Main.hs +15/−1
- vega-view.cabal +2/−2
ChangeLog.md view
@@ -1,8 +1,17 @@ # Changelog for vega-view +## 0.4.0.0++Support aeson 2.0. There is no functional change worthy of a major+version but let's do it anysay!+ ## 0.3.1.7 Bump aeson and scotty dependencies and try Yet-Another-Nix setup.++This release adds support for using local data files. To distinguish+Vega specification files from data, the Vega files are now expected to+end in `.vg.json`. ## 0.3.1.6
README.md view
@@ -51,6 +51,9 @@ memory- or time- issues if there are large non-JSON files in the directory tree. +Specifications should have filenames ending in `.vg.json`, to+distinguish them from local data files.+ ## GHC support This is currently a **very basic** application, so will hopefully build
app/Main.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-@@ -31,7 +32,13 @@ module Main where import qualified Data.ByteString.Lazy.Char8 as LB8++#if MIN_VERSION_aeson(2, 0, 0)+import qualified Data.Aeson.KeyMap as KeyMap+#else import qualified Data.HashMap.Strict as HM+#endif+ import qualified Data.Text as T import qualified Data.Text.Lazy as LT import qualified Data.Text.Lazy.IO as LT@@ -42,6 +49,7 @@ import Control.Exception (IOException, try) import Control.Monad (forM_, unless) import Control.Monad.IO.Class (liftIO)+ import Data.Aeson (Value(String, Object), Object , (.=) , eitherDecode', encode, object)@@ -106,7 +114,13 @@ createView spec specId = let vis = specVis spec - mDesc = case HM.lookup "description" vis of+ -- Must be a better way to deal with this change in aeson-2.0+#if MIN_VERSION_aeson(2, 0, 0)+ getDesc = KeyMap.lookup "description" vis+#else+ getDesc = HM.lookup "description" vis+#endif+ mDesc = case getDesc of Just (String d) -> Just d _ -> Nothing
vega-view.cabal view
@@ -1,5 +1,5 @@ name: vega-view-version: 0.3.1.7+version: 0.4.0.0 synopsis: Easily view Vega or Vega-Lite visualizations. description: A web server that is used to view all the Vega and Vega-Lite specifications in a directory, or sub-directory. It is similar@@ -35,7 +35,7 @@ app ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends:- aeson >= 1.1 && < 1.6+ aeson >= 1.1 && < 2.1 , base >= 4.9 && <5 , blaze-html >= 0.7 && < 0.10 , blaze-markup >= 0.6 && < 0.9