Repository navigation
Expand file tree
/
Copy pathplotschema-reference.html
More file actions
84 lines (75 loc) · 4.33 KB
/
Copy pathplotschema-reference.html
File metadata and controls
84 lines (75 loc) · 4.33 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{% capture plotschemacontent %}
{% for trace in site.data.plotschema.schema.traces %}
<div class="row">
<div class="eight columns">
<a id="{{ trace[0] }}" href="#{{ trace[0] }}"><h4>{{ trace[0] }}</h4></a>
<div class="description">
<!-- Ugh, wish I could keep `language` out of here -->
{% if page.language == "plotly_js" %}
A <code>{{trace[0]}}</code> trace is an object with the key <code>"type"</code> equal to <code>"{{trace[1].attributes.type}}"</code>
(i.e. <code>{"type": "{{trace[1].attributes.type}}"}</code>) and any of the keys listed below.
{% elsif page.language == "python" %}
{% if trace[1].hrName %}
{% capture graph_object %}{{ trace[1].hrName }}{% endcapture %}
{% else %}
{% capture graph_object %}{{trace[0] }}{% endcapture %}
{% endif %}
{% capture graph_object %}{{ graph_object | replace: '_', ' ') | capitalize_all | replace: ' ', '' |
replace: '2d', '2D' | replace: '3d' : '3D'}}{% endcapture %}
<code>import plotly.graph_objs as go</code><br><code>go.{{ graph_object }}</code><br>
A <code>{{ graph_object }}</code> trace is a graph object with any of the named arguments or attributes
listed below.
{% elsif page.language == "r" %}
A <code>{{trace[0]}}</code> trace is initialized with <code>plot_ly</code> or <code>add_trace</code>:<br>
<code>plot_ly(df, type="{{trace[0]}}"[, ...])<br>
add_trace(p, type="{{trace[0]}}"[, ...])</code><br>
A {{trace[0]}} trace accepts any of the keys listed below.
{% elsif page.language == "matlab" %}
A <code>{{trace[0]}}</code> trace is a <code>struct</code> inside <code>fig.data</code> which has
<code>type</code> equal to <code>'{{trace[0]}}'</code>. This section lists all of the valid keys that a
<code>{{trace[0]}} struct</code> can contain.
{% endif %}
<br><br>{{ trace[1].description }}<br><br>
</div>
{% assign localparentlink=trace[0] %}
{% assign attribute=trace[1].attributes %}
{% assign display_info = true %}
{% assign toc = false %}
{% assign block = "data" %}
{% include reference-block.html parentlink=localparentlink block=block %}
</div>
</div>
<hr>
{% endfor %}
<div class="row">
<div class="eight columns">
{% assign localparentlink=trace[0] %}
{% assign attribute=trace[1].attributes %}
{% assign display_info = true %}
{% assign toc = false %}
{% assign block = "data" %}
<a id="layout" href="#layout"><h4>layout</h4></a>
{% assign localparentlink="layout" %}
{% assign attribute=site.data.plotschema.schema.layout.layoutAttributes %}
{% assign block = "layout" %}
{% include reference-block.html parentlink=localparentlink block=block %}
{% assign localparentlink="layout" %}
{% assign attribute=site.data.plotschema.schema.traces.box.layoutAttributes %}
{% assign block = "layout" %}
{% include reference-block.html parentlink=localparentlink block=block %}
{% assign localparentlink="layout" %}
{% assign attribute=site.data.plotschema.schema.traces.bar.layoutAttributes %}
{% assign block = "layout" %}
{% include reference-block.html parentlink=localparentlink block=block %}
{% assign localparentlink="layout" %}
{% assign attribute=site.data.plotschema.schema.traces.violin.layoutAttributes %}
{% assign block = "layout" %}
{% include reference-block.html parentlink=localparentlink block=block %}
</div>
</div>
{% endcapture %}
{% capture curlyarray %}{% raw %}{array}{% endraw %}{% endcapture %}
{% capture curlyarrays %}{% raw %}{arrays}{% endraw %}{% endcapture %}
{% capture curly2darray %}{% raw %}{2D array}{% endraw %}{% endcapture %}
{% capture curlyobject %}{% raw %}{object}{% endraw %}{% endcapture %}
{{ plotschemacontent | replace:'*',quote | replace:curlyarray,array | replace:curlyobject,object | replace:curlyarrays,arrays | replace:curly2darray,2darray | replace:"data_array",data_array | replace:"true",truestring | replace:"false",falsestring }}