I am making a node-electron application that uses plotly.js for plotting. Now to export as pdf or eps I need to use orca. But I cant figure out how to use orca programmetically to save an image. I have tried using https://github.com/plotly/orca#api-usage but it shows
Uncaught TypeError: Cannot read property 'commandLine' of undefined
So, how do I use this?
Also I have some additional queries:
Do I have to use firstname.lastname@example.org to use orca ?
I just want orca to save the image and its already in a electron application, so do I have to use the full orca suit, or is there something just can just let me use the pdf exporter?
I’m running as (using a npm script) as yarn electron .. Now let’s say I’m on the renderer process and graphDiv is my plotly plot container so graphDiv.data and graphDiv.layout has my data and layout. So, what should I do to export it using orca. Is this okay to do ,
So I did some checks. I have two js files main.js and myfile.js. Electron runs the main.js in start (as usual) and also opens the actual app window which (i.e. the renderer process) runs the myfile.js. Now it turns out If I put
this part of the code directly in main.js then electron opens the window, outputs the output.pdf closes the window quickly.
If I put the code in myfile.js (i.e in renderer process) it doesn’t work throws the prvious error.
If I keep the part of the code (in a function) in the index.js and calls the function from the renderer process using ipcRenderer.send it doesn’t gives any output but also doesn’t throws any error.
So, I need keep that code block in main process because it doesn’t work in renderer process, also I can’t run this using inter processes communication calls. So, how do I do it? Am I doing something wrong?
I am developing a data analysis application (for my research work in computational chemistry) and it uses Plotly for visualization purposes. The application is basically a simple web page with plotly.js and I bundled up everything in an electron application for easy sharing with my colleagues. Now plotly.js can save images in jpg, png, svg and webp. That’s fine but everyone wants to save the image in pdf or eps as that’s like an unofficial standard for plots in my research field. Orca can export in pdf and eps so I wanted to integrate orca in my application for that purpose. But orca seems to only work in main process, whereas the electron application does all the analysis and visualization in the renderer process. So, I can’t use orca in my application, not now at least.