Skip to content
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

Polygons with holes doesn't work with scattergeo, fill: 'toself' seems to be ignored. #6044

Closed
awulkiew opened this issue Nov 26, 2021 · 1 comment

Comments

@awulkiew
Copy link

awulkiew commented Nov 26, 2021

If polygon is defined as multiple rings in one trace, with scattergeo the relation of the rings seems to be ignored even if fill is set to toself. Such polygon is treated as multipolygon and each ring is drawn WRT the whole globe. Projection type is irrelevant. The behavior is different and correct in the case of scatter plot.

Polygon without hole:
polygon without hole

Polygon with hole:
polygon with hole

Polygon with hole 2:
polygon with hole 2

To reproduce:

<http>
<head>
    <script src="https://cdn.plot.ly/plotly-latest.js"></script>
</head>
<body>
    <div id="plot"></div>
    <script>
        var plot = document.getElementById('plot');

        var layout = {
            geo: {
                bgcolor: '#fff',
                projection: {
                    type: 'orthographic',
                    rotation: {
                        lon: 45,
                        lat: 10
                    },
                },
                showocean: true,
                oceancolor: '#fff',
                showland: true,
                landcolor: '#fff',
                showlakes: false,
                lakecolor: '#fff',
                showcountries: true,
                lonaxis: {
                    showgrid: true,
                    gridcolor: '#555'
                },
                lataxis: {
                    showgrid: true,
                    gridcolor: '#555'
                }
            }
        };

        var traces = [{
            lon: [1,1,90,90,1,null,10,20,20,10,10],
            lat: [1,27,27,1,1,null,10,10,20,20,10],
            mode: 'lines+markers',
            type: 'scattergeo',
            fill: 'toself',
            fillcolor: '#f555',
            marker: {color: '#f55a'},
            line: {color: '#f55a'}
        }];

        Plotly.newPlot(plot, traces, layout);
    </script>
</body>
</http>
@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants