added withPlot

This commit is contained in:
Nicole Dresselhaus 2022-07-21 00:42:39 +02:00
parent ad5fdc1e64
commit 49539fc1ba

View File

@ -27,6 +27,9 @@ module DearImGui.Plot
-- * Demo so you can play with all features
, Raw.Plot.showPlotDemoWindow
-- * Plot Creation
, withPlot
-- * TEST
, plotLine
)
@ -80,6 +83,11 @@ plotLine label xs ys = liftIO $ do
withArray (map realToFrac ys) \ysPtr -> do
Raw.Plot.plotLine labelPtr xsPtr ysPtr size
withPlot :: (MonadIO m) => String -> m () -> m ()
withPlot p a = Raw.Plot.beginPlot p >>= \case
False -> return ()
True -> a >> Raw.Plot.endPlot
-- setNextPlotLimits :: MonadIO m => (Double, Double) -> (Double, Double) -> m ()
-- setNextPlotLimits (minX, maxX) (minY, maxY) = liftIO $ do
-- Raw.Plot.setNextPlotLimits (minX', maxX') (minY', maxY')