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

Add services position to the map #1

Open
nick88msn opened this issue Feb 25, 2020 · 0 comments
Open

Add services position to the map #1

nick88msn opened this issue Feb 25, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@nick88msn
Copy link
Owner

Add yellow triangle for services adding a trace to the mapbox figure

  • Handle Service Status assigning different color and sizes (based on quantities requested and processed)

  • Put only WIP services and new orders. Create a different map for archived (completed and rejected ones)

`@app.callback(Output('mapbox', 'children'), [Input("map-update", "n_intervals")])
def updateMap(_):
#MAP
map_fig = go.Figure()
global latitudes, longitudes, sizes
capacities, labels = query_nodes()

    #Actual Map
    map_fig.add_trace(go.Scattermapbox(
                lat=latitudes,
                lon=longitudes,
                mode='markers',
                marker=go.scattermapbox.Marker(
                    size=sizes,
                    color='red'
                ),
                text=labels,
                hoverinfo='text'
            )
    )

    map_fig.add_trace(go.Scattermapbox(
                lat=latitudes,
                lon=longitudes,
                mode='markers',
                marker=go.scattermapbox.Marker(
                    size=capacities,
                    color='#ffffff',
                    opacity=0.7
                ),
                hoverinfo='none',
            ))
    
    map_fig.update_layout(
            showlegend = False,
            hovermode='closest',
            #autosize = False,
            #width = 500,
            #height = 500,
            title='Manufacturing Network',
            uirevision= False,
            mapbox=dict(
                accesstoken=mapbox_access_token,
                bearing=0,
                center=go.layout.mapbox.Center(
                    lat=origin[0],
                    lon=origin[1]
                ),
                pitch=0,
                zoom=9
            )
    )

    map_graph = dcc.Graph(id='plot', figure=map_fig)

    return map_graph`
@nick88msn nick88msn added the enhancement New feature or request label Feb 25, 2020
@nick88msn nick88msn self-assigned this Feb 25, 2020
@nick88msn nick88msn added this to the Dash UI milestone Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant