Skip to content

plotly interfering with other controls that may be using off screen realestate #393

Closed
@jmsunseri

Description

@jmsunseri

I had an issue where once i called the plotly constructor and the graph is drawn then a few of my angular ui bootstrap based calendar controls completely disappeared. I never had a problem with it in the past and it is still not a problem in IE but when working in Chrome the issue began to pop up. After modifying the drawing.makeTester function it began to work without interfering with my other controls. making the left and top properties below even greater into negative space seemed to solve the problem. I'm not an expert on what's going on in this function but it was causing me a lot of trouble. I wish I could reproduce the issue for you but i can't even reproduce the issue for myself right now.

drawing.makeTester = function(gd) {
    var tester = d3.select('body')
        .selectAll('#js-plotly-tester')
        .data([0]);

    tester.enter().append('svg')
        .attr('id', 'js-plotly-tester')
        .attr(xmlnsNamespaces.svgAttrs)
        .style({
            position: 'absolute',
            left: '-90000px',
            top: '-90000px',
            width: '9000px',
            height: '9000px'
        });

    // browsers differ on how they describe the bounding rect of
    // the svg if its contents spill over... so make a 1x1px
    // reference point we can measure off of.
    var testref = tester.selectAll('.js-reference-point').data([0]);
    testref.enter().append('path')
        .classed('js-reference-point', true)
        .attr('d','M0,0H1V1H0Z')
        .style({
            'stroke-width': 0,
            fill: 'black'
        });

    if(!tester.node()._cache) {
        tester.node()._cache = {};
    }

    gd._tester = tester;
    gd._testref = testref;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions