Skip to content

Commit 4ddb8c3

Browse files
author
Kevin Yan
authored
Merge pull request #102 from plotly/sharing_config
Set world_readable to reflect value in config
2 parents cc9b9ed + 90ef666 commit 4ddb8c3

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## MATLAB PLOTLY API WRAPPER 2.2.5
1+
## MATLAB PLOTLY API WRAPPER 2.2.6
22

33
### NUTSHELL:
44

plotly/plotly_aux/plotly_version.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function version = plotly_version()
2-
version = '2.2.5';
2+
version = '2.2.6';
33
end

plotly/plotlyfig.m

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
obj.PlotOptions.CleanFeedTitle = true;
5454
obj.PlotOptions.FileName = '';
5555
obj.PlotOptions.FileOpt = 'new';
56-
obj.PlotOptions.WorldReadable = true;
56+
obj.PlotOptions.WorldReadable = obj.get_sharing;
5757
obj.PlotOptions.ShowURL = true;
5858
obj.PlotOptions.OpenURL = true;
5959
obj.PlotOptions.Strip = true;
@@ -887,6 +887,29 @@ function delete(obj)
887887
link_domain = strrep(plotly_domain, 'https://', '');
888888
link_domain = strrep(link_domain, 'http://', '');
889889
link_text = ['Export to ' link_domain];
890-
end
890+
end
891+
892+
function sharing_value = get_sharing(obj)
893+
config = loadplotlyconfig();
894+
if ~isfield(config, 'sharing')
895+
if isfield(config, 'world_readable')
896+
sharing_value = config.world_readable;
897+
return;
898+
else
899+
sharing_value = true;
900+
return;
901+
end
902+
end
903+
904+
config = config.sharing;
905+
if strcmp(config, 'private')
906+
sharing_value = false;
907+
elseif strcmp(config, 'secret')
908+
warning('Secret share keys are not currently supported in the MATLAB API.');
909+
sharing_value = false;
910+
else
911+
sharing_value = true;
912+
end
913+
end
891914
end
892915
end

0 commit comments

Comments
 (0)