* Stack a new crossfilter group onto this chart with an optional custom value accessor. All stacks * in the same chart will share the same key accessor and therefore the same set of keys. * * For example, in a stacked bar chart, the bars of each stack will be positioned using the same
(group, name, accessor)
| 101 | * @returns {Array<{group: crossfilter.group, name: String, accessor: Function}>|StackMixin} |
| 102 | */ |
| 103 | stack (group, name, accessor) { |
| 104 | if (!arguments.length) { |
| 105 | return this._stack; |
| 106 | } |
| 107 | |
| 108 | if (arguments.length <= 2) { |
| 109 | accessor = name; |
| 110 | } |
| 111 | |
| 112 | const layer = {group: group}; |
| 113 | if (typeof name === 'string') { |
| 114 | layer.name = name; |
| 115 | } |
| 116 | if (typeof accessor === 'function') { |
| 117 | layer.accessor = accessor; |
| 118 | } |
| 119 | this._stack.push(layer); |
| 120 | |
| 121 | return this; |
| 122 | } |
| 123 | |
| 124 | group (g, n, f) { |
| 125 | if (!arguments.length) { |
no outgoing calls
no test coverage detected