Skip to content

Fix ckanext-charts Plotly/Observable charts collapsing to a thin strip - #47

Merged
blagojabozinovski merged 1 commit into
ckan-2.11from
fix/charts-plotly-height-collapse
Jul 15, 2026
Merged

Fix ckanext-charts Plotly/Observable charts collapsing to a thin strip#47
blagojabozinovski merged 1 commit into
ckan-2.11from
fix/charts-plotly-height-collapse

Conversation

@blagojabozinovski

Copy link
Copy Markdown

The theme bundles ckanext-visualize's visualize_main.css, whose global ".chart-container { padding: 1rem }" collides with the class ckanext-charts uses for its Plotly/Observable graph div. That padding gives the otherwise empty div a nonzero computed height (~32px), and Plotly's autosize reads the computed height before falling back to max-height, so the whole chart renders 32px tall.

Pin the div-based chart engines to an explicit height:600px in the charts views so autosize gets a real value regardless of the inherited padding (box-sizing:border-box makes the padding harmless). ECharts (inline height, no .chart-container class) and ChartJS (canvas) are unaffected.

The theme bundles ckanext-visualize's visualize_main.css, whose global
".chart-container { padding: 1rem }" collides with the class ckanext-charts
uses for its Plotly/Observable graph div. That padding gives the otherwise
empty div a nonzero computed height (~32px), and Plotly's autosize reads the
computed height before falling back to max-height, so the whole chart renders
32px tall.

Pin the div-based chart engines to an explicit height:600px in the charts
views so autosize gets a real value regardless of the inherited padding
(box-sizing:border-box makes the padding harmless). ECharts (inline height,
no .chart-container class) and ChartJS (canvas) are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@blagojabozinovski
blagojabozinovski merged commit 0db7b0d into ckan-2.11 Jul 15, 2026
0 of 2 checks passed
@blagojabozinovski
blagojabozinovski deleted the fix/charts-plotly-height-collapse branch July 15, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant