Skip to content

Commit 3608840

Browse files
committed
add new errobar style step (now grabs data from trace <g>)
1 parent d3b3dfb commit 3608840

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/components/errorbars/style.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
10+
'use strict';
11+
12+
var d3 = require('d3');
13+
14+
var Color = require('../color');
15+
16+
17+
module.exports = function style(traces) {
18+
traces.each(function(d) {
19+
var trace = d[0].trace,
20+
yObj = trace.error_y || {},
21+
xObj = trace.error_x || {};
22+
23+
var s = d3.select(this);
24+
25+
s.selectAll('path.yerror')
26+
.style('stroke-width', yObj.thickness + 'px')
27+
.call(Color.stroke, yObj.color);
28+
29+
if(xObj.copy_ystyle) xObj = yObj;
30+
31+
s.selectAll('path.xerror')
32+
.style('stroke-width', xObj.thickness + 'px')
33+
.call(Color.stroke, xObj.color);
34+
});
35+
};

0 commit comments

Comments
 (0)