plotly_matlab icon indicating copy to clipboard operation
plotly_matlab copied to clipboard

Portable Installation

Open RoyiAvital opened this issue 8 years ago • 8 comments

Hello,

Currently the ploy.ly MATLAB Setup does some nasty things:

  1. Copy Plot.Ly into MATAB Toolbox folder.
  2. 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.

RoyiAvital avatar Feb 04 '17 09:02 RoyiAvital

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.

  1. Download plotly/MATLAB-Online from github into folder of your choice.
  2. Add that folder and its subfolders to your path, e.g. with addpath(genpath(<path_to_plotly_MATLAB-Online>))
  3. 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.

twocs avatar Apr 08 '17 09:04 twocs

Why not build in a portable manner? All kept inside one folder?

RoyiAvital avatar Apr 08 '17 09:04 RoyiAvital

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.

twocs avatar Apr 08 '17 11:04 twocs

Any update on that?

It will be really helpful allowing portable installation.

Thank You.

RoyiAvital avatar Jun 12 '17 18:06 RoyiAvital

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?

twocs avatar Jun 13 '17 01:06 twocs

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.

RoyiAvital avatar Jun 13 '17 04:06 RoyiAvital

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.

twocs avatar Jun 13 '17 05:06 twocs

My work around to generate a Portable installation is:

  1. From plotlysetup() add a remark to the section which tries to install PlotLy as a toolbox. Lines 47 - 138.
  2. Edit the function getuserdir (In the plotly\plotly_aux folder) to return the path to the folder PlotLy is installed to.
  3. 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...

RoyiAvital avatar Jan 09 '21 14:01 RoyiAvital