mirror of
https://github.com/Drezil/dear-implot.hs.git
synced 2024-11-14 17:07:01 +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
|
||||
, 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')
|
||||
|
Loading…
Reference in New Issue
Block a user