Skip to content

Commit aa93123

Browse files
committed
manually exclude colorbar 'tickvals' and 'ticktext' from array attrs
- as they scale independently of coordinates arrays, so shouldn't be filtered nor included in point event data - do not add a schema field for this now. + wait until solution become clearer.
1 parent 0d91074 commit aa93123

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Diff for: src/plot_api/plot_schema.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,25 @@ exports.isValObject = function(obj) {
142142
* list of array attributes for the given trace
143143
*/
144144
exports.findArrayAttributes = function(trace) {
145-
var arrayAttributes = [],
146-
stack = [];
145+
var arrayAttributes = [];
146+
var stack = [];
147147

148148
function callback(attr, attrName, attrs, level) {
149149
stack = stack.slice(0, level).concat([attrName]);
150150

151-
var splittableAttr = attr && (attr.valType === 'data_array' || attr.arrayOk === true);
151+
var splittableAttr = (
152+
attr &&
153+
(attr.valType === 'data_array' || attr.arrayOk === true) &&
154+
!(stack[level - 1] === 'colorbar' && (attrName === 'ticktext' || attrName === 'tickvals'))
155+
);
156+
157+
// Manually exclude 'colorbar.tickvals' and 'colorbar.ticktext' for now
158+
// which are declared as `valType: 'data_array'` but scale independently of
159+
// the coordinate arrays.
160+
//
161+
// Down the road, we might want to add a schema field (e.g `uncorrelatedArray: true`)
162+
// to distinguish attributes of the likes.
163+
152164
if(!splittableAttr) return;
153165

154166
var astr = toAttrString(stack);

0 commit comments

Comments
 (0)