-
Notifications
You must be signed in to change notification settings - Fork 167
Portable Installation #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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
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 I just filed issue reports to both 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. 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:
This will all needed credentials and offline files in the same folder as the user installed. |
My workaround for version 3.0:
function response = plotlyoffline(plotlyfig)
% Generate offline Plotly figure saved as an html file within
% the current working directory. The file will be saved as:
% 'plotlyfig.PlotOptions.FileName'.html.
% create dependency string unless not required
if plotlyfig.PlotOptions.IncludePlotlyjs
% grab the bundled dependencies
userHome = getuserdir();
plotlyConfigFolder = fullfile(userHome,'.plotly');
plotlyJSFolder = fullfile(plotlyConfigFolder, 'plotlyjs');
%--------------------------------Royi--------------------------------%
filePath = mfilename('fullpath');
[folderPath, fileName] = fileparts(filePath);
plotlyJSFolder = folderPath;
%--------------------------------Royi--------------------------------%
bundleName = 'plotly-matlab-offline-bundle.js';
bundleFile = fullfile(plotlyJSFolder, bundleName);
plotly_bundle = webread('http://cdn.plot.ly/plotly-latest.min.js');
bundle = escapechars(plotly_bundle);
file_id = fopen('plotly-matlab-offline-bundle.js', 'w');
fprintf(file_id, '%s', bundle);
fclose(file_id);
hF = figure();
plot(1:10);
fig2plotly(hF);
It would be great to have support for "Portable" installation where the JS file is kept within the folder yet the HTML files are generated inside Windows' |
Hello,
Currently the ploy.ly MATLAB Setup does some nasty things:
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.
The text was updated successfully, but these errors were encountered: