Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d4595c4
Gitignore scripts/reset-db.sh to keep it local-only
skaphan Mar 6, 2026
08b3f69
Add pie chart visualization template
skaphan Feb 24, 2026
edbd5fe
Use election color theme for pie chart instead of hardcoded colors
skaphan Mar 4, 2026
10b2d0e
Build pie chart data from processed Graph instead of raw JSON
skaphan Mar 4, 2026
48c4e8c
Pass config options to pie chart, initialize to final round
skaphan Mar 4, 2026
0df774d
Add hidePie setting to hide pie chart tab per election
skaphan Mar 4, 2026
3a97020
Add tests for graphToRCtab converter (32 tests)
skaphan Mar 4, 2026
1b9f289
Rebuild standalone component with tooltip fix
skaphan Mar 5, 2026
ad3876b
Scramble pie chart colors for better adjacent-slice contrast
skaphan Mar 5, 2026
cd5e09b
Interleave pie slices by vote count, fix color count
skaphan Mar 5, 2026
1cf43d1
Fix interleave: compute order once from round 1, reuse for all rounds
skaphan Mar 5, 2026
c3e6345
Add pie chart and special character tests
skaphan Mar 6, 2026
fc144ae
Update pie chart: per-round percentages, phase-labeled button
skaphan Mar 16, 2026
c9b41ed
Update pie chart: fix centering, tooltip positioning, remove bubble c…
skaphan Mar 16, 2026
9b03f5f
Fix CLS: reserve pie chart dimensions before JS loads
skaphan Mar 22, 2026
a648b2e
Update pie chart: shadow outline pie, slice separators
skaphan Mar 23, 2026
d58fd41
Update pie chart bundle: defer elected slice splitting
skaphan Mar 23, 2026
34186e0
Update pie chart bundle: donut shrink follows moving slices
skaphan Mar 24, 2026
f6e3de8
Address PR review feedback
skaphan Mar 24, 2026
95bcdf1
Update pie chart: fix ghost slices, button size
skaphan Mar 25, 2026
49e52dd
Clear stroke on zero-width slices
skaphan Mar 25, 2026
8aa7d3e
Add phase stepper for pie chart animation
skaphan Mar 25, 2026
a030695
Disable stepper on last round
skaphan Mar 25, 2026
b91ca14
Fix off-by-one in stepper disabled/label check
skaphan Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion common/cloudflare.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ def purge_vis_cache(cls, slug):
reverse('visualizeEmbedly', args=(slug, 'barchart-interactive')),
reverse('visualizeEmbedly', args=(slug, 'sankey')),
reverse('visualizeEmbedly', args=(slug, 'table')),
reverse('visualizeEmbedly', args=(slug, 'pie')),
reverse('visualizeBallotpedia', args=(slug,)),
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=barchart-interactive',
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=barchart-fixed',
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=tabular-by-candidate',
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=tabular-by-round',
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=tabular-by-round-interactive',
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=candidate-by-round',
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=sankey'
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=sankey',
reverse('visualizeEmbedded', args=(slug,)) + '?vistype=pie'

]
cls.purge_paths_cache(paths)

Expand Down
3 changes: 3 additions & 0 deletions common/viewUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from visualizer.descriptors.textForWinnerUtils import as_caption
from visualizer.graph.graphCreator import make_graph_with_file
from visualizer.models import TextForWinner
from visualizer.pie.graphToRCtab import graph_to_rctab_json
from visualizer.sankey.graphToD3 import D3Sankey
from visualizer.sidecar.reader import SidecarReader
from visualizer.tabular.tabular import TabulateByRoundInteractive, \
Expand Down Expand Up @@ -68,6 +69,8 @@ def get_data_for_graph(graph, config):
'tabularByRound': tabularByRound,
'tabularByRoundInteractive': tabularByRoundInteractive,
'graph': graph,
'rawData': graph._raw_JSON,
'pieData': graph_to_rctab_json(graph),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are both of these needed? Wouldn't one or the other be sufficient?

'textForWinner': as_caption(config).lower(),
}
roundDescriberData = get_data_for_round_describer(graph, config)
Expand Down
9 changes: 9 additions & 0 deletions rcvis/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@
}
}


def pie_chart_no_cache(headers, path, url):
"""In development, ensure browsers revalidate the pie chart component on every load."""
if DEBUG and url.endswith('pie-chart.es.js'):
headers['Cache-Control'] = 'no-cache'


WHITENOISE_ADD_HEADERS_FUNCTION = pie_chart_no_cache
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed or was this just for testing?


NODE_PACKAGE_JSON = './package.json'
NODE_MODULES_ROOT = './node_modules'
NODE_PACKAGE_MANAGER_EXECUTABLE = os.environ.get('NODE_PACKAGE_MANAGER_EXECUTABLE', '/usr/bin/npm')
Expand Down
Loading