Skip to content

Merged Fig <-> Nofig, now truely offline #369

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

Merged
merged 2 commits into from
Sep 6, 2021
Merged

Merged Fig <-> Nofig, now truely offline #369

merged 2 commits into from
Sep 6, 2021

Conversation

harshpurwar
Copy link
Contributor

@harshpurwar harshpurwar commented Sep 5, 2021

This PR merges the two classes plotlyfig and plotlynofig (previously created for documentation needs). This also now works truly in the offline mode.

There is no need to even signup to chart studio and get an API key if a user wants to use plotly_matlab in the offline mode.

Request to reviewers: Please test this thoroughly before merging it. You may use the following code or write your own complex version:

trace1 = struct(...
  'x', [1, 2, 3, 4], ...
  'y', [0, 2, 3, 5], ...
  'fill', 'tozeroy', ...
  'type', 'scatter');
trace2 = struct(...
  'x', [1, 2, 3, 4], ...
  'y', [3, 5, 1, 7], ...
  'fill', 'tonexty', ...
  'type', 'scatter');
data = {trace1,trace2};
response = plotly(data, struct('filename', 'basic-area', 'fileopt', 'overwrite', 'offline', 1));
url = response.url

@harshpurwar
Copy link
Contributor Author

Also added an option to suppress writing a file writeFile (defaults to true) in both fig2plotly() and plotly(). This can be used to just get an object of the plotly figure and not write any file to disk (in offline mode) or chart-studio (in online mode).

Copy link
Contributor

@gilbertogalvis gilbertogalvis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like much the code developed from @harshpurwar. Great style!

@jackparmer jackparmer merged commit 7a060e9 into master Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants