103 Commits

Author SHA1 Message Date
Samuele Mazzi
35f7955475 feat: add ImPlotPieChartFlags_Exploding (#592) 2024-12-24 08:09:05 -06:00
ocornut
419a8a0f5f Added support for IMGUI_DISABLE. (#563) 2024-10-29 17:36:47 +01:00
Michael Böhme
9be791503c Added header guard for IMGUI_DEFINE_MATH_OPERATORS (#546, #449) 2024-10-29 17:29:17 +01:00
ocornut
f156599fae Remove trailing blanks. 2024-01-22 11:32:06 +01:00
Ben
22ef01e8c6 Small Pie Chart enhancements (#412)
* Added ImPlotPieChartFlags_IgnoreHidden flag. Added PlotPieChart overload that accepts an ImPlotFormatter.

* Fixed a potential division by zero in PlotPieChart.

* Removed PlotPieChart overload code duplication
2023-09-26 10:14:14 -05:00
lighthouse
538a306162 fix: Fix indexing logic of GetterHeatmapColMaj::operator() (#511)
Change mod from Cols to Rows
2023-09-26 10:12:10 -05:00
epezent
2e469d58bc Early end items with count <= 0 2023-08-20 19:40:01 -05:00
epezent
433022038b fix division by zero in RendererShaded 2023-08-20 18:07:56 -05:00
Evan Pezent
a2632b9d0b Implement legend scrolling and update scroll capture behavior when zooming (#504)
* Fully functional legend scrolling

* refactor legend scroll capture

* remove ImPlotFlags_NoChild scroll capturing in favor of ImGui::SetKeyOwner

* change scroll capture behavior to only capture if scroll can be consumed

* rev version, add note about removal of ImPlotFlags_NoChild
2023-08-20 17:17:34 -05:00
epezent
18c72431f8 Update version and copyright year 2023-08-19 21:43:34 -05:00
Andrew Zonenberg
30d175bb50 Removed redundant semicolons (causes warning with -Wpedantic) (#453)
Removed redundant semicolons (causes warning with -Wpedantic)
2023-08-19 21:11:39 -05:00
ozlb
76c1f44c1d PlotDigital visualization problem when you zoom x axis and sample points are outside plot area (#492)
When sample points are outside plot area, x values are saturated to plot at least one rectangle; the problem is that ImRect::Contains the upper-left corners are checked with >= and the lower-right are checked with <, so in order to include there must be at least 1 pixel difference
https://github.com/ocornut/imgui/issues/3976
2023-08-18 19:11:10 -05:00
ocornut
85573fe04a Version 0.15
Add missing changelog.
v0.15 tag/release was previously set on cc5e1da about 3 weeks ago, will attempt to change tag into this commit.
2023-08-06 19:22:08 +02:00
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
Evan Pezent
f88ad32a47 remove mention of IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES in implot_items.cpp 2022-09-17 15:02:34 -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
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
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
Evan Pezent
86f4dd6e5c use ImFormatString instead of sprintf/snprintf 2022-01-30 10:19:29 -08:00
Evan Pezent
168244e422 replace sprintf with snprintf 2022-01-30 09:54:49 -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
5ed9e78676 add #include <immintrin.h> fallback 2021-09-07 20:20:12 -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
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
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
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
da1bf57136 fix scatter plot non-inclusive culling 2021-06-06 17:16:20 -07:00
omar
450e5b80df Fix for ImPool change in Dear ImGui version 18303+ (#239) 2021-06-03 11:45:25 -07:00
Evan Pezent
41a0e2c9fe add ImPlotAxisFlags_RangeFit and ImPlotAxisFlags_Foreground (#200) 2021-03-28 12:59:25 -07:00
epezent
7aab224742 make inline funcs static, add culling to PlotShaded 2021-03-20 21:22:18 -06:00
epezent
ccd29a646f rev up to v0.10 2021-03-20 20:45:31 -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
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