Altair: text position and repel on map

Created on 15 Oct 2019  路  11Comments  路  Source: altair-viz/altair

Hi,

Thanks for developing Altair! Finally a great tool for visualization using the grammar of graphics in python! I am really having a lot of fun with it!

I am visualizing a map using mark_geoshape. I am adding points to the map using mark_point, and corresponding labeling text using mark_text. I have two issues:

  1. The text is not always close to the corresponding point. I use x = "longitude:Q", y = "latitude:Q" both in mark_point and mark_text. As an example, see the distance between the green dot and the green text in the figure attached;
  2. Texts often overlap - see the pink and brown texts in the figure attached. Is there any function similar to ggrepel in ggplot?

Thank you very much again for such a great tool!
Serena

example

enhancement vega-lite-related

Most helpful comment

It has been implemented and we are in the process of releasing the feature in Vega. The code is already in master at https://github.com/vega/vega/tree/master/packages/vega-label. Once we have support in Vega, we can support it in Vega-Lite as well. I can't promise a release date yet but it's coming. Thanks for your patience. It's a big feature to add with a lot of moving parts.

All 11 comments

No, I'm not aware of any functionality to automatically prevent text overlap. It would be worth a feature request in Vega-Lite.

@domoritz I think in theory this would be addressed by https://github.com/vega/vega-label, right? Are there plans to just integrate that work into the core vega story?

Yes and yes. We are working on getting it into Vega and then Vega-Lite. I can't promise a release date yet, though.

Looking forward!!!

@chanwutk

Yes, we are working on getting Vega-Label shipped in Vega. The plan is, then, to add the feature to Vega-Lite. :)

This feature was implemented? I have a similar problem on my plots.
image

No, it has not been implemented yet as far as I am aware.

It has been implemented and we are in the process of releasing the feature in Vega. The code is already in master at https://github.com/vega/vega/tree/master/packages/vega-label. Once we have support in Vega, we can support it in Vega-Lite as well. I can't promise a release date yet but it's coming. Thanks for your patience. It's a big feature to add with a lot of moving parts.

Ok! Thank you for the reply
:)

That's a great piece of news! Thanks and looking forward!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SuperShinyEyes picture SuperShinyEyes  路  3Comments

DentonGentry picture DentonGentry  路  3Comments

jtbaker picture jtbaker  路  3Comments

tonylee3399 picture tonylee3399  路  3Comments

maxgerma picture maxgerma  路  3Comments