mirror of
https://github.com/Drezil/dear-implot.hs.git
synced 2024-11-22 04:27:00 +00:00
added withPlot
This commit is contained in:
parent
ad5fdc1e64
commit
49539fc1ba
@ -27,6 +27,9 @@ module DearImGui.Plot
|
|||||||
-- * Demo so you can play with all features
|
-- * Demo so you can play with all features
|
||||||
, Raw.Plot.showPlotDemoWindow
|
, Raw.Plot.showPlotDemoWindow
|
||||||
|
|
||||||
|
-- * Plot Creation
|
||||||
|
, withPlot
|
||||||
|
|
||||||
-- * TEST
|
-- * TEST
|
||||||
, plotLine
|
, plotLine
|
||||||
)
|
)
|
||||||
@ -80,6 +83,11 @@ plotLine label xs ys = liftIO $ do
|
|||||||
withArray (map realToFrac ys) \ysPtr -> do
|
withArray (map realToFrac ys) \ysPtr -> do
|
||||||
Raw.Plot.plotLine labelPtr xsPtr ysPtr size
|
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 :: MonadIO m => (Double, Double) -> (Double, Double) -> m ()
|
||||||
-- setNextPlotLimits (minX, maxX) (minY, maxY) = liftIO $ do
|
-- setNextPlotLimits (minX, maxX) (minY, maxY) = liftIO $ do
|
||||||
-- Raw.Plot.setNextPlotLimits (minX', maxX') (minY', maxY')
|
-- Raw.Plot.setNextPlotLimits (minX', maxX') (minY', maxY')
|
||||||
|
Loading…
Reference in New Issue
Block a user