dynamic-plot 0.2.1.0 → 0.2.2.0
raw patch · 2 files changed
+43/−5 lines, 2 filesdep ~manifoldsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: manifolds
API changes (from Hackage documentation)
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.Shade (Graphics.Dynamic.Plot.Internal.Types.R, Graphics.Dynamic.Plot.Internal.Types.R))
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.Shade Data.Manifold.Types.Primitive.ℝ²)
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.Shade Graphics.Dynamic.Plot.Internal.Types.P2)
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.Shade' (Graphics.Dynamic.Plot.Internal.Types.R, Graphics.Dynamic.Plot.Internal.Types.R))
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.Shade' Data.Manifold.Types.Primitive.ℝ²)
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.Shade' Graphics.Dynamic.Plot.Internal.Types.P2)
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.SimpleTree (Data.Manifold.TreeCover.WithAny Graphics.Dynamic.Plot.Internal.Types.R Graphics.Dynamic.Plot.Internal.Types.R))
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.Trees (Data.Manifold.TreeCover.WithAny Graphics.Dynamic.Plot.Internal.Types.R Graphics.Dynamic.Plot.Internal.Types.R))
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Web.PointsWeb (Math.Manifold.Core.Types.ℝ, Math.Manifold.Core.Types.ℝ) (Data.Manifold.TreeCover.Shade (Data.Colour.Internal.Colour Math.Manifold.Core.Types.ℝ)))
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Web.PointsWeb Data.Manifold.Types.Primitive.ℝ² (Data.Manifold.TreeCover.Shade (Data.Colour.Internal.Colour Math.Manifold.Core.Types.ℝ)))
- Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Web.PointsWeb Math.Manifold.Core.Types.ℝ (Data.Manifold.TreeCover.Shade' Math.Manifold.Core.Types.ℝ))
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Shade.Shade (Graphics.Dynamic.Plot.Internal.Types.R, Graphics.Dynamic.Plot.Internal.Types.R))
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Shade.Shade Data.Manifold.Types.Primitive.ℝ²)
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Shade.Shade Graphics.Dynamic.Plot.Internal.Types.P2)
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Shade.Shade' (Graphics.Dynamic.Plot.Internal.Types.R, Graphics.Dynamic.Plot.Internal.Types.R))
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Shade.Shade' Data.Manifold.Types.Primitive.ℝ²)
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Shade.Shade' Graphics.Dynamic.Plot.Internal.Types.P2)
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.SimpleTree (Data.Manifold.Shade.WithAny Graphics.Dynamic.Plot.Internal.Types.R Graphics.Dynamic.Plot.Internal.Types.R))
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.TreeCover.Trees (Data.Manifold.Shade.WithAny Graphics.Dynamic.Plot.Internal.Types.R Graphics.Dynamic.Plot.Internal.Types.R))
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Web.PointsWeb (Math.Manifold.Core.Types.ℝ, Math.Manifold.Core.Types.ℝ) (Data.Manifold.Shade.Shade (Data.Colour.Internal.Colour Math.Manifold.Core.Types.ℝ)))
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Web.PointsWeb Data.Manifold.Types.Primitive.ℝ² (Data.Manifold.Shade.Shade (Data.Colour.Internal.Colour Math.Manifold.Core.Types.ℝ)))
+ Graphics.Dynamic.Plot.R2: instance Graphics.Dynamic.Plot.R2.Plottable (Data.Manifold.Web.PointsWeb Math.Manifold.Core.Types.ℝ (Data.Manifold.Shade.Shade' Math.Manifold.Core.Types.ℝ))
+ Graphics.Dynamic.Plot.R2: linregressionPlot :: (SimpleSpace m, Scalar m ~ ℝ, y ~ ℝ, x ~ ℝ) => (x -> (m +> y)) -> [(x, Shade' y)] -> (Shade' m -> DynamicPlottable -> DynamicPlottable -> DynamicPlottable) -> DynamicPlottable
- Graphics.Dynamic.Plot.R2: fnPlot :: (forall m. (WithField ℝ PseudoAffine m, SimpleSpace (Needle m)) => AgentVal (-->) m ℝ -> AgentVal (-->) m ℝ) -> DynamicPlottable
+ Graphics.Dynamic.Plot.R2: fnPlot :: (forall m. Object (RWDiffable ℝ) m => AgentVal (-->) m ℝ -> AgentVal (-->) m ℝ) -> DynamicPlottable
Files
- Graphics/Dynamic/Plot/R2.hs +41/−3
- dynamic-plot.cabal +2/−2
Graphics/Dynamic/Plot/R2.hs view
@@ -40,6 +40,7 @@ , continFnPlot , tracePlot , lineSegPlot+ , linregressionPlot , PlainGraphicsR2 , shapePlot , diagramPlot@@ -131,9 +132,10 @@ import Data.Manifold.PseudoAffine import Data.Function.Differentiable import Data.Manifold.Types+import Data.Manifold.Shade import Data.Manifold.TreeCover import Data.Manifold.Web-import Data.Manifold.Riemannian (Geodesic)+import Data.Manifold.Riemannian (Geodesic, pointsBarycenter) import qualified Data.Map.Lazy as Map import qualified Data.Colour.Manifold as CSp@@ -1235,13 +1237,49 @@ -- segments.) -- -- This function is equivalent to using 'plot' on an 'RWDiffable' arrow.-fnPlot :: (∀ m . ( WithField ℝ PseudoAffine m- , SimpleSpace (Needle m) )+fnPlot :: (∀ m . Object (RWDiffable ℝ) m => AgentVal (-->) m ℝ -> AgentVal (-->) m ℝ ) -> DynamicPlottable fnPlot f = plot fd where fd :: ℝ --> ℝ fd = alg f++uncertainFnPlot :: ∀ m . (SimpleSpace m, Scalar m ~ ℝ)+ => (ℝ -> (m +> ℝ)) -> Shade' m -> DynamicPlottable+uncertainFnPlot = case linearManifoldWitness :: LinearManifoldWitness m of+ LinearManifoldWitness BoundarylessWitness -> \mfun (Shade' mBest me)+ -> plot $ continFnPlot (($ mBest) . mfun)+ : [ tweakPrerendered (Dia.opacity 0.2)+ $ continFnPlot (($ mBest^+^σ*^δm) . mfun)+ | δm <- normSpanningSystem' me+ , σ <- [-1,1] ]++linregressionPlot :: ∀ x m y . ( SimpleSpace m, Scalar m ~ ℝ, y ~ ℝ, x ~ ℝ )+ => (x -> (m +> y)) -> [(x, Shade' y)]+ -> (Shade' m -> DynamicPlottable -> DynamicPlottable+ -> DynamicPlottable)+ -> DynamicPlottable+linregressionPlot = lrp (linearManifoldWitness, dualSpaceWitness)+ where lrp :: (LinearManifoldWitness m, DualSpaceWitness m)+ -> (x -> (m +> y)) -> [(x, Shade' y)]+ -> (Shade' m -> DynamicPlottable -> DynamicPlottable+ -> DynamicPlottable)+ -> DynamicPlottable+ lrp _ _ [] _ = mempty+ lrp (LinearManifoldWitness BoundarylessWitness, DualSpaceWitness)+ mfun dataPts resultHook = resultHook shm+ (plot [ plot (Shade (x,y) (sumSubspaceNorms mempty $ dualNorm ey)+ :: Shade (ℝ,ℝ))+ | (x, Shade' y ey) <- dataPts ])+ (uncertainFnPlot mfun shm)+ where (mBest, mDevs) = linearRegressionWVar (mfun . (bcx.+~^))+ [ (δx,(fromInterior y,ey))+ | (x,Shade' y ey)<-dataPts+ , let Just δx = x.-~.bcx ]+ Just bcx = (pointsBarycenter . NE.fromList $ fst<$>dataPts)+ shm :: Shade' m+ shm@(Shade' _ em) = dualShade . coverAllAround mBest+ $ convexPolytopeRepresentatives mDevs -- | Plot a continuous, “parametric function”, i.e. mapping the real line to a path in ℝ². paramPlot :: (∀ m . ( WithField ℝ PseudoAffine m, SimpleSpace (Needle m) )
dynamic-plot.cabal view
@@ -1,5 +1,5 @@ Name: dynamic-plot-Version: 0.2.1.0+Version: 0.2.2.0 Category: graphics Synopsis: Interactive diagram windows Description: Haskell excels at handling data like continuous functions@@ -60,7 +60,7 @@ , gtk > 0.10 && < 0.15 , glib , colour >= 2 && < 3- , manifolds >= 0.3.1 && < 0.4+ , manifolds >= 0.4.1 && < 0.5 , manifold-random , colour-space , JuicyPixels > 3 && < 4