Skip to content

Commit 8eb01bd

Browse files
committed
fixed violin defaults
1 parent 54b73ee commit 8eb01bd

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

src/traces/violin/defaults.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
4949
var meanLineVisible = coerce('meanline.visible', Boolean(meanLineColor || meanLineWidth));
5050
if(!meanLineVisible) traceOut.meanline = {visible: false};
5151

52+
coerce('tooltip');
53+
coerce('tooltiptemplate');
54+
5255
coerce('quartilemethod');
5356
coerce('zorder');
5457
};
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"data": [{
3+
"type": "violin",
4+
"name": "kale",
5+
"y": [
6+
0.2, 0.2, 0.6, 1, 0.5, 0.4,
7+
0.2, 0.7, 0.9, 0.1, 0.5, 0.3
8+
],
9+
"x": [
10+
"day 1", "day 1", "day 1", "day 1", "day 1", "day 1",
11+
"day 2", "day 2", "day 2", "day 2", "day 2", "day 2"
12+
],
13+
"marker": {
14+
"symbol": "line-ew",
15+
"color": "#3D9970",
16+
"line": {
17+
"color": "#3D9970",
18+
"width": 2
19+
}
20+
},
21+
"points": "all",
22+
"jitter": 0,
23+
"span": [0, null],
24+
"tooltiptemplate": "%{fullData.name}<br>x: %{x}<br>y: %{y}",
25+
"tooltip": {"arrowcolor": "blue"}
26+
}, {
27+
"type": "violin",
28+
"name": "radishes",
29+
"y": [
30+
0.6, 0.7, 0.3, 0.6, 0, 0.5,
31+
0.7, 0.9, 0.5, 0.8, 0.7, 0.2
32+
],
33+
"x": [
34+
"day 1", "day 1", "day 1", "day 1", "day 1", "day 1",
35+
"day 2", "day 2", "day 2", "day 2", "day 2", "day 2"
36+
],
37+
"marker": {
38+
"symbol": "line-ew",
39+
"color": "#FF4136",
40+
"line": {
41+
"color": "#FF4136",
42+
"width": 2
43+
}
44+
},
45+
"points": "all",
46+
"jitter": 0,
47+
"span": [0, null],
48+
"tooltiptemplate": "%{fullData.name}<br>x: %{x}<br>y: %{y}",
49+
"tooltip": {"arrowcolor": "blue"}
50+
}, {
51+
"type": "violin",
52+
"name": "carrots",
53+
"y": [
54+
0.1, 0.3, 0.1, 0.9, 0.6, 0.6,
55+
0.9, 1, 0.3, 0.6, 0.8, 0.5
56+
],
57+
"x": [
58+
"day 1", "day 1", "day 1", "day 1", "day 1", "day 1",
59+
"day 2", "day 2", "day 2", "day 2", "day 2", "day 2"
60+
],
61+
"marker": {
62+
"symbol": "line-ew",
63+
"color": "#FF851B",
64+
"line": {
65+
"color": "#FF851B",
66+
"width": 2
67+
}
68+
},
69+
"points": "all",
70+
"jitter": 0,
71+
"span": [0, null],
72+
"tooltiptemplate": "%{fullData.name}<br>x: %{x}<br>y: %{y}",
73+
"tooltip": {"arrowcolor": "blue"}
74+
}],
75+
"layout": {
76+
"yaxis": {
77+
"zeroline": false,
78+
"title": {"text": "normalized moisture"}
79+
},
80+
"violinmode": "group"
81+
},
82+
"config": {
83+
"editable": true,
84+
"modeBarButtonsToAdd": [
85+
"tooltip",
86+
"hoverclosest",
87+
"hovercompare",
88+
"togglespikelines"
89+
],
90+
"displaylogo": false,
91+
"displayModeBar": true
92+
}
93+
}

0 commit comments

Comments
 (0)