Skip to content

Display hoverlabels above modebar #3589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/plotcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var rules = {
"X .cursor-n-resize": "cursor:n-resize;",
"X .cursor-ne-resize": "cursor:ne-resize;",
"X .cursor-grab": "cursor:-webkit-grab;cursor:grab;",
"X .modebar": "position:absolute;top:2px;right:2px;z-index:1001;",
"X .modebar": "position:absolute;top:2px;right:2px;",
"X .ease-bg": "-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;",
"X .modebar--hover>:not(.watermark)": "opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;",
"X:hover .modebar--hover .modebar-group": "opacity:1;",
Expand Down
1 change: 0 additions & 1 deletion src/css/_modebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
position: absolute;
top: 2px;
right: 2px;
z-index: 1001;
}

.ease-bg {
Expand Down
10 changes: 7 additions & 3 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3805,6 +3805,11 @@ function makePlotFramework(gd) {
fullLayout._toppaper = fullLayout._paperdiv.append('svg')
.classed('main-svg', true);

fullLayout._modebardiv = fullLayout._paperdiv.append('div');

fullLayout._hoverpaper = fullLayout._paperdiv.append('svg')
.classed('main-svg', true);

if(!fullLayout._uid) {
var otherUids = {};
d3.selectAll('defs').each(function() {
Expand Down Expand Up @@ -3881,11 +3886,10 @@ function makePlotFramework(gd) {
fullLayout._infolayer = fullLayout._toppaper.append('g').classed('infolayer', true);
fullLayout._menulayer = fullLayout._toppaper.append('g').classed('menulayer', true);
fullLayout._zoomlayer = fullLayout._toppaper.append('g').classed('zoomlayer', true);
fullLayout._hoverlayer = fullLayout._toppaper.append('g').classed('hoverlayer', true);
fullLayout._hoverlayer = fullLayout._hoverpaper.append('g').classed('hoverlayer', true);

// Make the modebar container
fullLayout._modebardiv = fullLayout._paperdiv.selectAll('.modebar-container').data([0]);
fullLayout._modebardiv.enter().append('div')
fullLayout._modebardiv
.classed('modebar-container', true)
.style('position', 'absolute')
.style('top', '0px')
Expand Down
6 changes: 3 additions & 3 deletions test/jasmine/tests/plots_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ describe('Test Plots', function() {

it('should resize the main svgs', function() {
var mainSvgs = document.getElementsByClassName('main-svg');
expect(mainSvgs.length).toBe(2);
expect(mainSvgs.length).toBe(3);

for(var i = 0; i < mainSvgs.length; i++) {
var svg = mainSvgs[i];
Expand All @@ -343,7 +343,7 @@ describe('Test Plots', function() {

it('should update the axis scales', function() {
var mainSvgs = document.getElementsByClassName('main-svg');
expect(mainSvgs.length).toBe(2);
expect(mainSvgs.length).toBe(3);

var fullLayout = gd._fullLayout;
var plotinfo = fullLayout._plots.xy;
Expand All @@ -357,7 +357,7 @@ describe('Test Plots', function() {

it('should allow resizing by plot ID', function(done) {
var mainSvgs = document.getElementsByClassName('main-svg');
expect(mainSvgs.length).toBe(2);
expect(mainSvgs.length).toBe(3);

expect(typeof gd.id).toBe('string');
expect(gd.id).toBeTruthy();
Expand Down