forked from plotly/plotly_matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateplotlyhelp.m
More file actions
39 lines (29 loc) · 1.04 KB
/
updateplotlyhelp.m
File metadata and controls
39 lines (29 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%----UPDATE THE PLOTLY HELP GRAPH REFERENCE----%
function updateplotlyhelp
% remote Plotly Graph Reference url
remote = ['https://raw.githubusercontent.com/plotly/',...
'graph_reference/master/graph_objs/matlab/graph_objs_keymeta.json'];
% download the remote content
try
prContent = urlread(remote);
catch
fprintf(['\nAn error occurred while trying to read the latest\n',...
'Plotly MATLAB API graph reference from:\n',...
'https://github.com/plotly/graph_reference.\n']);
return
end
% load the json into a struct
pr = loadjson(prContent);
%------------------------MATLAB SPECIFIC TWEAKS---------------------------%
%-key_type changes-%
pr.annotation.xref.key_type = 'plot_info';
pr.annotation.yref.key_type = 'plot_info';
pr.line.shape.key_type = 'plot_info';
%-------------------------------------------------------------------------%
% save directory
helpdir = fullfile(fileparts(which('updateplotlyhelp')),'plotly_reference');
% pr filename
prname = fullfile(helpdir);
%----save----%
save(prname,'pr');
end