Skip to content

Commit

Permalink
properly delete nested attributes, update doc crawl
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinerg committed Oct 25, 2018
1 parent f168ddc commit 7999517
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plot_api/plot_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ exports.get = function() {
* @param {String} attrName name string
* @param {object[]} attrs all the attributes
* @param {Number} level the recursion level, 0 at the root
* @param {String} fullAttrString full attribute name (ie 'marker.line')
* @param {Number} [specifiedLevel]
* The level in the tree, in order to let the callback function detect descend or backtrack,
* typically unsupplied (implied 0), just used by the self-recursive call.
Expand Down Expand Up @@ -466,9 +467,9 @@ function getTraceAttributes(type) {

// prune global-level trace attributes that are already defined in a trace
exports.crawl(copyModuleAttributes, function(attr, attrName, attrs, level, fullAttrString) {
delete copyBaseAttributes[fullAttrString];
Lib.nestedProperty(copyBaseAttributes, fullAttrString).set(undefined);
// Prune undefined attributes
if(attr === undefined) delete copyModuleAttributes[fullAttrString];
if(attr === undefined) Lib.nestedProperty(copyModuleAttributes, fullAttrString).set(undefined);
});

// base attributes (same for all trace types)
Expand Down

0 comments on commit 7999517

Please sign in to comment.