question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support to show polygons

See original GitHub issue

Hi there,

I would like to add support to show polygons. Before I start with an implementation, I would like to discuss with you the best approach.

I was thinking about the following steps:

  1. Create a new template polygon.html.
  2. Create in viz.py a new Class PolygonViz.
  3. Create in viz.py a new base Class Viz. PolygonViz, GraduatedCircleViz, and CircleViz inherit from this Class. Below is the rough outline of the Viz Class.
  4. Create one polygon example jupyter notebook that proves the implementation.

I am happy for any feedback about the above. Since I am new to the project, I am also open for a complete different approach to show polygons.

Looking forward to work on this 😊


class Viz(object):
    """Base class for all visualisations"""

    def __init__(self,
                 access_token=None,
                 center=(0, 0),
                 div_id='map',
                 height='500px',
                 style_url="mapbox://styles/mapbox/light-v9?optimize=true",
                 width='100%',
                 zoom=0):

        if access_token is None:
            access_token = os.environ.get('MAPBOX_ACCESS_TOKEN', '')
        if not access_token.startswith('pk'):
            raise TokenError('Mapbox access token must be public (pk)')
        self.access_token = access_token

        self.div_id = div_id
        self.width = width
        self.height = height
        self.data = data
        self.style_url = style_url
        self.center = center
        self.zoom = zoom

    def as_iframe(self, html_data):
        """Build the HTML representation for the mapviz."""
        ...
       
    def show(self, **kwargs):
        """Load the HTML iframe and display the  the iframe in the current jupyter notebook view"""
        ...

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ustroetzcommented, Feb 4, 2018

Glad to see that someone picked up the work! Sorry that I was a bit slow on this. Awesome to see that there is now so much traction on the project 👏

1reaction
ustroetzcommented, Jan 15, 2018

Yes, I actually have a branch sitting here that I want to finish up 😃

I’ll try to open a PR by the end of the week 🤞

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and Manage Map Polygons - Salesforce Help
Polygons make it easy to mass-update all appointments within a specific geographic area. ... Add a name, color, description, and service territory.
Read more >
Style polygon layers—ArcGIS Online Help | Documentation
Style polygon layers with or without attributes with smart mapping styles. ... Click Outline color to see the outline color options:.
Read more >
Add and Manage Polygons | iMapBuilder software
Click the Add Polygons button on the vertical toolbar. Click on the map to start drawing the shape. You can click on the...
Read more >
Newly created polygons display differently from existing ...
Solution: · Select the affected object or mesh. · In the Editable-Poly Sub-Object mode, choose Polygon. · Select a polygon in the model...
Read more >
Create and Display Polygons - MATLAB & Simulink - MathWorks
Create a polygon by listing vertices that define its boundaries without intersecting. The order of the vertices determines what parts of the polygon...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found