diff --git a/src/plots/polar/layout_defaults.js b/src/plots/polar/layout_defaults.js index 462916536ac..8017b42a7f8 100644 --- a/src/plots/polar/layout_defaults.js +++ b/src/plots/polar/layout_defaults.js @@ -10,6 +10,8 @@ var Lib = require('../../lib'); var Color = require('../../components/color'); +var Template = require('../../plot_api/plot_template'); + var handleSubplotDefaults = require('../subplot_defaults'); var getSubplotData = require('../get_data').getSubplotData; @@ -49,11 +51,7 @@ function handleDefaults(contIn, contOut, coerce, opts) { } var axIn = contIn[axName]; - // Note: does not need template propagation, since coerceAxis is still - // based on the subplot-wide coerce function. Though it may be more - // efficient to make a new coerce function, then we *would* need to - // propagate the template. - var axOut = contOut[axName] = {}; + var axOut = contOut[axName] = Template.newContainer(contOut, axName); axOut._id = axOut._name = axName; axOut._traceIndices = subplotData.map(function(t) { return t._expandedIndex; }); diff --git a/test/image/baselines/polar_template.png b/test/image/baselines/polar_template.png new file mode 100644 index 00000000000..98bea716231 Binary files /dev/null and b/test/image/baselines/polar_template.png differ diff --git a/test/image/mocks/polar_template.json b/test/image/mocks/polar_template.json new file mode 100644 index 00000000000..f2d7dc848c9 --- /dev/null +++ b/test/image/mocks/polar_template.json @@ -0,0 +1,40 @@ +{ + "data": [ + { + "r": [1, 2, 3], + "theta": [4, 1, 2], + "type": "scatterpolar" + } + ], + "layout": { + "template": { + "data": { + "scatterpolar": [ + { + "thetaunit": "radians", + "marker": { + "color": "hotpink", + "size": 20 + }, + "line": { + "color": "cyan" + } + } + ] + }, + "layout": { + "polar": { + "bgcolor": "black", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white" + }, + "angularaxis": { + "gridcolor": "white", + "linecolor": "white" + } + } + } + } + } +}