mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-19 12:56:08 +00:00
commit
602939ad0b
@ -43,7 +43,7 @@ install:
|
||||
# Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail.
|
||||
script:
|
||||
- |
|
||||
if [ ${GHCVER%.*} = "7.8" ]; then
|
||||
if [ ${GHCVER%.*} = "7.8" ] || [ ${GHCVER%.*} = "7.10" ]; then
|
||||
travis_retry ./build.sh all
|
||||
else
|
||||
travis_retry ./build.sh ihaskell
|
||||
|
@ -14,13 +14,13 @@ import Diagrams.Backend.Cairo
|
||||
import IHaskell.Display
|
||||
import IHaskell.Display.Diagrams.Animation
|
||||
|
||||
instance IHaskellDisplay (QDiagram Cairo R2 Any) where
|
||||
instance IHaskellDisplay (QDiagram Cairo V2 Double Any) where
|
||||
display renderable = do
|
||||
png <- diagramData renderable PNG
|
||||
svg <- diagramData renderable SVG
|
||||
return $ Display [png, svg]
|
||||
|
||||
diagramData :: Diagram Cairo R2 -> OutputType -> IO DisplayData
|
||||
diagramData :: Diagram Cairo -> OutputType -> IO DisplayData
|
||||
diagramData renderable format = do
|
||||
switchToTmpDir
|
||||
|
||||
@ -33,7 +33,7 @@ diagramData renderable format = do
|
||||
|
||||
-- Write the image.
|
||||
let filename = ".ihaskell-diagram." ++ extension format
|
||||
renderCairo filename (mkSizeSpec (Just imgWidth) (Just imgHeight)) renderable
|
||||
renderCairo filename (mkSizeSpec2D (Just imgWidth) (Just imgHeight)) renderable
|
||||
|
||||
-- Convert to base64.
|
||||
imgData <- readFile $ fpFromString filename
|
||||
@ -49,5 +49,5 @@ diagramData renderable format = do
|
||||
extension PNG = "png"
|
||||
|
||||
-- Rendering hint.
|
||||
diagram :: Diagram Cairo R2 -> Diagram Cairo R2
|
||||
diagram :: Diagram Cairo -> Diagram Cairo
|
||||
diagram = id
|
||||
|
@ -11,13 +11,13 @@ import Diagrams.Backend.CmdLine (DiagramOpts(..), mainRender)
|
||||
|
||||
import IHaskell.Display
|
||||
|
||||
instance IHaskellDisplay (QAnimation Cairo R2 Any) where
|
||||
instance IHaskellDisplay (QAnimation Cairo V2 Double Any) where
|
||||
display renderable = do
|
||||
gif <- animationData renderable
|
||||
return $ Display [html $ "<img src=\"data:image/gif;base64,"
|
||||
++ gif ++ "\" />"]
|
||||
|
||||
animationData :: Animation Cairo R2 -> IO String
|
||||
animationData :: Animation Cairo V2 Double -> IO String
|
||||
animationData renderable = do
|
||||
switchToTmpDir
|
||||
|
||||
@ -51,5 +51,5 @@ animationData renderable = do
|
||||
return . unpack . base64 $ imgData
|
||||
|
||||
-- Rendering hint.
|
||||
animation :: Animation Cairo R2 -> Animation Cairo R2
|
||||
animation :: Animation Cairo V2 Double -> Animation Cairo V2 Double
|
||||
animation = id
|
||||
|
@ -63,13 +63,13 @@ library
|
||||
bytestring,
|
||||
directory,
|
||||
-- Use diagrams wrapper package to ensure all same versions of subpackages
|
||||
diagrams==1.2.*,
|
||||
diagrams >= 1.3,
|
||||
diagrams-lib,
|
||||
diagrams-cairo,
|
||||
ihaskell >= 0.5,
|
||||
|
||||
-- The active package, used to represent animations
|
||||
active >= 0.1.0 && <0.1.1
|
||||
active >= 0.2
|
||||
|
||||
-- Directories containing source files.
|
||||
-- hs-source-dirs:
|
||||
|
@ -13,14 +13,14 @@ library
|
||||
exposed-modules: IHaskell.Display.Rlangqq
|
||||
other-extensions: TupleSections, TemplateHaskell
|
||||
build-depends: base <5,
|
||||
Rlang-QQ >=0.2 && <0.3,
|
||||
Rlang-QQ >= 0.3,
|
||||
directory >=1.2 && <1.3,
|
||||
filepath >=1.3 && <1.5,
|
||||
bytestring >=0.10 && <0.11,
|
||||
base64-bytestring >=1.0 && <1.1,
|
||||
ihaskell >= 0.5,
|
||||
ihaskell-blaze >=0.2 && <0.3,
|
||||
blaze-html >=0.6 && <0.8,
|
||||
blaze-html >=0.6 && <0.9,
|
||||
split >=0.2 && <0.3,
|
||||
stm -any,
|
||||
xformat >=0.1 && <0.2,
|
||||
|
Loading…
x
Reference in New Issue
Block a user