Skip to content

Conversation

@guptanshuman124
Copy link

@guptanshuman124 guptanshuman124 commented Nov 8, 2025

Description

Give a brief description of the pull request.

  • multi-expression implemented
  • panning and zoom implemented
  • gridlines and ticks implemented
image

Semver Changes

  • Patch (bug fix, no new features)
  • Minor (new features, no breaking changes)
  • Major (breaking changes)

Issues

List any issues that this pull request closes.
#8

Checklist

@nsh07
Copy link
Member

nsh07 commented Nov 10, 2025

Also, implicit functions, polar functions and parametric relations do not work anymore (you have simply removed all the required code for those features). Is this intentional?

@guptanshuman124
Copy link
Author

guptanshuman124 commented Nov 10, 2025

@nsh07 I accidently removed the features of implicit function polar function and parametric relation. I would do a commit by tomorrow evening as I was doing some refactoring in code to remove the clutterinside main application.cpp file.

@nsh07
Copy link
Member

nsh07 commented Nov 10, 2025

Sure, take your time. Your implementation is really good, and it is exactly what I was looking for.

namespace App::Core {

struct Expression {
std::array<char, 1024> expr; // expression as char array

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this instead be a std::string?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying this but faced some issues back then. As I remember that the exprtk compile and expression function require array of character. Not sure about it.

I would try to reuse it and check it out.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not correct. std::string is the primary input parameter for the string representation of an expression for use with the compile method.

https://www.partow.net/programming/exprtk/exprtk.hpp_.html#line_24640

Copy link
Author

@guptanshuman124 guptanshuman124 Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok got it, will change the implementation. There might be something else back when I was structuring it. Thanks for the help

for (size_t i = 0; i < functions.size(); ++i) {
if (!functions[i].visible) continue;
expressions[i].register_symbol_table(symbolTable);
parser.compile(functions[i].expr.data(), expressions[i]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to check the return value of the compile method. if it is false the function should not be further evaluated.

for (size_t i = 0; i < functions.size(); ++i) {
if (!functions[i].visible) continue;
expressions[i].register_symbol_table(symbolTable);
parser.compile(functions[i].expr.data(), expressions[i]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functions should only be compiled when they change. The Expression struct should perhaps hold the exprtk::expression instance. As constructing/destructing exprtk::parser/symbol_table/expression types on a per frame basis will be very expensive.

@nsh07
Copy link
Member

nsh07 commented Nov 13, 2025

Thank you so much for your review @ArashPartow

@guptanshuman124 please also resolve these change requests while you're working on the PR

@guptanshuman124
Copy link
Author

Thank you so much for your review @ArashPartow

@guptanshuman124 please also resolve these change requests while you're working on the PR

@ArashPartow thank you for the valuable feedback.I will take care of it.

@nsh07 my current progress

  • made the refactoring of code for removing the cluterness(adding new plotter and expression files for structuring)
  • reimplemented polar,parametric and explicit plotting
  • implicit functions and inequality are left willl try to do as soon as possible
  • added a remove function button
  • added random color generation on adding a new function
image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants