Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Mar 7, 2024
1 parent 4565efd commit e813f11
Show file tree
Hide file tree
Showing 40 changed files with 2,565 additions and 446 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
91e096a9
94ee667b
63 changes: 58 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@ <h2 class="anchored" data-anchor-id="installation">Installation</h2>
</section>
<section id="usage" class="level2">
<h2 class="anchored" data-anchor-id="usage">Usage</h2>
<p>To use a theme, call the theme function and add it to your App’s UI definition.</p>
<p>To use a theme, add a <code>shinyswatch.theme</code> theme object to your App’s UI definition.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Minty theme</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>shinyswatch.theme.minty()</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>shinyswatch.theme.minty</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="co"># Sketchy theme</span></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a>shinyswatch.theme.sketchy()</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a>shinyswatch.theme.sketchy</span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a><span class="co"># Superhero theme</span></span>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a>shinyswatch.theme.superhero()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a>shinyswatch.theme.superhero</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Example Shiny application:</p>
<pre class="shinylive-python" data-engine="python"><code>#| standalone: true
#| components: [editor, viewer]
Expand All @@ -209,7 +209,7 @@ <h2 class="anchored" data-anchor-id="usage">Usage</h2>

app_ui = ui.page_fluid(
# Theme code - start
shinyswatch.theme.darkly(),
shinyswatch.theme.darkly,
# Theme code - end
ui.input_slider("num", "Number:", min=10, max=100, value=30),
ui.output_text_verbatim("slider_val"),
Expand Down Expand Up @@ -273,6 +273,59 @@ <h2 class="anchored" data-anchor-id="theme-picker">Theme picker</h2>
shiny
shinyswatch
</code></pre>
</section>
<section id="plot-theming" class="level2">
<h2 class="anchored" data-anchor-id="plot-theming">Plot Theming</h2>
<p>shinyswatch themes include a <code>.colors</code> attribute that can be used to theme plots or other outputs and UI elements. In the example below, try changing the theme and re-running the app to see how the plot changes.</p>
<pre class="shinylive-python" data-engine="python"><code>#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 800
## file: app.py
import matplotlib.pyplot as plt
import numpy as np
from shiny import App, render, req, ui

# Try changing the theme from minty to united
from shinyswatch.theme import minty as shiny_theme

app_ui = ui.page_fluid(
shiny_theme,
ui.input_slider("n", "N", min=0, max=100, value=20),
ui.card(ui.output_plot("plot"))
)


def server(input):
@render.plot(alt="A histogram")
def plot():
np.random.seed(19680801)
x = 100 + 15 * np.random.randn(437)

fig, ax = plt.subplots()
ax.hist(x, input.n(), density=True, color=shiny_theme.colors.primary)

# Theme the plot to match the current theme
fig.patch.set_facecolor("none")
ax.set_facecolor("none")

color_fg = shiny_theme.colors.body_color
ax.tick_params(axis="both", colors=color_fg)
ax.spines["bottom"].set_color(color_fg)
ax.spines["top"].set_color(color_fg)
ax.spines["left"].set_color(color_fg)
ax.spines["right"].set_color(color_fg)

return fig


app = App(app_ui, server)

## file: requirements.txt
numpy
matplotlib
shiny
shinyswatch</code></pre>


</section>
Expand Down
2 changes: 1 addition & 1 deletion objects.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"project": "shinyswatch", "version": "0.0.9999", "count": 31, "items": [{"name": "shinyswatch.get_theme", "domain": "py", "role": "function", "priority": "1", "uri": "reference/get_theme.html#shinyswatch.get_theme", "dispname": "-"}, {"name": "shinyswatch._get_theme.get_theme", "domain": "py", "role": "function", "priority": "1", "uri": "reference/get_theme.html#shinyswatch.get_theme", "dispname": "shinyswatch.get_theme"}, {"name": "shinyswatch.theme_picker_ui", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme_picker_ui.html#shinyswatch.theme_picker_ui", "dispname": "-"}, {"name": "shinyswatch._theme_picker.theme_picker_ui", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme_picker_ui.html#shinyswatch.theme_picker_ui", "dispname": "shinyswatch.theme_picker_ui"}, {"name": "shinyswatch.theme_picker_server", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme_picker_server.html#shinyswatch.theme_picker_server", "dispname": "-"}, {"name": "shinyswatch._theme_picker.theme_picker_server", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme_picker_server.html#shinyswatch.theme_picker_server", "dispname": "shinyswatch.theme_picker_server"}, {"name": "shinyswatch.theme.cerulean", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.cerulean.html#shinyswatch.theme.cerulean", "dispname": "-"}, {"name": "shinyswatch.theme.cosmo", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.cosmo.html#shinyswatch.theme.cosmo", "dispname": "-"}, {"name": "shinyswatch.theme.cyborg", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.cyborg.html#shinyswatch.theme.cyborg", "dispname": "-"}, {"name": "shinyswatch.theme.darkly", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.darkly.html#shinyswatch.theme.darkly", "dispname": "-"}, {"name": "shinyswatch.theme.flatly", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.flatly.html#shinyswatch.theme.flatly", "dispname": "-"}, {"name": "shinyswatch.theme.journal", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.journal.html#shinyswatch.theme.journal", "dispname": "-"}, {"name": "shinyswatch.theme.litera", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.litera.html#shinyswatch.theme.litera", "dispname": "-"}, {"name": "shinyswatch.theme.lumen", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.lumen.html#shinyswatch.theme.lumen", "dispname": "-"}, {"name": "shinyswatch.theme.lux", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.lux.html#shinyswatch.theme.lux", "dispname": "-"}, {"name": "shinyswatch.theme.materia", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.materia.html#shinyswatch.theme.materia", "dispname": "-"}, {"name": "shinyswatch.theme.minty", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.minty.html#shinyswatch.theme.minty", "dispname": "-"}, {"name": "shinyswatch.theme.morph", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.morph.html#shinyswatch.theme.morph", "dispname": "-"}, {"name": "shinyswatch.theme.pulse", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.pulse.html#shinyswatch.theme.pulse", "dispname": "-"}, {"name": "shinyswatch.theme.quartz", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.quartz.html#shinyswatch.theme.quartz", "dispname": "-"}, {"name": "shinyswatch.theme.sandstone", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.sandstone.html#shinyswatch.theme.sandstone", "dispname": "-"}, {"name": "shinyswatch.theme.simplex", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.simplex.html#shinyswatch.theme.simplex", "dispname": "-"}, {"name": "shinyswatch.theme.sketchy", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.sketchy.html#shinyswatch.theme.sketchy", "dispname": "-"}, {"name": "shinyswatch.theme.slate", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.slate.html#shinyswatch.theme.slate", "dispname": "-"}, {"name": "shinyswatch.theme.solar", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.solar.html#shinyswatch.theme.solar", "dispname": "-"}, {"name": "shinyswatch.theme.spacelab", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.spacelab.html#shinyswatch.theme.spacelab", "dispname": "-"}, {"name": "shinyswatch.theme.superhero", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.superhero.html#shinyswatch.theme.superhero", "dispname": "-"}, {"name": "shinyswatch.theme.united", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.united.html#shinyswatch.theme.united", "dispname": "-"}, {"name": "shinyswatch.theme.vapor", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.vapor.html#shinyswatch.theme.vapor", "dispname": "-"}, {"name": "shinyswatch.theme.yeti", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.yeti.html#shinyswatch.theme.yeti", "dispname": "-"}, {"name": "shinyswatch.theme.zephyr", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme.zephyr.html#shinyswatch.theme.zephyr", "dispname": "-"}]}
{"project": "shinyswatch", "version": "0.0.9999", "count": 33, "items": [{"name": "shinyswatch.get_theme", "domain": "py", "role": "function", "priority": "1", "uri": "reference/get_theme.html#shinyswatch.get_theme", "dispname": "-"}, {"name": "shinyswatch._get_theme.get_theme", "domain": "py", "role": "function", "priority": "1", "uri": "reference/get_theme.html#shinyswatch.get_theme", "dispname": "shinyswatch.get_theme"}, {"name": "shinyswatch.get_theme_deps", "domain": "py", "role": "function", "priority": "1", "uri": "reference/get_theme_deps.html#shinyswatch.get_theme_deps", "dispname": "-"}, {"name": "shinyswatch._get_theme_deps.get_theme_deps", "domain": "py", "role": "function", "priority": "1", "uri": "reference/get_theme_deps.html#shinyswatch.get_theme_deps", "dispname": "shinyswatch.get_theme_deps"}, {"name": "shinyswatch.theme_picker_ui", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme_picker_ui.html#shinyswatch.theme_picker_ui", "dispname": "-"}, {"name": "shinyswatch._theme_picker.theme_picker_ui", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme_picker_ui.html#shinyswatch.theme_picker_ui", "dispname": "shinyswatch.theme_picker_ui"}, {"name": "shinyswatch.theme_picker_server", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme_picker_server.html#shinyswatch.theme_picker_server", "dispname": "-"}, {"name": "shinyswatch._theme_picker.theme_picker_server", "domain": "py", "role": "function", "priority": "1", "uri": "reference/theme_picker_server.html#shinyswatch.theme_picker_server", "dispname": "shinyswatch.theme_picker_server"}, {"name": "shinyswatch.theme.cerulean", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.cerulean.html#shinyswatch.theme.cerulean", "dispname": "-"}, {"name": "shinyswatch.theme.cosmo", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.cosmo.html#shinyswatch.theme.cosmo", "dispname": "-"}, {"name": "shinyswatch.theme.cyborg", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.cyborg.html#shinyswatch.theme.cyborg", "dispname": "-"}, {"name": "shinyswatch.theme.darkly", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.darkly.html#shinyswatch.theme.darkly", "dispname": "-"}, {"name": "shinyswatch.theme.flatly", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.flatly.html#shinyswatch.theme.flatly", "dispname": "-"}, {"name": "shinyswatch.theme.journal", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.journal.html#shinyswatch.theme.journal", "dispname": "-"}, {"name": "shinyswatch.theme.litera", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.litera.html#shinyswatch.theme.litera", "dispname": "-"}, {"name": "shinyswatch.theme.lumen", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.lumen.html#shinyswatch.theme.lumen", "dispname": "-"}, {"name": "shinyswatch.theme.lux", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.lux.html#shinyswatch.theme.lux", "dispname": "-"}, {"name": "shinyswatch.theme.materia", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.materia.html#shinyswatch.theme.materia", "dispname": "-"}, {"name": "shinyswatch.theme.minty", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.minty.html#shinyswatch.theme.minty", "dispname": "-"}, {"name": "shinyswatch.theme.morph", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.morph.html#shinyswatch.theme.morph", "dispname": "-"}, {"name": "shinyswatch.theme.pulse", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.pulse.html#shinyswatch.theme.pulse", "dispname": "-"}, {"name": "shinyswatch.theme.quartz", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.quartz.html#shinyswatch.theme.quartz", "dispname": "-"}, {"name": "shinyswatch.theme.sandstone", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.sandstone.html#shinyswatch.theme.sandstone", "dispname": "-"}, {"name": "shinyswatch.theme.simplex", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.simplex.html#shinyswatch.theme.simplex", "dispname": "-"}, {"name": "shinyswatch.theme.sketchy", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.sketchy.html#shinyswatch.theme.sketchy", "dispname": "-"}, {"name": "shinyswatch.theme.slate", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.slate.html#shinyswatch.theme.slate", "dispname": "-"}, {"name": "shinyswatch.theme.solar", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.solar.html#shinyswatch.theme.solar", "dispname": "-"}, {"name": "shinyswatch.theme.spacelab", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.spacelab.html#shinyswatch.theme.spacelab", "dispname": "-"}, {"name": "shinyswatch.theme.superhero", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.superhero.html#shinyswatch.theme.superhero", "dispname": "-"}, {"name": "shinyswatch.theme.united", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.united.html#shinyswatch.theme.united", "dispname": "-"}, {"name": "shinyswatch.theme.vapor", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.vapor.html#shinyswatch.theme.vapor", "dispname": "-"}, {"name": "shinyswatch.theme.yeti", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.yeti.html#shinyswatch.theme.yeti", "dispname": "-"}, {"name": "shinyswatch.theme.zephyr", "domain": "py", "role": "attribute", "priority": "1", "uri": "reference/theme.zephyr.html#shinyswatch.theme.zephyr", "dispname": "-"}]}
22 changes: 16 additions & 6 deletions reference/get_theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@
<a href="../reference/get_theme.html" class="sidebar-item-text sidebar-link active">
<span class="menu-text">get_theme</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="../reference/get_theme_deps.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">get_theme_deps</span></a>
</div>
</li>
</ul>
</li>
Expand Down Expand Up @@ -348,7 +354,7 @@
<section id="shinyswatch.get_theme" class="level1">
<h1>get_theme</h1>
<p><code>get_theme(name)</code></p>
<p>Create a Bootswatch and Bootstrap 5 theme for Shiny.</p>
<p>Get a Bootstrap 5 Bootswatch theme for Shiny.</p>
<section id="parameters" class="level2">
<h2 class="anchored" data-anchor-id="parameters">Parameters</h2>
<table class="table">
Expand Down Expand Up @@ -379,6 +385,10 @@ <h2 class="anchored" data-anchor-id="parameters">Parameters</h2>
<section id="returns" class="level2">
<h2 class="anchored" data-anchor-id="returns">Returns</h2>
<table class="table">
<colgroup>
<col style="width: 58%">
<col style="width: 41%">
</colgroup>
<thead>
<tr class="header">
<th>Type</th>
Expand All @@ -387,8 +397,8 @@ <h2 class="anchored" data-anchor-id="returns">Returns</h2>
</thead>
<tbody>
<tr class="odd">
<td><a href="https://docs.python.org/3/library/stdtypes.html#list">list</a>[<code>HTMLDependency</code>]</td>
<td>A list of HTML dependencies.</td>
<td><code>ShinyswatchTheme</code></td>
<td>A Bootswatch and Bootstrap 5 theme for Shiny.</td>
</tr>
</tbody>
</table>
Expand All @@ -406,7 +416,7 @@ <h2 class="anchored" data-anchor-id="examples">Examples</h2>
import shinyswatch

app_ui = ui.page_navbar(
ui.nav(
ui.nav_panel(
"Navbar 1",
shinyswatch.get_theme("superhero"),
ui.layout_sidebar(
Expand Down Expand Up @@ -441,8 +451,8 @@ <h2 class="anchored" data-anchor-id="examples">Examples</h2>
),
),
),
ui.nav("Plot", "Plot content"),
ui.nav("Table", "Table content"),
ui.nav_panel("Plot", "Plot content"),
ui.nav_panel("Table", "Table content"),
title="shinyswatch",
)

Expand Down
Loading

0 comments on commit e813f11

Please sign in to comment.