plotly / plotly/plotly.js

add GeoJSON Layer Display

Open
#6,964 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

I propose for Plotly the ability to overlay multiple GeoJSON objects on a map, each with a distinct color and corresponding legend, without the need to bind them to a specific data attribute (like z in choropleth maps).

Currently, Plotly.js requires GeoJSON features to be associated with data for visualization. However, there are use cases, including one of my own, where the goal is simply to display the shapes defined by GeoJSON files, differentiate them with colors, and provide a legend for reference. This is purely for visual comparison and spatial representation.

For example, I have two GeoJSON datasets representing which type of agricultural simulation performed better for a region: Yield Potential (in blue) and Rainfed Potential (in yellow). I want to display these on a map, each with a random but consistent color, and include a legend to identify them. See this example image for reference.

image

Implementing this feature would benefit users who need to visualize spatial data layers without additional data-driven coloring. It would enhance Plotly's functionality and maintain consistency within applications that rely on Plotly for other types of data visualization.

I am open to trying contributing to the development of this feature and would like to hear the community's and maintainers' thoughts on its potential inclusion in Plotly.js.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining Plotly.js map and choropleth support, especially how GeoJSON features are currently associated with data. Define the scope for displaying multiple GeoJSON layers with distinct colors and legend entries without a z attribute. The issue provides no file or test locations, so the relevant entry points and acceptance tests will need to be identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.