1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2025-04-22 08:18:50 -04:00

Compare commits

..

371 Commits
v0.3 ... master

Author SHA1 Message Date
omar 18758e237e
Avoid fetching GImPlot multiple times when possible. (#468)
In the case this is a thread_local variable it is best to avoid fetching too many times.
Either way local caching tends to be beneficial as a non-local variable would often be fetched multiple times.
2023-04-19 18:35:30 +02:00
Minty-Meeo fb084f3719
Use 'nullptr' instead of 'NULL' (#465) 2023-04-17 15:21:32 +02:00
omar 33c5a965f5
Fixes for requirement to define IMGUI_DEFINE_MATH_OPERATORS before imgui.h (or at least at imconfig) (#449) 2023-02-15 19:53:25 -06:00
Evan Pezent d875123534 make PlotText honor ImPlotItemFlags_NoFit 2022-11-25 09:31:58 -06:00
Joshua Minor fcb51d2c9c
Use snprintf instead of sprintf in implot_demo.cpp (#426)
* Use snprintf instead of sprintf in implot_demo.cpp

* Enlarged text buffer

Co-authored-by: BenBE <BenBE@geshi.org>

Co-authored-by: BenBE <BenBE@geshi.org>
2022-11-25 09:21:45 -06:00
omar 626e391670
Fixes for ImGuiModFlags_XXX -> ImGuiMod_XXX (v1.89) (#347) (#407)
Sorry!
2022-09-29 13:00:23 -05:00
omar 8879c99aef
Fix for allowing core imgui to use typed ImGuiCol / ImGuiStyleVar enums. (#405) 2022-09-23 19:30:19 -05:00
Evan Pezent 6978a3e177
Update README.md 2022-09-17 15:25:29 -05:00
Evan Pezent 15e494b76a Merge branch 'master' of https://github.com/epezent/implot 2022-09-17 15:02:47 -05:00
Evan Pezent f88ad32a47 remove mention of IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES in implot_items.cpp 2022-09-17 15:02:34 -05:00
Evan Pezent 3e13c95986
Add ImPlotLegendFlags_Sort (#404)
* add ImPlotLegendFlags_Sort

* replace qsort_s with qsort
2022-09-17 14:23:26 -05:00
Evan Pezent 4ba42f200a address a few static analysis warnings 2022-09-17 13:17:07 -05:00
Evan Pezent 57149164d5 Fix clamp in SetupAxisTicks 2022-09-17 10:25:30 -05:00
Evan Pezent 9ef3a97966 Merge branch 'master' of https://github.com/epezent/implot 2022-09-17 10:20:33 -05:00
Evan Pezent 921a81f307 Replace assert with clamp in SetupAxisTicks 2022-09-17 10:20:20 -05:00
Mengna Li 8c06ff0252
Add vcpkg installation instructions (#401)
* Add vcpkg installation instructions

* update
2022-09-15 07:00:13 -05:00
Pascal Thomet 98c76edbb4
Remove support for IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES (#402) 2022-09-14 09:41:10 -05:00
Pascal Thomet f719a180ff
Support custom numeric types (#399)
* implot_items.cpp: support types customization

You can customize the supported types in two ways:
  1. Define IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES at compile time to add support for all known types.
  2. Or, define IMPLOT_CUSTOM_NUMERIC_TYPES at compile time to define your own type list. As an example, you could use the compile time define given by the line below in order to support only float and double.
        -DIMPLOT_CUSTOM_NUMERIC_TYPES="(float)(double)"

Details:

- `CALL_INSTANTIATE_FOR_NUMERIC_TYPES` will duplicate the template instantion code `INSTANTIATE_MACRO(T)` on supported types. It uses a trick to be able to loop on the type list `IMPLOT_NUMERIC_TYPES`

- `INSTANTIATE_MACRO` needs to be defined, then undefined before and after each template instantiation

* CI: link example app, with null backend

Github's CI will now compile ImGui, compile ImPlot, link and run an example application (with no backend).
It serves as a proof that an app can be built, linked, and run, with type customization.

- .github/example_implot.cpp is an example app built with Dear ImGui and ImPlot
  This app uses implot and imgui, but does not output to any backend!
  If `IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES` is active, it will test that `long double` is supported.

- Corrected arch matrix options:
     32 bits or 64 bits for win and linux
     x86_64 or arm64 for mac (32 bits is deprecated on macs, and will not link with recent XCode)

- Added `IMPLOT_NUMERIC_SETIMPLOT_NUMERIC_SET` as a switch to CMakeList
  This switch is currently not used in CI, but can be used during development.
  It could be later be used in the matrix options, at the cost of increasing the number of build
   per workflow.

Note: support for MingW 32 bits was commented out. MingW on Github CI does not fully support 32 bits: link fails when it tries to link 64 bits system libraries. As a result, the windows matrix was spearated into Windows_MSVC and Windows_MingW
2022-09-13 20:39:29 -05:00
Pascal Thomet 49db527db1
Support long & long double, add macro INSTANTIATE_FOR_NUMERIC_TYPES (Fix #319) (#397)
* implot_items: INSTANTIATE_FOR_NUMERIC_TYPES / add long & long double (Fix #319)

- INSTANTIATE_FOR_NUMERIC_TYPES is a macro which instantiates templated plotting functions for numeric types.
This macro helps reduce some boilerplate code for template functions instantiations.

- Added optional support for more numeric types (long and long double)
The numeric type list does not include "long", "unsigned long" and "long double".
Most of the time, it is not an issue when linking statically.
However, when linking dynamically, issues related to undefined functions can arise:
although those types might have the same size, they are considered separate.

define IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES) in order to define versions for those types

In this case, the compilation time for this specific file will be 33% longer

- implot_internal.h / ImMean and ImStdDev: added cast  to double
(suppress MSVC warning about downcasting)

- Notes about numeric types "synonyms":
  Even if "long double" and "double" might occupy the same size,
they are not complete synonyms, and it is legal to define overloads for both double and long double.
  On some platforms, "unsigned long" might be the same size as "unsigned long long",
but it is nonetheless a separate type: see https://godbolt.org/z/1KWv5re7q (example with GCC 64 bits)
  On some other platforms, "long double" might be the same size as "double", but it is nonetheless a separate type: see https://godbolt.org/z/ae71P7rqG (example with MSVC 64 bits)

* IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES: disabled by default

* uppercase template instantiatation macros & group them

* implot_items.cpp: reword comments on IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES

* README.md: mention compile-time option IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES

* Github CI: IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES=1
2022-09-11 09:43:27 -05:00
Rokas Kupstys fd16fe001c
CI setup (#395)
* Fix truncation warnings.

* CI: GitHub Actions CI setup.
2022-09-06 18:28:32 -05:00
Rokas Kupstys 002ffc95bc
Fix truncation warnings. (#392) 2022-09-06 18:17:09 -05:00
ozlb e80e42e8b4
ImPlotTimeFmt_MinSMs (#383) 2022-07-29 07:57:51 -05:00
ozlb 220f5c9ab4
Annotation Label y axis fix (#384) 2022-07-28 22:41:21 -05:00
Evan Pezent 7a470b2e17 add ImPlotAxisFlags_NoSideSwitch and ImPlotAxisFlags_NoHighlight 2022-07-07 20:27:24 -05:00
Evan Pezent f33a5990d7 Merge branch 'master' of https://github.com/epezent/implot 2022-07-07 19:04:24 -05:00
Evan Pezent 1fed5c2c19 temp fix for time formatted mouse position text 2022-07-07 19:04:16 -05:00
K b4aec718a5
fix merge typo in Locator_Time() (#380) 2022-07-07 18:31:05 -05:00
Evan Pezent 8c53333489 fix PlotDigital/Dummy flags 2022-07-04 19:30:36 -05:00
Evan Pezent fc0fd11246 ImPlotLineFlags_Shaded and ImPlotStairsFlags_Shaded 2022-06-22 11:00:42 -05:00
Evan Pezent 6c00109636 make ColormapScale reversable 2022-06-20 07:48:51 -05:00
Evan Pezent 0f4d4dccc3 add ImPlotColormapScaleFlags 2022-06-19 22:51:51 -05:00
Evan Pezent 6f4986b14f add ColormapSlider to demo 2022-06-19 21:14:36 -05:00
Evan Pezent dbb461db24 update README 2022-06-18 23:16:01 -05:00
Evan Pezent 63d5ed94b7
Features/item flags (#319)
* add PlotBarGroups and layout some plans for flags

* exprimentin

* item flags added to each plotter

* rendering templates

* rendering templates

* item flags and axis scales

* item flags

* template markers

* markers

* benching

* buffer

* inline adjust

* inline fix

* dunno

* fix some todos

* tickers

* clean up

* update TODO

* update breaking changes

* demo cleanup

* remove TODO label

* header cleanup
2022-06-18 22:59:32 -05:00
Rokas Kupstys 79b05d5e25
Fix freed memory read error in AddTicksTime(). Invalid read occurred when LabelTickTime() resizes ticks.TextBuffer while last_major held pointer pointing into old now freed buffer. (#365)
Fixed a warning about condition depending on uninitialized ImPlotLegend::PreviousLocation.
2022-06-17 09:09:25 -05:00
rjasiak54 b9c0a39b08
in README.md 'Demos' section, changed 'imgui_demo.h' to imgui_demo.cpp' (#369) 2022-06-17 09:06:38 -05:00
Evan Pezent 3dd7e75c7d gaurd IMPLOT_DISABLE_OBSOLETE_FUNCTIONS in implot_demo.cpp 2022-05-08 10:40:27 -05:00
Evan Pezent 947c2c02e4 gaurd IMPLOT_DISABLE_OBSOLETE_FUNCTIONS in implot_demo.cpp 2022-05-08 10:40:16 -05:00
Evan Pezent 32a4617cd6 fix legend icons and drag tools with ImGui::KeepAliveID 2022-05-08 10:23:42 -05:00
Max Schwarz 196a0243c5
ImPlotAxis::WillRender(): return false if axis is disabled (#350)
This saves a few CPU cycles in SetupFinish(), which otherwise formats
tick labels & spacing for disabled axes.
2022-04-20 20:19:39 -07:00
omar df4256c9e8
Demo: tweak for runtime speed. (#353) 2022-04-20 20:19:01 -07:00
omar 1160243218
Fix for 1.88 WIP (18716) renaming ImGuiKeyModFlags to ImGuiModFlags (#347) 2022-04-05 06:58:12 -07:00
Evan Pezent b47c8bacdb Merge branch 'master' of https://github.com/epezent/implot 2022-01-30 17:07:12 -08:00
Evan Pezent 58240e5311 remove redefinition of GetInputMap 2022-01-30 17:07:05 -08:00
Evan Pezent 9b4ba149ec
Update README.md 2022-01-30 10:47:33 -08:00
Evan Pezent f438a21813 fix comment find/replace accident 2022-01-30 10:26:21 -08:00
Evan Pezent 86f4dd6e5c use ImFormatString instead of sprintf/snprintf 2022-01-30 10:19:29 -08:00
Evan Pezent adfc96810e remove unecessary msvc warning disables 2022-01-30 10:08:55 -08:00
Evan Pezent 8d3bd31395 -Wformat-nonliteral 2022-01-30 10:06:39 -08:00
Evan Pezent 168244e422 replace sprintf with snprintf 2022-01-30 09:54:49 -08:00
Evan Pezent 3a53f0b796 init PixelMin/Max 2022-01-30 09:35:49 -08:00
Evan Pezent 199b4803b6 Merge branch 'sergeyn-pr_branch' 2022-01-30 09:32:07 -08:00
Sergey Nenakhov 6659b164fe intel compiler warning fixes (and fastmath in general) 2022-01-23 00:50:18 +01:00
Evan Pezent 4fcc6e01ac fix sizeof(T) in IndexData 2021-12-02 20:54:54 -08:00
Evan Pezent c0da6fea04 add PlotBarGroups 2021-10-24 00:25:46 -07:00
Evan Pezent 6ee1559715
Setup API (#294)
* add new padding algo

* opposite working for y and x

* remove name axis colors

* move title label rendering

* axis dev

* clean up

* pre formatter

* formatter

* changing over to multi x axes

* more multi x changes

* more multi x changes

* more multi x changes

* setup 75% there

* 85% there

* 85% there

* remove query

* update input handling

* input and dnd tweaking

* input testing

* update demo

* setup debug

* setup debug

* bug fixes

* bug fixes

* more debug

* input

* more setup

* setup api almost complete

* setup api almost complete

* more clean up

* cleanup

* final commit before merge
2021-10-19 20:01:06 -07:00
Evan Pezent dea3387cdc buffer overflow fix 2021-09-07 21:46:54 -07:00
Evan Pezent c40206f2ea spaces 2021-09-07 20:24:34 -07:00
Evan Pezent f1b86b9fe4 Merge branch 'master' of https://github.com/epezent/implot 2021-09-07 20:23:59 -07:00
Evan Pezent 5ed9e78676 add #include <immintrin.h> fallback 2021-09-07 20:20:12 -07:00
Dario Mambro 14d4c96d0c
more flexible custom context management (#281) 2021-08-28 07:00:47 -07:00
sergeyn 0fb3346a7a
custom context management (same way as in ImGui) (#278) 2021-08-24 08:08:00 -07:00
Evan Pezent 3e96fd7c02
improve indexing, line rendering performance by 45% (#270)
* add IndexData and Indexers

* simplify transformers

* 30% improvement

* moving around

* add TODO.md

* fix bar plot aliasing

* finishup indexing

* remove debug bools
2021-07-30 20:27:02 -07:00
Evan Pezent c8601ac0d5 rev version, fix unused lines 2021-07-29 19:14:13 -07:00
Jeslas Pravin 864ebb90b6
fix: PlotShaded Opposite triangle winding (#269) 2021-07-29 19:09:01 -07:00
Evan Pezent 4be83def59 add IsSubplotsHovered 2021-07-28 11:52:57 -07:00
Evan Pezent 507459fd5f move axis equal constraint after pixel determination 2021-07-23 16:32:57 -07:00
Evan Pezent 2dc2a4cfd5 improve tick label culling 2021-07-15 20:40:51 -07:00
Evan Pezent 83cb14b54a fix offsetandstride args...oops 2021-07-09 20:29:04 -07:00
Evan Pezent cd4704fd52 revert OffsetAndStride 2021-07-09 20:23:12 -07:00
Evan Pezent bffd448207 revert OffsetAndStride 2021-07-09 20:22:21 -07:00
Evan Pezent 51930a5ae6 fix imgui backward compat, YAxis[3], and add new demo benchmark option for LineG 2021-07-09 17:39:12 -07:00
Evan Pezent 5ab78cbc7d version string 2021-07-08 08:21:56 -07:00
Evan Pezent eb40cc908d Merge branch 'master' of https://github.com/epezent/implot 2021-07-07 22:18:51 -07:00
Evan Pezent 389781c31c v0.11 WIP 2021-07-07 22:18:38 -07:00
Evan Pezent 8c1bbf4d8d
Subplots (#203)
* SubPlots: Y axis padding over multiple plots

* Align Plots Group

new signature ID, ImPool  to store padding data, demo

* Align plots orientation (vertically, horizontally)

vertical will align Y axis, horizontal will align X axis.
*signature changed

* ImPlotOrientation used as flag for 2D grids of aligned plots

https://github.com/epezent/implot/pull/144#issuecomment-725849368

* AlignPlots updates to merge with v.0.9

* Sync to v0.9 20210127

* subplots proto

* make link flags work

* stuff

* add multi-line centered titles

* subplots work

* flag ideas

* better subplot positioning

* resizable subplots

* subplot shared items

* subplot ratios

* some cleanup and refactor

* some cleanup and refactor

* refactors and demo reorganization

* context menus...almost done!

* context menus, bug fixes

* active id

* make implot use ButtonBehavior throughout

* bug fixes

* more bug fixes

* tweaks

* fix id issue

* finish work on subplots

Co-authored-by: ozlb <ozlb@users.noreply.github.com>
2021-07-07 21:06:15 -07:00
Perry MacMurray 65aa2c8264
Update README.md with link to Java bindings (#257) 2021-06-22 21:37:58 -07:00
Evan Pezent ab24f756fa make pie plots respond to fits 2021-06-09 11:26:54 -07:00
Evan Pezent e9469cf347 constrain values <= 0 to DBL_MIN for log axes, fix div by zero 2021-06-08 20:31:30 -07:00
Evan Pezent 0cafcd0011 fix compiler warning in demo 2021-06-08 19:36:28 -07:00
Evan Pezent 3109940b46 handle equal axis edge case when user sets x limits 2021-06-06 21:13:40 -07:00
Evan Pezent 4edb1c75b6 fix GetColormapSize 2021-06-06 17:42:00 -07:00
Evan Pezent da1bf57136 fix scatter plot non-inclusive culling 2021-06-06 17:16:20 -07:00
Evan Pezent e966e0d2bc add warning to demo about 16-bit indices 2021-06-06 16:03:41 -07:00
omar 450e5b80df
Fix for ImPool change in Dear ImGui version 18303+ (#239) 2021-06-03 11:45:25 -07:00
Evan Pezent dd78125bfb
Update README.md 2021-06-02 08:06:31 -07:00
Jann 555ff688a8
add appropriate space for X tick labels with newlines (#214)
When painting a graph with densely labeled ticks on the X axis, it may be
necessary to add newlines in the labels to avoid label text overlap.

Reserve appropriate padding space for that.
2021-04-10 09:31:12 -07:00
epezent 04ae3728f8 fix smaplecolormapu32 2021-04-07 20:02:35 -07:00
epezent 27bc59eb43 fix linked axis and auto fitting issue #205 2021-03-30 16:23:21 -07:00
epezent 1d674e7557 range fit on candlestick demo 2021-03-28 13:10:03 -07:00
Evan Pezent 41a0e2c9fe
add ImPlotAxisFlags_RangeFit and ImPlotAxisFlags_Foreground (#200) 2021-03-28 12:59:25 -07:00
Evan Pezent 707a0bee36
Update README.md 2021-03-27 00:27:57 -07:00
Evan Pezent ed1baf471a
Adds SetNextPlotFormatX/Y for custom tick label formatting (#198)
* add SetNextPlotFormat

* work on pruning

* finish up fmt
2021-03-25 09:19:00 -06:00
epezent 4b0f9c9495 fix debug build error 2021-03-24 22:28:35 -06:00
epezent ab110ceec8 misc refactors/improvements 2021-03-24 16:35:44 -06:00
epezent e5c457b326 tidy up selection/query code, add new methods 2021-03-23 23:50:02 -06:00
epezent ef6c55cd00 tidy up selection/query code, add new methods 2021-03-23 23:42:26 -06:00
epezent 5db2ba3b22 make plots initially fit to plotted data on first frame 2021-03-20 22:56:47 -06:00
epezent 7aab224742 make inline funcs static, add culling to PlotShaded 2021-03-20 21:22:18 -06:00
epezent db6b0356ee Merge branch 'master' of https://github.com/epezent/implot 2021-03-20 20:45:38 -06:00
epezent ccd29a646f rev up to v0.10 2021-03-20 20:45:31 -06:00
Evan Pezent 95a530f05c
Update README.md 2021-03-19 23:17:34 -06:00
Evan Pezent eff70aeee0
Update README.md 2021-03-19 23:14:17 -06:00
epezent eea12d6b4c make PlotHeatmap autoscaling by default 2021-03-19 22:43:03 -06:00
Evan Pezent 1d9381a004
Adds PlotHistogram and PlotHistogram2D, Improves Colormaps and Heatmap (#148) 2021-03-17 07:38:45 -05:00
omar b85a2c0800
Fix for changes in imgui master + fix misuse of ImGui::Value() (#186) 2021-03-16 06:37:45 -05:00
epezent 46ea9abab4 improve ShowColormapScale 2021-03-07 12:36:01 -06:00
epezent 607703d2af Merge branch 'master' of https://github.com/epezent/implot 2021-03-03 09:10:43 -06:00
epezent b958abf459 bandaid for zero formatting issues 2021-03-03 09:10:33 -06:00
Evan Pezent dd2d9ce032
fix buffer overflow 2021-03-02 21:43:45 -06:00
Evan Pezent 67e0876f89
Improved Drag and Drop Support (#172)
* prototyping enhanced dnd features

* improve dnd demo using new utils

* dnd stuff

* finish up dnd improvements

* remove unused code, fix timestamps
2021-02-28 18:10:23 -06:00
Preston Cothren 7234801868
Merge pull request #1 from Pcothren/Pcothren-patch-1
DatePicker separate disabled color
2021-01-31 15:00:20 -06:00
Preston Cothren 413fb083ad
[#174] DatePicker separate disabled color
Separate disabled color from the selected date to the truly disabled dates in another month. Move setting col/styles after we are done getting them.
2021-01-31 14:51:16 -06:00
Philippe Kehl e64df657b2
render x-axis drag/drop hover (#149)
Co-authored-by: Philippe Kehl <philippe.kehl@fixposition.com>
2021-01-19 19:52:34 -06:00
epezent 6e2499093b add PrimUnreserve to AddTextVertical when the render characters is less than the expected characters (fixes utf8 issues) 2021-01-19 19:42:22 -06:00
Evan Pezent c73509d6d1
make context menus open on single right click, move ImPlotInputMap out of public API (see implot_internal.h) (#170) 2021-01-18 21:49:23 -06:00
Evan Pezent 798e2e7585
Update README.md 2021-01-15 02:17:00 -06:00
Evan Pezent 6f7bf5f38b
adds PlotVLines and PlotHLines for plotting infinite reference lines (#166) 2021-01-15 01:52:37 -06:00
epezent 5fd1ecdfd7 add ability to fill shaded plot to +/- INFINITY 2021-01-11 13:22:52 -06:00
Evan Pezent a6bab98517
Update README.md 2021-01-06 09:52:59 -06:00
Yan 5b59b47bae
Allow second and third axes to have labels (#163)
* Allow second and third axes to have labels

* Handle both axes in one loop

* fix compiler warnings, add ImPlotAxisFlags_NoLabel

* fix bug when y2 label hidden

Co-authored-by: epezent <epezent@rice.edu>
2021-01-06 09:34:03 -06:00
Evan Pezent a9d3347915
Update README.md 2020-12-09 19:44:08 -06:00
Rokas Kupstys fa10618df6
Fix ID collisions in the demo (#157)
Several `CollapsingHeader()` use same label as `BeginPlot()`. This creates an ID collision, which confuses Dear ImGui testing engine. Added `##` in `CollapsingHeader()` label are included in ID calculation, but discarded when rendering. This gives affected `CollapsingHeader()` a different ID and solves ID collision.
2020-12-08 07:31:18 -06:00
epezent b22c21f912 fix bad defs in implot_internal and add WriteV to ImBufferWritter 2020-12-06 11:09:53 -06:00
Yan 9b5adca5f1
Center constant data when fitting. (#154)
Co-authored-by: Yan Zaretskiy <yzaretskiy@stoneridgetechnology.com>
2020-12-04 13:33:44 -06:00
Philippe Kehl 4af202a988
fix compiler warning re. 'if does not guard...' (#152)
Co-authored-by: Philippe Kehl <philippe.kehl@fixposition.com>
2020-12-04 06:46:34 -06:00
epezent 9974ce1a30 update readme 2020-12-04 00:25:45 -06:00
epezent 10a58c52ca typos and incorrect docs 2020-12-04 00:07:50 -06:00
epezent b369d62f86 remove inline on LabelTickTime 2020-12-03 23:47:27 -06:00
epezent fa10a03a53 add ImPlotStyleVar_FitPadding 2020-12-03 23:27:38 -06:00
epezent 24b543839b fix addtickstime definition and heatmap labels 2020-12-03 07:20:55 -06:00
Evan Pezent 95eb2ea78d
Update README.md 2020-11-16 17:26:32 -06:00
Evan Pezent af7d99cbca
Update README.md 2020-11-16 09:58:16 -06:00
Evan Pezent 40cbe88673
Add ImPlotFlags_Equal and simplify axis-related structs in implot_internal.h (#147)
* prototyping equal axes

* equal proto

* more refactors

* euqal axes almost perfect

* fitting axis equal working

* fitting axis equal working

* finish equal axis
2020-11-15 21:47:06 -06:00
epezent 48c0d6fe38 add legend ctx menu, rev up to 0.9 2020-11-10 08:27:28 -06:00
Nick Postma ad29c9a046
Option for not rendering the title of the graph. (#140)
* Update implot.h

* Update implot.cpp

Added the flag implementation of NoTitle. I needed a smal form factor barchart.

* Update implot.cpp

Same codestyle as original.

* Update implot.h
2020-11-10 07:45:25 -06:00
Edvard Thörnros c942a400e4
IM_NORMALIZE2F_OVER_ZERO -> IMPLOT_NORMALIZE2F_OVER_ZERO (#142)
Avoids warnings when compiling with certain compilers.
2020-11-10 07:42:51 -06:00
epezent 862b8c44ea update tables demo to use TableHeadersRow 2020-10-27 08:06:40 -05:00
Evan Pezent f506f94c08
Update README.md 2020-10-23 16:27:45 -05:00
epezent adbec89ae9 Merge branch 'master' of https://github.com/epezent/implot 2020-10-21 10:08:48 -05:00
epezent 96e0fd9c57 fix crashing caused by legend refactors, add ShowMetricsWindow (WIP) 2020-10-21 10:08:41 -05:00
Evan Pezent 638ae7d5f7
Update README.md 2020-10-20 16:57:11 -05:00
epezent eb935d0b4f simplify legend demo 2020-10-19 18:11:38 -05:00
Evan Pezent 42d93bcdbc
add stairstep plots (#136) 2020-10-19 10:00:03 -05:00
Evan Pezent 587c8b6221
Configurable Legend Locations (#135)
* add support for ISO 8601 timestamps

* clean up work on ISO 8601

* legend location proto

* location docs

* add horizontal legends, and ability to position mouse location

* add ShowAltLegend

* add ShowAltLegend

* default sizing for ShowAltLegend

* finish up legend locations
2020-10-18 23:26:34 -05:00
Evan Pezent f9a15a7147
Add Option for ISO 8601 Date Formatting (#132)
* add support for ISO 8601 timestamps

* clean up work on ISO 8601
2020-10-14 22:07:27 -05:00
epezent ce6d720828 header org 2020-10-12 09:51:22 -05:00
Evan Pezent 394516cedb
Merge pull request #130 from sonoro1234/varargs
Addition of va_list V versions of Annotate and AnnotateClamped
2020-10-12 09:47:22 -05:00
Evan Pezent 92bc4d64e3
Update implot_demo.cpp 2020-10-12 09:45:27 -05:00
Victor Bombi b5cf8b8431 Addition of va_list V versions of Annotate and AnnotateClamped 2020-10-11 09:53:28 +02:00
epezent 8a3ccf0a44 remove BustItemCache from SetColormap and add ShowColormapSelector 2020-10-11 00:38:18 -05:00
Evan Pezent da5b4ab8d3 fix compile issue with latest ImGui 2020-09-28 16:38:27 -05:00
Evan Pezent 90cbb561f0
tweak CalcTextColor 2020-09-22 17:23:50 -05:00
epezent 28fedd01f9 handle time/log formatting for drag lines and points 2020-09-21 07:09:14 -05:00
epezent 93bab1930e fix missing marker in demo 2020-09-20 08:30:34 -05:00
epezent 019de727ba fix bug in demo 2020-09-19 22:02:55 -05:00
epezent 1911116b3b remove ImPlotStyleVar_AnnotationOffset 2020-09-19 21:25:44 -05:00
epezent 13e430a9e5 add annotation API 2020-09-19 20:54:19 -05:00
epezent a7ae1bca53 rename and refine draglines and dragpoints 2020-09-19 12:33:33 -05:00
epezent 9c4ef16696 change function names, fix issues with scroll 2020-09-18 22:05:43 -05:00
epezent bbbf4e2a42 anchor point prototype 2020-09-18 13:37:55 -05:00
epezent 297c69dae8 fix selection over guides 2020-09-18 08:22:06 -05:00
epezent 0e9ceb6bc0 prevent guides drag outside plot 2020-09-18 00:07:26 -05:00
epezent 4ed7d01637 finish guides 2020-09-17 23:31:16 -05:00
epezent c6aff1362c Merge branch 'master' into guides 2020-09-17 21:02:19 -05:00
Evan Pezent 0ed6307d0b
Merge pull request #117 from ozlb/master
ImPlotTimeFmt_HrMinSMs time format
2020-09-17 20:48:33 -05:00
Evan Pezent 927c9c82a5
Update README.md 2020-09-17 20:42:28 -05:00
epezent 45e3433a1a header cleanup 2020-09-17 20:40:16 -05:00
epezent fd746c3776 plot image demo 2020-09-17 20:34:37 -05:00
ozlb 9e927df91e
ImPlotTimeFmt_HrMinSMs time format
ImPlotTimeFmt_HrMinSMs,        // 7:21:29.428pm (19:21:29.428)
2020-09-18 00:35:14 +02:00
epezent ec8e87561f PlotImage 2020-09-17 11:58:58 -05:00
epezent 13927c608d add public API for horizontal and vertical guide lines 2020-09-17 09:58:33 -05:00
Max Thrun 39328e1106 add an example demonstrating how you can make custom dragable lines 2020-09-16 21:59:54 -07:00
Max Thrun 2ac10e73b0 check for HoveredIdPreviousFrame incase there is another widget on top of us added via SetItemAllowOverlap, if the previously hovered id does not match our id set our hover flags to false 2020-09-16 21:47:49 -07:00
epezent 04cc84ece0 add HideNextItem 2020-09-15 09:48:46 -05:00
epezent f348c15fde clean up getters 2020-09-15 08:56:58 -05:00
epezent eff5cee895 remove imvec2 and implotpoint getters 2020-09-15 08:38:40 -05:00
epezent bb844612eb add option for 24 hour clock 2020-09-12 11:32:44 -05:00
epezent 117816d4e1 add option for 24 hour clock 2020-09-12 10:25:47 -05:00
epezent 5e0e60b969 test xscale and x0 2020-09-10 15:59:08 -05:00
epezent 4f0a09f14d add xscale and x0 to values* functions 2020-09-09 23:29:29 -05:00
epezent fbfd41047b Merge branch 'date-picker' 2020-09-09 19:17:39 -05:00
epezent 04dc2c6be9 fix bugs in date picker 2020-09-09 19:17:19 -05:00
epezent 3cdf7add04 finish date/time picker 2020-09-09 09:00:50 -05:00
Evan Pezent 9f1b0f195c
Update README.md 2020-09-09 00:04:28 -05:00
epezent 729bd762cc date picker finished, time picker working 2020-09-08 23:47:02 -05:00
epezent 0154c02a37 prototyping date picker widget 2020-09-08 00:56:00 -05:00
epezent c0409ff4ff fix compiler warnings on macos 2020-09-07 21:30:57 -05:00
epezent 700a7bab56 add IMPLOT_API macro, confirm DLL linkage working 2020-09-07 20:59:43 -05:00
epezent 75e779c931 finish templetizing API, several optimizations to plotting pipeline, remmove t_float etc from demo 2020-09-07 16:08:59 -05:00
epezent 48cc6e15d6 Merge branch 'master' into templates 2020-09-07 10:54:49 -05:00
epezent 3206209777 add more benchmarks 2020-09-07 10:17:44 -05:00
epezent 8fdeacac54 use different types in demo 2020-09-07 00:33:47 -05:00
epezent 2eeceb3e22 templetize PlotLine, PlotScatter, PlotShaded, PlotBars, PlotBarsH 2020-09-07 00:16:47 -05:00
epezent 5c550385c6 Merge branch 'master' into templates 2020-09-06 22:36:00 -05:00
epezent 5c3d64cd9e fix compiler warning on GCC 2020-09-06 22:35:44 -05:00
epezent 930c4b2eb4 initial testing of templates 2020-09-06 22:34:58 -05:00
epezent 902cf44234 rev up to 0.8 2020-09-06 21:20:38 -05:00
epezent d8610c33c7 trim white space 2020-09-06 21:08:25 -05:00
epezent 2b46c3eac3 fix axis constraints 2020-09-06 21:04:36 -05:00
epezent d14dd621e4 Merge branch 'master' of https://github.com/epezent/implot 2020-09-06 20:51:49 -05:00
epezent 5ea558cf51 fix demo axis flags 2020-09-06 20:51:41 -05:00
Evan Pezent 041d88a520
Update README.md 2020-09-06 20:40:20 -05:00
Evan Pezent 06629f5675
Update README.md 2020-09-06 20:32:27 -05:00
Evan Pezent c87c34d7c3
Update README.md 2020-09-06 19:43:55 -05:00
Evan Pezent a09cca5329
Update README.md 2020-09-06 19:43:38 -05:00
Evan Pezent 508502a38f
Update README.md 2020-09-06 19:43:18 -05:00
epezent 60b080941a readme screens 2020-09-06 19:42:08 -05:00
Evan Pezent 899f19ab08
Update README.md 2020-09-06 19:18:39 -05:00
Evan Pezent 94b22ee584
Update README.md 2020-09-06 19:17:39 -05:00
epezent 5f1818ac05 readme typos 2020-09-06 17:29:28 -05:00
Evan Pezent 99ed32233e
Update README.md 2020-09-06 17:24:16 -05:00
Evan Pezent efc72d9c34
Update README.md 2020-09-06 16:23:40 -05:00
epezent 2206af8c1e merge linked axes 2020-09-06 16:09:00 -05:00
Evan Pezent 42d267f7f4
Merge pull request #110 from epezent/time-axes
Time axes
2020-09-06 14:53:20 -05:00
epezent 901f0558b1 fix up time format demo 2020-09-06 14:48:16 -05:00
epezent d23bd30a44 header cleanup 2020-09-06 01:48:47 -05:00
epezent 6f3f43c815 ImPlotAxisFlags_NoDecorations 2020-09-06 01:38:18 -05:00
epezent be6e1c2d2e invert ImPlotAxisFlags 2020-09-06 01:32:15 -05:00
epezent 2dcdfc519a invert ImPlotFlags 2020-09-06 00:42:03 -05:00
epezent defc529219 time-axes complete 2020-09-06 00:06:51 -05:00
epezent d3ea373cc7 convert to ImPlotTime usage 2020-09-05 12:25:44 -05:00
epezent f92625a462 add ImPlotTime struct 2020-09-05 09:38:08 -05:00
epezent 61e6b5118e tidy up time-axes so far 2020-09-04 23:30:45 -05:00
epezent e0450d00af improve axis constraining 2020-09-04 19:33:10 -05:00
epezent fe552f25f0 make time override log 2020-09-04 13:36:56 -05:00
epezent c70eee5701 make time override log 2020-09-04 13:28:55 -05:00
epezent 8d74440765 time axes nearly finished except for a few bugs and oddities 2020-09-04 13:13:45 -05:00
epezent 0c76ffe81e time-axes almost working! 2020-09-03 23:27:56 -05:00
epezent fc1962cdef linked axes prototype 2020-09-03 09:19:34 -05:00
epezent e5f1cf4bdf fix bug in FormatTime 2020-09-03 08:00:36 -05:00
epezent 5f77a9bb58 first pass at time formatted axes 2020-09-02 23:30:32 -05:00
Evan Pezent 90693cca1b
Update README.md 2020-09-02 16:44:45 -05:00
epezent 071503b43a extend previous commit based on #50 for vertical lines (e.g. for x-axis) 2020-09-02 16:09:57 -05:00
epezent 70f56d8a40 add quick fix for fitting data when data is a flat line (see #50) 2020-09-02 16:02:51 -05:00
epezent bb2ff2aea7 increment version, add GetMarkerName 2020-09-02 15:55:35 -05:00
Evan Pezent 0877aca4f9
Update README.md 2020-09-02 11:01:25 -05:00
epezent 0fa1fb982a undo inline Begin/EndItem 2020-09-02 09:26:51 -05:00
epezent c8b21a6d36 add stems and fix bug with marker size 2020-09-02 09:17:18 -05:00
Evan Pezent 624fedabe4
Update README.md 2020-09-01 21:03:48 -05:00
epezent 9d9b145548 tidy up implot_internal.h 2020-09-01 21:01:00 -05:00
epezent 4a584bad40 fix compiler warning in demo 2020-09-01 08:22:49 -05:00
epezent b74accfb59 edit custom popups demo 2020-09-01 01:35:36 -05:00
epezent 9e82be5bff tidy up legend context menus 2020-09-01 01:14:09 -05:00
Peter Johnson 8cbbfc241f
Add BeginPopupContextLegend and EndPopup
EndPopup is just a wrapper around ImGui::EndPopup.

BeginPopupContextLegend provides easy-to-use context menus for legend
entries along the lines of ImGui::BeginPopupContextItem.
2020-08-31 22:08:52 -07:00
epezent fb19e76443 tidy up legend DND 2020-08-31 23:58:15 -05:00
epezent fa2c704bb2 Merge branch 'legend-dnd' of https://github.com/PeterJohnson/implot into PeterJohnson-legend-dnd 2020-08-31 23:28:40 -05:00
epezent 9bc5b55766 Merge branch 'item-style' 2020-08-31 23:24:13 -05:00
epezent 71bf19b4c4 finish up item styling changes 2020-08-31 23:23:48 -05:00
Peter Johnson e783825e4b
Add BeginLegendDragDropSource
This uses pieces of the ImGui BeginDragDropSource implementation to
provide a method to drag from a legend entry.

EndDragDropSource is just a wrapper around ImGui::EndDragDropSource.
2020-08-31 20:38:14 -07:00
epezent 92f787944c fix casts in Getters 2020-08-31 11:38:37 -05:00
epezent 3e21d841a2 migrate PlotEx functinos to use Begin/EndItem 2020-08-30 21:03:11 -05:00
epezent dfc77f2ba4 add item styling API 2020-08-30 17:12:36 -05:00
epezent fce58ee075 add ImPlotScale, ImPlotNextItemData, BeginItem EndItem, and more 2020-08-30 11:03:25 -05:00
epezent 02e3226e51 more fixes for box selection and key modifiers 2020-08-29 08:31:34 -05:00
epezent ae568a3260 fix plot selection, remove ability to combine marker styles 2020-08-28 17:13:36 -05:00
epezent b198a8b2bc fix plot selection, remove ability to combine marker styles 2020-08-28 17:11:36 -05:00
Evan Pezent fc3658e420 setnextwindowpos fix 2020-08-26 10:33:31 -05:00
epezent 13c8f97215 add benchmark tool to demo 2020-08-26 09:50:59 -05:00
epezent b84e74b885 add global AA variable to ImPlotStyle 2020-08-25 22:47:03 -05:00
epezent 2880ae8414 Merge branch 'master' of https://github.com/epezent/implot 2020-08-25 21:59:45 -05:00
epezent cac7a61235 tick abstraction 2020-08-25 21:59:43 -05:00
epezent 0111edcd76 fix aux y axes for Light style 2020-08-24 13:59:57 -05:00
epezent acb69ab410 add Configuration section to demo 2020-08-24 11:48:00 -05:00
epezent 2f139f8a99 add StyleColorsX 2020-08-24 11:06:43 -05:00
epezent 30ffe79d1d add StyleColorsX 2020-08-24 11:06:29 -05:00
epezent 044ac47f51 fix context menu axis drag 2020-08-24 09:04:45 -05:00
epezent 8eb6bba63b Merge branch 'jaswantp-RecoverAxesLimits' 2020-08-24 09:04:01 -05:00
epezent 9f851e700b Merge branch 'RecoverAxesLimits' of https://github.com/jaswantp/implot into jaswantp-RecoverAxesLimits 2020-08-24 08:59:52 -05:00
epezent 1b4a2049a7 fix vertical text scaling and offset 2020-08-24 08:51:03 -05:00
jaswantp b2db7d11ec
Recover from almost equal axis limits.
When state.Axis->Range.Size() == DBL_EPSILON, the 'speed' to DragFloat is about 1.0e-14 which makes it virtually impossible to recover from that state!
The fix proposes to detect and adjust the drag_speed accordingly.
2020-08-24 15:18:29 +02:00
epezent 5cc168dbf0 change demo back to float 2020-08-24 00:18:43 -05:00
epezent 1884d3d7d5 overhaul styling 2020-08-23 23:45:42 -05:00
epezent db16011e73 reorganize header 2020-08-22 23:26:49 -05:00
epezent 9b8270d939 overhaul log plots - improve zoom, labels, and fit 2020-08-22 22:55:37 -05:00
epezent 63e2ce3ddd fix bug in IsPlotHovered, add more data to candlestick demo 2020-08-22 01:44:19 -05:00
epezent 0fd704b2a6 reorder demo code to avoid confusion 2020-08-22 00:57:06 -05:00
epezent eff8b5be43 fix bug where no offsetting was done for ImPlotPoint* and ImVec2* plotters 2020-08-22 00:35:41 -05:00
epezent 5039315122 add custom getters to demo 2020-08-22 00:16:37 -05:00
epezent 9b85a2ef6e Merge branch 'master' of https://github.com/epezent/implot 2020-08-21 22:13:24 -05:00
epezent 0afa53059e add Push/PopColormap, custom PlotShaded 2020-08-21 22:13:11 -05:00
Evan Pezent a8e7194f2b
Update README.md 2020-08-21 08:00:01 -05:00
epezent 9deca4e422 add overloads for PlotShaded, ImPlotStyleVar_PlotPadding, and ImGui Tables API demo section 2020-08-20 23:01:21 -05:00
epezent a41d413790 add FitNextPlotAxes 2020-08-19 23:50:46 -05:00
epezent 7da6ed69f3 add FitNextPlotAxes 2020-08-19 23:50:12 -05:00
epezent ff29f1ebcc add tooltip to candlestick demo 2020-08-19 12:25:12 -05:00
epezent 8c125ccd6b small fix to query 2020-08-19 11:43:00 -05:00
Evan Pezent c1daaab8ea
Merge pull request #96 from jaswantp/SkipDrawQuery
Draw query rect only when query enabled.
2020-08-19 11:37:45 -05:00
epezent 59aa912e73 fix bugs in axis hit box detection 2020-08-19 11:34:52 -05:00
jaswantp ac07bea9ac
Merge pull request #1 from jaswantp/SkipDrawQuery
Draw query rect only when ImPlotFlags_Query is set.
2020-08-19 14:40:11 +02:00
jaswantp 36a86cf955
Draw query rect only when query enabled. 2020-08-19 14:31:26 +02:00
epezent 038a9c9282 document per axis menus in demo 2020-08-19 01:20:42 -05:00
epezent b409aecd30 add per axis context menus 2020-08-19 01:18:05 -05:00
epezent 53c867f414 code cleanup, define magic numbers, add minimum plot size constraint, misc improvements to tick mark labels 2020-08-19 00:04:05 -05:00
epezent 0926677b52 improve candlestick demo 2020-08-18 11:17:16 -05:00
epezent 017a273862 Merge branch 'master' of https://github.com/epezent/implot 2020-08-18 11:10:29 -05:00
epezent 642bc97a6e improve candlestick demo 2020-08-18 11:10:22 -05:00
Evan Pezent 2df34aea12
Update README.md 2020-08-17 20:52:49 -05:00
Evan Pezent 47a76851ee
typo 2020-08-17 20:40:19 -05:00
epezent 7763b9cf43 add example for custom plotters 2020-08-17 20:20:15 -05:00
epezent 2bc716d2b6 misc clean up, experimental rect rendering, center PlotText 2020-08-17 18:31:30 -05:00
epezent d7e3cc78ac Merge branch 'master' of https://github.com/epezent/implot 2020-08-17 16:26:48 -05:00
epezent be5c3b6959 wip rect rendering 2020-08-17 16:26:45 -05:00
epezent 632808ca4c fixed template specialization on GCC 2020-08-17 16:04:08 -05:00
epezent bd4036fbff fix max idx calculation 2020-08-16 20:16:19 -05:00
epezent 34c3829277 Merge branch 'v0.5' 2020-08-16 18:49:17 -05:00
epezent 803d250bb6 bug in debug mode 2020-08-16 18:48:09 -05:00
epezent 4463fa107a clean up refactors, organize implot_internal.h 2020-08-16 18:46:59 -05:00
Evan Pezent 73eb27456a
Update README.md 2020-08-16 15:43:41 -05:00
Evan Pezent a011de9e3f
Merge pull request #92 from epezent/v0.5
Add explicit ImPlot context creation/destruction and major refactors
2020-08-16 15:42:17 -05:00
epezent d9ae47bf2b finish refactoring implot for v0.5 2020-08-16 15:38:51 -05:00
epezent 862f96c560 add implot_internal.h 2020-08-16 11:36:20 -05:00
epezent 86a9e51f9d add explicit context creation/destruction 2020-08-16 10:25:06 -05:00
Evan Pezent a130aa414f
Merge pull request #91 from PeterJohnson/fix-warning
Fix compiler warning in implot_demo.cpp
2020-08-16 08:21:17 -05:00
Peter Johnson a5d1f85040
Fix compiler warning in implot_demo.cpp
implot_demo.cpp:1012:69: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
2020-08-15 23:47:18 -07:00
epezent 96dc5b5a28 expose NextColormapColor 2020-08-16 00:49:34 -05:00
epezent 510366e12e document and demo PlotText colors 2020-08-16 00:24:09 -05:00
Evan Pezent df0a159391
Merge pull request #84 from ozlb/patch-1
PlotText color
2020-08-16 00:18:12 -05:00
epezent 4db63635fb add info about ImDrawIdx to benchmark demo 2020-08-16 00:14:05 -05:00
Evan Pezent c09d160d19
Merge pull request #88 from bear24rw/imdrawidx_32bit
Fix overflow when using 32-bit ImDrawIdx
2020-08-15 23:25:11 -05:00
Evan Pezent 0969a8df83
Merge pull request #90 from PeterJohnson/fix-yaxis-settings
Fix yaxis setting updates not working
2020-08-15 23:22:47 -05:00
Peter Johnson 214504a20e
Fix yaxis setting updates not working
The new values were being stored in PreviousFlags instead of Flags.
2020-08-15 21:05:03 -07:00
Max Thrun 1ec47915d3 Fix overflow when using 32-bit ImDrawIdx 2020-08-13 16:04:21 -07:00
Evan Pezent 6a5e9401f7 rev up to v0.5 2020-08-07 13:04:31 -05:00
ozlb ab9217049a
PlotText color
PlotText color properties inherited from ImGuiCol_Text, so it can be customized by `ImGui::PushStyleColor(ImGuiCol_Text, <myColor>);`
2020-08-05 04:59:05 +02:00
Evan Pezent 5c9679c2ab
header documentation correction 2020-07-28 22:22:37 -05:00
Evan Pezent 7d0d2d1e65 rename IsPlotItemHighlighted to IsLegendEntryHovered 2020-07-26 21:49:31 -05:00
Evan Pezent 397fc05ca8 fix bug in IsPlotYAxisHovered 2020-07-26 21:39:17 -05:00
Evan Pezent 5ee62dd86a Merge branch 'ozlb-master' 2020-07-26 21:28:46 -05:00
Evan Pezent 9815d64691 tidy up ozlb axis hovering work 2020-07-26 21:28:22 -05:00
Evan Pezent db38039e97 Merge branch 'master' of https://github.com/ozlb/implot into ozlb-master 2020-07-26 20:10:24 -05:00
Evan Pezent b1e2e501d0
Update README.md 2020-07-25 08:11:43 -05:00
Evan Pezent e847aa786d bug fix: calculate adaptive divisions after canvas bounding box is calculated 2020-07-25 07:59:47 -05:00
Evan Pezent 0a3442f389 fix issue with heatmap bounds not working correctly 2020-07-25 07:52:15 -05:00
Evan Pezent 7a4bb510fb
Merge pull request #71 from JoelLinn/fix-zerodiv
Fix divison by zero when plotting 0 data lenght.
2020-07-19 17:53:48 -05:00
Joel Linn e43be28452 Fix divison by zero when plotting 0 data lenght. 2020-07-20 00:09:35 +02:00
ozlb 9df6f22555
IsPlotXAxisHovered, IsPlotYAxisHovered
Returns true if the XAxis plot area or YAxis[n] plot area in the current or most recent plot is hovered.
2020-07-14 23:43:57 +02:00
ozlb 140dd2bd8a
IsPlotItemHighlight
Returns true if plot item is highlight
2020-07-13 06:44:51 +02:00
Evan Pezent 4d4cac629b always show items without a legend entry 2020-06-23 22:02:22 -05:00
Evan Pezent 2177ad1982
Merge pull request #68 from jpieper/20200622-empty-legend
Only display non-empty legends
2020-06-23 21:20:48 -05:00
Evan Pezent 6bc7e04fe1
Update README.md 2020-06-23 21:14:36 -05:00
Josh Pieper 0b3bf9bc9f Only display non-empty legends 2020-06-22 13:56:38 -04:00
Evan Pezent 9894df4934
Update implot.cpp 2020-06-18 17:26:30 -05:00
Evan Pezent 37ee2d4c54 fix compiler warnings for plot digital 2020-06-15 21:35:09 -05:00
Evan Pezent a3defa4881 Merge branch 'master' of https://github.com/epezent/implot 2020-06-15 21:18:27 -05:00
Evan Pezent 307205bb7f
Merge pull request #64 from ozlb/patch-2
Fix circular buffer rollover (issue #60)
2020-06-15 21:21:55 -05:00
Evan Pezent bf29e02320
Update README.md 2020-06-15 21:18:07 -05:00
Evan Pezent d661d4235a
Merge pull request #61 from JaapSuter/work-input-remap
Support for input remapping (mouse-buttons/modifiers-keys).
2020-06-15 21:03:39 -05:00
Evan Pezent 8d205530cd Merge branch 'master' of https://github.com/epezent/implot 2020-06-15 21:00:45 -05:00
Evan Pezent 70a044ee17 improve mouse pos label precision 2020-06-15 21:00:42 -05:00
Evan Pezent c6ad6e9c7f clean up and debug input mappings 2020-06-15 19:54:58 -05:00
Evan Pezent 676ea011b8 Merge branch 'work-input-remap' of https://github.com/JaapSuter/implot into JaapSuter-work-input-remap 2020-06-15 17:08:47 -05:00
Evan Pezent 4bb00c71da typo in header 2020-06-15 17:08:42 -05:00
Jaap Suter ce79420146 Switched from in-class initialization to setting the default input mapping in a constructor in the .cpp file. 2020-06-15 09:55:30 -07:00
Jaap Suter 989815bec5 Merge branch 'master' into work-input-remap 2020-06-15 09:06:09 -07:00
Jaap Suter f02088fef1 Changed from SetInputMap(ImPlotInputMap) to ImPlotInputMap& GetInputMap() per Evan's suggestion. 2020-06-15 08:54:53 -07:00
ozlb 4cf06cf52c
PlotDigitalEx fix NAN values and fix circular buffer rollover (issue #60)
Fixes issue #60 (circular buffer rollover)
2020-06-14 22:28:01 +02:00
Evan Pezent fcbbc6c735
Update README.md 2020-06-14 08:49:56 -05:00
Evan Pezent 530367db09 move demo typedefs into namespace 2020-06-14 08:31:09 -05:00
Evan Pezent 504b1ea155 Merge branch 'shaded' 2020-06-14 08:28:28 -05:00
Evan Pezent 11ba96f088 Merge branch 'master' of https://github.com/epezent/implot 2020-06-14 08:28:14 -05:00
Evan Pezent 07aed7d079 general reorginzation to plot item rendering 2020-06-14 08:27:58 -05:00
Evan Pezent e2fd883224 remove adaptive divisions flag, not really used 2020-06-13 13:25:38 -05:00
Evan Pezent 1934bdfd47 remove culling flag, enabled by default now 2020-06-13 13:18:29 -05:00
Evan Pezent 808856dcc3 shaded plots complete 2020-06-13 12:59:48 -05:00
Evan Pezent fee873d74a shaded plots complete 2020-06-13 12:42:47 -05:00
Evan Pezent 61bc4d1426 working prototype for shaded plots 2020-06-12 22:02:43 -05:00
Evan Pezent 218e7bc5f1 Merge branch 'master' into shaded 2020-06-12 16:15:19 -05:00
Evan Pezent 7a53c2058f remove garbage 2020-06-12 16:15:11 -05:00
Jaap Suter 7f4f3ecd21 Added prototype/rough-attempt to allow remapping input (mouse-buttons/modifiers-keys). 2020-06-10 13:50:00 -07:00
Evan Pezent 0dea5f8bb7 prototyping renderer change 2020-06-07 20:44:37 -05:00
10 changed files with 13718 additions and 4271 deletions

95
.github/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,95 @@
# This build script is not meant for general use, it is for CI use only!
cmake_minimum_required(VERSION 3.0)
project(implot)
#
# Global options
#
# Same as Dear ImGui
set(CMAKE_CXX_STANDARD 11)
# Arch option for linux
if (NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" AND DEFINED GCC_ARCH)
if ("${GCC_ARCH}" MATCHES "Win32|x86|32")
add_compile_options(-m32)
add_link_options(-m32)
elseif ("${GCC_ARCH}" MATCHES "Win64|x64|64")
add_compile_options(-m64)
add_link_options(-m64)
endif ()
endif ()
# Arch option for Mac: arm64 for M1 or x86_64 for intel (32 bits build are deprecated on Mac)
if(APPLE AND DEFINED OSX_ARCH)
if ("${OSX_ARCH}" MATCHES "x86_64")
set(CMAKE_OSX_ARCHITECTURES "x86_64")
elseif ("${OSX_ARCH}" MATCHES "arm64")
set(CMAKE_OSX_ARCHITECTURES "arm64")
else()
message(FATAL_ERROR "Unhandled OSX_ARCH=${OSX_ARCH}")
endif()
endif()
#
# Dear ImGui library with no backend
#
set(imgui_sources
../imgui/imconfig.h
../imgui/imgui.cpp
../imgui/imgui.h
../imgui/imgui_demo.cpp
../imgui/imgui_draw.cpp
../imgui/imgui_internal.h
../imgui/imgui_tables.cpp
../imgui/imgui_widgets.cpp
../imgui/imstb_rectpack.h
../imgui/imstb_textedit.h
../imgui/imstb_truetype.h
)
add_library(imgui ${imgui_sources})
target_include_directories(imgui PUBLIC ../imgui)
#
# ImPlot library
#
file(GLOB SOURCE_CODE ../implot*.*)
add_library(implot STATIC ${SOURCE_CODE})
if(MSVC)
target_compile_options(implot PRIVATE /W4 /WX)
else()
target_compile_options(implot PRIVATE -Wall -Werror -pedantic)
endif()
target_include_directories(implot PUBLIC ${CMAKE_CURRENT_LIST_DIR}/..)
target_link_libraries(implot PUBLIC imgui)
if (UNIX)
target_link_libraries(implot PUBLIC m stdc++)
endif()
# Define supported types via command line:
# - With no choice all types are supported (so that the CI provides support for all known types)
# - with -DIMPLOT_CUSTOM_NUMERIC_TYPES="default" the default set defined in implot_items.cpp is used
# - with -DIMPLOT_CUSTOM_NUMERIC_TYPES="(int)(float)(double)" only int, float and double are supported
if (NOT DEFINED IMPLOT_CUSTOM_NUMERIC_TYPES)
set(IMPLOT_CUSTOM_NUMERIC_TYPES "all")
endif()
if ("${IMPLOT_CUSTOM_NUMERIC_TYPES}" STREQUAL "default")
message("==== Compiling for default types ====")
elseif("${IMPLOT_CUSTOM_NUMERIC_TYPES}" STREQUAL "all")
message("==== Compiling for all types ====")
target_compile_definitions(implot PRIVATE "IMPLOT_CUSTOM_NUMERIC_TYPES=(signed char)(unsigned char)(signed short)(unsigned short)(signed int)(unsigned int)(signed long)(unsigned long)(signed long long)(unsigned long long)(float)(double)(long double)")
else()
message("==== Compiling for custom types: ${IMPLOT_CUSTOM_NUMERIC_TYPES} ====")
target_compile_definitions(implot PRIVATE "IMPLOT_CUSTOM_NUMERIC_TYPES=${IMPLOT_CUSTOM_NUMERIC_TYPES}")
endif()
#
# implot example binary application (with no backend)
#
add_executable(example_implot example_implot.cpp)
target_link_libraries(example_implot PRIVATE implot)

55
.github/example_implot.cpp vendored Normal file
View File

@ -0,0 +1,55 @@
// Sample app built with Dear ImGui and ImPlot
// This app uses implot and imgui, but does not output to any backend! It only serves as a proof that an app can be built, linked, and run.
#include "imgui.h"
#include "implot.h"
#include "stdio.h"
int main(int, char**)
{
printf("sample_implot: start\n");
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImPlot::CreateContext();
// Additional imgui initialization needed when no backend is present
ImGui::GetIO().DisplaySize = ImVec2(400.f, 400.f);
ImGui::GetIO().Fonts->Build();
// Render 500 frames
for(int counter = 0; counter < 500; ++counter)
{
ImGui::NewFrame();
if (ImGui::Begin("Hello, world!"))
{
ImGui::Text("Hello again");
if (ImPlot::BeginPlot("My Plot"))
{
static double values[] = {1., 3., 5.};
ImPlot::PlotLine("Values", values, 3);
ImPlot::EndPlot();
}
#ifdef IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES
if (ImPlot::BeginPlot("My Plot (long double)"))
{
static long double values[] = {1., 3., 5.};
ImPlot::PlotLine("Values", values, 3);
ImPlot::EndPlot();
}
#endif
ImGui::End();
}
ImGui::Render();
}
ImPlot::DestroyContext();
ImGui::DestroyContext();
printf("sample_implot: end\n");
return 0;
}

144
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,144 @@
name: build
on:
push:
pull_request:
jobs:
Linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
build_type:
- debug
- release
compiler:
- gcc
- clang
arch:
- x86
- x64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ocornut/imgui
path: imgui
- name: Dependencies
run: sudo apt-get install g++-multilib
- name: Configure
run: cmake -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_C_COMPILER=${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DGCC_ARCH=${{ matrix.arch }} -B cmake-build -S .github
- name: Build
run: cmake --build cmake-build --parallel $(nproc)
- name: Run
run: |
file cmake-build/example_implot
cmake-build/example_implot
MacOS:
runs-on: macos-11
strategy:
fail-fast: false
matrix:
build_type:
- debug
- release
arch:
- x86_64
- arm64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ocornut/imgui
path: imgui
- name: Configure
shell: bash
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DOSX_ARCH=${{ matrix.arch }} -B cmake-build -S .github
- name: Build
shell: bash
run: cmake --build cmake-build --parallel $(sysctl -n hw.ncpu)
- name: Run
if: matrix.arch == 'x86_64' # github's CI hosts seem to be running intel and can not run ARM
run: |
file cmake-build/example_implot
cmake-build/example_implot
Windows_MSVC:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build_type:
- debug
- release
arch:
- Win32
- x64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ocornut/imgui
path: imgui
- name: Configure
shell: bash
run: cmake -G 'Visual Studio 17 2022' -A ${{ matrix.arch }} -B cmake-build -S .github
- name: Build
shell: bash
run: cmake --build cmake-build -- -p:Configuration=${{ matrix.build_type }} -maxcpucount:$NUMBER_OF_PROCESSORS
- name: Run
run: .\cmake-build\${{matrix.build_type}}\example_implot.exe
Windows_MingW: # MingW on Github CI does not fully support 32 bits: link fails when it tries to link 64 bits system libraries.
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build_type:
- debug
- release
arch:
- x64
# - Win32
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ocornut/imgui
path: imgui
- name: Configure
shell: bash
run: cmake -G 'MinGW Makefiles' -DGCC_ARCH=${{ matrix.arch }} -B cmake-build -S .github
- name: Build
shell: bash
run: cmake --build cmake-build --parallel $NUMBER_OF_PROCESSORS
- name: Run (MingW)
run: .\cmake-build\example_implot.exe

139
README.md
View File

@ -1,66 +1,118 @@
# ImPlot
ImPlot is an immediate mode plotting widget for [Dear ImGui](https://github.com/ocornut/imgui). It aims to provide a first-class API that will make ImGui users feel right at home. ImPlot is well suited for visualizing program data in real-time and requires minimal code to integrate. Just like ImGui, it does not burden the end user with GUI state management, avoids STL containers and C++ headers, and has no external dependencies except for ImGui itself.
ImPlot is an immediate mode, GPU accelerated plotting library for [Dear ImGui](https://github.com/ocornut/imgui). It aims to provide a first-class API that ImGui fans will love. ImPlot is well suited for visualizing program data in real-time or creating interactive plots, and requires minimal code to integrate. Just like ImGui, it does not burden the end user with GUI state management, avoids STL containers and C++ headers, and has no external dependencies except for ImGui itself.
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/controls.gif" width="285"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/dnd.gif" width="285"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/log.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/controls.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/dnd.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/pie.gif" width="270">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/bar.gif" width="285"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/query.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/views.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/query.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/bars.gif" width="270">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/rt.gif" width="270">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/noise.gif" width="285"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/stock.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots/multiy.gif" width="285">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/stem.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/markers.gif" width="270">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/shaded.gif" width="270">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/candle.gif" width="270"> <img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/heat.gif" width="270">
<img src="https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/tables.gif" width="270">
## Features
- GPU accelerated rendering
- multiple plot types:
- line plots
- shaded plots
- scatter plots
- vertical/horizontal bars graphs
- vertical/horizontal/stacked bars graphs
- vertical/horizontal error bars
- stem plots
- stair plots
- pie charts
- heatmap charts
- 1D/2D histograms
- images
- and more likely to come
- mix/match multiple plot items on a single plot
- configurable axes ranges and scaling (linear/log)
- subplots
- time formatted x-axes (US formatted or ISO 8601)
- reversible and lockable axes
- support for up to three independent y-axes
- multiple x-axes and y-axes
- controls for zooming, panning, box selection, and auto-fitting data
- controls for creating persistent query ranges (see demo)
- several plot styling options: 10 marker types, adjustable marker sizes, line weights, outline colors, fill colors, etc.
- built-in and user definable colormaps
- 16 built-in colormaps and support for and user-added colormaps
- optional plot titles, axis labels, and grid labels
- optional legend with toggle buttons to quickly show/hide items
- size-aware grid with smart labels that are always power-of-ten multiples of 1, 2, and 5
- default styling based on current ImGui theme, but most elements can be customized independently
- mouse cursor location display and optional crosshairs cursor
- optional and configurable legends with toggle buttons to quickly show/hide plot items
- default styling based on current ImGui theme, or completely custom plot styles
- customizable data getters and data striding (just like ImGui:PlotLine)
- relatively good performance for high density plots
- support for single and double precision data
- accepts data as float, double, and 8, 16, 32, and 64-bit signed/unsigned integral types
- and more! (see Announcements [2022](https://github.com/epezent/implot/discussions/370)/[2021](https://github.com/epezent/implot/issues/168)/[2020](https://github.com/epezent/implot/issues/48))
## Usage
The API is used just like any other ImGui `BeginX`/`EndX` pair. First, start a plotting context with `ImPlot::BeginPlot()`. Next, plot as many items as you want with the provided `PlotX` functions (e.g. `PlotLine()`, `PlotBars()`, `PlotErrorBars()`, etc). Finally, wrap things up with a call to `ImPlot::EndPlot()`. That's it!
The API is used just like any other ImGui `BeginX`/`EndX` pair. First, start a new plot with `ImPlot::BeginPlot()`. Next, plot as many items as you want with the provided `PlotX` functions (e.g. `PlotLine()`, `PlotBars()`, `PlotScatter()`, etc). Finally, wrap things up with a call to `ImPlot::EndPlot()`. That's it!
```cpp
int bar_data[11] = ...;
float x_data[1000] = ...;
float y_data[1000] = ...;
ImGui::Begin("My Window");
if (ImPlot::BeginPlot("My Plot")) {
ImPlot::PlotBars("My Bar Plot", bar_data, 11);
ImPlot::PlotLine("My Line Plot", x_data, y_data, 1000);
ImPlot::PlotBars("My Bar Plot", values, 10);
...
ImPlot::EndPlot();
}
ImGui::End();
```
Consult `implot_demo.cpp` for a comprehensive example of ImPlot's features.
![Usage](https://raw.githubusercontent.com/wiki/epezent/implot/screenshots3/example.PNG)
Of course, there's much more you can do with ImPlot...
## Demos
A comprehensive example of ImPlot's features can be found in `implot_demo.cpp`. Add this file to your sources and call `ImPlot::ShowDemoWindow()` somewhere in your update loop. You are encouraged to use this file as a reference when needing to implement various plot types. The demo is always updated to show new plot types and features as they are added, so check back with each release!
An online version of the demo is hosted [here](https://traineq.org/implot_demo/src/implot_demo.html). You can view the plots and the source code that generated them. Note that this demo may not always be up to date and is not as performant as a desktop implementation, but it should give you a general taste of what's possible with ImPlot. Special thanks to [pthom](https://github.com/pthom) for creating and hosting this!
More sophisticated demos requiring lengthier code and/or third-party libraries can be found in a separate repository: [implot_demos](https://github.com/epezent/implot_demos). Here, you will find advanced signal processing and ImPlot usage in action. Please read the `Contributing` section of that repository if you have an idea for a new demo!
## Integration
Just add `implot.h`, `implot.cpp`, and optionally `implot_demo.cpp` to your sources. This assumes you already have an ImGui-ready environment. If not, consider trying [mahi-gui](https://github.com/mahilab/mahi-gui), which bundles ImGui, ImPlot, and several other packages for you.
0) Set up an [ImGui](https://github.com/ocornut/imgui) environment if you don't already have one.
1) Add `implot.h`, `implot_internal.h`, `implot.cpp`, `implot_items.cpp` and optionally `implot_demo.cpp` to your sources. Alternatively, you can get ImPlot using [vcpkg](https://github.com/microsoft/vcpkg/tree/master/ports/implot).
2) Create and destroy an `ImPlotContext` wherever you do so for your `ImGuiContext`:
## Special Notes
```cpp
ImGui::CreateContext();
ImPlot::CreateContext();
...
ImPlot::DestroyContext();
ImGui::DestroyContext();
```
- If you experience data truncation and/or visual glitches, it is **HIGHLY** recommended that you either:
1) Handle the `ImGuiBackendFlags_RendererHasVtxOffset` flag in your renderer when using 16-bit indices (the official OpenGL3 renderer supports this) and use an ImGui version with patch [imgui@f6120f8](https://github.com/ocornut/imgui/commit/f6120f8e16eefcdb37b63974e6915a3dd35414be).
2) Enable 32-bit indices by uncommenting `#define ImDrawIdx unsigned int` in your `imconfig.h` file.
- By default, no anti-aliasing is done on line plots for performance reasons. If you use 4x MSAA, then you likely won't even notice. However, you can re-enable AA with the `ImPlotFlags_AntiAliased` flag.
You should be good to go!
## Installing ImPlot using vcpkg
You can download and install ImPlot using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
```bash
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install implot
```
The ImPlot port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
## Extremely Important Note
Dear ImGui uses **16-bit indexing by default**, so high-density ImPlot widgets like `ImPlot::PlotHeatmap()` may produce too many vertices into `ImDrawList`, which causes an assertion failure and will result in data truncation and/or visual glitches. Therefore, it is **HIGHLY** recommended that you EITHER:
- **Option 1:** Enable 32-bit indices by uncommenting `#define ImDrawIdx unsigned int` in your ImGui [`imconfig.h`](https://github.com/ocornut/imgui/blob/master/imconfig.h#L89) file.
- **Option 2:** Handle the `ImGuiBackendFlags_RendererHasVtxOffset` flag in your renderer if you must use 16-bit indices. Many of the default ImGui rendering backends already support `ImGuiBackendFlags_RendererHasVtxOffset`. Refer to [this issue](https://github.com/ocornut/imgui/issues/2591) for more information.
## FAQ
@ -68,25 +120,38 @@ Just add `implot.h`, `implot.cpp`, and optionally `implot_demo.cpp` to your sour
A: ImGui is an incredibly powerful tool for rapid prototyping and development, but provides only limited mechanisms for data visualization. Two dimensional plots are ubiquitous and useful to almost any application. Being able to visualize your data in real-time will give you insight and better understanding of your application.
**Q: Is ImPlot suitable for real-time plotting?**
**Q: Is ImPlot the right plotting library for me?**
A: Yes, within reason. You can plot tens to hundreds of thousands of points without issue, but don't expect plotting over a million to be a buttery smooth experience. We do our best to keep it fast and avoid memory allocations.
A: If you're looking to generate publication quality plots and/or export plots to a file, ImPlot is NOT the library for you! ImPlot is geared toward plotting application data at realtime speeds with high levels of interactivity. ImPlot does its best to create pretty plots (indeed, there are quite a few styling options available), but it will always favor function over form.
**Q: Where is the documentation?**
A: The API is thoroughly commented in `implot.h`, and the demo in `implot_demo.cpp` should be more than enough to get you started. Also take a look at the [implot_demos](https://github.com/epezent/implot_demos) repository.
**Q: Is ImPlot suitable for plotting large datasets?**
A: Yes, within reason. You can plot tens to hundreds of thousands of points without issue, but don't expect millions to be a buttery smooth experience. That said, you can always downsample extremely large datasets by telling ImPlot to stride your data at larger intervals if needed. Also try the experimental `backends` branch which aims to provide GPU acceleration support.
**Q: What data types can I plot?**
A: ImPlot plotting functions accept most scalar types:
`float`, `double`, `int8`, `uint8`, `int16`, `uint16`, `int32`, `uint32`, `int64`, `uint64`. Arrays of custom structs or classes (e.g. `Vector2f` or similar) are easily passed to ImPlot functions using the built-in striding features (see `implot.h` for documentation), and many plotters provide a "getter" overload which accepts data generating callbacks. You can fully customize the list of accepted types by defining `IMPLOT_CUSTOM_NUMERIC_TYPES` at compile time: see doc in `implot_items.cpp`.
**Q: Can plot styles be modified?**
A: Yes. Plot colors, palettes, and various styling variables can be pushed/popped or modified permanently on startup.
A: Yes. Data colormaps and various styling colors and variables can be pushed/popped or modified permanently on startup. Three default styles are available, as well as an automatic style that attempts to match you ImGui style.
**Q: Does ImPlot support logarithmic scaling?**
**Q: Does ImPlot support logarithmic scaling or time formatting?**
A: Yep!
A: Yep! Both logscale and timescale are supported.
**Q: Does ImPlot support multiple y-axes? x-axes?**
A: Yes to y-axes (up to three), "not yet" to x-axes.
A: Yes. Up to three x-axes and three y-axes can be enabled.
**Q: Does ImPlot support [insert plot type]?**
A: Maybe. Check the demo, gallery, or [Announcements](https://github.com/epezent/implot/issues/48) to see if your desired plot type is shown. If not, consider submitting an issue or better yet, a PR!
A: Maybe. Check the demo, gallery, or Announcements ([2020](https://github.com/epezent/implot/issues/48)/[2021](https://github.com/epezent/implot/issues/168))to see if your desired plot type is shown. If not, consider submitting an issue or better yet, a PR!
**Q: Does ImPlot support 3D plots?**
@ -94,7 +159,7 @@ A: No, and likely never will since ImGui only deals in 2D rendering.
**Q: My plot lines look like crap!**
A: See the note about anti-aliasing under **Special Notes** above.
A: By default, no anti-aliasing is done on line plots for performance gains. If you use at least 4x MSAA, then you likely won't even notice. However, you can enable software AA per-plot with the `ImPlotFlags_AntiAliased` flag, or globally with `ImPlot::GetStyle().AntiAliasedLines = true;`.
**Q: Does ImPlot provide analytic tools?**
@ -102,14 +167,12 @@ A: Not exactly, but it does give you the ability to query plot sub-ranges, with
**Q: Can plots be exported/saved to image?**
A: Not currently. Use your OS's screen capturing mechanisms if you need to capture a plot. ImPlot is not suitable for rendering publication quality plots; it is only intended to be used as a visualization tool. Post-process your data with MATLAB and matplotlib for these purposes.
A: Not currently. Use your OS's screen capturing mechanisms if you need to capture a plot. ImPlot is not suitable for rendering publication quality plots; it is only intended to be used as a visualization tool. Post-process your data with MATLAB or matplotlib for these purposes.
**Q: Does ImPlot handle double precision data?**
**Q: Can I compile ImPlot as a dynamic library?**
A: Yes, ImPlot accepts both `float` and `double` for all of its plotting functions.
A: Like ImGui, it is recommended that you compile and link ImPlot as a *static* library or directly as a part of your sources. However, if you must and are compiling ImPlot and ImGui as separate DLLs, make sure you set the current *ImGui* context with `ImPlot::SetImGuiContext(ImGuiContext* ctx)`. This ensures that global ImGui variables are correctly shared across the DLL boundary.
**Q: Can ImPlot be used with other languages/bindings?**
A: Yes, you can use the C binding, [cimplot](https://github.com/cimgui/cimplot) with most high level languages.
A: Yes, you can use the generated C binding, [cimplot](https://github.com/cimgui/cimplot) with most high level languages. [DearPyGui](https://github.com/hoffstadt/DearPyGui) provides a Python wrapper, among other things. [imgui-java](https://github.com/SpaiR/imgui-java) provides bindings for Java. A Rust binding, [implot-rs](https://github.com/4bb4/implot-rs), is currently in the works. An example using Emscripten can be found [here](https://github.com/pthom/implot_demo).

100
TODO.md Normal file
View File

@ -0,0 +1,100 @@
The list below represents a combination of high-priority work, nice-to-have features, and random ideas. We make no guarantees that all of this work will be completed or even started. If you see something that you need or would like to have, let us know, or better yet consider submitting a PR for the feature.
## API
## Axes
- add flag to remove weekends on Time axis
- pixel space scale (`ImPlotTransform_Display`), normalized space scale (`ImPlotTransform_Axes`), data space scale (`ImPlotTransform_Data`)
- make ImPlotFlags_Equal not a flag -> `SetupEqual(ImPlotAxis x, ImPlotAxis y)`
- allow inverted arguments `SetAxes` to transpose data?
- `SetupAxisColors()`
- `SetupAxisHome()`
## Plot Items
- add `PlotBubbles` (see MATLAB bubble chart)
- add non-zero references for `PlotBars` etc.
- add exploding to `PlotPieChart` (on hover-highlight?)
- fix appearance of `PlotBars` spacing
## Styling
- support gradient and/or colormap sampled fills (e.g. ImPlotFillStyle_)
- API for setting different fonts for plot elements
## Colormaps
- gradient editing tool
- `RemoveColormap`
- `enum ImPlotColorRule_ { Solid, Faded, XValue, YValue, ZValue }`
## Legend
- `ImPlotLegendFlags_Scroll`
- improve legend icons (e.g. adopt markers, gradients, etc)
- make legend frame use ButtonBehavior (maybe impossible)
## Tools / Misc.
- add `IsPlotChanging` to detect change in limits
- add ability to extend plot/axis context menus
- add LTTB downsampling for lines
- add box selection to axes
- first frame render delay might fix "fit pop" effect
- move some code to new `implot_tools.cpp`
- ColormapSlider (see metrics)
- FillAlpha should not affect markers?
- fix mouse text for time axes
## Optimizations
- find faster way to buffer data into ImDrawList (very slow)
- reduce number of calls to `PushClipRect`
- explore SIMD operations for high density plot items
## Plotter Pipeline
Ideally every `PlotX` function should use our faster rendering pipeline when it is applicable.
` User Data > Getter > Fitter > Renderer > RenderPrimitives`
|Plotter|Getter|Fitter|Renderer|RenderPrimitives|
|---|:-:|:-:|:-:|:-:|
|PlotLine|Yes|Yes|Yes|Yes|
|PlotScatter|Yes|Yes|Yes|Yes|
|PlotStairs|Yes|Yes|Yes|Yes|
|PlotShaded|Yes|Yes|Yes|Yes|
|PlotBars|Yes|Yes|Yes|Yes|
|PlotBarGroups|:|:|:|:|
|PlotHistogram|:|:|:|:|
|PlotErrorBars|Yes|Yes|No|No|
|PlotStems|Yes|Yes|Yes|Yes|
|PlotInfLines|Yes|Yes|Yes|Yes|
|PlotPieChart|No|No|No|No|
|PlotHeatmap|Yes|No|Yes|Mixed|
|PlotHistogram2D|:|:|:|:|
|PlotDigital|Yes|No|No|No|
|PlotImage|-|-|-|-|
|PlotText|-|-|-|-|
|PlotDummy|-|-|-|-|
## Completed
- make BeginPlot take fewer args:
- make query a tool -> `DragRect`
- rework DragLine/Point to use ButtonBehavior
- add support for multiple x-axes and don't limit count to 3
- make axis side configurable (top/left, right/bottom) via new flag `ImPlotAxisFlags_Opposite`
- add support for setting tick label strings via callback
- give each axis an ID, remove ad-hoc DND solution
- allow axis to be drag to opposite side (ala ImGui Table headers)
- legend items can be hovered even if plot is not
- fix frame delay on DragX tools
- remove tag from drag line/point -> add `Tag` tool
- add shortcut/legacy overloads for BeginPlot
- `SetupAxisConstraints()`
- `SetupAxisScale()`
- add `ImPlotLineFlags`, `ImPlotBarsFlags`, etc. for each plot type
- add `PlotBarGroups` wrapper that makes rendering groups of bars easier, with stacked bar support
- `PlotBars` restore outlines
- add hover/active color for plot axes

8421
implot.cpp

File diff suppressed because it is too large Load Diff

1409
implot.h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1667
implot_internal.h Normal file

File diff suppressed because it is too large Load Diff

2692
implot_items.cpp Normal file

File diff suppressed because it is too large Load Diff