plotly.js 3.0.0-rc.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@ Erase active shape // components/modebar/but
24
24
  Lasso Select // components/modebar/buttons.js:121
25
25
  Orbital rotation // components/modebar/buttons.js:341
26
26
  Pan // components/modebar/buttons.js:101
27
- Produced with Plotly.js // components/modebar/modebar.js:323
27
+ Produced with Plotly.js // components/modebar/modebar.js:324
28
28
  Reset // components/modebar/buttons.js:514
29
29
  Reset axes // components/modebar/buttons.js:213
30
30
  Reset camera to default // components/modebar/buttons.js:380
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotly.js",
3
- "version": "3.0.0-rc.2",
3
+ "version": "3.0.0",
4
4
  "description": "The open source javascript graphing library that powers plotly",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",
@@ -60,9 +60,6 @@ proto.update = function(graphInfo, buttons) {
60
60
  document.querySelectorAll(groupSelector).forEach(function(group) {
61
61
  group.style.backgroundColor = style.bgcolor;
62
62
  });
63
- // set styles on hover using event listeners instead of inline CSS that's not allowed by strict CSP's
64
- Lib.setStyleOnHover('#' + modeBarId + ' .modebar-btn', '.active', '.icon path', 'fill: ' + style.activecolor, 'fill: ' + style.color);
65
-
66
63
  // if buttons or logo have changed, redraw modebar interior
67
64
  var needsNewButtons = !this.hasButtons(buttons);
68
65
  var needsNewLogo = (this.hasLogo !== context.displaylogo);
@@ -92,6 +89,10 @@ proto.update = function(graphInfo, buttons) {
92
89
  }
93
90
 
94
91
  this.updateActiveButton();
92
+
93
+ // set styles on hover using event listeners instead of inline CSS that's not allowed by strict CSP's
94
+ Lib.setStyleOnHover('#' + modeBarId + ' .modebar-btn', '.active', '.icon path', 'fill: ' + style.activecolor, 'fill: ' + style.color, this.element);
95
+
95
96
  };
96
97
 
97
98
  proto.updateButtons = function(buttons) {
package/src/lib/dom.js CHANGED
@@ -101,12 +101,14 @@ function deleteRelatedStyleRule(uid) {
101
101
  * @param {string} activeStyle style that has to be applied when 'hovered' or 'active'
102
102
  * @param {string} inactiveStyle style that has to be applied when not 'hovered' nor 'active'
103
103
  */
104
- function setStyleOnHover(selector, activeSelector, childSelector, activeStyle, inactiveStyle) {
104
+ function setStyleOnHover(selector, activeSelector, childSelector, activeStyle, inactiveStyle, element) {
105
105
  var activeStyleParts = activeStyle.split(':');
106
106
  var inactiveStyleParts = inactiveStyle.split(':');
107
107
  var eventAddedAttrName = 'data-btn-style-event-added';
108
-
109
- document.querySelectorAll(selector).forEach(function(el) {
108
+ if (!element) {
109
+ element = document;
110
+ }
111
+ element.querySelectorAll(selector).forEach(function(el) {
110
112
  if(!el.getAttribute(eventAddedAttrName)) {
111
113
  // Emulate ":hover" CSS style using JS event handlers to set the
112
114
  // style in a strict CSP-compliant manner.
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use strict';
2
2
 
3
3
  // package version injected by `npm run preprocess`
4
- exports.version = '3.0.0-rc.2';
4
+ exports.version = '3.0.0';