-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix occasional integration test failure and some IE issues
IE uses left/right instead of x/y and different format "transform". Use "closest" (with polyfill) to navigate up to the chart element. Polyfill "matches" which is used by d3fc Move default theme variables to where they actually need to be (IE/Edge don't get the variables otherwise)
- Loading branch information
1 parent
8955dc0
commit 2bf487b
Showing
7 changed files
with
83 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/perspective-viewer-d3fc/src/js/plugin/polyfills/closest.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (c) 2017, the Perspective Authors. | ||
* | ||
* This file is part of the Perspective library, distributed under the terms of | ||
* the Apache License 2.0. The full license can be found in the LICENSE file. | ||
* | ||
*/ | ||
if (!Element.prototype.matches) { | ||
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; | ||
} | ||
|
||
if (!Element.prototype.closest) { | ||
Element.prototype.closest = function(s) { | ||
var el = this; | ||
|
||
do { | ||
if (el.matches(s)) return el; | ||
el = el.parentElement || el.parentNode; | ||
} while (el !== null && el.nodeType === 1); | ||
return null; | ||
}; | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/perspective-viewer-d3fc/src/js/plugin/polyfills/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import "./matches"; | ||
import "./closest"; |
11 changes: 11 additions & 0 deletions
11
packages/perspective-viewer-d3fc/src/js/plugin/polyfills/matches.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright (c) 2017, the Perspective Authors. | ||
* | ||
* This file is part of the Perspective library, distributed under the terms of | ||
* the Apache License 2.0. The full license can be found in the LICENSE file. | ||
* | ||
*/ | ||
if (!Element.prototype.matches) { | ||
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; | ||
} |
33 changes: 0 additions & 33 deletions
33
packages/perspective-viewer-d3fc/src/less/perspective-view.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters