Skip to content

Commit e43227c

Browse files
committed
Documentation for setOffsetAndWidth and fix for sieve documentations
1 parent ac93f5d commit e43227c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/traces/bar/cross_trace_calc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,18 @@ function setGroupPositionsInStackOrRelativeMode(gd, pa, sa, calcTraces, opts) {
300300
if(opts.norm) normalizeBars(sa, sieve, opts);
301301
}
302302

303+
/**
304+
* Mode group: Traces should be offsetted to other traces at the same position if they have a
305+
* different offsetgroup or if no offsetgroups are specified.
306+
* If there are no other traces at the same position, the trace will not be offsetted and it
307+
* can occupy the whole width.
308+
* If two traces share an offsetgroup, they should overlap.
309+
* Mode overlay/stack/relative: Traces should be offseted to other traces at the same position if
310+
* they have a different offsetgroup.
311+
* If two traces share an offsetgroup or if no offsetgroups are specified, they should instead
312+
* overlap/stack.
313+
* Angular axes (for barpolar type) don't support group offsets.
314+
*/
303315
function setOffsetAndWidth(gd, pa, sieve, opts) {
304316
var fullLayout = gd._fullLayout;
305317
var positions = sieve.positions;

src/traces/bar/sieve.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function Sieve(traces, opts) {
6666
*
6767
* @method
6868
* @param {number} position
69+
* @param {number} group
6970
* @param {number} value
7071
* @returns {number} Previous bin value
7172
*/
@@ -83,6 +84,7 @@ Sieve.prototype.put = function put(position, group, value) {
8384
*
8485
* @method
8586
* @param {number} position Position of datum
87+
* @param {number} group
8688
* @param {number} [value] Value of datum
8789
* (required if this.sepNegVal is true)
8890
* @returns {number} Current bin value
@@ -97,6 +99,7 @@ Sieve.prototype.get = function get(position, group, value) {
9799
*
98100
* @method
99101
* @param {number} position Position of datum
102+
* @param {number} group
100103
* @param {number} [value] Value of datum
101104
* (required if this.sepNegVal is true)
102105
* @returns {string} Bin label

0 commit comments

Comments
 (0)