Skip to content

Commit

Permalink
better example
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlambson committed Aug 11, 2024
1 parent 3610203 commit 0868d7a
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions boredcharts/templates/pages/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@ and use a little bit of jinja magic to pull in charts that we create in python.
The USA's population has been growing linearly:

<pre>{% raw %}
&lt;div class="flex flex-wrap"&gt;
{{ figure(report, "example_simple_usa") }}
&lt;/div&gt;
{% endraw %}</pre>

{{ figure(report, "example_simple_usa") }}

South Africa's growth is a bit weirder looking according to this chart:

<pre>{% raw %}
&lt;div class="flex flex-wrap"&gt;
{{ figure(report, "example_params", country="South Africa") }}
&lt;/div&gt;
{% endraw %}</pre>

{{ figure(report, "example_params", country="South Africa") }}
Expand All @@ -33,26 +29,26 @@ We can do light HTML to put two charts side by side:

<pre>{% raw %}
&lt;div class="flex flex-wrap"&gt;
{{ figure(report, "example_simple_usa") }}
{{ figure(report, "example_simple_usa") }}
{{ figure(report, "example_params", country="United Kingdom") }}
{{ figure(report, "example_params", country="France") }}
&lt;/div&gt;
{% endraw %}</pre>

<div class="flex flex-wrap">
{{ figure(report, "example_simple_usa") }}
{{ figure(report, "example_simple_usa") }}
{{ figure(report, "example_params", country="United Kingdom") }}
{{ figure(report, "example_params", country="France") }}
</div>

And we can add custom tailwind classes to the figures:

<pre>{% raw %}
&lt;div class="flex flex-wrap"&gt;
{{ figure(report, "example_simple_usa", class="h-[300px] min-w-[300px]") }}
{{ figure(report, "example_simple_usa", class="h-[300px] min-w-[300px]") }}
{{ figure(report, "example_params", country="Canada", class="h-[300px] min-w-[300px]") }}
{{ figure(report, "example_params", country="Australia", class="h-[300px] min-w-[300px]") }}
&lt;/div&gt;
{% endraw %}</pre>

<div class="flex flex-wrap">
{{ figure(report, "example_simple_usa", class="h-[300px] min-w-[300px]") }}
{{ figure(report, "example_simple_usa", class="h-[300px] min-w-[300px]") }}
{{ figure(report, "example_params", country="Canada", class="h-[300px] min-w-[300px]") }}
{{ figure(report, "example_params", country="Australia", class="h-[300px] min-w-[300px]") }}
</div>

0 comments on commit 0868d7a

Please sign in to comment.