mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-07 00:15:13 +00:00
Pages with wide horizontal content could horizontally scroll on mobile due to `.page-wrapper` not having fixed width inf851142fb2Re-add overflow-wrap which was removed ine6dba41f3d(in attempt to simplify logic). Add horizontal scroll to unresponsive Plotly charts. Also, refactor chart style and refactor callout styles into dedicated file. This commit attempts to fix https://discord.com/channels/722225264733716590/742863504515793149/774343154949816350
17 lines
478 B
HTML
17 lines
478 B
HTML
{{ $json := printf "./%s.json" (.Get "data") }}
|
|
{{ $id := delimit (shuffle (seq 1 9)) "" }}
|
|
<div id="chart-{{$id}}" class="chart"></div>
|
|
<script>
|
|
(function() {
|
|
let a = setInterval( function() {
|
|
if ( typeof window.Plotly === 'undefined' ) {
|
|
return;
|
|
}
|
|
clearInterval( a );
|
|
|
|
Plotly.d3.json({{$json}}, function(chart) {
|
|
Plotly.plot('chart-{{$id}}', chart.data, chart.layout, {responsive: true});
|
|
});
|
|
}, 500 );
|
|
})();
|
|
</script> |