__init__.pyi 133 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714
  1. ###############################################################################
  2. # This file is a part of Dear ImGui Bundle, NOT a part of ImPlot
  3. # -----------------------------------------------------------------------------
  4. # implot/__init__.pyi is the equivalent of implot.h, using the bindings
  5. # provided by Dear ImGui Bundle.
  6. #
  7. # It is automatically generated (using https://pthom.github.io/litgen/),
  8. # and is generally very close to the C++ version. Comments, docs are identical.
  9. ###############################################################################
  10. # ruff: noqa: B008, F821, F811
  11. from typing import Any, Optional, Tuple, List, overload
  12. import numpy as np
  13. import enum
  14. from . import internal as internal
  15. from imgui_bundle import imgui
  16. from imgui_bundle.imgui import (
  17. ImVec2,
  18. ImVec2Like,
  19. ImVec4,
  20. ImVec4Like,
  21. MouseButton,
  22. ImU32,
  23. DragDropFlags,
  24. ImDrawList,
  25. ImTextureRef,
  26. WindowFlags,
  27. )
  28. ImGui_Context = imgui.internal.Context
  29. ##################################################
  30. # Manually inserted code (typedefs, etc.)
  31. ##################################################
  32. """
  33. //-----------------------------------------------------------------------------
  34. // [SECTION] Enums and Types
  35. //-----------------------------------------------------------------------------
  36. // Forward declarations
  37. struct ImPlotContext; // ImPlot context (opaque struct, see implot_internal.h)
  38. // Enums/Flags
  39. typedef int ImAxis; // -> enum ImAxis_
  40. typedef int ImPlotFlags; // -> enum ImPlotFlags_
  41. typedef int ImPlotAxisFlags; // -> enum ImPlotAxisFlags_
  42. typedef int ImPlotSubplotFlags; // -> enum ImPlotSubplotFlags_
  43. typedef int ImPlotLegendFlags; // -> enum ImPlotLegendFlags_
  44. typedef int ImPlotMouseTextFlags; // -> enum ImPlotMouseTextFlags_
  45. typedef int ImPlotDragToolFlags; // -> ImPlotDragToolFlags_
  46. typedef int ImPlotColormapScaleFlags; // -> ImPlotColormapScaleFlags_
  47. typedef int ImPlotItemFlags; // -> ImPlotItemFlags_
  48. typedef int ImPlotLineFlags; // -> ImPlotLineFlags_
  49. typedef int ImPlotScatterFlags; // -> ImPlotScatterFlags
  50. typedef int ImPlotStairsFlags; // -> ImPlotStairsFlags_
  51. typedef int ImPlotShadedFlags; // -> ImPlotShadedFlags_
  52. typedef int ImPlotBarsFlags; // -> ImPlotBarsFlags_
  53. typedef int ImPlotBarGroupsFlags; // -> ImPlotBarGroupsFlags_
  54. typedef int ImPlotErrorBarsFlags; // -> ImPlotErrorBarsFlags_
  55. typedef int ImPlotStemsFlags; // -> ImPlotStemsFlags_
  56. typedef int ImPlotInfLinesFlags; // -> ImPlotInfLinesFlags_
  57. typedef int ImPlotPieChartFlags; // -> ImPlotPieChartFlags_
  58. typedef int ImPlotHeatmapFlags; // -> ImPlotHeatmapFlags_
  59. typedef int ImPlotHistogramFlags; // -> ImPlotHistogramFlags_
  60. typedef int ImPlotDigitalFlags; // -> ImPlotDigitalFlags_
  61. typedef int ImPlotImageFlags; // -> ImPlotImageFlags_
  62. typedef int ImPlotTextFlags; // -> ImPlotTextFlags_
  63. typedef int ImPlotDummyFlags; // -> ImPlotDummyFlags_
  64. typedef int ImPlotCond; // -> enum ImPlotCond_
  65. typedef int ImPlotCol; // -> enum ImPlotCol_
  66. typedef int ImPlotStyleVar; // -> enum ImPlotStyleVar_
  67. typedef int ImPlotScale; // -> enum ImPlotScale_
  68. typedef int ImPlotMarker; // -> enum ImPlotMarker_
  69. typedef int ImPlotColormap; // -> enum ImPlotColormap_
  70. typedef int ImPlotLocation; // -> enum ImPlotLocation_
  71. typedef int ImPlotBin; // -> enum ImPlotBin_
  72. """
  73. ImAxis = int # -> enum ImAxis_
  74. Flags = int # -> enum Flags_
  75. AxisFlags = int # -> enum AxisFlags_
  76. SubplotFlags = int # -> enum SubplotFlags_
  77. LegendFlags = int # -> enum LegendFlags_
  78. MouseTextFlags = int # -> enum MouseTextFlags_
  79. DragToolFlags = int # -> DragToolFlags_
  80. ColormapScaleFlags = int # -> ColormapScaleFlags_
  81. ItemFlags = int # -> ItemFlags_
  82. LineFlags = int # -> LineFlags_
  83. ScatterFlags = int # -> ScatterFlags
  84. StairsFlags = int # -> StairsFlags_
  85. ShadedFlags = int # -> ShadedFlags_
  86. BarsFlags = int # -> BarsFlags_
  87. BarGroupsFlags = int # -> BarGroupsFlags_
  88. ErrorBarsFlags = int # -> ErrorBarsFlags_
  89. StemsFlags = int # -> StemsFlags_
  90. InfLinesFlags = int # -> InfLinesFlags_
  91. PieChartFlags = int # -> PieChartFlags_
  92. HeatmapFlags = int # -> HeatmapFlags_
  93. HistogramFlags = int # -> HistogramFlags_
  94. DigitalFlags = int # -> DigitalFlags_
  95. ImageFlags = int # -> ImageFlags_
  96. TextFlags = int # -> TextFlags_
  97. DummyFlags = int # -> DummyFlags_
  98. Cond = int # -> enum Cond_
  99. Col = int # -> enum Col_
  100. StyleVar = int # -> enum StyleVar_
  101. Scale = int # -> enum Scale_
  102. Marker = int # -> enum Marker_
  103. Colormap = int # -> enum Colormap_
  104. Location = int # -> enum Location_
  105. Bin = int # -> enum Bin_
  106. # ImPlotContext is an opaque structure
  107. Context = Any
  108. #
  109. IMPLOT_AUTO = -1 # Deduce variable automatically
  110. IMPLOT_AUTO_COL = ImVec4(0, 0, 0, -1) # Deduce color automatically
  111. AUTO = IMPLOT_AUTO
  112. AUTO_COL = IMPLOT_AUTO_COL
  113. version: str
  114. #
  115. VoidPtr = Any
  116. ImTextureID = VoidPtr
  117. Bin_Sturges = Bin_.sturges
  118. Marker_None = Marker_.none
  119. ItemFlags_None = ItemFlags_.none
  120. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  121. # <litgen_stub> // Autogenerated code below! Do not edit!
  122. #################### <generated_from:implot.h> ####################
  123. # MIT License
  124. # Copyright (c) 2020-2024 Evan Pezent
  125. # Copyright (c) 2025-2026 Breno Cunha Queiroz
  126. # Permission is hereby granted, free of charge, to any person obtaining a copy
  127. # of this software and associated documentation files (the "Software"), to deal
  128. # in the Software without restriction, including without limitation the rights
  129. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  130. # copies of the Software, and to permit persons to whom the Software is
  131. # furnished to do so, subject to the following conditions:
  132. # The above copyright notice and this permission notice shall be included in all
  133. # copies or substantial portions of the Software.
  134. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  135. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  136. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  137. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  138. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  139. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  140. # SOFTWARE.
  141. # ImPlot v1.1 WIP
  142. # Table of Contents:
  143. #
  144. # [SECTION] Macros and Defines
  145. # [SECTION] Enums and Types
  146. # [SECTION] Callbacks
  147. # [SECTION] Contexts
  148. # [SECTION] Begin/End Plot
  149. # [SECTION] Begin/End Subplot
  150. # [SECTION] Setup
  151. # [SECTION] SetNext
  152. # [SECTION] Plot Items
  153. # [SECTION] Plot Tools
  154. # [SECTION] Plot Utils
  155. # [SECTION] Legend Utils
  156. # [SECTION] Drag and Drop
  157. # [SECTION] Styling
  158. # [SECTION] Colormaps
  159. # [SECTION] Input Mapping
  160. # [SECTION] Miscellaneous
  161. # [SECTION] Demo
  162. # [SECTION] Obsolete API
  163. # #ifndef IMGUI_DISABLE
  164. #
  165. # IMGUI_BUNDLE_PYTHON_API is defined when building the python bindings.
  166. # #ifdef IMGUI_BUNDLE_PYTHON_API
  167. #
  168. class BoxedValue:
  169. # double value; /* original C++ signature */
  170. value: float
  171. # BoxedValue(double value = double()); /* original C++ signature */
  172. def __init__(self, value: float = float()) -> None:
  173. """Auto-generated default constructor with named params"""
  174. pass
  175. # #endif
  176. #
  177. # [/ADAPT_IMGUI_BUNDLE]
  178. # -----------------------------------------------------------------------------
  179. # [SECTION] Macros and Defines
  180. # -----------------------------------------------------------------------------
  181. # Define attributes of all API symbols declarations (e.g. for DLL under Windows)
  182. # Using ImPlot via a shared library is not recommended, because we don't guarantee
  183. # backward nor forward ABI compatibility and also function call overhead. If you
  184. # do use ImPlot as a DLL, be sure to call SetImGuiContext (see Miscellaneous section).
  185. # -----------------------------------------------------------------------------
  186. # [SECTION] Enums and Types
  187. # -----------------------------------------------------------------------------
  188. # Forward declarations
  189. # Enums/Flags
  190. class ImAxis_(enum.IntFlag):
  191. """Axis indices. The values assigned may change; NEVER hardcode these."""
  192. # horizontal axes
  193. # ImAxis_X1 = 0, /* original C++ signature */
  194. x1 = enum.auto() # (= 0) # enabled by default
  195. # ImAxis_X2, /* original C++ signature */
  196. x2 = enum.auto() # (= 1) # disabled by default
  197. # ImAxis_X3, /* original C++ signature */
  198. x3 = enum.auto() # (= 2) # disabled by default
  199. # vertical axes
  200. # ImAxis_Y1, /* original C++ signature */
  201. y1 = enum.auto() # (= 3) # enabled by default
  202. # ImAxis_Y2, /* original C++ signature */
  203. y2 = enum.auto() # (= 4) # disabled by default
  204. # ImAxis_Y3, /* original C++ signature */
  205. y3 = enum.auto() # (= 5) # disabled by default
  206. # ImAxis_COUNT /* original C++ signature */
  207. # }
  208. # bookkeeping
  209. count = enum.auto() # (= 6)
  210. class Prop_(enum.IntFlag):
  211. """Plotting properties. These provide syntactic sugar for creating ImPlotSpecs from (ImPlotProp,value) pairs. See ImPlotSpec documentation."""
  212. # ImPlotProp_LineColor, /* original C++ signature */
  213. line_color = (
  214. enum.auto()
  215. ) # (= 0) # line color (applies to lines, bar edges); IMPLOT_AUTO_COL will use next Colormap color or current item color
  216. # ImPlotProp_LineColors, /* original C++ signature */
  217. line_colors = enum.auto() # (= 1) # array of colors for each line; if None, use LineColor for all lines
  218. # ImPlotProp_LineWeight, /* original C++ signature */
  219. line_weight = enum.auto() # (= 2) # line weight in pixels (applies to lines, bar edges, marker edges)
  220. # ImPlotProp_FillColor, /* original C++ signature */
  221. fill_color = (
  222. enum.auto()
  223. ) # (= 3) # fill color (applies to shaded regions, bar faces); IMPLOT_AUTO_COL will use next Colormap color or current item color
  224. # ImPlotProp_FillColors, /* original C++ signature */
  225. fill_colors = enum.auto() # (= 4) # array of colors for each fill; if None, use FillColor for all fills
  226. # ImPlotProp_FillAlpha, /* original C++ signature */
  227. fill_alpha = (
  228. enum.auto()
  229. ) # (= 5) # alpha multiplier (applies to FillColor, FillColors, MarkerFillColor, and MarkerFillColors)
  230. # ImPlotProp_Marker, /* original C++ signature */
  231. marker = enum.auto() # (= 6) # marker type; specify ImPlotMarker_Auto to use the next unused marker
  232. # ImPlotProp_MarkerSize, /* original C++ signature */
  233. marker_size = enum.auto() # (= 7) # size of markers (radius) *in pixels*
  234. # ImPlotProp_MarkerSizes, /* original C++ signature */
  235. marker_sizes = enum.auto() # (= 8) # array of sizes for each marker; if None, use MarkerSize for all markers
  236. # ImPlotProp_MarkerLineColor, /* original C++ signature */
  237. marker_line_color = enum.auto() # (= 9) # marker edge color; IMPLOT_AUTO_COL will use LineColor
  238. # ImPlotProp_MarkerLineColors, /* original C++ signature */
  239. marker_line_colors = (
  240. enum.auto()
  241. ) # (= 10) # array of colors for each marker edge; if None, use MarkerLineColor for all markers
  242. # ImPlotProp_MarkerFillColor, /* original C++ signature */
  243. marker_fill_color = enum.auto() # (= 11) # marker face color; IMPLOT_AUTO_COL will use LineColor
  244. # ImPlotProp_MarkerFillColors, /* original C++ signature */
  245. marker_fill_colors = (
  246. enum.auto()
  247. ) # (= 12) # array of colors for each marker face; if None, use MarkerFillColor for all markers
  248. # ImPlotProp_Size, /* original C++ signature */
  249. size = enum.auto() # (= 13) # size of error bar whiskers (width or height), and digital bars (height) *in pixels*
  250. # ImPlotProp_Offset, /* original C++ signature */
  251. offset = enum.auto() # (= 14) # data index offset
  252. # ImPlotProp_Stride, /* original C++ signature */
  253. stride = (
  254. enum.auto()
  255. ) # (= 15) # data stride in bytes; IMPLOT_AUTO will result in sizeof(T) where T is the type passed to PlotX
  256. # ImPlotProp_Flags /* original C++ signature */
  257. flags = (
  258. enum.auto()
  259. ) # (= 16) # optional item flags; can be composed from common ImPlotItemFlags and/or specialized ImPlotXFlags
  260. class Flags_(enum.IntFlag):
  261. """Options for plots (see BeginPlot)."""
  262. # ImPlotFlags_None = 0, /* original C++ signature */
  263. none = enum.auto() # (= 0) # default
  264. # ImPlotFlags_NoTitle = 1 << 0, /* original C++ signature */
  265. no_title = (
  266. enum.auto()
  267. ) # (= 1 << 0) # the plot title will not be displayed (titles are also hidden if preceded by double hashes, e.g. "##MyPlot")
  268. # ImPlotFlags_NoLegend = 1 << 1, /* original C++ signature */
  269. no_legend = enum.auto() # (= 1 << 1) # the legend will not be displayed
  270. # ImPlotFlags_NoMouseText = 1 << 2, /* original C++ signature */
  271. no_mouse_text = (
  272. enum.auto()
  273. ) # (= 1 << 2) # the mouse position, in plot coordinates, will not be displayed inside of the plot
  274. # ImPlotFlags_NoInputs = 1 << 3, /* original C++ signature */
  275. no_inputs = enum.auto() # (= 1 << 3) # the user will not be able to interact with the plot
  276. # ImPlotFlags_NoMenus = 1 << 4, /* original C++ signature */
  277. no_menus = enum.auto() # (= 1 << 4) # the user will not be able to open context menus
  278. # ImPlotFlags_NoBoxSelect = 1 << 5, /* original C++ signature */
  279. no_box_select = enum.auto() # (= 1 << 5) # the user will not be able to box-select
  280. # ImPlotFlags_NoFrame = 1 << 6, /* original C++ signature */
  281. no_frame = enum.auto() # (= 1 << 6) # the ImGui frame will not be rendered
  282. # ImPlotFlags_Equal = 1 << 7, /* original C++ signature */
  283. equal = enum.auto() # (= 1 << 7) # x and y axes pairs will be constrained to have the same units/pixel
  284. # ImPlotFlags_Crosshairs = 1 << 8, /* original C++ signature */
  285. crosshairs = enum.auto() # (= 1 << 8) # the default mouse cursor will be replaced with a crosshair when hovered
  286. # ImPlotFlags_CanvasOnly = ImPlotFlags_NoTitle | ImPlotFlags_NoLegend | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText /* original C++ signature */
  287. # }
  288. canvas_only = (
  289. enum.auto()
  290. ) # (= Flags_NoTitle | Flags_NoLegend | Flags_NoMenus | Flags_NoBoxSelect | Flags_NoMouseText)
  291. class AxisFlags_(enum.IntFlag):
  292. """Options for plot axes (see SetupAxis)."""
  293. # ImPlotAxisFlags_None = 0, /* original C++ signature */
  294. none = enum.auto() # (= 0) # default
  295. # ImPlotAxisFlags_NoLabel = 1 << 0, /* original C++ signature */
  296. no_label = (
  297. enum.auto()
  298. ) # (= 1 << 0) # the axis label will not be displayed (axis labels are also hidden if the supplied string name is None)
  299. # ImPlotAxisFlags_NoGridLines = 1 << 1, /* original C++ signature */
  300. no_grid_lines = enum.auto() # (= 1 << 1) # no grid lines will be displayed
  301. # ImPlotAxisFlags_NoTickMarks = 1 << 2, /* original C++ signature */
  302. no_tick_marks = enum.auto() # (= 1 << 2) # no tick marks will be displayed
  303. # ImPlotAxisFlags_NoTickLabels = 1 << 3, /* original C++ signature */
  304. no_tick_labels = enum.auto() # (= 1 << 3) # no text labels will be displayed
  305. # ImPlotAxisFlags_NoInitialFit = 1 << 4, /* original C++ signature */
  306. no_initial_fit = (
  307. enum.auto()
  308. ) # (= 1 << 4) # axis will not be initially fit to data extents on the first rendered frame
  309. # ImPlotAxisFlags_NoMenus = 1 << 5, /* original C++ signature */
  310. no_menus = enum.auto() # (= 1 << 5) # the user will not be able to open context menus with right-click
  311. # ImPlotAxisFlags_NoSideSwitch = 1 << 6, /* original C++ signature */
  312. no_side_switch = enum.auto() # (= 1 << 6) # the user will not be able to switch the axis side by dragging it
  313. # ImPlotAxisFlags_NoHighlight = 1 << 7, /* original C++ signature */
  314. no_highlight = enum.auto() # (= 1 << 7) # the axis will not have its background highlighted when hovered or held
  315. # ImPlotAxisFlags_Opposite = 1 << 8, /* original C++ signature */
  316. opposite = (
  317. enum.auto()
  318. ) # (= 1 << 8) # axis ticks and labels will be rendered on the conventionally opposite side (i.e, right or top)
  319. # ImPlotAxisFlags_Foreground = 1 << 9, /* original C++ signature */
  320. foreground = (
  321. enum.auto()
  322. ) # (= 1 << 9) # grid lines will be displayed in the foreground (i.e. on top of data) instead of the background
  323. # ImPlotAxisFlags_Invert = 1 << 10, /* original C++ signature */
  324. invert = enum.auto() # (= 1 << 10) # the axis will be inverted
  325. # ImPlotAxisFlags_AutoFit = 1 << 11, /* original C++ signature */
  326. auto_fit = enum.auto() # (= 1 << 11) # axis will be auto-fitting to data extents
  327. # ImPlotAxisFlags_RangeFit = 1 << 12, /* original C++ signature */
  328. range_fit = (
  329. enum.auto()
  330. ) # (= 1 << 12) # axis will only fit points if the point is in the visible range of the **orthogonal** axis
  331. # ImPlotAxisFlags_PanStretch = 1 << 13, /* original C++ signature */
  332. pan_stretch = (
  333. enum.auto()
  334. ) # (= 1 << 13) # panning in a locked or constrained state will cause the axis to stretch if possible
  335. # ImPlotAxisFlags_LockMin = 1 << 14, /* original C++ signature */
  336. lock_min = enum.auto() # (= 1 << 14) # the axis minimum value will be locked when panning/zooming
  337. # ImPlotAxisFlags_LockMax = 1 << 15, /* original C++ signature */
  338. lock_max = enum.auto() # (= 1 << 15) # the axis maximum value will be locked when panning/zooming
  339. # ImPlotAxisFlags_Lock = ImPlotAxisFlags_LockMin | ImPlotAxisFlags_LockMax, /* original C++ signature */
  340. lock = enum.auto() # (= AxisFlags_LockMin | AxisFlags_LockMax)
  341. # ImPlotAxisFlags_NoDecorations = ImPlotAxisFlags_NoLabel | ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_NoTickMarks | ImPlotAxisFlags_NoTickLabels, /* original C++ signature */
  342. no_decorations = (
  343. enum.auto()
  344. ) # (= AxisFlags_NoLabel | AxisFlags_NoGridLines | AxisFlags_NoTickMarks | AxisFlags_NoTickLabels)
  345. # ImPlotAxisFlags_AuxDefault = ImPlotAxisFlags_NoGridLines | ImPlotAxisFlags_Opposite /* original C++ signature */
  346. # }
  347. aux_default = enum.auto() # (= AxisFlags_NoGridLines | AxisFlags_Opposite)
  348. class SubplotFlags_(enum.IntFlag):
  349. """Options for subplots (see BeginSubplot)"""
  350. # ImPlotSubplotFlags_None = 0, /* original C++ signature */
  351. none = enum.auto() # (= 0) # default
  352. # ImPlotSubplotFlags_NoTitle = 1 << 0, /* original C++ signature */
  353. no_title = (
  354. enum.auto()
  355. ) # (= 1 << 0) # the subplot title will not be displayed (titles are also hidden if preceded by double hashes, e.g. "##MySubplot")
  356. # ImPlotSubplotFlags_NoLegend = 1 << 1, /* original C++ signature */
  357. no_legend = (
  358. enum.auto()
  359. ) # (= 1 << 1) # the legend will not be displayed (only applicable if ImPlotSubplotFlags_ShareItems is enabled)
  360. # ImPlotSubplotFlags_NoMenus = 1 << 2, /* original C++ signature */
  361. no_menus = enum.auto() # (= 1 << 2) # the user will not be able to open context menus with right-click
  362. # ImPlotSubplotFlags_NoResize = 1 << 3, /* original C++ signature */
  363. no_resize = enum.auto() # (= 1 << 3) # resize splitters between subplot cells will be not be provided
  364. # ImPlotSubplotFlags_NoAlign = 1 << 4, /* original C++ signature */
  365. no_align = enum.auto() # (= 1 << 4) # subplot edges will not be aligned vertically or horizontally
  366. # ImPlotSubplotFlags_ShareItems = 1 << 5, /* original C++ signature */
  367. share_items = (
  368. enum.auto()
  369. ) # (= 1 << 5) # items across all subplots will be shared and rendered into a single legend entry
  370. # ImPlotSubplotFlags_LinkRows = 1 << 6, /* original C++ signature */
  371. link_rows = (
  372. enum.auto()
  373. ) # (= 1 << 6) # link the y-axis limits of all plots in each row (does not apply to auxiliary axes)
  374. # ImPlotSubplotFlags_LinkCols = 1 << 7, /* original C++ signature */
  375. link_cols = (
  376. enum.auto()
  377. ) # (= 1 << 7) # link the x-axis limits of all plots in each column (does not apply to auxiliary axes)
  378. # ImPlotSubplotFlags_LinkAllX = 1 << 8, /* original C++ signature */
  379. link_all_x = (
  380. enum.auto()
  381. ) # (= 1 << 8) # link the x-axis limits in every plot in the subplot (does not apply to auxiliary axes)
  382. # ImPlotSubplotFlags_LinkAllY = 1 << 9, /* original C++ signature */
  383. link_all_y = (
  384. enum.auto()
  385. ) # (= 1 << 9) # link the y-axis limits in every plot in the subplot (does not apply to auxiliary axes)
  386. # ImPlotSubplotFlags_ColMajor = 1 << 10 /* original C++ signature */
  387. col_major = (
  388. enum.auto()
  389. ) # (= 1 << 10) # subplots are added in column major order instead of the default row major order
  390. class LegendFlags_(enum.IntFlag):
  391. """Options for legends (see SetupLegend)"""
  392. # ImPlotLegendFlags_None = 0, /* original C++ signature */
  393. none = enum.auto() # (= 0) # default
  394. # ImPlotLegendFlags_NoButtons = 1 << 0, /* original C++ signature */
  395. no_buttons = enum.auto() # (= 1 << 0) # legend icons will not function as hide/show buttons
  396. # ImPlotLegendFlags_NoHighlightItem = 1 << 1, /* original C++ signature */
  397. no_highlight_item = (
  398. enum.auto()
  399. ) # (= 1 << 1) # plot items will not be highlighted when their legend entry is hovered
  400. # ImPlotLegendFlags_NoHighlightAxis = 1 << 2, /* original C++ signature */
  401. no_highlight_axis = (
  402. enum.auto()
  403. ) # (= 1 << 2) # axes will not be highlighted when legend entries are hovered (only relevant if x/y-axis count > 1)
  404. # ImPlotLegendFlags_NoMenus = 1 << 3, /* original C++ signature */
  405. no_menus = enum.auto() # (= 1 << 3) # the user will not be able to open context menus with right-click
  406. # ImPlotLegendFlags_Outside = 1 << 4, /* original C++ signature */
  407. outside = enum.auto() # (= 1 << 4) # legend will be rendered outside of the plot area
  408. # ImPlotLegendFlags_Horizontal = 1 << 5, /* original C++ signature */
  409. horizontal = enum.auto() # (= 1 << 5) # legend entries will be displayed horizontally
  410. # ImPlotLegendFlags_Sort = 1 << 6, /* original C++ signature */
  411. sort = enum.auto() # (= 1 << 6) # legend entries will be displayed in alphabetical order
  412. # ImPlotLegendFlags_Reverse = 1 << 7, /* original C++ signature */
  413. reverse = enum.auto() # (= 1 << 7) # legend entries will be displayed in reverse order
  414. class MouseTextFlags_(enum.IntFlag):
  415. """Options for mouse hover text (see SetupMouseText)"""
  416. # ImPlotMouseTextFlags_None = 0, /* original C++ signature */
  417. none = enum.auto() # (= 0) # default
  418. # ImPlotMouseTextFlags_NoAuxAxes = 1 << 0, /* original C++ signature */
  419. no_aux_axes = enum.auto() # (= 1 << 0) # only show the mouse position for primary axes
  420. # ImPlotMouseTextFlags_NoFormat = 1 << 1, /* original C++ signature */
  421. no_format = enum.auto() # (= 1 << 1) # axes label formatters won't be used to render text
  422. # ImPlotMouseTextFlags_ShowAlways = 1 << 2, /* original C++ signature */
  423. show_always = enum.auto() # (= 1 << 2) # always display mouse position even if plot not hovered
  424. class DragToolFlags_(enum.IntFlag):
  425. """Options for DragPoint, DragLine, DragRect"""
  426. # ImPlotDragToolFlags_None = 0, /* original C++ signature */
  427. none = enum.auto() # (= 0) # default
  428. # ImPlotDragToolFlags_NoCursors = 1 << 0, /* original C++ signature */
  429. no_cursors = enum.auto() # (= 1 << 0) # drag tools won't change cursor icons when hovered or held
  430. # ImPlotDragToolFlags_NoFit = 1 << 1, /* original C++ signature */
  431. no_fit = enum.auto() # (= 1 << 1) # the drag tool won't be considered for plot fits
  432. # ImPlotDragToolFlags_NoInputs = 1 << 2, /* original C++ signature */
  433. no_inputs = enum.auto() # (= 1 << 2) # lock the tool from user inputs
  434. # ImPlotDragToolFlags_Delayed = 1 << 3, /* original C++ signature */
  435. delayed = (
  436. enum.auto()
  437. ) # (= 1 << 3) # tool rendering will be delayed one frame; useful when applying position-constraints
  438. class ColormapScaleFlags_(enum.IntFlag):
  439. """Flags for ColormapScale"""
  440. # ImPlotColormapScaleFlags_None = 0, /* original C++ signature */
  441. none = enum.auto() # (= 0) # default
  442. # ImPlotColormapScaleFlags_NoLabel = 1 << 0, /* original C++ signature */
  443. no_label = enum.auto() # (= 1 << 0) # the colormap axis label will not be displayed
  444. # ImPlotColormapScaleFlags_Opposite = 1 << 1, /* original C++ signature */
  445. opposite = enum.auto() # (= 1 << 1) # render the colormap label and tick labels on the opposite side
  446. # ImPlotColormapScaleFlags_Invert = 1 << 2, /* original C++ signature */
  447. invert = (
  448. enum.auto()
  449. ) # (= 1 << 2) # invert the colormap bar and axis scale (this only affects rendering; if you only want to reverse the scale mapping, make scale_min > scale_max)
  450. class ItemFlags_(enum.IntFlag):
  451. """Flags for ANY PlotX function. Used by setting ImPlotSpec::Flags."""
  452. # ImPlotItemFlags_None = 0, /* original C++ signature */
  453. none = enum.auto() # (= 0)
  454. # ImPlotItemFlags_NoLegend = 1 << 0, /* original C++ signature */
  455. no_legend = enum.auto() # (= 1 << 0) # the item won't have a legend entry displayed
  456. # ImPlotItemFlags_NoFit = 1 << 1, /* original C++ signature */
  457. no_fit = enum.auto() # (= 1 << 1) # the item won't be considered for plot fits
  458. class LineFlags_(enum.IntFlag):
  459. """Flags for PlotLine. Used by setting ImPlotSpec::Flags."""
  460. # ImPlotLineFlags_None = 0, /* original C++ signature */
  461. none = enum.auto() # (= 0) # default
  462. # ImPlotLineFlags_Segments = 1 << 10, /* original C++ signature */
  463. segments = enum.auto() # (= 1 << 10) # a line segment will be rendered from every two consecutive points
  464. # ImPlotLineFlags_Loop = 1 << 11, /* original C++ signature */
  465. loop = enum.auto() # (= 1 << 11) # the last and first point will be connected to form a closed loop
  466. # ImPlotLineFlags_SkipNaN = 1 << 12, /* original C++ signature */
  467. skip_nan = enum.auto() # (= 1 << 12) # NaNs values will be skipped instead of rendered as missing data
  468. # ImPlotLineFlags_NoClip = 1 << 13, /* original C++ signature */
  469. no_clip = enum.auto() # (= 1 << 13) # markers (if displayed) on the edge of a plot will not be clipped
  470. # ImPlotLineFlags_Shaded = 1 << 14, /* original C++ signature */
  471. shaded = (
  472. enum.auto()
  473. ) # (= 1 << 14) # a filled region between the line and horizontal origin will be rendered; use PlotShaded for more advanced cases
  474. class ScatterFlags_(enum.IntFlag):
  475. """Flags for PlotScatter. Used by setting ImPlotSpec::Flags."""
  476. # ImPlotScatterFlags_None = 0, /* original C++ signature */
  477. none = enum.auto() # (= 0) # default
  478. # ImPlotScatterFlags_NoClip = 1 << 10, /* original C++ signature */
  479. no_clip = enum.auto() # (= 1 << 10) # markers on the edge of a plot will not be clipped
  480. class BubblesFlags_(enum.IntFlag):
  481. """Flags for PlotBubbles. Used by setting ImPlotSpec::Flags."""
  482. # ImPlotBubblesFlags_None = 0, /* original C++ signature */
  483. none = enum.auto() # (= 0) # default
  484. class PolygonFlags_(enum.IntFlag):
  485. """Flags for PlotPolygon. Used by setting ImPlotSpec::Flags."""
  486. # ImPlotPolygonFlags_None = 0, /* original C++ signature */
  487. none = enum.auto() # (= 0) # default (closed, convex polygon)
  488. # ImPlotPolygonFlags_Concave = 1 << 10, /* original C++ signature */
  489. concave = enum.auto() # (= 1 << 10) # use concave polygon filling (slower but supports concave shapes)
  490. class StairsFlags_(enum.IntFlag):
  491. """Flags for PlotStairs. Used by setting ImPlotSpec::Flags."""
  492. # ImPlotStairsFlags_None = 0, /* original C++ signature */
  493. none = enum.auto() # (= 0) # default
  494. # ImPlotStairsFlags_PreStep = 1 << 10, /* original C++ signature */
  495. pre_step = (
  496. enum.auto()
  497. ) # (= 1 << 10) # the y value is continued constantly to the left from every x position, i.e. the interval (x[i-1], x[i]] has the value y[i]
  498. # ImPlotStairsFlags_Shaded = 1 << 11 /* original C++ signature */
  499. shaded = (
  500. enum.auto()
  501. ) # (= 1 << 11) # a filled region between the stairs and horizontal origin will be rendered; use PlotShaded for more advanced cases
  502. class ShadedFlags_(enum.IntFlag):
  503. """Flags for PlotShaded (placeholder). Used by setting ImPlotSpec::Flags."""
  504. # ImPlotShadedFlags_None = 0 /* original C++ signature */
  505. none = enum.auto() # (= 0) # default
  506. class BarsFlags_(enum.IntFlag):
  507. """Flags for PlotBars. Used by setting ImPlotSpec::Flags."""
  508. # ImPlotBarsFlags_None = 0, /* original C++ signature */
  509. none = enum.auto() # (= 0) # default
  510. # ImPlotBarsFlags_Horizontal = 1 << 10, /* original C++ signature */
  511. horizontal = enum.auto() # (= 1 << 10) # bars will be rendered horizontally on the current y-axis
  512. class BarGroupsFlags_(enum.IntFlag):
  513. """Flags for PlotBarGroups. Used by setting ImPlotSpec::Flags."""
  514. # ImPlotBarGroupsFlags_None = 0, /* original C++ signature */
  515. none = enum.auto() # (= 0) # default
  516. # ImPlotBarGroupsFlags_Horizontal = 1 << 10, /* original C++ signature */
  517. horizontal = enum.auto() # (= 1 << 10) # bar groups will be rendered horizontally on the current y-axis
  518. # ImPlotBarGroupsFlags_Stacked = 1 << 11, /* original C++ signature */
  519. stacked = enum.auto() # (= 1 << 11) # items in a group will be stacked on top of each other
  520. class ErrorBarsFlags_(enum.IntFlag):
  521. """Flags for PlotErrorBars. Used by setting ImPlotSpec::Flags."""
  522. # ImPlotErrorBarsFlags_None = 0, /* original C++ signature */
  523. none = enum.auto() # (= 0) # default
  524. # ImPlotErrorBarsFlags_Horizontal = 1 << 10, /* original C++ signature */
  525. horizontal = enum.auto() # (= 1 << 10) # error bars will be rendered horizontally on the current y-axis
  526. class StemsFlags_(enum.IntFlag):
  527. """Flags for PlotStems. Used by setting ImPlotSpec::Flags."""
  528. # ImPlotStemsFlags_None = 0, /* original C++ signature */
  529. none = enum.auto() # (= 0) # default
  530. # ImPlotStemsFlags_Horizontal = 1 << 10, /* original C++ signature */
  531. horizontal = enum.auto() # (= 1 << 10) # stems will be rendered horizontally on the current y-axis
  532. class InfLinesFlags_(enum.IntFlag):
  533. """Flags for PlotInfLines. Used by setting ImPlotSpec::Flags."""
  534. # ImPlotInfLinesFlags_None = 0, /* original C++ signature */
  535. none = enum.auto() # (= 0) # default
  536. # ImPlotInfLinesFlags_Horizontal = 1 << 10 /* original C++ signature */
  537. horizontal = enum.auto() # (= 1 << 10) # lines will be rendered horizontally on the current y-axis
  538. class PieChartFlags_(enum.IntFlag):
  539. """Flags for PlotPieChart. Used by setting ImPlotSpec::Flags."""
  540. # ImPlotPieChartFlags_None = 0, /* original C++ signature */
  541. none = enum.auto() # (= 0) # default
  542. # ImPlotPieChartFlags_Normalize = 1 << 10, /* original C++ signature */
  543. normalize = (
  544. enum.auto()
  545. ) # (= 1 << 10) # force normalization of pie chart values (i.e. always make a full circle if sum < 0)
  546. # ImPlotPieChartFlags_IgnoreHidden = 1 << 11, /* original C++ signature */
  547. ignore_hidden = (
  548. enum.auto()
  549. ) # (= 1 << 11) # ignore hidden slices when drawing the pie chart (as if they were not there)
  550. # ImPlotPieChartFlags_Exploding = 1 << 12, /* original C++ signature */
  551. exploding = enum.auto() # (= 1 << 12) # explode legend-hovered slice
  552. # ImPlotPieChartFlags_NoSliceBorder = 1 << 13 /* original C++ signature */
  553. no_slice_border = enum.auto() # (= 1 << 13) # do not draw slice borders
  554. class HeatmapFlags_(enum.IntFlag):
  555. """Flags for PlotHeatmap. Used by setting ImPlotSpec::Flags."""
  556. # ImPlotHeatmapFlags_None = 0, /* original C++ signature */
  557. none = enum.auto() # (= 0) # default
  558. # ImPlotHeatmapFlags_ColMajor = 1 << 10, /* original C++ signature */
  559. col_major = enum.auto() # (= 1 << 10) # data will be read in column major order
  560. class HistogramFlags_(enum.IntFlag):
  561. """Flags for PlotHistogram and PlotHistogram2D. Used by setting ImPlotSpec::Flags."""
  562. # ImPlotHistogramFlags_None = 0, /* original C++ signature */
  563. none = enum.auto() # (= 0) # default
  564. # ImPlotHistogramFlags_Horizontal = 1 << 10, /* original C++ signature */
  565. horizontal = (
  566. enum.auto()
  567. ) # (= 1 << 10) # histogram bars will be rendered horizontally (not supported by PlotHistogram2D)
  568. # ImPlotHistogramFlags_Cumulative = 1 << 11, /* original C++ signature */
  569. cumulative = (
  570. enum.auto()
  571. ) # (= 1 << 11) # each bin will contain its count plus the counts of all previous bins (not supported by PlotHistogram2D)
  572. # ImPlotHistogramFlags_Density = 1 << 12, /* original C++ signature */
  573. density = (
  574. enum.auto()
  575. ) # (= 1 << 12) # counts will be normalized, i.e. the PDF will be visualized, or the CDF will be visualized if Cumulative is also set
  576. # ImPlotHistogramFlags_NoOutliers = 1 << 13, /* original C++ signature */
  577. no_outliers = (
  578. enum.auto()
  579. ) # (= 1 << 13) # exclude values outside the specified histogram range from the count toward normalizing and cumulative counts
  580. # ImPlotHistogramFlags_ColMajor = 1 << 14 /* original C++ signature */
  581. col_major = enum.auto() # (= 1 << 14) # data will be read in column major order (not supported by PlotHistogram)
  582. class DigitalFlags_(enum.IntFlag):
  583. """Flags for PlotDigital (placeholder). Used by setting ImPlotSpec::Flags."""
  584. # ImPlotDigitalFlags_None = 0 /* original C++ signature */
  585. none = enum.auto() # (= 0) # default
  586. class ImageFlags_(enum.IntFlag):
  587. """Flags for PlotImage (placeholder). Used by setting ImPlotSpec::Flags."""
  588. # ImPlotImageFlags_None = 0 /* original C++ signature */
  589. none = enum.auto() # (= 0) # default
  590. class TextFlags_(enum.IntFlag):
  591. """Flags for PlotText. Used by setting ImPlotSpec::Flags."""
  592. # ImPlotTextFlags_None = 0, /* original C++ signature */
  593. none = enum.auto() # (= 0) # default
  594. # ImPlotTextFlags_Vertical = 1 << 10 /* original C++ signature */
  595. vertical = enum.auto() # (= 1 << 10) # text will be rendered vertically
  596. class DummyFlags_(enum.IntFlag):
  597. """Flags for PlotDummy (placeholder). Used by setting ImPlotSpec::Flags."""
  598. # ImPlotDummyFlags_None = 0 /* original C++ signature */
  599. none = enum.auto() # (= 0) # default
  600. class Cond_(enum.IntFlag):
  601. """Represents a condition for SetupAxisLimits etc. (same as ImGuiCond, but we only support a subset of those enums)"""
  602. # ImPlotCond_None = ImGuiCond_None, /* original C++ signature */
  603. none = enum.auto() # (= Cond_None) # No condition (always set the variable), same as _Always
  604. # ImPlotCond_Always = ImGuiCond_Always, /* original C++ signature */
  605. always = enum.auto() # (= Cond_Always) # No condition (always set the variable)
  606. # ImPlotCond_Once = ImGuiCond_Once, /* original C++ signature */
  607. once = enum.auto() # (= Cond_Once) # Set the variable once per runtime session (only the first call will succeed)
  608. class Col_(enum.IntFlag):
  609. """Plot styling colors."""
  610. # ImPlotCol_FrameBg, /* original C++ signature */
  611. frame_bg = enum.auto() # (= 0) # plot frame background color (defaults to ImGuiCol_FrameBg)
  612. # ImPlotCol_PlotBg, /* original C++ signature */
  613. plot_bg = enum.auto() # (= 1) # plot area background color (defaults to ImGuiCol_WindowBg)
  614. # ImPlotCol_PlotBorder, /* original C++ signature */
  615. plot_border = enum.auto() # (= 2) # plot area border color (defaults to ImGuiCol_Border)
  616. # ImPlotCol_LegendBg, /* original C++ signature */
  617. legend_bg = enum.auto() # (= 3) # legend background color (defaults to ImGuiCol_PopupBg)
  618. # ImPlotCol_LegendBorder, /* original C++ signature */
  619. legend_border = enum.auto() # (= 4) # legend border color (defaults to ImPlotCol_PlotBorder)
  620. # ImPlotCol_LegendText, /* original C++ signature */
  621. legend_text = enum.auto() # (= 5) # legend text color (defaults to ImPlotCol_InlayText)
  622. # ImPlotCol_TitleText, /* original C++ signature */
  623. title_text = enum.auto() # (= 6) # plot title text color (defaults to ImGuiCol_Text)
  624. # ImPlotCol_InlayText, /* original C++ signature */
  625. inlay_text = enum.auto() # (= 7) # color of text appearing inside of plots (defaults to ImGuiCol_Text)
  626. # ImPlotCol_AxisText, /* original C++ signature */
  627. axis_text = enum.auto() # (= 8) # axis label and tick labels color (defaults to ImGuiCol_Text)
  628. # ImPlotCol_AxisGrid, /* original C++ signature */
  629. axis_grid = enum.auto() # (= 9) # axis grid color (defaults to 25% ImPlotCol_AxisText)
  630. # ImPlotCol_AxisTick, /* original C++ signature */
  631. axis_tick = enum.auto() # (= 10) # axis tick color (defaults to AxisGrid)
  632. # ImPlotCol_AxisBg, /* original C++ signature */
  633. axis_bg = enum.auto() # (= 11) # background color of axis hover region (defaults to transparent)
  634. # ImPlotCol_AxisBgHovered, /* original C++ signature */
  635. axis_bg_hovered = enum.auto() # (= 12) # axis hover color (defaults to ImGuiCol_ButtonHovered)
  636. # ImPlotCol_AxisBgActive, /* original C++ signature */
  637. axis_bg_active = enum.auto() # (= 13) # axis active color (defaults to ImGuiCol_ButtonActive)
  638. # ImPlotCol_Selection, /* original C++ signature */
  639. selection = enum.auto() # (= 14) # box-selection color (defaults to yellow)
  640. # ImPlotCol_Crosshairs, /* original C++ signature */
  641. crosshairs = enum.auto() # (= 15) # crosshairs color (defaults to ImPlotCol_PlotBorder)
  642. # ImPlotCol_COUNT /* original C++ signature */
  643. # }
  644. count = enum.auto() # (= 16)
  645. class StyleVar_(enum.IntFlag):
  646. """Plot styling variables."""
  647. # ImPlotStyleVar_PlotDefaultSize, /* original C++ signature */
  648. plot_default_size = enum.auto() # (= 0) # ImVec2, default size used when ImVec2(0,0) is passed to BeginPlot
  649. # ImPlotStyleVar_PlotMinSize, /* original C++ signature */
  650. plot_min_size = enum.auto() # (= 1) # ImVec2, minimum size plot frame can be when shrunk
  651. # ImPlotStyleVar_PlotBorderSize, /* original C++ signature */
  652. plot_border_size = enum.auto() # (= 2) # float, thickness of border around plot area
  653. # ImPlotStyleVar_MinorAlpha, /* original C++ signature */
  654. minor_alpha = enum.auto() # (= 3) # float, alpha multiplier applied to minor axis grid lines
  655. # ImPlotStyleVar_MajorTickLen, /* original C++ signature */
  656. major_tick_len = enum.auto() # (= 4) # ImVec2, major tick lengths for X and Y axes
  657. # ImPlotStyleVar_MinorTickLen, /* original C++ signature */
  658. minor_tick_len = enum.auto() # (= 5) # ImVec2, minor tick lengths for X and Y axes
  659. # ImPlotStyleVar_MajorTickSize, /* original C++ signature */
  660. major_tick_size = enum.auto() # (= 6) # ImVec2, line thickness of major ticks
  661. # ImPlotStyleVar_MinorTickSize, /* original C++ signature */
  662. minor_tick_size = enum.auto() # (= 7) # ImVec2, line thickness of minor ticks
  663. # ImPlotStyleVar_MajorGridSize, /* original C++ signature */
  664. major_grid_size = enum.auto() # (= 8) # ImVec2, line thickness of major grid lines
  665. # ImPlotStyleVar_MinorGridSize, /* original C++ signature */
  666. minor_grid_size = enum.auto() # (= 9) # ImVec2, line thickness of minor grid lines
  667. # ImPlotStyleVar_PlotPadding, /* original C++ signature */
  668. plot_padding = (
  669. enum.auto()
  670. ) # (= 10) # ImVec2, padding between widget frame and plot area, labels, or outside legends (i.e. main padding)
  671. # ImPlotStyleVar_LabelPadding, /* original C++ signature */
  672. label_padding = enum.auto() # (= 11) # ImVec2, padding between axes labels, tick labels, and plot edge
  673. # ImPlotStyleVar_LegendPadding, /* original C++ signature */
  674. legend_padding = enum.auto() # (= 12) # ImVec2, legend padding from plot edges
  675. # ImPlotStyleVar_LegendInnerPadding, /* original C++ signature */
  676. legend_inner_padding = enum.auto() # (= 13) # ImVec2, legend inner padding from legend edges
  677. # ImPlotStyleVar_LegendSpacing, /* original C++ signature */
  678. legend_spacing = enum.auto() # (= 14) # ImVec2, spacing between legend entries
  679. # ImPlotStyleVar_MousePosPadding, /* original C++ signature */
  680. mouse_pos_padding = enum.auto() # (= 15) # ImVec2, padding between plot edge and interior info text
  681. # ImPlotStyleVar_AnnotationPadding, /* original C++ signature */
  682. annotation_padding = enum.auto() # (= 16) # ImVec2, text padding around annotation labels
  683. # ImPlotStyleVar_FitPadding, /* original C++ signature */
  684. fit_padding = (
  685. enum.auto()
  686. ) # (= 17) # ImVec2, additional fit padding as a percentage of the fit extents (e.g. ImVec2(0.1,0.1) adds 10% to the fit extents of X and Y)
  687. # ImPlotStyleVar_DigitalPadding, /* original C++ signature */
  688. digital_padding = enum.auto() # (= 18) # float, digital plot padding from bottom in pixels
  689. # ImPlotStyleVar_DigitalSpacing, /* original C++ signature */
  690. digital_spacing = enum.auto() # (= 19) # float, digital plot spacing gap in pixels
  691. # ImPlotStyleVar_COUNT /* original C++ signature */
  692. # }
  693. count = enum.auto() # (= 20)
  694. class Scale_(enum.IntFlag):
  695. """Axis scale"""
  696. # ImPlotScale_Linear = 0, /* original C++ signature */
  697. linear = enum.auto() # (= 0) # default linear scale
  698. # ImPlotScale_Time, /* original C++ signature */
  699. time = enum.auto() # (= 1) # date/time scale
  700. # ImPlotScale_Log10, /* original C++ signature */
  701. log10 = enum.auto() # (= 2) # base 10 logarithmic scale
  702. # ImPlotScale_SymLog, /* original C++ signature */
  703. sym_log = enum.auto() # (= 3) # symmetric log scale
  704. class Marker_(enum.IntFlag):
  705. """Marker specifications."""
  706. # ImPlotMarker_None = -2, /* original C++ signature */
  707. none = enum.auto() # (= -2) # no marker
  708. # ImPlotMarker_Auto = -1, /* original C++ signature */
  709. auto = enum.auto() # (= -1) # automatic marker selection
  710. # ImPlotMarker_Circle, /* original C++ signature */
  711. circle = enum.auto() # (= 0) # a circle marker (default)
  712. # ImPlotMarker_Square, /* original C++ signature */
  713. square = enum.auto() # (= 1) # a square maker
  714. # ImPlotMarker_Diamond, /* original C++ signature */
  715. diamond = enum.auto() # (= 2) # a diamond marker
  716. # ImPlotMarker_Up, /* original C++ signature */
  717. up = enum.auto() # (= 3) # an upward-pointing triangle marker
  718. # ImPlotMarker_Down, /* original C++ signature */
  719. down = enum.auto() # (= 4) # an downward-pointing triangle marker
  720. # ImPlotMarker_Left, /* original C++ signature */
  721. left = enum.auto() # (= 5) # an leftward-pointing triangle marker
  722. # ImPlotMarker_Right, /* original C++ signature */
  723. right = enum.auto() # (= 6) # an rightward-pointing triangle marker
  724. # ImPlotMarker_Cross, /* original C++ signature */
  725. cross = enum.auto() # (= 7) # a cross marker (not fill-able)
  726. # ImPlotMarker_Plus, /* original C++ signature */
  727. plus = enum.auto() # (= 8) # a plus marker (not fill-able)
  728. # ImPlotMarker_Asterisk, /* original C++ signature */
  729. asterisk = enum.auto() # (= 9) # a asterisk marker (not fill-able)
  730. # ImPlotMarker_COUNT /* original C++ signature */
  731. # }
  732. count = enum.auto() # (= 10)
  733. class Colormap_(enum.IntFlag):
  734. """Built-in colormaps"""
  735. # ImPlotColormap_Deep = 0, /* original C++ signature */
  736. deep = enum.auto() # (= 0) # a.k.a. seaborn deep (qual=True, n=10) (default)
  737. # ImPlotColormap_Dark = 1, /* original C++ signature */
  738. dark = enum.auto() # (= 1) # a.k.a. matplotlib "Set1" (qual=True, n=9 )
  739. # ImPlotColormap_Pastel = 2, /* original C++ signature */
  740. pastel = enum.auto() # (= 2) # a.k.a. matplotlib "Pastel1" (qual=True, n=9 )
  741. # ImPlotColormap_Paired = 3, /* original C++ signature */
  742. paired = enum.auto() # (= 3) # a.k.a. matplotlib "Paired" (qual=True, n=12)
  743. # ImPlotColormap_Viridis = 4, /* original C++ signature */
  744. viridis = enum.auto() # (= 4) # a.k.a. matplotlib "viridis" (qual=False, n=11)
  745. # ImPlotColormap_Plasma = 5, /* original C++ signature */
  746. plasma = enum.auto() # (= 5) # a.k.a. matplotlib "plasma" (qual=False, n=11)
  747. # ImPlotColormap_Hot = 6, /* original C++ signature */
  748. hot = enum.auto() # (= 6) # a.k.a. matplotlib/MATLAB "hot" (qual=False, n=11)
  749. # ImPlotColormap_Cool = 7, /* original C++ signature */
  750. cool = enum.auto() # (= 7) # a.k.a. matplotlib/MATLAB "cool" (qual=False, n=11)
  751. # ImPlotColormap_Pink = 8, /* original C++ signature */
  752. pink = enum.auto() # (= 8) # a.k.a. matplotlib/MATLAB "pink" (qual=False, n=11)
  753. # ImPlotColormap_Jet = 9, /* original C++ signature */
  754. jet = enum.auto() # (= 9) # a.k.a. MATLAB "jet" (qual=False, n=11)
  755. # ImPlotColormap_Twilight = 10, /* original C++ signature */
  756. twilight = enum.auto() # (= 10) # a.k.a. matplotlib "twilight" (qual=False, n=11)
  757. # ImPlotColormap_RdBu = 11, /* original C++ signature */
  758. rd_bu = enum.auto() # (= 11) # red/blue, Color Brewer (qual=False, n=11)
  759. # ImPlotColormap_BrBG = 12, /* original C++ signature */
  760. br_bg = enum.auto() # (= 12) # brown/blue-green, Color Brewer (qual=False, n=11)
  761. # ImPlotColormap_PiYG = 13, /* original C++ signature */
  762. pi_yg = enum.auto() # (= 13) # pink/yellow-green, Color Brewer (qual=False, n=11)
  763. # ImPlotColormap_Spectral = 14, /* original C++ signature */
  764. spectral = enum.auto() # (= 14) # color spectrum, Color Brewer (qual=False, n=11)
  765. # ImPlotColormap_Greys = 15, /* original C++ signature */
  766. greys = enum.auto() # (= 15) # white/black (qual=False, n=2 )
  767. class Location_(enum.IntFlag):
  768. """Used to position items on a plot (e.g. legends, labels, etc.)"""
  769. # ImPlotLocation_Center = 0, /* original C++ signature */
  770. center = enum.auto() # (= 0) # center-center
  771. # ImPlotLocation_North = 1 << 0, /* original C++ signature */
  772. north = enum.auto() # (= 1 << 0) # top-center
  773. # ImPlotLocation_South = 1 << 1, /* original C++ signature */
  774. south = enum.auto() # (= 1 << 1) # bottom-center
  775. # ImPlotLocation_West = 1 << 2, /* original C++ signature */
  776. west = enum.auto() # (= 1 << 2) # center-left
  777. # ImPlotLocation_East = 1 << 3, /* original C++ signature */
  778. east = enum.auto() # (= 1 << 3) # center-right
  779. # ImPlotLocation_NorthWest = ImPlotLocation_North | ImPlotLocation_West, /* original C++ signature */
  780. north_west = enum.auto() # (= Location_North | Location_West) # top-left
  781. # ImPlotLocation_NorthEast = ImPlotLocation_North | ImPlotLocation_East, /* original C++ signature */
  782. north_east = enum.auto() # (= Location_North | Location_East) # top-right
  783. # ImPlotLocation_SouthWest = ImPlotLocation_South | ImPlotLocation_West, /* original C++ signature */
  784. south_west = enum.auto() # (= Location_South | Location_West) # bottom-left
  785. # ImPlotLocation_SouthEast = ImPlotLocation_South | ImPlotLocation_East /* original C++ signature */
  786. south_east = enum.auto() # (= Location_South | Location_East) # bottom-right
  787. class Bin_(enum.IntFlag):
  788. """Enums for different automatic histogram binning methods (k = bin count or w = bin width)"""
  789. # ImPlotBin_Sqrt = -1, /* original C++ signature */
  790. sqrt = enum.auto() # (= -1) # k = sqrt(n)
  791. # ImPlotBin_Sturges = -2, /* original C++ signature */
  792. sturges = enum.auto() # (= -2) # k = 1 + log2(n)
  793. # ImPlotBin_Rice = -3, /* original C++ signature */
  794. rice = enum.auto() # (= -3) # k = 2 * cbrt(n)
  795. # ImPlotBin_Scott = -4, /* original C++ signature */
  796. scott = enum.auto() # (= -4) # w = 3.49 * sigma / cbrt(n)
  797. class Spec:
  798. """Plot item styling specification. Provide these to PlotX functions to override styling, specify
  799. offsetting or stride, or set optional flags. This struct can be used in the following ways:
  800. 1. By declaring and defining a struct instance:
  801. ImPlotSpec spec;
  802. spec.LineColor = ImVec4(1,0,0,1);
  803. spec.LineWeight = 2.0;
  804. spec.Marker = ImPlotMarker_Circle;
  805. spec.Flags = ImPlotItemFlags_NoLegend | ImPlotLineFlags_Segments;
  806. ImPlot::PlotLine("MyLine", xs, ys, 100, spec);
  807. 2. Inline using (ImPlotProp,value) pairs (order does NOT matter):
  808. ImPlot::PlotLine("MyLine", xs, ys, 100, {
  809. ImPlotProp_LineColor, ImVec4(1,0,0,1),
  810. ImPlotProp_LineWeight, 2.0,
  811. ImPlotProp_Marker, ImPlotMarker_Circle,
  812. ImPlotProp_Flags, ImPlotItemFlags_NoLegend | ImPlotLineFlags_Segments
  813. });
  814. """
  815. # ImVec4 LineColor = IMPLOT_AUTO_COL; /* original C++ signature */
  816. line_color: ImVec4 = (
  817. IMPLOT_AUTO_COL # line color (applies to lines, bar edges); IMPLOT_AUTO_COL will use next Colormap color or current item color
  818. )
  819. # float LineWeight = 1.0f; /* original C++ signature */
  820. line_weight: float = 1.0 # line weight in pixels (applies to lines, bar edges, marker edges)
  821. # ImVec4 FillColor = IMPLOT_AUTO_COL; /* original C++ signature */
  822. fill_color: ImVec4 = (
  823. IMPLOT_AUTO_COL # fill color (applies to shaded regions, bar faces); IMPLOT_AUTO_COL will use next Colormap color or current item color
  824. )
  825. # float FillAlpha = 1.0f; /* original C++ signature */
  826. fill_alpha: float = (
  827. 1.0 # alpha multiplier (applies to FillColor, FillColors, MarkerFillColor, and MarkerFillColors)
  828. )
  829. # ImPlotMarker Marker = ImPlotMarker_None; /* original C++ signature */
  830. marker: Marker = Marker_None # marker type; specify ImPlotMarker_Auto to use the next unused marker
  831. # float MarkerSize = 4; /* original C++ signature */
  832. marker_size: float = 4 # size of markers (radius) *in pixels*
  833. # ImVec4 MarkerLineColor = IMPLOT_AUTO_COL; /* original C++ signature */
  834. marker_line_color: ImVec4 = IMPLOT_AUTO_COL # marker edge color; IMPLOT_AUTO_COL will use LineColor
  835. # ImVec4 MarkerFillColor = IMPLOT_AUTO_COL; /* original C++ signature */
  836. marker_fill_color: ImVec4 = IMPLOT_AUTO_COL # marker face color; IMPLOT_AUTO_COL will use LineColor
  837. # float Size = 4; /* original C++ signature */
  838. size: float = 4 # size of error bar whiskers (width or height), and digital bars (height) *in pixels*
  839. # int Offset = 0; /* original C++ signature */
  840. offset: int = 0 # data index offset
  841. # int Stride = IMPLOT_AUTO; /* original C++ signature */
  842. stride: int = (
  843. IMPLOT_AUTO # data stride in bytes; IMPLOT_AUTO will result in sizeof(T) where T is the type passed to PlotX
  844. )
  845. # ImPlotItemFlags Flags = ImPlotItemFlags_None; /* original C++ signature */
  846. flags: ItemFlags = (
  847. ItemFlags_None # optional item flags; can be composed from common ImPlotItemFlags and/or specialized ImPlotXFlags
  848. )
  849. # ImPlotSpec(ImVec4 LineColor = IMPLOT_AUTO_COL, float LineWeight = 1.0f, ImVec4 FillColor = IMPLOT_AUTO_COL, float FillAlpha = 1.0f, ImPlotMarker Marker = ImPlotMarker_None, float MarkerSize = 4, ImVec4 MarkerLineColor = IMPLOT_AUTO_COL, ImVec4 MarkerFillColor = IMPLOT_AUTO_COL, float Size = 4, int Offset = 0, int Stride = IMPLOT_AUTO, ImPlotItemFlags Flags = ImPlotItemFlags_None); /* original C++ signature */
  850. def __init__(
  851. self,
  852. line_color: Optional[ImVec4Like] = None,
  853. line_weight: float = 1.0,
  854. fill_color: Optional[ImVec4Like] = None,
  855. fill_alpha: float = 1.0,
  856. marker: Optional[Marker] = None,
  857. marker_size: float = 4,
  858. marker_line_color: Optional[ImVec4Like] = None,
  859. marker_fill_color: Optional[ImVec4Like] = None,
  860. size: float = 4,
  861. offset: int = 0,
  862. stride: int = IMPLOT_AUTO,
  863. flags: ItemFlags = ItemFlags_None,
  864. ) -> None:
  865. """Auto-generated default constructor with named params
  866. Python bindings defaults:
  867. If any of the params below is None, then its default value below will be used:
  868. * LineColor: IMPLOT_AUTO_COL
  869. * FillColor: IMPLOT_AUTO_COL
  870. * Marker: Marker_None
  871. * MarkerLineColor: IMPLOT_AUTO_COL
  872. * MarkerFillColor: IMPLOT_AUTO_COL
  873. """
  874. pass
  875. line_colors: Optional[np.ndarray] = (
  876. None # array of colors (np.uint32) for each line. Must have the same length as the data arrays. If None, use LineColor for all lines.
  877. )
  878. fill_colors: Optional[np.ndarray] = (
  879. None # array of colors (np.uint32) for each fill. Must have the same length as the data arrays. If None, use FillColor for all fills.
  880. )
  881. marker_line_colors: Optional[np.ndarray] = (
  882. None # array of colors (np.uint32) for each marker edge. Must have the same length as the data arrays. If None, use MarkerLineColor for all markers.
  883. )
  884. marker_fill_colors: Optional[np.ndarray] = (
  885. None # array of colors (np.uint32) for each marker face. Must have the same length as the data arrays. If None, use MarkerFillColor for all markers.
  886. )
  887. marker_sizes: Optional[np.ndarray] = (
  888. None # array of sizes (np.float32) for each marker. Must have the same length as the data arrays. If None, use MarkerSize for all markers.
  889. )
  890. class Point:
  891. # double x, /* original C++ signature */
  892. x: float
  893. # y; /* original C++ signature */
  894. y: float
  895. # constexpr ImPlotPoint() : x(0.0), y(0.0) { } /* original C++ signature */
  896. @overload
  897. def __init__(self) -> None:
  898. pass
  899. # constexpr ImPlotPoint(double _x, double _y) : x(_x), y(_y) { } /* original C++ signature */
  900. @overload
  901. def __init__(self, _x: float, _y: float) -> None:
  902. pass
  903. # constexpr ImPlotPoint(const ImVec2& p) : x((double)p.x), y((double)p.y) { } /* original C++ signature */
  904. @overload
  905. def __init__(self, p: ImVec2Like) -> None:
  906. pass
  907. # IMPLOT_API double& operator[] (size_t idx) { IM_ASSERT(idx == 0 || idx == 1); return ((double*)(void*)(char*)this)[idx]; } /* original C++ signature */
  908. def __getitem__(self, idx: int) -> float:
  909. pass
  910. class Range:
  911. """Range defined by a min/max value."""
  912. # double Min, /* original C++ signature */
  913. min: float
  914. # Max; /* original C++ signature */
  915. max: float
  916. # constexpr ImPlotRange() : Min(0.0), Max(0.0) { } /* original C++ signature */
  917. @overload
  918. def __init__(self) -> None:
  919. pass
  920. # constexpr ImPlotRange(double _min, double _max) : Min(_min), Max(_max) { } /* original C++ signature */
  921. @overload
  922. def __init__(self, _min: float, _max: float) -> None:
  923. pass
  924. # IMPLOT_API bool Contains(double value) const { return value >= Min && value <= Max; } /* original C++ signature */
  925. def contains(self, value: float) -> bool:
  926. pass
  927. # IMPLOT_API double Size() const { return Max - Min; } /* original C++ signature */
  928. def size(self) -> float:
  929. pass
  930. # IMPLOT_API double Clamp(double value) const { return (value < Min) ? Min : (value > Max) ? Max : value; } /* original C++ signature */
  931. def clamp(self, value: float) -> float:
  932. pass
  933. class Rect:
  934. """Combination of two range limits for X and Y axes. Also an AABB defined by Min()/Max()."""
  935. # ImPlotRange X, /* original C++ signature */
  936. x: Range
  937. # Y; /* original C++ signature */
  938. y: Range
  939. # constexpr ImPlotRect() : X(0.0,0.0), Y(0.0,0.0) { } /* original C++ signature */
  940. @overload
  941. def __init__(self) -> None:
  942. pass
  943. # constexpr ImPlotRect(double x_min, double x_max, double y_min, double y_max) : X(x_min, x_max), Y(y_min, y_max) { } /* original C++ signature */
  944. @overload
  945. def __init__(self, x_min: float, x_max: float, y_min: float, y_max: float) -> None:
  946. pass
  947. # IMPLOT_API bool Contains(const ImPlotPoint& p) const { return Contains(p.x, p.y); } /* original C++ signature */
  948. @overload
  949. def contains(self, p: Point) -> bool:
  950. pass
  951. # IMPLOT_API bool Contains(double x, double y) const { return X.Contains(x) && Y.Contains(y); } /* original C++ signature */
  952. @overload
  953. def contains(self, x: float, y: float) -> bool:
  954. pass
  955. # IMPLOT_API ImPlotPoint Size() const { return ImPlotPoint(X.Size(), Y.Size()); } /* original C++ signature */
  956. def size(self) -> Point:
  957. pass
  958. # IMPLOT_API ImPlotPoint Clamp(const ImPlotPoint& p) const { return Clamp(p.x, p.y); } /* original C++ signature */
  959. @overload
  960. def clamp(self, p: Point) -> Point:
  961. pass
  962. # IMPLOT_API ImPlotPoint Clamp(double x, double y) const { return ImPlotPoint(X.Clamp(x),Y.Clamp(y)); } /* original C++ signature */
  963. @overload
  964. def clamp(self, x: float, y: float) -> Point:
  965. pass
  966. # IMPLOT_API ImPlotPoint Min() const { return ImPlotPoint(X.Min, Y.Min); } /* original C++ signature */
  967. def min(self) -> Point:
  968. pass
  969. # IMPLOT_API ImPlotPoint Max() const { return ImPlotPoint(X.Max, Y.Max); } /* original C++ signature */
  970. def max(self) -> Point:
  971. pass
  972. class Style:
  973. """Plot style structure
  974. (has support for copy.copy)
  975. """
  976. # plot styling
  977. # ImVec2 PlotDefaultSize; /* original C++ signature */
  978. plot_default_size: ImVec2 # = 400,300 default size used when ImVec2(0,0) is passed to BeginPlot
  979. # ImVec2 PlotMinSize; /* original C++ signature */
  980. plot_min_size: ImVec2 # = 200,150 minimum size plot frame can be when shrunk
  981. # float PlotBorderSize; /* original C++ signature */
  982. plot_border_size: float # = 1, line thickness of border around plot area
  983. # float MinorAlpha; /* original C++ signature */
  984. minor_alpha: float # = 0.25 alpha multiplier applied to minor axis grid lines
  985. # ImVec2 MajorTickLen; /* original C++ signature */
  986. major_tick_len: ImVec2 # = 10,10 major tick lengths for X and Y axes
  987. # ImVec2 MinorTickLen; /* original C++ signature */
  988. minor_tick_len: ImVec2 # = 5,5 minor tick lengths for X and Y axes
  989. # ImVec2 MajorTickSize; /* original C++ signature */
  990. major_tick_size: ImVec2 # = 1,1 line thickness of major ticks
  991. # ImVec2 MinorTickSize; /* original C++ signature */
  992. minor_tick_size: ImVec2 # = 1,1 line thickness of minor ticks
  993. # ImVec2 MajorGridSize; /* original C++ signature */
  994. major_grid_size: ImVec2 # = 1,1 line thickness of major grid lines
  995. # ImVec2 MinorGridSize; /* original C++ signature */
  996. minor_grid_size: ImVec2 # = 1,1 line thickness of minor grid lines
  997. # plot padding
  998. # ImVec2 PlotPadding; /* original C++ signature */
  999. plot_padding: (
  1000. ImVec2 # = 10,10 padding between widget frame and plot area, labels, or outside legends (i.e. main padding)
  1001. )
  1002. # ImVec2 LabelPadding; /* original C++ signature */
  1003. label_padding: ImVec2 # = 5,5 padding between axes labels, tick labels, and plot edge
  1004. # ImVec2 LegendPadding; /* original C++ signature */
  1005. legend_padding: ImVec2 # = 10,10 legend padding from plot edges
  1006. # ImVec2 LegendInnerPadding; /* original C++ signature */
  1007. legend_inner_padding: ImVec2 # = 5,5 legend inner padding from legend edges
  1008. # ImVec2 LegendSpacing; /* original C++ signature */
  1009. legend_spacing: ImVec2 # = 5,0 spacing between legend entries
  1010. # ImVec2 MousePosPadding; /* original C++ signature */
  1011. mouse_pos_padding: ImVec2 # = 10,10 padding between plot edge and interior mouse location text
  1012. # ImVec2 AnnotationPadding; /* original C++ signature */
  1013. annotation_padding: ImVec2 # = 2,2 text padding around annotation labels
  1014. # ImVec2 FitPadding; /* original C++ signature */
  1015. fit_padding: ImVec2 # = 0,0 additional fit padding as a percentage of the fit extents (e.g. ImVec2(0.1,0.1) adds 10% to the fit extents of X and Y)
  1016. # float DigitalPadding; /* original C++ signature */
  1017. digital_padding: float # = 20, digital plot padding from bottom in pixels
  1018. # float DigitalSpacing; /* original C++ signature */
  1019. digital_spacing: float # = 4, digital plot spacing gap in pixels
  1020. # [ADAPT_IMGUI_BUNDLE]
  1021. # #ifdef IMGUI_BUNDLE_PYTHON_API
  1022. #
  1023. # python adapter for ImPlotStyle::Colors[ImPlotCol_COUNT]
  1024. # You can query and modify those values (0 <= idxColor < implot.Col_.count)
  1025. # inline IMPLOT_API ImVec4& Color_(size_t idxColor) { IM_ASSERT( (idxColor >=0) && (idxColor < ImPlotCol_COUNT)); return Colors[idxColor]; } /* original C++ signature */
  1026. def color_(self, idx_color: int) -> ImVec4:
  1027. """Array of styling colors (index from implot.Col_.xxx)"""
  1028. pass
  1029. # inline IMPLOT_API void SetColor_(size_t idxColor, ImVec4 color) { IM_ASSERT( (idxColor >=0) && (idxColor < ImPlotCol_COUNT)); Colors[idxColor] = color; } /* original C++ signature */
  1030. def set_color_(self, idx_color: int, color: ImVec4Like) -> None:
  1031. """Array of styling colors (index from implot.Col_.xxx)"""
  1032. pass
  1033. # #endif
  1034. #
  1035. # [/ADAPT_IMGUI_BUNDLE]
  1036. # colormap
  1037. # ImPlotColormap Colormap; /* original C++ signature */
  1038. colormap: Colormap # The current colormap. Set this to either an ImPlotColormap_ enum or an index returned by AddColormap.
  1039. # settings/flags
  1040. # bool UseLocalTime; /* original C++ signature */
  1041. use_local_time: (
  1042. bool # = False, axis labels will be formatted for your timezone when ImPlotAxisFlag_Time is enabled
  1043. )
  1044. # bool UseISO8601; /* original C++ signature */
  1045. use_iso8601: bool # = False, dates will be formatted according to ISO 8601 where applicable (e.g. YYYY-MM-DD, YYYY-MM, --MM-DD, etc.)
  1046. # bool Use24HourClock; /* original C++ signature */
  1047. use24_hour_clock: bool # = False, times will be formatted using a 24 hour clock
  1048. # IMPLOT_API ImPlotStyle(); /* original C++ signature */
  1049. def __init__(self) -> None:
  1050. pass
  1051. # Support for legacy versions
  1052. class InputMap:
  1053. """Input mapping structure. Default values listed. See also MapInputDefault, MapInputReverse."""
  1054. # ImGuiMouseButton Pan; /* original C++ signature */
  1055. pan: MouseButton # LMB enables panning when held,
  1056. # int PanMod; /* original C++ signature */
  1057. pan_mod: int # none optional modifier that must be held for panning/fitting
  1058. # ImGuiMouseButton Fit; /* original C++ signature */
  1059. fit: MouseButton # LMB initiates fit when double clicked
  1060. # ImGuiMouseButton Select; /* original C++ signature */
  1061. select: MouseButton # RMB begins box selection when pressed and confirms selection when released
  1062. # ImGuiMouseButton SelectCancel; /* original C++ signature */
  1063. select_cancel: MouseButton # LMB cancels active box selection when pressed; cannot be same as Select
  1064. # int SelectMod; /* original C++ signature */
  1065. select_mod: int # none optional modifier that must be held for box selection
  1066. # int SelectHorzMod; /* original C++ signature */
  1067. select_horz_mod: int # Alt expands active box selection horizontally to plot edge when held
  1068. # int SelectVertMod; /* original C++ signature */
  1069. select_vert_mod: int # Shift expands active box selection vertically to plot edge when held
  1070. # ImGuiMouseButton Menu; /* original C++ signature */
  1071. menu: MouseButton # RMB opens context menus (if enabled) when clicked
  1072. # int OverrideMod; /* original C++ signature */
  1073. override_mod: int # Ctrl when held, all input is ignored; used to enable axis/plots as DND sources
  1074. # int ZoomMod; /* original C++ signature */
  1075. zoom_mod: int # none optional modifier that must be held for scroll wheel zooming
  1076. # float ZoomRate; /* original C++ signature */
  1077. zoom_rate: (
  1078. float # 0.1 zoom rate for scroll (e.g. 0.1 = 10% plot range every scroll click); make negative to invert
  1079. )
  1080. # IMPLOT_API ImPlotInputMap(); /* original C++ signature */
  1081. def __init__(self) -> None:
  1082. pass
  1083. # -----------------------------------------------------------------------------
  1084. # [SECTION] Callbacks
  1085. # -----------------------------------------------------------------------------
  1086. # -----------------------------------------------------------------------------
  1087. # [SECTION] Contexts
  1088. # -----------------------------------------------------------------------------
  1089. # IMPLOT_API ImPlotContext* CreateContext(); /* original C++ signature */
  1090. def create_context() -> Context:
  1091. """Creates a new ImPlot context. Call this after ImGui::CreateContext."""
  1092. pass
  1093. # IMPLOT_API void DestroyContext(ImPlotContext* ctx = nullptr); /* original C++ signature */
  1094. def destroy_context(ctx: Optional[Context] = None) -> None:
  1095. """Destroys an ImPlot context. Call this before ImGui::DestroyContext. None = destroy current context."""
  1096. pass
  1097. # IMPLOT_API ImPlotContext* GetCurrentContext(); /* original C++ signature */
  1098. def get_current_context() -> Context:
  1099. """Returns the current ImPlot context. None if no context has ben set."""
  1100. pass
  1101. # IMPLOT_API void SetCurrentContext(ImPlotContext* ctx); /* original C++ signature */
  1102. def set_current_context(ctx: Context) -> None:
  1103. """Sets the current ImPlot context."""
  1104. pass
  1105. # IMPLOT_API void SetImGuiContext(ImGuiContext* ctx); /* original C++ signature */
  1106. def set_imgui_context(ctx: ImGui_Context) -> None:
  1107. """Sets the current **ImGui** context. This is ONLY necessary if you are compiling
  1108. ImPlot as a DLL (not recommended) separate from your ImGui compilation. It
  1109. sets the global variable GImGui, which is not shared across DLL boundaries.
  1110. See GImGui documentation in imgui.cpp for more details.
  1111. """
  1112. pass
  1113. # -----------------------------------------------------------------------------
  1114. # [SECTION] Begin/End Plot
  1115. # -----------------------------------------------------------------------------
  1116. # IMPLOT_API bool BeginPlot(const char* title_id, const ImVec2& size=ImVec2(-1,0), ImPlotFlags flags=0); /* original C++ signature */
  1117. def begin_plot(title_id: str, size: Optional[ImVec2Like] = None, flags: Flags = 0) -> bool:
  1118. """Starts a 2D plotting context. If this function returns True, EndPlot() MUST
  1119. be called! You are encouraged to use the following convention:
  1120. if (BeginPlot(...)) {
  1121. PlotLine(...);
  1122. ...
  1123. EndPlot();
  1124. }
  1125. Important notes:
  1126. - #title_id must be unique to the current ImGui ID scope. If you need to avoid ID
  1127. collisions or don't want to display a title in the plot, use double hashes
  1128. (e.g. "MyPlot##HiddenIdText" or "##NoTitle").
  1129. - #size is the **frame** size of the plot widget, not the plot area. The default
  1130. size of plots (i.e. when ImVec2(0,0)) can be modified in your ImPlotStyle.
  1131. Python bindings defaults:
  1132. If size is None, then its default value will be: ImVec2(-1,0)
  1133. """
  1134. pass
  1135. # IMPLOT_API void EndPlot(); /* original C++ signature */
  1136. def end_plot() -> None:
  1137. """Only call EndPlot() if BeginPlot() returns True! Typically called at the end
  1138. of an if statement conditioned on BeginPlot(). See example above.
  1139. """
  1140. pass
  1141. # -----------------------------------------------------------------------------
  1142. # [SECTION] Begin/End Subplots
  1143. # -----------------------------------------------------------------------------
  1144. # Starts a subdivided plotting context. If the function returns True,
  1145. # EndSubplots() MUST be called! Call BeginPlot/EndPlot AT MOST [rows*cols]
  1146. # times in between the beginning and end of the subplot context. Plots are
  1147. # added in row major order.
  1148. #
  1149. # Example:
  1150. #
  1151. # if (BeginSubplots("My Subplot",2,3,ImVec2(800,400)) {
  1152. # for (int i = 0; i < 6; ++i) {
  1153. # if (BeginPlot(...)) {
  1154. # ImPlot::PlotLine(...);
  1155. # ...
  1156. # EndPlot();
  1157. # }
  1158. # }
  1159. # EndSubplots();
  1160. # }
  1161. #
  1162. # Produces:
  1163. #
  1164. # [0] | [1] | [2]
  1165. # ----|-----|----
  1166. # [3] | [4] | [5]
  1167. #
  1168. # Important notes:
  1169. #
  1170. # - #title_id must be unique to the current ImGui ID scope. If you need to avoid ID
  1171. # collisions or don't want to display a title in the plot, use double hashes
  1172. # (e.g. "MySubplot##HiddenIdText" or "##NoTitle").
  1173. # - #rows and #cols must be greater than 0.
  1174. # - #size is the size of the entire grid of subplots, not the individual plots
  1175. # - #row_ratios and #col_ratios must have AT LEAST #rows and #cols elements,
  1176. # respectively. These are the sizes of the rows and columns expressed in ratios.
  1177. # If the user adjusts the dimensions, the arrays are updated with new ratios.
  1178. #
  1179. # Important notes regarding BeginPlot from inside of BeginSubplots:
  1180. #
  1181. # - The #title_id parameter of _BeginPlot_ (see above) does NOT have to be
  1182. # unique when called inside of a subplot context. Subplot IDs are hashed
  1183. # for your convenience so you don't have call PushID or generate unique title
  1184. # strings. Simply pass an empty string to BeginPlot unless you want to title
  1185. # each subplot.
  1186. # - The #size parameter of _BeginPlot_ (see above) is ignored when inside of a
  1187. # subplot context. The actual size of the subplot will be based on the
  1188. # #size value you pass to _BeginSubplots_ and #row/#col_ratios if provided.
  1189. # #ifdef IMGUI_BUNDLE_PYTHON_API
  1190. #
  1191. class SubplotsRowColRatios:
  1192. # std::vector<float> row_ratios; /* original C++ signature */
  1193. row_ratios: List[float]
  1194. # std::vector<float> col_ratios; /* original C++ signature */
  1195. col_ratios: List[float]
  1196. # SubplotsRowColRatios(std::vector<float> row_ratios = std::vector<float>(), std::vector<float> col_ratios = std::vector<float>()); /* original C++ signature */
  1197. def __init__(self, row_ratios: Optional[List[float]] = None, col_ratios: Optional[List[float]] = None) -> None:
  1198. """Auto-generated default constructor with named params
  1199. Python bindings defaults:
  1200. If any of the params below is None, then its default value below will be used:
  1201. * row_ratios: List[float]()
  1202. * col_ratios: List[float]()
  1203. """
  1204. pass
  1205. # IMPLOT_API inline bool BeginSubplotsWithRatios(const char* title_id, /* original C++ signature */
  1206. # int rows,
  1207. # int cols,
  1208. # const ImVec2& size,
  1209. # ImPlotSubplotFlags flags = 0,
  1210. # SubplotsRowColRatios* row_col_ratios = nullptr)
  1211. # {
  1212. # if (row_col_ratios == nullptr)
  1213. # return BeginSubplots(title_id, rows, cols, size, flags, nullptr , nullptr);
  1214. # return BeginSubplots(title_id, rows, cols, size, flags, row_col_ratios->row_ratios.data(), row_col_ratios->col_ratios.data());
  1215. # }
  1216. def begin_subplots(
  1217. title_id: str,
  1218. rows: int,
  1219. cols: int,
  1220. size: ImVec2Like,
  1221. flags: SubplotFlags = 0,
  1222. row_col_ratios: Optional[SubplotsRowColRatios] = None,
  1223. ) -> bool:
  1224. pass
  1225. # #endif
  1226. #
  1227. # IMPLOT_API void EndSubplots(); /* original C++ signature */
  1228. def end_subplots() -> None:
  1229. """Only call EndSubplots() if BeginSubplots() returns True! Typically called at the end
  1230. of an if statement conditioned on BeginSubplots(). See example above.
  1231. """
  1232. pass
  1233. # -----------------------------------------------------------------------------
  1234. # [SECTION] Setup
  1235. # -----------------------------------------------------------------------------
  1236. # The following API allows you to setup and customize various aspects of the
  1237. # current plot. The functions should be called immediately after BeginPlot
  1238. # and before any other API calls. Typical usage is as follows:
  1239. # if (BeginPlot(...)) { 1) begin a new plot
  1240. # SetupAxis(ImAxis_X1, "My X-Axis"); 2) make Setup calls
  1241. # SetupAxis(ImAxis_Y1, "My Y-Axis");
  1242. # SetupLegend(ImPlotLocation_North);
  1243. # ...
  1244. # SetupFinish(); 3) [optional] explicitly finish setup
  1245. # PlotLine(...); 4) plot items
  1246. # ...
  1247. # EndPlot(); 5) end the plot
  1248. # }
  1249. #
  1250. # Important notes:
  1251. #
  1252. # - Always call Setup code at the top of your BeginPlot conditional statement.
  1253. # - Setup is locked once you start plotting or explicitly call SetupFinish.
  1254. # Do NOT call Setup code after you begin plotting or after you make
  1255. # any non-Setup API calls (e.g. utils like PlotToPixels also lock Setup)
  1256. # - Calling SetupFinish is OPTIONAL, but probably good practice. If you do not
  1257. # call it yourself, then the first subsequent plotting or utility function will
  1258. # call it for you.
  1259. # IMPLOT_API void SetupAxis(ImAxis axis, const char* label=nullptr, ImPlotAxisFlags flags=0); /* original C++ signature */
  1260. def setup_axis(axis: ImAxis, label: Optional[str] = None, flags: AxisFlags = 0) -> None:
  1261. """Enables an axis or sets the label and/or flags for an existing axis. Leave #label = None for no label."""
  1262. pass
  1263. # IMPLOT_API void SetupAxisLimits(ImAxis axis, double v_min, double v_max, ImPlotCond cond = ImPlotCond_Once); /* original C++ signature */
  1264. def setup_axis_limits(axis: ImAxis, v_min: float, v_max: float, cond: Optional[Cond] = None) -> None:
  1265. """Sets an axis range limits. If ImPlotCond_Always is used, the axes limits will be locked. Inversion with v_min > v_max is not supported; use SetupAxisLimits instead.
  1266. Python bindings defaults:
  1267. If cond is None, then its default value will be: Cond_Once
  1268. """
  1269. pass
  1270. # #ifdef IMGUI_BUNDLE_PYTHON_API
  1271. #
  1272. # IMPLOT_API inline void SetupAxisLinks(ImAxis axis, BoxedValue* link_min, BoxedValue* link_max) { SetupAxisLinks(axis, &link_min->value, &link_max->value); } /* original C++ signature */
  1273. def setup_axis_links(axis: ImAxis, link_min: BoxedValue, link_max: BoxedValue) -> None:
  1274. """Links an axis range limits to external values. Use BoxedValue to transmit values (which will be updated after EndPlot)."""
  1275. pass
  1276. # #endif
  1277. #
  1278. # IMPLOT_API void SetupAxisFormat(ImAxis axis, const char* fmt); /* original C++ signature */
  1279. def setup_axis_format(axis: ImAxis, fmt: str) -> None:
  1280. """Sets the format of numeric axis labels via formatter specifier (default="%g"). Formatted values will be double (i.e. use %f)."""
  1281. pass
  1282. # IMPLOT_API void SetupAxisScale(ImAxis axis, ImPlotScale scale); /* original C++ signature */
  1283. def setup_axis_scale(axis: ImAxis, scale: Scale) -> None:
  1284. """Sets an axis' scale using built-in options."""
  1285. pass
  1286. # IMPLOT_API void SetupAxisLimitsConstraints(ImAxis axis, double v_min, double v_max); /* original C++ signature */
  1287. def setup_axis_limits_constraints(axis: ImAxis, v_min: float, v_max: float) -> None:
  1288. """Sets an axis' limits constraints."""
  1289. pass
  1290. # IMPLOT_API void SetupAxisZoomConstraints(ImAxis axis, double z_min, double z_max); /* original C++ signature */
  1291. def setup_axis_zoom_constraints(axis: ImAxis, z_min: float, z_max: float) -> None:
  1292. """Sets an axis' zoom constraints."""
  1293. pass
  1294. # IMPLOT_API void SetupAxes(const char* x_label, const char* y_label, ImPlotAxisFlags x_flags=0, ImPlotAxisFlags y_flags=0); /* original C++ signature */
  1295. def setup_axes(x_label: str, y_label: str, x_flags: AxisFlags = 0, y_flags: AxisFlags = 0) -> None:
  1296. """Sets the label and/or flags for primary X and Y axes (shorthand for two calls to SetupAxis)."""
  1297. pass
  1298. # IMPLOT_API void SetupAxesLimits(double x_min, double x_max, double y_min, double y_max, ImPlotCond cond = ImPlotCond_Once); /* original C++ signature */
  1299. def setup_axes_limits(x_min: float, x_max: float, y_min: float, y_max: float, cond: Optional[Cond] = None) -> None:
  1300. """Sets the primary X and Y axes range limits. If ImPlotCond_Always is used, the axes limits will be locked (shorthand for two calls to SetupAxisLimits).
  1301. Python bindings defaults:
  1302. If cond is None, then its default value will be: Cond_Once
  1303. """
  1304. pass
  1305. # IMPLOT_API void SetupLegend(ImPlotLocation location, ImPlotLegendFlags flags=0); /* original C++ signature */
  1306. def setup_legend(location: Location, flags: LegendFlags = 0) -> None:
  1307. """Sets up the plot legend. This can also be called immediately after BeginSubplots when using ImPlotSubplotFlags_ShareItems."""
  1308. pass
  1309. # IMPLOT_API void SetupMouseText(ImPlotLocation location, ImPlotMouseTextFlags flags=0); /* original C++ signature */
  1310. def setup_mouse_text(location: Location, flags: MouseTextFlags = 0) -> None:
  1311. """Set the location of the current plot's mouse position text (default = South|East)."""
  1312. pass
  1313. # IMPLOT_API void SetupFinish(); /* original C++ signature */
  1314. def setup_finish() -> None:
  1315. """Explicitly finalize plot setup. Once you call this, you cannot make anymore Setup calls for the current plot!
  1316. Note that calling this function is OPTIONAL; it will be called by the first subsequent setup-locking API call.
  1317. """
  1318. pass
  1319. # -----------------------------------------------------------------------------
  1320. # [SECTION] SetNext
  1321. # -----------------------------------------------------------------------------
  1322. # Though you should default to the `Setup` API above, there are some scenarios
  1323. # where (re)configuring a plot or axis before `BeginPlot` is needed (e.g. if
  1324. # using a preceding button or slider widget to change the plot limits). In
  1325. # this case, you can use the `SetNext` API below. While this is not as feature
  1326. # rich as the Setup API, most common needs are provided. These functions can be
  1327. # called anywhere except for inside of `Begin/EndPlot`. For example:
  1328. # if (ImGui::Button("Center Plot"))
  1329. # ImPlot::SetNextPlotLimits(-1,1,-1,1);
  1330. # if (ImPlot::BeginPlot(...)) {
  1331. # ...
  1332. # ImPlot::EndPlot();
  1333. # }
  1334. #
  1335. # Important notes:
  1336. #
  1337. # - You must still enable non-default axes with SetupAxis for these functions
  1338. # to work properly.
  1339. # IMPLOT_API void SetNextAxisLimits(ImAxis axis, double v_min, double v_max, ImPlotCond cond = ImPlotCond_Once); /* original C++ signature */
  1340. def set_next_axis_limits(axis: ImAxis, v_min: float, v_max: float, cond: Optional[Cond] = None) -> None:
  1341. """Sets an upcoming axis range limits. If ImPlotCond_Always is used, the axes limits will be locked.
  1342. Python bindings defaults:
  1343. If cond is None, then its default value will be: Cond_Once
  1344. """
  1345. pass
  1346. # #ifdef IMGUI_BUNDLE_PYTHON_API
  1347. #
  1348. # IMPLOT_API inline void SetNextAxisLinks(ImAxis axis, BoxedValue* link_min, BoxedValue* link_max) { SetNextAxisLinks(axis, &link_min->value, &link_max->value); } /* original C++ signature */
  1349. def set_next_axis_links(axis: ImAxis, link_min: BoxedValue, link_max: BoxedValue) -> None:
  1350. """Links an upcoming axis range limits to external values. Use BoxedValue to transmit values (which will be updated after EndPlot)."""
  1351. pass
  1352. # #endif
  1353. #
  1354. # IMPLOT_API void SetNextAxisToFit(ImAxis axis); /* original C++ signature */
  1355. def set_next_axis_to_fit(axis: ImAxis) -> None:
  1356. """Set an upcoming axis to auto fit to its data."""
  1357. pass
  1358. # IMPLOT_API void SetNextAxesLimits(double x_min, double x_max, double y_min, double y_max, ImPlotCond cond = ImPlotCond_Once); /* original C++ signature */
  1359. def set_next_axes_limits(x_min: float, x_max: float, y_min: float, y_max: float, cond: Optional[Cond] = None) -> None:
  1360. """Sets the upcoming primary X and Y axes range limits. If ImPlotCond_Always is used, the axes limits will be locked (shorthand for two calls to SetupAxisLimits).
  1361. Python bindings defaults:
  1362. If cond is None, then its default value will be: Cond_Once
  1363. """
  1364. pass
  1365. # IMPLOT_API void SetNextAxesToFit(); /* original C++ signature */
  1366. def set_next_axes_to_fit() -> None:
  1367. """Sets all upcoming axes to auto fit to their data."""
  1368. pass
  1369. # -----------------------------------------------------------------------------
  1370. # [SECTION] Plot Items
  1371. # -----------------------------------------------------------------------------
  1372. # The main plotting API is provided below. Call these functions between
  1373. # Begin/EndPlot and after any Setup API calls. Each plots data on the current
  1374. # x and y axes, which can be changed with `SetAxis/Axes`.
  1375. #
  1376. # The templated functions are explicitly instantiated in implot_items.cpp.
  1377. # They are not intended to be used generically with custom types. You will get
  1378. # a linker error if you try! All functions support the following scalar types:
  1379. #
  1380. # float, double, ImS8, ImU8, ImS16, ImU16, ImS32, ImU32, ImS64, ImU64
  1381. #
  1382. #
  1383. # If you need to plot custom or non-homogenous data you have a few options:
  1384. #
  1385. # 1. If your data is a simple struct/class (e.g. Vector2), you can use striding in your ImPlotSpec.
  1386. # This is the most performant option if applicable.
  1387. #
  1388. # struct Vector2 { float X, Y; };
  1389. # ...
  1390. # Vector2 data[42];
  1391. # ImPlot::PlotLine("line", &data[0].x, &data[0].y, 42, {ImPlotProp_Stride, sizeof(Vector2});
  1392. #
  1393. # 2. Write a custom getter C function or C++ lambda and pass it and optionally your data to
  1394. # an ImPlot function post-fixed with a G (e.g. PlotScatterG). This has a slight performance
  1395. # cost, but probably not enough to worry about unless your data is very large. Examples:
  1396. #
  1397. # ImPlotPoint MyDataGetter(int idx, None* data) {
  1398. # MyData* my_data = (MyData*)data;
  1399. # ImPlotPoint p;
  1400. # p.x = my_data->GetTime(idx);
  1401. # p.y = my_data->GetValue(idx);
  1402. # return p
  1403. # }
  1404. # ...
  1405. # auto my_lambda = [](int idx, None*) {
  1406. # double t = idx / 999.0;
  1407. # return ImPlotPoint(t, 0.5+0.5*std::sin(2*PI*10*t));
  1408. # };
  1409. # ...
  1410. # if (ImPlot::BeginPlot("MyPlot")) {
  1411. # MyData my_data;
  1412. # ImPlot::PlotScatterG("scatter", MyDataGetter, &my_data, my_data.Size());
  1413. # ImPlot::PlotLineG("line", my_lambda, None, 1000);
  1414. # ImPlot::EndPlot();
  1415. # }
  1416. #
  1417. # NB: All types are converted to double before plotting. You may lose information
  1418. # if you try plotting extremely large 64-bit integral types. Proceed with caution!
  1419. # Plots a standard 2D line plot.
  1420. # IMPLOT_TMP void PlotLine(const char* label_id, const T* values, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1421. @overload
  1422. def plot_line(
  1423. label_id: str, values: np.ndarray, xscale: float = 1, xstart: float = 0, spec: Optional[Spec] = None
  1424. ) -> None:
  1425. """Python bindings defaults:
  1426. If spec is None, then its default value will be: Spec()
  1427. """
  1428. pass
  1429. # IMPLOT_TMP void PlotLine(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1430. @overload
  1431. def plot_line(label_id: str, xs: np.ndarray, ys: np.ndarray, spec: Optional[Spec] = None) -> None:
  1432. """Python bindings defaults:
  1433. If spec is None, then its default value will be: Spec()
  1434. """
  1435. pass
  1436. # Plots a standard 2D scatter plot. Default marker is ImPlotMarker_Circle.
  1437. # IMPLOT_TMP void PlotScatter(const char* label_id, const T* values, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1438. @overload
  1439. def plot_scatter(
  1440. label_id: str, values: np.ndarray, xscale: float = 1, xstart: float = 0, spec: Optional[Spec] = None
  1441. ) -> None:
  1442. """Python bindings defaults:
  1443. If spec is None, then its default value will be: Spec()
  1444. """
  1445. pass
  1446. # IMPLOT_TMP void PlotScatter(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1447. @overload
  1448. def plot_scatter(label_id: str, xs: np.ndarray, ys: np.ndarray, spec: Optional[Spec] = None) -> None:
  1449. """Python bindings defaults:
  1450. If spec is None, then its default value will be: Spec()
  1451. """
  1452. pass
  1453. # Plots a bubble graph. #szs are the radius of each bubble in plot units.
  1454. # IMPLOT_TMP void PlotBubbles(const char* label_id, const T* values, const T* szs, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1455. @overload
  1456. def plot_bubbles(
  1457. label_id: str,
  1458. values: np.ndarray,
  1459. szs: np.ndarray,
  1460. xscale: float = 1,
  1461. xstart: float = 0,
  1462. spec: Optional[Spec] = None,
  1463. ) -> None:
  1464. """Python bindings defaults:
  1465. If spec is None, then its default value will be: Spec()
  1466. """
  1467. pass
  1468. # IMPLOT_TMP void PlotBubbles(const char* label_id, const T* xs, const T* ys, const T* szs, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1469. @overload
  1470. def plot_bubbles(label_id: str, xs: np.ndarray, ys: np.ndarray, szs: np.ndarray, spec: Optional[Spec] = None) -> None:
  1471. """Python bindings defaults:
  1472. If spec is None, then its default value will be: Spec()
  1473. """
  1474. pass
  1475. # IMPLOT_TMP void PlotPolygon(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1476. def plot_polygon(label_id: str, xs: np.ndarray, ys: np.ndarray, spec: Optional[Spec] = None) -> None:
  1477. """Plots a polygon. Points are specified in counter-clockwise order. If concave, make sure to set the Concave flag.
  1478. Python bindings defaults:
  1479. If spec is None, then its default value will be: Spec()
  1480. """
  1481. pass
  1482. # Plots a a stairstep graph. The y value is continued constantly to the right from every x position, i.e. the interval [x[i], x[i+1]) has the value y[i]
  1483. # IMPLOT_TMP void PlotStairs(const char* label_id, const T* values, int count, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1484. @overload
  1485. def plot_stairs(
  1486. label_id: str, values: np.ndarray, xscale: float = 1, xstart: float = 0, spec: Optional[Spec] = None
  1487. ) -> None:
  1488. """Python bindings defaults:
  1489. If spec is None, then its default value will be: Spec()
  1490. """
  1491. pass
  1492. # IMPLOT_TMP void PlotStairs(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1493. @overload
  1494. def plot_stairs(label_id: str, xs: np.ndarray, ys: np.ndarray, spec: Optional[Spec] = None) -> None:
  1495. """Python bindings defaults:
  1496. If spec is None, then its default value will be: Spec()
  1497. """
  1498. pass
  1499. # Plots a shaded (filled) region between two lines, or a line and a horizontal reference. Set yref to +/-INFINITY for infinite fill extents.
  1500. # IMPLOT_TMP void PlotShaded(const char* label_id, const T* values, int count, double yref=0, double xscale=1, double xstart=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1501. @overload
  1502. def plot_shaded(
  1503. label_id: str,
  1504. values: np.ndarray,
  1505. yref: float = 0,
  1506. xscale: float = 1,
  1507. xstart: float = 0,
  1508. spec: Optional[Spec] = None,
  1509. ) -> None:
  1510. """Python bindings defaults:
  1511. If spec is None, then its default value will be: Spec()
  1512. """
  1513. pass
  1514. # IMPLOT_TMP void PlotShaded(const char* label_id, const T* xs, const T* ys, int count, double yref=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1515. @overload
  1516. def plot_shaded(label_id: str, xs: np.ndarray, ys: np.ndarray, yref: float = 0, spec: Optional[Spec] = None) -> None:
  1517. """Python bindings defaults:
  1518. If spec is None, then its default value will be: Spec()
  1519. """
  1520. pass
  1521. # IMPLOT_TMP void PlotShaded(const char* label_id, const T* xs, const T* ys1, const T* ys2, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1522. @overload
  1523. def plot_shaded(label_id: str, xs: np.ndarray, ys1: np.ndarray, ys2: np.ndarray, spec: Optional[Spec] = None) -> None:
  1524. """Python bindings defaults:
  1525. If spec is None, then its default value will be: Spec()
  1526. """
  1527. pass
  1528. # Plots a bar graph. Vertical by default. #bar_size and #shift are in plot units.
  1529. # IMPLOT_TMP void PlotBars(const char* label_id, const T* values, int count, double bar_size=0.67, double shift=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1530. @overload
  1531. def plot_bars(
  1532. label_id: str, values: np.ndarray, bar_size: float = 0.67, shift: float = 0, spec: Optional[Spec] = None
  1533. ) -> None:
  1534. """Python bindings defaults:
  1535. If spec is None, then its default value will be: Spec()
  1536. """
  1537. pass
  1538. # IMPLOT_TMP void PlotBars(const char* label_id, const T* xs, const T* ys, int count, double bar_size, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1539. @overload
  1540. def plot_bars(label_id: str, xs: np.ndarray, ys: np.ndarray, bar_size: float, spec: Optional[Spec] = None) -> None:
  1541. """Python bindings defaults:
  1542. If spec is None, then its default value will be: Spec()
  1543. """
  1544. pass
  1545. # #ifdef IMGUI_BUNDLE_PYTHON_API
  1546. #
  1547. # IMPLOT_TMP void PlotBarGroups(const std::vector<std::string>& label_ids, const T* values, int count, double group_size=0.67, double shift=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1548. def plot_bar_groups(
  1549. label_ids: List[str], values: np.ndarray, group_size: float = 0.67, shift: float = 0, spec: Optional[Spec] = None
  1550. ) -> None:
  1551. """Plots a group of bars.
  1552. - values should be a **1 dimension** numpy array of values.
  1553. - label_ids should be a list of strings corresponding to bars labels
  1554. Python bindings defaults:
  1555. If spec is None, then its default value will be: Spec()
  1556. """
  1557. pass
  1558. # #endif
  1559. #
  1560. # Plots vertical error bar. The label_id should be the same as the label_id of the associated line or bar plot.
  1561. # IMPLOT_TMP void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* err, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1562. @overload
  1563. def plot_error_bars(
  1564. label_id: str, xs: np.ndarray, ys: np.ndarray, err: np.ndarray, spec: Optional[Spec] = None
  1565. ) -> None:
  1566. """Python bindings defaults:
  1567. If spec is None, then its default value will be: Spec()
  1568. """
  1569. pass
  1570. # IMPLOT_TMP void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* neg, const T* pos, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1571. @overload
  1572. def plot_error_bars(
  1573. label_id: str, xs: np.ndarray, ys: np.ndarray, neg: np.ndarray, pos: np.ndarray, spec: Optional[Spec] = None
  1574. ) -> None:
  1575. """Python bindings defaults:
  1576. If spec is None, then its default value will be: Spec()
  1577. """
  1578. pass
  1579. # Plots stems. Vertical by default.
  1580. # IMPLOT_TMP void PlotStems(const char* label_id, const T* values, int count, double ref=0, double scale=1, double start=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1581. @overload
  1582. def plot_stems(
  1583. label_id: str, values: np.ndarray, ref: float = 0, scale: float = 1, start: float = 0, spec: Optional[Spec] = None
  1584. ) -> None:
  1585. """Python bindings defaults:
  1586. If spec is None, then its default value will be: Spec()
  1587. """
  1588. pass
  1589. # IMPLOT_TMP void PlotStems(const char* label_id, const T* xs, const T* ys, int count, double ref=0, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1590. @overload
  1591. def plot_stems(label_id: str, xs: np.ndarray, ys: np.ndarray, ref: float = 0, spec: Optional[Spec] = None) -> None:
  1592. """Python bindings defaults:
  1593. If spec is None, then its default value will be: Spec()
  1594. """
  1595. pass
  1596. # IMPLOT_TMP void PlotInfLines(const char* label_id, const T* values, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1597. def plot_inf_lines(label_id: str, values: np.ndarray, spec: Optional[Spec] = None) -> None:
  1598. """Plots infinite vertical or horizontal lines (e.g. for references or asymptotes).
  1599. Python bindings defaults:
  1600. If spec is None, then its default value will be: Spec()
  1601. """
  1602. pass
  1603. # Plots a pie chart. Center and radius are in plot units. #label_fmt can be set to None for no labels.
  1604. # IMPLOT_TMP void PlotPieChart(const char* const label_ids[], const T* values, int count, double x, double y, double radius, const char* label_fmt="%.1f", double angle0=90, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1605. def plot_pie_chart(
  1606. label_ids: List[str],
  1607. values: np.ndarray,
  1608. x: float,
  1609. y: float,
  1610. radius: float,
  1611. label_fmt: str = "%.1",
  1612. angle0: float = 90,
  1613. spec: Optional[Spec] = None,
  1614. ) -> None:
  1615. """Python bindings defaults:
  1616. If spec is None, then its default value will be: Spec()
  1617. """
  1618. pass
  1619. # IMPLOT_TMP double PlotHistogram(const char* label_id, const T* values, int count, int bins=ImPlotBin_Sturges, double bar_scale=1.0, ImPlotRange range=ImPlotRange(), const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1620. def plot_histogram(
  1621. label_id: str,
  1622. values: np.ndarray,
  1623. bins: int = Bin_Sturges,
  1624. bar_scale: float = 1.0,
  1625. range: Optional[Range] = None,
  1626. spec: Optional[Spec] = None,
  1627. ) -> float:
  1628. """Plots a horizontal histogram. #bins can be a positive integer or an ImPlotBin_ method. If #range is left unspecified, the min/max of #values will be used as the range.
  1629. Otherwise, outlier values outside of the range are not binned. The largest bin count or density is returned.
  1630. Python bindings defaults:
  1631. If any of the params below is None, then its default value below will be used:
  1632. * range: Range()
  1633. * spec: Spec()
  1634. """
  1635. pass
  1636. # IMPLOT_TMP double PlotHistogram2D(const char* label_id, const T* xs, const T* ys, int count, int x_bins=ImPlotBin_Sturges, int y_bins=ImPlotBin_Sturges, ImPlotRect range=ImPlotRect(), const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1637. def plot_histogram_2d(
  1638. label_id: str,
  1639. xs: np.ndarray,
  1640. ys: np.ndarray,
  1641. x_bins: int = Bin_Sturges,
  1642. y_bins: int = Bin_Sturges,
  1643. range: Optional[Rect] = None,
  1644. spec: Optional[Spec] = None,
  1645. ) -> float:
  1646. """Plots two dimensional, bivariate histogram as a heatmap. #x_bins and #y_bins can be a positive integer or an ImPlotBin. If #range is left unspecified, the min/max of
  1647. #xs an #ys will be used as the ranges. Otherwise, outlier values outside of range are not binned. The largest bin count or density is returned.
  1648. Python bindings defaults:
  1649. If any of the params below is None, then its default value below will be used:
  1650. * range: Rect()
  1651. * spec: Spec()
  1652. """
  1653. pass
  1654. # Plots digital data. Digital plots do not respond to y drag or zoom, and are always referenced to the bottom of the plot.
  1655. # IMPLOT_TMP void PlotDigital(const char* label_id, const T* xs, const T* ys, int count, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1656. def plot_digital(label_id: str, xs: np.ndarray, ys: np.ndarray, spec: Optional[Spec] = None) -> None:
  1657. """Python bindings defaults:
  1658. If spec is None, then its default value will be: Spec()
  1659. """
  1660. pass
  1661. # #ifdef IMGUI_HAS_TEXTURES
  1662. #
  1663. # IMPLOT_API void PlotImage(const char* label_id, ImTextureRef tex_ref, const ImPlotPoint& bounds_min, const ImPlotPoint& bounds_max, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1664. def plot_image(
  1665. label_id: str,
  1666. tex_ref: ImTextureRef,
  1667. bounds_min: Point,
  1668. bounds_max: Point,
  1669. uv0: Optional[ImVec2Like] = None,
  1670. uv1: Optional[ImVec2Like] = None,
  1671. tint_col: Optional[ImVec4Like] = None,
  1672. spec: Optional[Spec] = None,
  1673. ) -> None:
  1674. """Plots an axis-aligned image. #bounds_min/bounds_max are in plot coordinates (y-up) and #uv0/uv1 are in texture coordinates (y-down).
  1675. Python bindings defaults:
  1676. If any of the params below is None, then its default value below will be used:
  1677. * uv0: ImVec2(0, 0)
  1678. * uv1: ImVec2(1, 1)
  1679. * tint_col: ImVec4(1, 1, 1, 1)
  1680. * spec: Spec()
  1681. """
  1682. pass
  1683. # #endif
  1684. #
  1685. # IMPLOT_API void PlotText(const char* text, double x, double y, const ImVec2& pix_offset=ImVec2(0,0), const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1686. def plot_text(
  1687. text: str, x: float, y: float, pix_offset: Optional[ImVec2Like] = None, spec: Optional[Spec] = None
  1688. ) -> None:
  1689. """Plots a centered text label at point x,y with an optional pixel offset. Text color can be changed with ImPlot::PushStyleColor(ImPlotCol_InlayText, ...).
  1690. Python bindings defaults:
  1691. If any of the params below is None, then its default value below will be used:
  1692. * pix_offset: ImVec2(0,0)
  1693. * spec: Spec()
  1694. """
  1695. pass
  1696. # IMPLOT_API void PlotDummy(const char* label_id, const ImPlotSpec& spec=ImPlotSpec()); /* original C++ signature */
  1697. def plot_dummy(label_id: str, spec: Optional[Spec] = None) -> None:
  1698. """Plots a dummy item (i.e. adds a legend entry colored by ImPlotCol_Line)
  1699. Python bindings defaults:
  1700. If spec is None, then its default value will be: Spec()
  1701. """
  1702. pass
  1703. # -----------------------------------------------------------------------------
  1704. # [SECTION] Plot Tools
  1705. # -----------------------------------------------------------------------------
  1706. # The following can be used to render interactive elements and/or annotations.
  1707. # Like the item plotting functions above, they apply to the current x and y
  1708. # axes, which can be changed with `SetAxis/SetAxes`. These functions return True
  1709. # when user interaction causes the provided coordinates to change. Additional
  1710. # user interactions can be retrieved through the optional output parameters.
  1711. # IMPLOT_API bool DragPoint(int id, double* x, double* y, const ImVec4& col, float size = 4, ImPlotDragToolFlags flags = 0, bool* out_clicked = nullptr, bool* out_hovered = nullptr, bool* out_held = nullptr); /* original C++ signature */
  1712. def drag_point(
  1713. id_: int,
  1714. x: float,
  1715. y: float,
  1716. col: ImVec4Like,
  1717. size: float = 4,
  1718. flags: DragToolFlags = 0,
  1719. out_clicked: Optional[bool] = None,
  1720. out_hovered: Optional[bool] = None,
  1721. out_held: Optional[bool] = None,
  1722. ) -> Tuple[bool, float, float, Optional[bool], Optional[bool], Optional[bool]]:
  1723. """Shows a draggable point at x,y. #col defaults to ImGuiCol_Text."""
  1724. pass
  1725. # IMPLOT_API bool DragLineX(int id, double* x, const ImVec4& col, float thickness = 1, ImPlotDragToolFlags flags = 0, bool* out_clicked = nullptr, bool* out_hovered = nullptr, bool* out_held = nullptr); /* original C++ signature */
  1726. def drag_line_x(
  1727. id_: int,
  1728. x: float,
  1729. col: ImVec4Like,
  1730. thickness: float = 1,
  1731. flags: DragToolFlags = 0,
  1732. out_clicked: Optional[bool] = None,
  1733. out_hovered: Optional[bool] = None,
  1734. out_held: Optional[bool] = None,
  1735. ) -> Tuple[bool, float, Optional[bool], Optional[bool], Optional[bool]]:
  1736. """Shows a draggable vertical guide line at an x-value. #col defaults to ImGuiCol_Text."""
  1737. pass
  1738. # IMPLOT_API bool DragLineY(int id, double* y, const ImVec4& col, float thickness = 1, ImPlotDragToolFlags flags = 0, bool* out_clicked = nullptr, bool* out_hovered = nullptr, bool* out_held = nullptr); /* original C++ signature */
  1739. def drag_line_y(
  1740. id_: int,
  1741. y: float,
  1742. col: ImVec4Like,
  1743. thickness: float = 1,
  1744. flags: DragToolFlags = 0,
  1745. out_clicked: Optional[bool] = None,
  1746. out_hovered: Optional[bool] = None,
  1747. out_held: Optional[bool] = None,
  1748. ) -> Tuple[bool, float, Optional[bool], Optional[bool], Optional[bool]]:
  1749. """Shows a draggable horizontal guide line at a y-value. #col defaults to ImGuiCol_Text."""
  1750. pass
  1751. # IMPLOT_API bool DragRect(int id, double* x1, double* y1, double* x2, double* y2, const ImVec4& col, ImPlotDragToolFlags flags = 0, bool* out_clicked = nullptr, bool* out_hovered = nullptr, bool* out_held = nullptr); /* original C++ signature */
  1752. def drag_rect(
  1753. id_: int,
  1754. x1: float,
  1755. y1: float,
  1756. x2: float,
  1757. y2: float,
  1758. col: ImVec4Like,
  1759. flags: DragToolFlags = 0,
  1760. out_clicked: Optional[bool] = None,
  1761. out_hovered: Optional[bool] = None,
  1762. out_held: Optional[bool] = None,
  1763. ) -> Tuple[bool, float, float, float, float, Optional[bool], Optional[bool], Optional[bool]]:
  1764. """Shows a draggable and resizeable rectangle."""
  1765. pass
  1766. # Shows an annotation callout at a chosen point. Clamping keeps annotations in the plot area. Annotations are always rendered on top.
  1767. # IMPLOT_API void Annotation(double x, double y, const ImVec4& col, const ImVec2& pix_offset, bool clamp, bool round = false); /* original C++ signature */
  1768. @overload
  1769. def annotation(x: float, y: float, col: ImVec4Like, pix_offset: ImVec2Like, clamp: bool, round: bool = False) -> None:
  1770. pass
  1771. # IMPLOT_API void Annotation(double x, double y, const ImVec4& col, const ImVec2& pix_offset, bool clamp, const char* fmt, ...) ; /* original C++ signature */
  1772. @overload
  1773. def annotation(x: float, y: float, col: ImVec4Like, pix_offset: ImVec2Like, clamp: bool, fmt: str) -> None:
  1774. pass
  1775. # Shows a x-axis tag at the specified coordinate value.
  1776. # IMPLOT_API void TagX(double x, const ImVec4& col, bool round = false); /* original C++ signature */
  1777. @overload
  1778. def tag_x(x: float, col: ImVec4Like, round: bool = False) -> None:
  1779. pass
  1780. # IMPLOT_API void TagX(double x, const ImVec4& col, const char* fmt, ...) ; /* original C++ signature */
  1781. @overload
  1782. def tag_x(x: float, col: ImVec4Like, fmt: str) -> None:
  1783. pass
  1784. # Shows a y-axis tag at the specified coordinate value.
  1785. # IMPLOT_API void TagY(double y, const ImVec4& col, bool round = false); /* original C++ signature */
  1786. @overload
  1787. def tag_y(y: float, col: ImVec4Like, round: bool = False) -> None:
  1788. pass
  1789. # IMPLOT_API void TagY(double y, const ImVec4& col, const char* fmt, ...) ; /* original C++ signature */
  1790. @overload
  1791. def tag_y(y: float, col: ImVec4Like, fmt: str) -> None:
  1792. pass
  1793. # -----------------------------------------------------------------------------
  1794. # [SECTION] Plot Utils
  1795. # -----------------------------------------------------------------------------
  1796. # Select which axis/axes will be used for subsequent plot elements.
  1797. # IMPLOT_API void SetAxis(ImAxis axis); /* original C++ signature */
  1798. def set_axis(axis: ImAxis) -> None:
  1799. pass
  1800. # IMPLOT_API void SetAxes(ImAxis x_axis, ImAxis y_axis); /* original C++ signature */
  1801. def set_axes(x_axis: ImAxis, y_axis: ImAxis) -> None:
  1802. pass
  1803. # Convert pixels to a position in the current plot's coordinate system. Passing IMPLOT_AUTO uses the current axes.
  1804. # IMPLOT_API ImPlotPoint PixelsToPlot(const ImVec2& pix, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO); /* original C++ signature */
  1805. @overload
  1806. def pixels_to_plot(pix: ImVec2Like, x_axis: Optional[ImAxis] = None, y_axis: Optional[ImAxis] = None) -> Point:
  1807. """Python bindings defaults:
  1808. If any of the params below is None, then its default value below will be used:
  1809. * x_axis: IMPLOT_AUTO
  1810. * y_axis: IMPLOT_AUTO
  1811. """
  1812. pass
  1813. # IMPLOT_API ImPlotPoint PixelsToPlot(float x, float y, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO); /* original C++ signature */
  1814. @overload
  1815. def pixels_to_plot(x: float, y: float, x_axis: Optional[ImAxis] = None, y_axis: Optional[ImAxis] = None) -> Point:
  1816. """Python bindings defaults:
  1817. If any of the params below is None, then its default value below will be used:
  1818. * x_axis: IMPLOT_AUTO
  1819. * y_axis: IMPLOT_AUTO
  1820. """
  1821. pass
  1822. # Convert a position in the current plot's coordinate system to pixels. Passing IMPLOT_AUTO uses the current axes.
  1823. # IMPLOT_API ImVec2 PlotToPixels(const ImPlotPoint& plt, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO); /* original C++ signature */
  1824. @overload
  1825. def plot_to_pixels(plt: Point, x_axis: Optional[ImAxis] = None, y_axis: Optional[ImAxis] = None) -> ImVec2:
  1826. """Python bindings defaults:
  1827. If any of the params below is None, then its default value below will be used:
  1828. * x_axis: IMPLOT_AUTO
  1829. * y_axis: IMPLOT_AUTO
  1830. """
  1831. pass
  1832. # IMPLOT_API ImVec2 PlotToPixels(double x, double y, ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO); /* original C++ signature */
  1833. @overload
  1834. def plot_to_pixels(x: float, y: float, x_axis: Optional[ImAxis] = None, y_axis: Optional[ImAxis] = None) -> ImVec2:
  1835. """Python bindings defaults:
  1836. If any of the params below is None, then its default value below will be used:
  1837. * x_axis: IMPLOT_AUTO
  1838. * y_axis: IMPLOT_AUTO
  1839. """
  1840. pass
  1841. # IMPLOT_API ImVec2 GetPlotPos(); /* original C++ signature */
  1842. def get_plot_pos() -> ImVec2:
  1843. """Get the current Plot position (top-left) in pixels."""
  1844. pass
  1845. # IMPLOT_API ImVec2 GetPlotSize(); /* original C++ signature */
  1846. def get_plot_size() -> ImVec2:
  1847. """Get the current Plot size in pixels."""
  1848. pass
  1849. # IMPLOT_API ImPlotPoint GetPlotMousePos(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO); /* original C++ signature */
  1850. def get_plot_mouse_pos(x_axis: Optional[ImAxis] = None, y_axis: Optional[ImAxis] = None) -> Point:
  1851. """Returns the mouse position in x,y coordinates of the current plot. Passing IMPLOT_AUTO uses the current axes.
  1852. Python bindings defaults:
  1853. If any of the params below is None, then its default value below will be used:
  1854. * x_axis: IMPLOT_AUTO
  1855. * y_axis: IMPLOT_AUTO
  1856. """
  1857. pass
  1858. # IMPLOT_API ImPlotRect GetPlotLimits(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO); /* original C++ signature */
  1859. def get_plot_limits(x_axis: Optional[ImAxis] = None, y_axis: Optional[ImAxis] = None) -> Rect:
  1860. """Returns the current plot axis range.
  1861. Python bindings defaults:
  1862. If any of the params below is None, then its default value below will be used:
  1863. * x_axis: IMPLOT_AUTO
  1864. * y_axis: IMPLOT_AUTO
  1865. """
  1866. pass
  1867. # IMPLOT_API bool IsPlotHovered(); /* original C++ signature */
  1868. def is_plot_hovered() -> bool:
  1869. """Returns True if the plot area in the current plot is hovered."""
  1870. pass
  1871. # IMPLOT_API bool IsAxisHovered(ImAxis axis); /* original C++ signature */
  1872. def is_axis_hovered(axis: ImAxis) -> bool:
  1873. """Returns True if the axis label area in the current plot is hovered."""
  1874. pass
  1875. # IMPLOT_API bool IsSubplotsHovered(); /* original C++ signature */
  1876. def is_subplots_hovered() -> bool:
  1877. """Returns True if the bounding frame of a subplot is hovered."""
  1878. pass
  1879. # IMPLOT_API bool IsPlotSelected(); /* original C++ signature */
  1880. def is_plot_selected() -> bool:
  1881. """Returns True if the current plot is being box selected."""
  1882. pass
  1883. # IMPLOT_API ImPlotRect GetPlotSelection(ImAxis x_axis = IMPLOT_AUTO, ImAxis y_axis = IMPLOT_AUTO); /* original C++ signature */
  1884. def get_plot_selection(x_axis: Optional[ImAxis] = None, y_axis: Optional[ImAxis] = None) -> Rect:
  1885. """Returns the current plot box selection bounds. Passing IMPLOT_AUTO uses the current axes.
  1886. Python bindings defaults:
  1887. If any of the params below is None, then its default value below will be used:
  1888. * x_axis: IMPLOT_AUTO
  1889. * y_axis: IMPLOT_AUTO
  1890. """
  1891. pass
  1892. # IMPLOT_API void CancelPlotSelection(); /* original C++ signature */
  1893. def cancel_plot_selection() -> None:
  1894. """Cancels a the current plot box selection."""
  1895. pass
  1896. # IMPLOT_API void HideNextItem(bool hidden = true, ImPlotCond cond = ImPlotCond_Once); /* original C++ signature */
  1897. def hide_next_item(hidden: bool = True, cond: Optional[Cond] = None) -> None:
  1898. """Hides or shows the next plot item (i.e. as if it were toggled from the legend).
  1899. Use ImPlotCond_Always if you need to forcefully set this every frame.
  1900. Python bindings defaults:
  1901. If cond is None, then its default value will be: Cond_Once
  1902. """
  1903. pass
  1904. # Use the following around calls to Begin/EndPlot to align l/r/t/b padding.
  1905. # Consider using Begin/EndSubplots first. They are more feature rich and
  1906. # accomplish the same behaviour by default. The functions below offer lower
  1907. # level control of plot alignment.
  1908. # IMPLOT_API bool BeginAlignedPlots(const char* group_id, bool vertical = true); /* original C++ signature */
  1909. def begin_aligned_plots(group_id: str, vertical: bool = True) -> bool:
  1910. """Align axis padding over multiple plots in a single row or column. #group_id must
  1911. be unique. If this function returns True, EndAlignedPlots() must be called.
  1912. """
  1913. pass
  1914. # IMPLOT_API void EndAlignedPlots(); /* original C++ signature */
  1915. def end_aligned_plots() -> None:
  1916. """Only call EndAlignedPlots() if BeginAlignedPlots() returns True!"""
  1917. pass
  1918. # -----------------------------------------------------------------------------
  1919. # [SECTION] Legend Utils
  1920. # -----------------------------------------------------------------------------
  1921. # IMPLOT_API bool BeginLegendPopup(const char* label_id, ImGuiMouseButton mouse_button=1); /* original C++ signature */
  1922. def begin_legend_popup(label_id: str, mouse_button: MouseButton = 1) -> bool:
  1923. """Begin a popup for a legend entry."""
  1924. pass
  1925. # IMPLOT_API void EndLegendPopup(); /* original C++ signature */
  1926. def end_legend_popup() -> None:
  1927. """End a popup for a legend entry."""
  1928. pass
  1929. # IMPLOT_API bool IsLegendEntryHovered(const char* label_id); /* original C++ signature */
  1930. def is_legend_entry_hovered(label_id: str) -> bool:
  1931. """Returns True if a plot item legend entry is hovered."""
  1932. pass
  1933. # -----------------------------------------------------------------------------
  1934. # [SECTION] Drag and Drop
  1935. # -----------------------------------------------------------------------------
  1936. # IMPLOT_API bool BeginDragDropTargetPlot(); /* original C++ signature */
  1937. def begin_drag_drop_target_plot() -> bool:
  1938. """Turns the current plot's plotting area into a drag and drop target. Don't forget to call EndDragDropTarget!"""
  1939. pass
  1940. # IMPLOT_API bool BeginDragDropTargetAxis(ImAxis axis); /* original C++ signature */
  1941. def begin_drag_drop_target_axis(axis: ImAxis) -> bool:
  1942. """Turns the current plot's X-axis into a drag and drop target. Don't forget to call EndDragDropTarget!"""
  1943. pass
  1944. # IMPLOT_API bool BeginDragDropTargetLegend(); /* original C++ signature */
  1945. def begin_drag_drop_target_legend() -> bool:
  1946. """Turns the current plot's legend into a drag and drop target. Don't forget to call EndDragDropTarget!"""
  1947. pass
  1948. # IMPLOT_API void EndDragDropTarget(); /* original C++ signature */
  1949. def end_drag_drop_target() -> None:
  1950. """Ends a drag and drop target (currently just an alias for ImGui::EndDragDropTarget)."""
  1951. pass
  1952. # NB: By default, plot and axes drag and drop *sources* require holding the Ctrl modifier to initiate the drag.
  1953. # You can change the modifier if desired. If ImGuiMod_None is provided, the axes will be locked from panning.
  1954. # IMPLOT_API bool BeginDragDropSourcePlot(ImGuiDragDropFlags flags=0); /* original C++ signature */
  1955. def begin_drag_drop_source_plot(flags: DragDropFlags = 0) -> bool:
  1956. """Turns the current plot's plotting area into a drag and drop source. You must hold Ctrl. Don't forget to call EndDragDropSource!"""
  1957. pass
  1958. # IMPLOT_API bool BeginDragDropSourceAxis(ImAxis axis, ImGuiDragDropFlags flags=0); /* original C++ signature */
  1959. def begin_drag_drop_source_axis(axis: ImAxis, flags: DragDropFlags = 0) -> bool:
  1960. """Turns the current plot's X-axis into a drag and drop source. You must hold Ctrl. Don't forget to call EndDragDropSource!"""
  1961. pass
  1962. # IMPLOT_API bool BeginDragDropSourceItem(const char* label_id, ImGuiDragDropFlags flags=0); /* original C++ signature */
  1963. def begin_drag_drop_source_item(label_id: str, flags: DragDropFlags = 0) -> bool:
  1964. """Turns an item in the current plot's legend into drag and drop source. Don't forget to call EndDragDropSource!"""
  1965. pass
  1966. # IMPLOT_API void EndDragDropSource(); /* original C++ signature */
  1967. def end_drag_drop_source() -> None:
  1968. """Ends a drag and drop source (currently just an alias for ImGui::EndDragDropSource)."""
  1969. pass
  1970. # -----------------------------------------------------------------------------
  1971. # [SECTION] Styling
  1972. # -----------------------------------------------------------------------------
  1973. # Styling colors in ImPlot works similarly to styling colors in ImGui, but
  1974. # with one important difference. Like ImGui, all style colors are stored in an
  1975. # indexable array in ImPlotStyle. You can permanently modify these values through
  1976. # GetStyle().Colors, or temporarily modify them with Push/Pop functions below.
  1977. # However, by default all style colors in ImPlot default to a special color
  1978. # IMPLOT_AUTO_COL. IMPLOT_AUTO_COL tells ImPlot to set that color from color data
  1979. # in your **ImGuiStyle**. The ImGuiCol_ that these style colors default to are
  1980. # detailed above, and in general have been mapped to produce plots visually
  1981. # consistent with your current ImGui style. Of course, you are free to
  1982. # manually set these colors to whatever you like, and further can Push/Pop
  1983. # them around individual plots for plot-specific styling (e.g. coloring axes).
  1984. # Provides access to plot style structure for permanent modifications to colors, sizes, etc.
  1985. # IMPLOT_API ImPlotStyle& GetStyle(); /* original C++ signature */
  1986. def get_style() -> Style:
  1987. pass
  1988. # IMPLOT_API void SetStyle(const ImPlotStyle& style); /* original C++ signature */
  1989. def set_style(style: Style) -> None:
  1990. pass
  1991. # IMPLOT_API void StyleColorsAuto(ImPlotStyle* dst = nullptr); /* original C++ signature */
  1992. def style_colors_auto(dst: Optional[Style] = None) -> None:
  1993. """Style plot colors for current ImGui style (default)."""
  1994. pass
  1995. # IMPLOT_API void StyleColorsClassic(ImPlotStyle* dst = nullptr); /* original C++ signature */
  1996. def style_colors_classic(dst: Optional[Style] = None) -> None:
  1997. """Style plot colors for ImGui "Classic"."""
  1998. pass
  1999. # IMPLOT_API void StyleColorsDark(ImPlotStyle* dst = nullptr); /* original C++ signature */
  2000. def style_colors_dark(dst: Optional[Style] = None) -> None:
  2001. """Style plot colors for ImGui "Dark"."""
  2002. pass
  2003. # IMPLOT_API void StyleColorsLight(ImPlotStyle* dst = nullptr); /* original C++ signature */
  2004. def style_colors_light(dst: Optional[Style] = None) -> None:
  2005. """Style plot colors for ImGui "Light"."""
  2006. pass
  2007. # Use PushStyleX to temporarily modify your ImPlotStyle. The modification
  2008. # will last until the matching call to PopStyleX. You MUST call a pop for
  2009. # every push, otherwise you will leak memory! This behaves just like ImGui.
  2010. # Temporarily modify a style color. Don't forget to call PopStyleColor!
  2011. # IMPLOT_API void PushStyleColor(ImPlotCol idx, ImU32 col); /* original C++ signature */
  2012. @overload
  2013. def push_style_color(idx: Col, col: ImU32) -> None:
  2014. pass
  2015. # IMPLOT_API void PushStyleColor(ImPlotCol idx, const ImVec4& col); /* original C++ signature */
  2016. @overload
  2017. def push_style_color(idx: Col, col: ImVec4Like) -> None:
  2018. pass
  2019. # IMPLOT_API void PopStyleColor(int count = 1); /* original C++ signature */
  2020. def pop_style_color(count: int = 1) -> None:
  2021. """Undo temporary style color modification(s). Undo multiple pushes at once by increasing count."""
  2022. pass
  2023. # IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, int val); /* original C++ signature */
  2024. @overload
  2025. def push_style_var(idx: StyleVar, val: int) -> None:
  2026. """Temporarily modify a style variable of int type. Don't forget to call PopStyleVar!"""
  2027. pass
  2028. # IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, float val); /* original C++ signature */
  2029. @overload
  2030. def push_style_var(idx: StyleVar, val: float) -> None:
  2031. """Temporarily modify a style variable of float type. Don't forget to call PopStyleVar!"""
  2032. pass
  2033. # IMPLOT_API void PushStyleVar(ImPlotStyleVar idx, const ImVec2& val); /* original C++ signature */
  2034. @overload
  2035. def push_style_var(idx: StyleVar, val: ImVec2Like) -> None:
  2036. """Temporarily modify a style variable of ImVec2 type. Don't forget to call PopStyleVar!"""
  2037. pass
  2038. # IMPLOT_API void PopStyleVar(int count = 1); /* original C++ signature */
  2039. def pop_style_var(count: int = 1) -> None:
  2040. """Undo temporary style variable modification(s). Undo multiple pushes at once by increasing count."""
  2041. pass
  2042. # IMPLOT_API ImVec4 GetLastItemColor(); /* original C++ signature */
  2043. def get_last_item_color() -> ImVec4:
  2044. """Gets the last item primary color (i.e. its legend icon color)"""
  2045. pass
  2046. # IMPLOT_API const char* GetStyleColorName(ImPlotCol idx); /* original C++ signature */
  2047. def get_style_color_name(idx: Col) -> str:
  2048. """Returns the null terminated string name for an ImPlotCol."""
  2049. pass
  2050. # IMPLOT_API const char* GetMarkerName(ImPlotMarker idx); /* original C++ signature */
  2051. def get_marker_name(idx: Marker) -> str:
  2052. """Returns the null terminated string name for an ImPlotMarker."""
  2053. pass
  2054. # IMPLOT_API ImPlotMarker NextMarker(); /* original C++ signature */
  2055. def next_marker() -> Marker:
  2056. """Returns the next marker and advances the marker for the current plot. You need to call this between Begin/EndPlot!"""
  2057. pass
  2058. # -----------------------------------------------------------------------------
  2059. # [SECTION] Colormaps
  2060. # -----------------------------------------------------------------------------
  2061. # Item styling is based on colormaps when the relevant ImPlotCol_XXX is set to
  2062. # IMPLOT_AUTO_COL (default). Several built-in colormaps are available. You can
  2063. # add and then push/pop your own colormaps as well. To permanently set a colormap,
  2064. # modify the Colormap index member of your ImPlotStyle.
  2065. # Colormap data will be ignored and a custom color will be used if you have done one of the following:
  2066. # 1) Modified an item style color in your ImPlotStyle to anything other than IMPLOT_AUTO_COL.
  2067. # 2) Pushed an item style color using PushStyleColor().
  2068. # 3) Set the next item style with a SetNextXXXStyle function.
  2069. # Add a new colormap. The color data will be copied. The colormap can be used by pushing either the returned index or the
  2070. # string name with PushColormap. The colormap name must be unique and the size must be greater than 1. You will receive
  2071. # an assert otherwise! By default colormaps are considered to be qualitative (i.e. discrete). If you want to create a
  2072. # continuous colormap, set #qual=False. This will treat the colors you provide as keys, and ImPlot will build a linearly
  2073. # interpolated lookup table. The memory footprint of this table will be exactly ((size-1)*255+1)*4 bytes.
  2074. # IMPLOT_API int GetColormapCount(); /* original C++ signature */
  2075. def get_colormap_count() -> int:
  2076. """Returns the number of available colormaps (i.e. the built-in + user-added count)."""
  2077. pass
  2078. # IMPLOT_API const char* GetColormapName(ImPlotColormap cmap); /* original C++ signature */
  2079. def get_colormap_name(cmap: Colormap) -> str:
  2080. """Returns a null terminated string name for a colormap given an index. Returns None if index is invalid."""
  2081. pass
  2082. # IMPLOT_API ImPlotColormap GetColormapIndex(const char* name); /* original C++ signature */
  2083. def get_colormap_index(name: str) -> Colormap:
  2084. """Returns an index number for a colormap given a valid string name. Returns -1 if name is invalid."""
  2085. pass
  2086. # IMPLOT_API void PushColormap(ImPlotColormap cmap); /* original C++ signature */
  2087. @overload
  2088. def push_colormap(cmap: Colormap) -> None:
  2089. """Temporarily switch to one of the built-in (i.e. ImPlotColormap_XXX) or user-added colormaps (i.e. a return value of AddColormap). Don't forget to call PopColormap!"""
  2090. pass
  2091. # IMPLOT_API void PushColormap(const char* name); /* original C++ signature */
  2092. @overload
  2093. def push_colormap(name: str) -> None:
  2094. """Push a colormap by string name. Use built-in names such as "Default", "Deep", "Jet", etc. or a string you provided to AddColormap. Don't forget to call PopColormap!"""
  2095. pass
  2096. # IMPLOT_API void PopColormap(int count = 1); /* original C++ signature */
  2097. def pop_colormap(count: int = 1) -> None:
  2098. """Undo temporary colormap modification(s). Undo multiple pushes at once by increasing count."""
  2099. pass
  2100. # IMPLOT_API ImVec4 NextColormapColor(); /* original C++ signature */
  2101. def next_colormap_color() -> ImVec4:
  2102. """Returns the next color from the current colormap and advances the colormap for the current plot.
  2103. Can also be used with no return value to skip colors if desired. You need to call this between Begin/EndPlot!
  2104. """
  2105. pass
  2106. # Colormap utils. If cmap = IMPLOT_AUTO (default), the current colormap is assumed.
  2107. # Pass an explicit colormap index (built-in or user-added) to specify otherwise.
  2108. # IMPLOT_API int GetColormapSize(ImPlotColormap cmap = IMPLOT_AUTO); /* original C++ signature */
  2109. def get_colormap_size(cmap: Optional[Colormap] = None) -> int:
  2110. """Returns the size of a colormap.
  2111. Python bindings defaults:
  2112. If cmap is None, then its default value will be: IMPLOT_AUTO
  2113. """
  2114. pass
  2115. # IMPLOT_API ImVec4 GetColormapColor(int idx, ImPlotColormap cmap = IMPLOT_AUTO); /* original C++ signature */
  2116. def get_colormap_color(idx: int, cmap: Optional[Colormap] = None) -> ImVec4:
  2117. """Returns a color from a colormap given an index >= 0 (modulo will be performed).
  2118. Python bindings defaults:
  2119. If cmap is None, then its default value will be: IMPLOT_AUTO
  2120. """
  2121. pass
  2122. # IMPLOT_API ImVec4 SampleColormap(float t, ImPlotColormap cmap = IMPLOT_AUTO); /* original C++ signature */
  2123. def sample_colormap(t: float, cmap: Optional[Colormap] = None) -> ImVec4:
  2124. """Sample a color from the current colormap given t between 0 and 1.
  2125. Python bindings defaults:
  2126. If cmap is None, then its default value will be: IMPLOT_AUTO
  2127. """
  2128. pass
  2129. # IMPLOT_API void ColormapScale(const char* label, double scale_min, double scale_max, const ImVec2& size = ImVec2(0,0), const char* format = "%g", ImPlotColormapScaleFlags flags = 0, ImPlotColormap cmap = IMPLOT_AUTO); /* original C++ signature */
  2130. def colormap_scale(
  2131. label: str,
  2132. scale_min: float,
  2133. scale_max: float,
  2134. size: Optional[ImVec2Like] = None,
  2135. format: str = "%g",
  2136. flags: ColormapScaleFlags = 0,
  2137. cmap: Optional[Colormap] = None,
  2138. ) -> None:
  2139. """Shows a vertical color scale with linear spaced ticks using the specified color map. Use double hashes to hide label (e.g. "##NoLabel"). If scale_min > scale_max, the scale to color mapping will be reversed.
  2140. Python bindings defaults:
  2141. If any of the params below is None, then its default value below will be used:
  2142. * size: ImVec2(0,0)
  2143. * cmap: IMPLOT_AUTO
  2144. """
  2145. pass
  2146. # IMPLOT_API bool ColormapSlider(const char* label, float* t, ImVec4* out = nullptr, const char* format = "", ImPlotColormap cmap = IMPLOT_AUTO); /* original C++ signature */
  2147. def colormap_slider(
  2148. label: str, t: float, out: Optional[ImVec4Like] = None, format: str = "", cmap: Optional[Colormap] = None
  2149. ) -> Tuple[bool, float]:
  2150. """Shows a horizontal slider with a colormap gradient background. Optionally returns the color sampled at t in [0 1].
  2151. Python bindings defaults:
  2152. If cmap is None, then its default value will be: IMPLOT_AUTO
  2153. """
  2154. pass
  2155. # IMPLOT_API bool ColormapButton(const char* label, const ImVec2& size = ImVec2(0,0), ImPlotColormap cmap = IMPLOT_AUTO); /* original C++ signature */
  2156. def colormap_button(label: str, size: Optional[ImVec2Like] = None, cmap: Optional[Colormap] = None) -> bool:
  2157. """Shows a button with a colormap gradient background.
  2158. Python bindings defaults:
  2159. If any of the params below is None, then its default value below will be used:
  2160. * size: ImVec2(0,0)
  2161. * cmap: IMPLOT_AUTO
  2162. """
  2163. pass
  2164. # IMPLOT_API void BustColorCache(const char* plot_title_id = nullptr); /* original C++ signature */
  2165. def bust_color_cache(plot_title_id: Optional[str] = None) -> None:
  2166. """When items in a plot sample their color from a colormap, the color is cached and does not change
  2167. unless explicitly overridden. Therefore, if you change the colormap after the item has already been plotted,
  2168. item colors will NOT update. If you need item colors to resample the new colormap, then use this
  2169. function to bust the cached colors. If #plot_title_id is None, then every item in EVERY existing plot
  2170. will be cache busted. Otherwise only the plot specified by #plot_title_id will be busted. For the
  2171. latter, this function must be called in the same ImGui ID scope that the plot is in. You should rarely if ever
  2172. need this function, but it is available for applications that require runtime colormap swaps (e.g. Heatmaps demo).
  2173. """
  2174. pass
  2175. # -----------------------------------------------------------------------------
  2176. # [SECTION] Input Mapping
  2177. # -----------------------------------------------------------------------------
  2178. # IMPLOT_API ImPlotInputMap& GetInputMap(); /* original C++ signature */
  2179. def get_input_map() -> InputMap:
  2180. """Provides access to input mapping structure for permanent modifications to controls for pan, select, etc."""
  2181. pass
  2182. # IMPLOT_API void MapInputDefault(ImPlotInputMap* dst = nullptr); /* original C++ signature */
  2183. def map_input_default(dst: Optional[InputMap] = None) -> None:
  2184. """Default input mapping: pan = LMB drag, box select = RMB drag, fit = LMB double click, context menu = RMB click, zoom = scroll."""
  2185. pass
  2186. # IMPLOT_API void MapInputReverse(ImPlotInputMap* dst = nullptr); /* original C++ signature */
  2187. def map_input_reverse(dst: Optional[InputMap] = None) -> None:
  2188. """Reverse input mapping: pan = RMB drag, box select = LMB drag, fit = LMB double click, context menu = RMB click, zoom = scroll."""
  2189. pass
  2190. # -----------------------------------------------------------------------------
  2191. # [SECTION] Miscellaneous
  2192. # -----------------------------------------------------------------------------
  2193. # Render icons similar to those that appear in legends (nifty for data lists).
  2194. # IMPLOT_API void ItemIcon(const ImVec4& col); /* original C++ signature */
  2195. @overload
  2196. def item_icon(col: ImVec4Like) -> None:
  2197. pass
  2198. # IMPLOT_API void ItemIcon(ImU32 col); /* original C++ signature */
  2199. @overload
  2200. def item_icon(col: ImU32) -> None:
  2201. pass
  2202. # IMPLOT_API void ColormapIcon(ImPlotColormap cmap); /* original C++ signature */
  2203. def colormap_icon(cmap: Colormap) -> None:
  2204. pass
  2205. # IMPLOT_API ImDrawList* GetPlotDrawList(); /* original C++ signature */
  2206. def get_plot_draw_list() -> ImDrawList:
  2207. """Get the plot draw list for custom rendering to the current plot area. Call between Begin/EndPlot."""
  2208. pass
  2209. # IMPLOT_API void PushPlotClipRect(float expand=0); /* original C++ signature */
  2210. def push_plot_clip_rect(expand: float = 0) -> None:
  2211. """Push clip rect for rendering to current plot area. The rect can be expanded or contracted by #expand pixels. Call between Begin/EndPlot."""
  2212. pass
  2213. # IMPLOT_API void PopPlotClipRect(); /* original C++ signature */
  2214. def pop_plot_clip_rect() -> None:
  2215. """Pop plot clip rect. Call between Begin/EndPlot."""
  2216. pass
  2217. # IMPLOT_API bool ShowStyleSelector(const char* label); /* original C++ signature */
  2218. def show_style_selector(label: str) -> bool:
  2219. """Shows ImPlot style selector dropdown menu."""
  2220. pass
  2221. # IMPLOT_API bool ShowColormapSelector(const char* label); /* original C++ signature */
  2222. def show_colormap_selector(label: str) -> bool:
  2223. """Shows ImPlot colormap selector dropdown menu."""
  2224. pass
  2225. # IMPLOT_API bool ShowInputMapSelector(const char* label); /* original C++ signature */
  2226. def show_input_map_selector(label: str) -> bool:
  2227. """Shows ImPlot input map selector dropdown menu."""
  2228. pass
  2229. # IMPLOT_API void ShowStyleEditor(ImPlotStyle* ref = nullptr); /* original C++ signature */
  2230. def show_style_editor(ref: Optional[Style] = None) -> None:
  2231. """Shows ImPlot style editor block (not a window)."""
  2232. pass
  2233. # IMPLOT_API void ShowUserGuide(); /* original C++ signature */
  2234. def show_user_guide() -> None:
  2235. """Add basic help/info block for end users (not a window)."""
  2236. pass
  2237. # IMPLOT_API void ShowMetricsWindow(bool* p_popen = nullptr); /* original C++ signature */
  2238. def show_metrics_window(p_popen: Optional[bool] = None) -> Optional[bool]:
  2239. """Shows ImPlot metrics/debug information window."""
  2240. pass
  2241. # -----------------------------------------------------------------------------
  2242. # [SECTION] Demo
  2243. # -----------------------------------------------------------------------------
  2244. # IMPLOT_API void ShowDemoWindow(bool* p_open = nullptr); /* original C++ signature */
  2245. def show_demo_window(p_open: Optional[bool] = None) -> Optional[bool]:
  2246. """Shows the ImPlot demo window (add implot_demo.cpp to your sources!)"""
  2247. pass
  2248. # IMPLOT_API void ShowDemoWindow_MaybeDocked(bool create_window, bool* p_open = NULL, ImGuiWindowFlags initial_extra_flags = 0, ImVec2 window_pos = ImVec2(0, 0), ImVec2 window_size = ImVec2(0, 0)); /* original C++ signature */
  2249. def show_demo_window_maybe_docked(
  2250. create_window: bool,
  2251. p_open: Optional[bool] = None,
  2252. initial_extra_flags: WindowFlags = 0,
  2253. window_pos: Optional[ImVec2Like] = None,
  2254. window_size: Optional[ImVec2Like] = None,
  2255. ) -> Optional[bool]:
  2256. """Bundle: ShowDemoWindow_MaybeDocked is ShowDemoWindow, but can be used without creating an ImGui window.
  2257. Python bindings defaults:
  2258. If any of the params below is None, then its default value below will be used:
  2259. * window_pos: ImVec2(0, 0)
  2260. * window_size: ImVec2(0, 0)
  2261. """
  2262. pass
  2263. # -----------------------------------------------------------------------------
  2264. # [SECTION] Obsolete API
  2265. # -----------------------------------------------------------------------------
  2266. # The following functions will be removed! Keep your copy of implot up to date!
  2267. # Occasionally set '#define IMPLOT_DISABLE_OBSOLETE_FUNCTIONS' to stay ahead.
  2268. # If you absolutely must use these functions and do not want to receive compiler
  2269. # warnings, set '#define IMPLOT_DISABLE_OBSOLETE_WARNINGS'.
  2270. # #endif
  2271. #################### </generated_from:implot.h> ####################
  2272. # </litgen_stub>
  2273. # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AUTOGENERATED CODE END !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2274. ###############################################################################
  2275. # MANUAL BINDINGS BELOW
  2276. ###############################################################################
  2277. # Add a new colormap. The color data will be copied. The colormap can be used by pushing either the returned index or the
  2278. # string name with PushColormap. The colormap name must be unique and the size must be greater than 1. You will receive
  2279. # an assert otherwise! By default, colormaps are considered to be qualitative (i.e. discrete). If you want to create a
  2280. # continuous colormap, set #qual=False. This will treat the colors you provide as keys, and ImPlot will build a linearly
  2281. # interpolated lookup table. The memory footprint of this table will be exactly ((size-1)*255+1)*4 bytes.
  2282. #
  2283. # Warning:
  2284. # The colormap 'cols' must either be a 1D array of type uint32 (if using hexadecimal colors),
  2285. # or a 2D (Nx4 ->RGBA) array of type float32 (if using float values between 0 and 1)
  2286. def add_colormap(name: str, cols: np.ndarray, qual: bool = True) -> Colormap:
  2287. pass
  2288. # Sets an axis' ticks and optionally the labels for the next plot. To keep the default ticks, set #keep_default=true.
  2289. # IMPLOT_API void SetupAxisTicks(ImAxis axis, double v_min, double v_max, int n_ticks, const char* const labels[]=nullptr, bool keep_default=false);
  2290. @overload
  2291. def setup_axis_ticks(
  2292. axis: ImAxis,
  2293. v_min: float,
  2294. v_max: float,
  2295. n_ticks: int,
  2296. labels: List[str] | None = None,
  2297. keep_default: bool = False,
  2298. ) -> None:
  2299. pass
  2300. # Sets an axis' ticks and optionally the labels for the next plot. To keep the default ticks, set #keep_default=true.
  2301. # IMPLOT_API void SetupAxisTicks(ImAxis axis, const double* values, int n_ticks, const char* const labels[]=nullptr, bool keep_default=false);
  2302. @overload
  2303. def setup_axis_ticks(
  2304. axis: ImAxis,
  2305. values: List[float],
  2306. labels: List[str] | None = None,
  2307. keep_default: bool = False,
  2308. ) -> None:
  2309. pass
  2310. # Plots a 2D heatmap chart. Values are expected to be in row-major order by default. Leave #scale_min and scale_max both at 0 for automatic color scaling, or set them to a predefined range. #label_fmt can be set to NULL for no labels.
  2311. # IMPLOT_TMP void PlotHeatmap(const char* label_id, const T* values, int rows, int cols, double scale_min=0, double scale_max=0, const char* label_fmt="%.1f", const ImPlotPoint& bounds_min=ImPlotPoint(0,0), const ImPlotPoint& bounds_max=ImPlotPoint(1,1), ImPlotHeatmapFlags flags=0); /* original C++ signature */
  2312. def plot_heatmap(
  2313. label_id: str,
  2314. values: np.ndarray,
  2315. scale_min: float = 0.0,
  2316. scale_max: float = 0.0,
  2317. label_fmt: str = "%.1f",
  2318. bounds_min: Point = Point(0, 0),
  2319. bounds_max: Point = Point(1, 1),
  2320. spec: Spec = Spec(),
  2321. ) -> None:
  2322. pass
  2323. # ============================================================================
  2324. # OBSOLETED in v0.18 (from February 2026)
  2325. # ============================================================================
  2326. # The following functions have been REMOVED. Use Spec objects instead:
  2327. #
  2328. # set_next_line_style(col, weight)
  2329. # -> Use: spec=implot.Spec(line_color=col, line_weight=weight)
  2330. #
  2331. # set_next_fill_style(col, alpha_mod)
  2332. # -> Use: spec=implot.Spec(fill_color=col, fill_alpha=alpha_mod)
  2333. #
  2334. # set_next_marker_style(marker, size, fill, weight, outline)
  2335. # -> Use: spec=implot.Spec(marker=marker, marker_size=size,
  2336. # marker_fill_color=fill, line_weight=weight,
  2337. # marker_line_color=outline)
  2338. #
  2339. # set_next_error_bar_style(col, size, weight)
  2340. # -> Use: spec=implot.Spec(line_color=col, size=size, line_weight=weight)
  2341. #
  2342. # Example migration:
  2343. # # OLD (removed):
  2344. # implot.set_next_line_style(ImVec4(1,0,0,1), 2.0)
  2345. # implot.plot_line("data", xs, ys)
  2346. #
  2347. # # NEW:
  2348. # implot.plot_line("data", xs, ys,
  2349. # spec=implot.Spec(line_color=ImVec4(1,0,0,1),
  2350. # line_weight=2.0))
  2351. # ============================================================================