Skip to content

Commit f0f9a86

Browse files
authored
Merge pull request #3191 from plotly/parcats_dark
Use paper_bgcolor for parcats text-shadow instead of hardcoding to white
2 parents 1819584 + ffcecd4 commit f0f9a86

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

src/traces/parcats/parcats.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ function performPlot(parcatsModels, graphDiv, layout, svg) {
230230
.attr('class', 'catlabel')
231231
.attr('pointer-events', 'none');
232232

233+
var paperColor = graphDiv._fullLayout.paper_bgcolor;
234+
233235
// Update category label
234236
categorySelection.select('text.catlabel')
235237
.attr('text-anchor',
@@ -245,10 +247,10 @@ function performPlot(parcatsModels, graphDiv, layout, svg) {
245247
.attr('alignment-baseline', 'middle')
246248

247249
.style('text-shadow',
248-
'rgb(255, 255, 255) -1px 1px 2px, ' +
249-
'rgb(255, 255, 255) 1px 1px 2px, ' +
250-
'rgb(255, 255, 255) 1px -1px 2px, ' +
251-
'rgb(255, 255, 255) -1px -1px 2px')
250+
paperColor + ' -1px 1px 2px, ' +
251+
paperColor + ' 1px 1px 2px, ' +
252+
paperColor + ' 1px -1px 2px, ' +
253+
paperColor + ' -1px -1px 2px')
252254
.style('fill', 'rgb(0, 0, 0)')
253255
.attr('x',
254256
function(d) {

test/image/baselines/parcats_dark.png

28.6 KB
Loading

test/image/mocks/parcats_dark.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"data": [
3+
{"type": "parcats",
4+
"domain": {"x": [0.125, 0.625],"y": [0.25, 0.75]},
5+
"dimensions":[
6+
{"label": "One", "values": [1, 1, 2, 1, 2, 1, 1, 2, 1]},
7+
{"label": "Two", "values": ["A", "B", "A", "B", "C", "C", "A", "B", "C"]},
8+
{"label": "Three", "values": [11, 11, 11, 11, 11, 11, 11, 11, 11]}]}
9+
],
10+
"layout": {
11+
"paper_bgcolor": "black",
12+
"font": {"color": "white"},
13+
"height": 602,
14+
"width": 592,
15+
"margin": {
16+
"l": 40, "r": 40, "t": 50, "b": 40
17+
}}
18+
}

0 commit comments

Comments
 (0)