questions around an idea i have for a feature in lyx

Pavel Sanda sanda at lyx.org
Fri May 3 11:12:38 UTC 2024


On Fri, May 03, 2024 at 12:28:04PM +0300, matan guedj wrote:
> that's about it) but I wanted to add a new feature to LyX - a plotting tool.
> What I'm thinking of is on the math bar or some other bar, add a plot icon
> that will open a window with all the parameters for the mostly used plots
> (2D/3D, Cartesian/polar/spherical..., scatter/bars/pie..., parametric
> curves or surfaces, implicit functions, vector fields, and more).
> I'm still learning pgfplots but it follows a fairly simple and well-defined
> formula for most of the plots so it most likely can be automated.
> And now it opens some questions:

Dear Matan,

thanks for reaching out before you actually started coding. 

> 1. Is there a way I can start work on it as a personal project (I
> specifically want it to be a personal thing, to see if I'm capable of this,
> and also it can't look bad on the resume),

You can just git pull the current master, create locally your own branch
and start working on it. From time to time locally merge with the master 
branch and you should be set.

> and when I believe it's done and
> an acceptable feature, present it to the developers and implement it for
> the next version? (2.5.x probably whenever this will come up)

Right, apart from the obvious question whether you can pull it off, it's
also important to ask whether, that's something lyx needs and wants.

I do not use pgfplots myself to know the answer right now, but the
obvious points to clarify (anyone competent please chime in):

- are there competing packages around? Is pgfplots the obvious
  mainstream solution for the task it's designed for?

- how much is pgfplots used/maintained over long time. Does the
  history of releases and community around looks like it would
  be around in the next 10 years?

- how much is their API (or commands) changing over time? Are 
  the .lyx documents using pgf constructs compile over the span
  of years? I am reasonably sure that the constructs from our math
  panel will compile in the long term, is the pgf stable enough
  that we should build the graphical UI around it?

> 2. I have also already been working with LyX on a device, so if I'm to try
> to develop it (meaning I have some interaction with a copy/mirror of the
> source code) should I just for safety do it on a completely new device
> where I don't have lyx installed? (I'm mostly thinking about if I develop
> it on the device I already am using lyx in, it'll lead to errors in the
> regular lyx files I'm using)

Not really, you can easily have many different versions of lyx to run
in parallel, you just need to separate them in different folders and
configure so that for different versions use different configuration
files (--with-version-suffix=2.5 of ./configure might be enough if you
work in linux).

> 3. I also thought that the output on the LyX document itself would be a new
> environment (specifically like the math environment, with the
> instant-preview feature to render those plots in the lyx document itself
> like the math is already rendered with the instant preview) so that it'll
> cut the need to compile the document to check if the plot is what you
> really wanted, so how do I create such an environment?

What would be the advantage over having already existing ert + instant preview
+ newly created iconbar for pgfplots? This solution looks actually pretty easy
if we decide that we want to support pgf - not much C++ coding would be needed.


Cheers,
Pavel


More information about the lyx-devel mailing list