Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1539fea

Browse filesBrowse files
authored
Merge pull request #3092 from plotly/template-fixes
Use Template.newContainer in polar axis defaults
2 parents 8efe385 + abb79ac commit 1539fea
Copy full SHA for 1539fea

File tree

Expand file treeCollapse file tree

3 files changed

+43
-5
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+43
-5
lines changed

‎src/plots/polar/layout_defaults.js

Copy file name to clipboardExpand all lines: src/plots/polar/layout_defaults.js
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
var Lib = require('../../lib');
1212
var Color = require('../../components/color');
13+
var Template = require('../../plot_api/plot_template');
14+
1315
var handleSubplotDefaults = require('../subplot_defaults');
1416
var getSubplotData = require('../get_data').getSubplotData;
1517

@@ -49,11 +51,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
4951
}
5052

5153
var axIn = contIn[axName];
52-
// Note: does not need template propagation, since coerceAxis is still
53-
// based on the subplot-wide coerce function. Though it may be more
54-
// efficient to make a new coerce function, then we *would* need to
55-
// propagate the template.
56-
var axOut = contOut[axName] = {};
54+
var axOut = contOut[axName] = Template.newContainer(contOut, axName);
5755
axOut._id = axOut._name = axName;
5856
axOut._traceIndices = subplotData.map(function(t) { return t._expandedIndex; });
5957

49.2 KB
Loading

‎test/image/mocks/polar_template.json

Copy file name to clipboard
+40Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"data": [
3+
{
4+
"r": [1, 2, 3],
5+
"theta": [4, 1, 2],
6+
"type": "scatterpolar"
7+
}
8+
],
9+
"layout": {
10+
"template": {
11+
"data": {
12+
"scatterpolar": [
13+
{
14+
"thetaunit": "radians",
15+
"marker": {
16+
"color": "hotpink",
17+
"size": 20
18+
},
19+
"line": {
20+
"color": "cyan"
21+
}
22+
}
23+
]
24+
},
25+
"layout": {
26+
"polar": {
27+
"bgcolor": "black",
28+
"radialaxis": {
29+
"gridcolor": "white",
30+
"linecolor": "white"
31+
},
32+
"angularaxis": {
33+
"gridcolor": "white",
34+
"linecolor": "white"
35+
}
36+
}
37+
}
38+
}
39+
}
40+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.