plotly / plotly/plotly.js

Implement lat/lon data-referenced annotations on geo and mapbox subplots

Open
#3,834 2 comments 3 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

If annotating a point in a scattergeo plot, we should be able to refer to the co-ordinate of the point we must refer to in terms of "lat,lon". In fact, the annotation is required to be "x,y".
This is quite problematic: even when using a conversion factor as below, because when the map is zoomed, the annotations don't remain attached to the plot. We should be able to annotate "the lat-lon point that is associated with the marker", rather than "the x-y point on the screen".

annotation = {
text: "my_annotation",
x: (data.points[i].lon + 180)/360,
y: (data.points[i].lat/200) + 0.5 //yes, 200 not 180.
}

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 reproducing the annotation behavior in a scattergeo or mapbox subplot using the lat/lon example in the issue. Trace how annotations are positioned relative to geo coordinates during zoom, and consider the work complete when an annotation can target a geographic point and remains attached to it after zooming.

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
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.