Skip to content

Commit

Permalink
fixed violin defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
kb- committed Oct 12, 2024
1 parent 44a7ebf commit 7c3d481
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/traces/violin/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
var meanLineVisible = coerce('meanline.visible', Boolean(meanLineColor || meanLineWidth));
if(!meanLineVisible) traceOut.meanline = {visible: false};

coerce('tooltip');
coerce('tooltiptemplate');

coerce('quartilemethod');
coerce('zorder');
};
93 changes: 93 additions & 0 deletions test/image/mocks/tooltip_tooltiptemplate_violin_grouped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"data": [{
"type": "violin",
"name": "kale",
"y": [
0.2, 0.2, 0.6, 1, 0.5, 0.4,
0.2, 0.7, 0.9, 0.1, 0.5, 0.3
],
"x": [
"day 1", "day 1", "day 1", "day 1", "day 1", "day 1",
"day 2", "day 2", "day 2", "day 2", "day 2", "day 2"
],
"marker": {
"symbol": "line-ew",
"color": "#3D9970",
"line": {
"color": "#3D9970",
"width": 2
}
},
"points": "all",
"jitter": 0,
"span": [0, null],
"tooltiptemplate": "%{fullData.name}<br>x: %{x}<br>y: %{y}",
"tooltip": {"arrowcolor": "blue"}
}, {
"type": "violin",
"name": "radishes",
"y": [
0.6, 0.7, 0.3, 0.6, 0, 0.5,
0.7, 0.9, 0.5, 0.8, 0.7, 0.2
],
"x": [
"day 1", "day 1", "day 1", "day 1", "day 1", "day 1",
"day 2", "day 2", "day 2", "day 2", "day 2", "day 2"
],
"marker": {
"symbol": "line-ew",
"color": "#FF4136",
"line": {
"color": "#FF4136",
"width": 2
}
},
"points": "all",
"jitter": 0,
"span": [0, null],
"tooltiptemplate": "%{fullData.name}<br>x: %{x}<br>y: %{y}",
"tooltip": {"arrowcolor": "blue"}
}, {
"type": "violin",
"name": "carrots",
"y": [
0.1, 0.3, 0.1, 0.9, 0.6, 0.6,
0.9, 1, 0.3, 0.6, 0.8, 0.5
],
"x": [
"day 1", "day 1", "day 1", "day 1", "day 1", "day 1",
"day 2", "day 2", "day 2", "day 2", "day 2", "day 2"
],
"marker": {
"symbol": "line-ew",
"color": "#FF851B",
"line": {
"color": "#FF851B",
"width": 2
}
},
"points": "all",
"jitter": 0,
"span": [0, null],
"tooltiptemplate": "%{fullData.name}<br>x: %{x}<br>y: %{y}",
"tooltip": {"arrowcolor": "blue"}
}],
"layout": {
"yaxis": {
"zeroline": false,
"title": {"text": "normalized moisture"}
},
"violinmode": "group"
},
"config": {
"editable": true,
"modeBarButtonsToAdd": [
"tooltip",
"hoverclosest",
"hovercompare",
"togglespikelines"
],
"displaylogo": false,
"displayModeBar": true
}
}

0 comments on commit 7c3d481

Please sign in to comment.