Skip to content

Commit 80acb54

Browse files
wip
1 parent af9cb5f commit 80acb54

File tree

2 files changed

+60
-57
lines changed

2 files changed

+60
-57
lines changed

_data/get_plotschema.py

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -32,60 +32,3 @@ def reorder_keys(parent, target, order):
3232
reorder_keys(trace, "attributes", orders["trace_attr_order"])
3333

3434
json.dump(schema, open('plotschema.json', 'w'), indent=2)
35-
36-
37-
for upperlang in ["Python", "JavaScript", "MATLAB", "R"]:
38-
lang = upperlang.lower()
39-
for attr in [
40-
"xaxis", "yaxis", "coloraxis", "scene", "polar", "ternary", "geo", "mapbox",
41-
"sliders", "updatemenus", "annotations", "shapes", "images", "global"
42-
]:
43-
fullattr = "layout" + ("." + attr if attr != "global" else "")
44-
with open(f"../_posts/reference_pages/{lang}/2020-07-20-{attr}.html" , 'w') as f:
45-
f.write(
46-
f"""---
47-
permalink: /{lang}/reference/{fullattr.replace(".", "/")}/
48-
layout: langindex
49-
page_type: reference
50-
language: {lang}
51-
name: {fullattr}
52-
description: Figure attribute reference for Plotly's {upperlang} open-source graphing library.
53-
---
54-
55-
<h2>{upperlang} Figure Reference: <code>{fullattr}</code></h2>
56-
<br />
57-
<div class="row">
58-
<div class="eight columns">
59-
60-
{{% assign attribute=site.data.plotschema.layout.layoutAttributes %}}
61-
{{% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="{attr}" %}}
62-
63-
</div>
64-
</div>
65-
"""
66-
)
67-
68-
69-
for trace in schema["traces"]:
70-
with open(f"../_posts/reference_pages/{lang}/2020-07-20-{trace}.html" , 'w') as f:
71-
f.write(
72-
f"""---
73-
permalink: /{lang}/reference/{trace}/
74-
layout: langindex
75-
page_type: reference
76-
language: {lang}
77-
name: {trace} Traces
78-
description: Figure attribute reference for Plotly's {upperlang} open-source graphing library.
79-
---
80-
81-
<h2>{upperlang} Figure Reference: <code>{trace}</code> Traces</h2>
82-
<br /><br />
83-
<div class="row">
84-
<div class="eight columns">
85-
86-
{{% include posts/reference-trace.html trace_name="{trace}" trace_data=site.data.plotschema.traces.{trace} %}}
87-
88-
</div>
89-
</div>
90-
"""
91-
)

_data/make_ref_pages.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import json
2+
3+
schema = json.load(open("plotschema.json"))
4+
5+
6+
for upperlang in ["Python", "JavaScript", "MATLAB", "R"]:
7+
lang = upperlang.lower()
8+
for attr in [
9+
"xaxis", "yaxis", "coloraxis", "scene", "polar", "ternary", "geo", "mapbox",
10+
"sliders", "updatemenus", "annotations", "shapes", "images", "global"
11+
]:
12+
fullattr = "layout" + ("." + attr if attr != "global" else "")
13+
with open(f"../_posts/reference_pages/{lang}/2020-07-20-{attr}.html" , 'w') as f:
14+
f.write(
15+
f"""---
16+
permalink: /{lang}/reference/{fullattr.replace(".", "/")}/
17+
layout: langindex
18+
page_type: reference
19+
language: {lang}
20+
name: {fullattr}
21+
description: Figure attribute reference for Plotly's {upperlang} open-source graphing library.
22+
---
23+
24+
<h2>{upperlang} Figure Reference: <code>{fullattr}</code></h2>
25+
<br />
26+
<div class="row">
27+
<div class="eight columns">
28+
29+
{{% assign attribute=site.data.plotschema.layout.layoutAttributes %}}
30+
{{% include posts/reference-block.html parentlink="layout" block="layout" parentpath="layout" mustmatch="{attr}" %}}
31+
32+
</div>
33+
</div>
34+
"""
35+
)
36+
37+
38+
for trace in schema["traces"]:
39+
with open(f"../_posts/reference_pages/{lang}/2020-07-20-{trace}.html" , 'w') as f:
40+
f.write(
41+
f"""---
42+
permalink: /{lang}/reference/{trace}/
43+
layout: langindex
44+
page_type: reference
45+
language: {lang}
46+
name: {trace} Traces
47+
description: Figure attribute reference for Plotly's {upperlang} open-source graphing library.
48+
---
49+
50+
<h2>{upperlang} Figure Reference: <code>{trace}</code> Traces</h2>
51+
<br /><br />
52+
<div class="row">
53+
<div class="eight columns">
54+
55+
{{% include posts/reference-trace.html trace_name="{trace}" trace_data=site.data.plotschema.traces.{trace} %}}
56+
57+
</div>
58+
</div>
59+
"""
60+
)

0 commit comments

Comments
 (0)