python-visualization / python-visualization/folium

Multiple Vincent/Vega charts in a popup?

Open
#1,245 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
7.4k
Forks
2.3k
Avg merge
17h 22m
Merged PRs (30d)
11

Description

I'm trying to add two Vincent bar charts in a popup using Vega, one on top of the other. The two methods below are not working:


# Adding both charts to add_child: This only renders the first chart
m.add_child( folium.CircleMarker(
        location = [df['latitude'], df['longitude']],
        popup = folium.Popup(max_width = 450).add_child(chart1, chart2)
  ))

# Method-chaining: This only renders the second chart
m.add_child( folium.CircleMarker(
        location = [df['latitude'], df['longitude']],
        popup = folium.Popup(max_width = 450).add_child(chart1, name = 'c1').add_child(chart2, name = 'c2')
    ) )

Is there a way to accomplish this?

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 tracing Popup.add_child from the two examples in the issue and inspect how popup children are rendered. The work is done when a single popup reliably displays both Vincent/Vega charts rather than only the first or second chart.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.