@@ -25,6 +25,11 @@ def insert_whitespace(x):
25
25
x = x .replace (word , " " + word + " " ).replace (" " , " " )
26
26
return x .strip (" " )
27
27
28
+ split_layout_attrs = [
29
+ "xaxis" , "yaxis" , "coloraxis" , "scene" , "polar" , "ternary" , "geo" , "mapbox" ,
30
+ "sliders" , "updatemenus" , "annotations" , "shapes" , "images"
31
+ ]
32
+
28
33
_epsilon = 0.0
29
34
30
35
def epsilon ():
@@ -43,6 +48,10 @@ def next_level(previous_level, chain_dict):
43
48
permalink = chain_dict ["permalink" ] + "-" + sub_attr ,
44
49
rank = chain_dict ["rank" ] + 1 + epsilon (),
45
50
)
51
+ for attr in split_layout_attrs :
52
+ if attribute ["permalink" ].endswith ("layout-" + attr ):
53
+ attribute ["permalink" ] = attribute ["permalink" ].replace ("/layout/" , "/layout/" + attr + "/" )
54
+
46
55
if "description" in previous_level [sub_attr ]:
47
56
attribute ["description" ] = previous_level [sub_attr ][
48
57
"description"
@@ -57,7 +66,7 @@ def next_level(previous_level, chain_dict):
57
66
next_level (previous_level [sub_attr ], attribute .copy ())
58
67
59
68
60
- layout_chain_dict = dict (name = "layout" , split_name = "layout" , permalink = "reference/#layout" , rank = epsilon ())
69
+ layout_chain_dict = dict (name = "layout" , split_name = "layout" , permalink = "reference/layout/ #layout" , rank = epsilon ())
61
70
62
71
# recursively add layout attributes to schema
63
72
next_level (p ["layout" ]["layoutAttributes" ], layout_chain_dict .copy ())
@@ -66,7 +75,7 @@ def next_level(previous_level, chain_dict):
66
75
trace_chain_dict = dict (
67
76
name = trace_type + " traces" ,
68
77
split_name = insert_whitespace (trace_type ),
69
- permalink = "reference/#" + trace_type , rank = epsilon ()
78
+ permalink = "reference/" + trace_type + "/ #" + trace_type , rank = epsilon ()
70
79
)
71
80
if p ["traces" ][trace_type ]["meta" ]:
72
81
trace_chain_dict ["description" ] = (
0 commit comments