plotly_matlab
plotly_matlab copied to clipboard
Portable Installation
Hello,
Currently the ploy.ly MATLAB Setup does some nasty things:
- Copy Plot.Ly into MATAB Toolbox folder.
- Put files into User Folder.
I propose much simpler way and a portable way - Use only the folder plotly was copied into.
Only add that folder to MATLAB Path (If user wants that).
All can be done easily by changing few lines.
Thank You.
It seems like you are looking at two problems. The first is adding Plotly as a Toolbox; the second is that files are added to the user folder.
For the first: Actually it is possible to use Plotly that way. If you are an advanced user, you don't need to run plotlysetup
.
- Download plotly/MATLAB-Online from github into folder of your choice.
- Add that folder and its subfolders to your path, e.g. with
addpath(genpath(<path_to_plotly_MATLAB-Online>))
- Run
saveplotlycredentials('DemoAccount', 'lr1c37zw81')
with your credentials
However, note that plotly credentials must still be located in the proper folder (step 3). Quite a few changes would be needed to fix that part.
Why not build in a portable manner? All kept inside one folder?
I agree with you, @RoyiAvital, that portable would be nice, especially for offline use, or for multiple configs or credentials. I was just clarifying that there are two issues that you mentioned and in my opinion, the first issue is possible to work around. The steps I suggested are the same as used for using plotly/MATLAB-Online
within a Jupyter
notebook here: https://github.com/imatlab/imatlab
I just filed issue reports to both plotly/MATLAB-Online
and to plotly/plotly.py
related to the config and credential files, so that's why I also responded to your similar issue report.
plotly/MATLAB-Online#120
https://github.com/plotly/plotly.py/issues/728
I would make a pull request myself to improve the user files, but it seems like they affect multiple parts of the code, and they are somewhat parallel to the structure used for other plotly languages.
Any update on that?
It will be really helpful allowing portable installation.
Thank You.
Sorry, I'm really not sure what you're looking for. Do you want to use plotly? Either run the plotlysetup or copy the whole folder as I described. What part of the instructions I gave don't meet your expectations?
Hi,
On the one hand you agree with me on the other you ask what I want?
What I want is to have Plotly save all its configuration files within its folder and not in the User Profile Folder. It can be done manually, I wanted it to be official and automatically (At least a choice to do so).
Thank You.
Hi, I only ask because your initial question asked how to load Plotly without it adding as a toolbox, which it can do (but is undocumented). As far as I can see, certain parts of Plotly-MATLAB have hard-coded the config directory. The devs have not responded to my config file requests (above), and looking at other issues, I don't think they will get to it any time soon.
As I see it, Plotly does not have any developers actively working on fixing issues for project (40+ open issues). However, they do accept pull requests (0 open pull requests, most pull requests were accepted). Therefore, if we want the user profile folder to be "official and automatic", we need to code the changes and submit the pull request. Or wait for a major refactor.
My work around to generate a Portable installation is:
- From
plotlysetup()
add a remark to the section which tries to installPlotLy
as a toolbox. Lines 47 - 138. - Edit the function
getuserdir
(In theplotly\plotly_aux
folder) to return the path to the folderPlotLy
is installed to. - Run setup as instructed.
This will all needed credentials and offline files in the same folder as the user installed.
This allows, for instance, using PlotLy
on the same computer with 2 different accounts, etc...