plotly.js: plots in plotly.js tutorial docs not displaying in Internet Explorer 11

This issue is specific only to the plots in CodePen.

codepen

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@alexcjohnson Yeah, your comment still makes sense for me if you check that you use IE 11 beforehand 😸. The if-block was for skipping every element that has .remove() naturally, right? So if I just check once if I’m looking at IE 11 or not I can skip the whole iteration beforehand for everything but IE 11. 😼

(BTW thanks @Braintelligence for tracking down the broken feature) Modify that polyfill to always overwrite, and trace its calls, and you can see whenever node.remove is called in any browser:

(function (arr) {
  arr.forEach(function (item) {
    Object.defineProperty(item, 'remove', {
      configurable: true,
      enumerable: true,
      writable: true,
      value: function remove() {
        console.trace(this);
        if (this.parentNode !== null)
          this.parentNode.removeChild(this);
      }
    });
  });
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);

Perhaps we can build that into our tests, with a throw instead of a console.trace, to ensure we never use node.remove?