Skip to content

Commit c24ae98

Browse files
piePattern : use the old point color when no shape present
+ plot-schema.json after running npm run schema
1 parent fedbe67 commit c24ae98

File tree

2 files changed

+96
-1
lines changed

2 files changed

+96
-1
lines changed

src/traces/pie/style_one.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ module.exports = function styleOne(s, pt, trace, gd) {
2020
// coming from a legend
2121
s[0][0].__data__.i = s[0][0].__data__[0].i;
2222
}
23-
// console.log( 's0 - i : ', s[0][0].__data__['i']);
23+
// console.log( 's0 - i : ', s[0][0].__data__['i'], 'pt.color', pt.color, 'trace', trace);
24+
25+
if(!trace.marker.shape) trace.marker.color = pt.color;
2426

2527
Drawing.pointStyle(s, trace, gd);
2628
// to do : push into s.style d3 logic

test/plot-schema.json

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41856,6 +41856,99 @@
4185641856
"valType": "string"
4185741857
}
4185841858
},
41859+
"pattern": {
41860+
"bgcolor": {
41861+
"arrayOk": true,
41862+
"description": "When there is no colorscale sets the color of background pattern fill. Defaults to a `marker.color` background when `fillmode` is *overlay*. Otherwise, defaults to a transparent background.",
41863+
"editType": "style",
41864+
"valType": "color"
41865+
},
41866+
"bgcolorsrc": {
41867+
"description": "Sets the source reference on Chart Studio Cloud for `bgcolor`.",
41868+
"editType": "none",
41869+
"valType": "string"
41870+
},
41871+
"description": "Sets the pattern within the marker.",
41872+
"editType": "style",
41873+
"fgcolor": {
41874+
"arrayOk": true,
41875+
"description": "When there is no colorscale sets the color of foreground pattern fill. Defaults to a `marker.color` background when `fillmode` is *replace*. Otherwise, defaults to dark grey or white to increase contrast with the `bgcolor`.",
41876+
"editType": "style",
41877+
"valType": "color"
41878+
},
41879+
"fgcolorsrc": {
41880+
"description": "Sets the source reference on Chart Studio Cloud for `fgcolor`.",
41881+
"editType": "none",
41882+
"valType": "string"
41883+
},
41884+
"fgopacity": {
41885+
"description": "Sets the opacity of the foreground pattern fill. Defaults to a 0.5 when `fillmode` is *overlay*. Otherwise, defaults to 1.",
41886+
"editType": "style",
41887+
"max": 1,
41888+
"min": 0,
41889+
"valType": "number"
41890+
},
41891+
"fillmode": {
41892+
"description": "Determines whether `marker.color` should be used as a default to `bgcolor` or a `fgcolor`.",
41893+
"dflt": "replace",
41894+
"editType": "style",
41895+
"valType": "enumerated",
41896+
"values": [
41897+
"replace",
41898+
"overlay"
41899+
]
41900+
},
41901+
"role": "object",
41902+
"shape": {
41903+
"arrayOk": true,
41904+
"description": "Sets the shape of the pattern fill. By default, no pattern is used for filling the area.",
41905+
"dflt": "",
41906+
"editType": "style",
41907+
"valType": "enumerated",
41908+
"values": [
41909+
"",
41910+
"/",
41911+
"\\",
41912+
"x",
41913+
"-",
41914+
"|",
41915+
"+",
41916+
"."
41917+
]
41918+
},
41919+
"shapesrc": {
41920+
"description": "Sets the source reference on Chart Studio Cloud for `shape`.",
41921+
"editType": "none",
41922+
"valType": "string"
41923+
},
41924+
"size": {
41925+
"arrayOk": true,
41926+
"description": "Sets the size of unit squares of the pattern fill in pixels, which corresponds to the interval of repetition of the pattern.",
41927+
"dflt": 8,
41928+
"editType": "style",
41929+
"min": 0,
41930+
"valType": "number"
41931+
},
41932+
"sizesrc": {
41933+
"description": "Sets the source reference on Chart Studio Cloud for `size`.",
41934+
"editType": "none",
41935+
"valType": "string"
41936+
},
41937+
"solidity": {
41938+
"arrayOk": true,
41939+
"description": "Sets the solidity of the pattern fill. Solidity is roughly the fraction of the area filled by the pattern. Solidity of 0 shows only the background color without pattern and solidty of 1 shows only the foreground color without pattern.",
41940+
"dflt": 0.3,
41941+
"editType": "style",
41942+
"max": 1,
41943+
"min": 0,
41944+
"valType": "number"
41945+
},
41946+
"soliditysrc": {
41947+
"description": "Sets the source reference on Chart Studio Cloud for `solidity`.",
41948+
"editType": "none",
41949+
"valType": "string"
41950+
}
41951+
},
4185941952
"role": "object"
4186041953
},
4186141954
"meta": {

0 commit comments

Comments
 (0)