Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
juba committed May 24, 2024
1 parent 3b348ca commit dad67c8
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
380c5522
612c7d7b
1 change: 1 addition & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ <h2 class="anchored" data-anchor-id="pyobsplot-0.4.3-dev">pyobsplot 0.4.3 (dev)<
<ul>
<li>Plots can now be generated in “png” and “pdf” formats when using the <code>jsdom</code> renderer. This is done by converting figures using <a href="https://typst.app">typst</a>. Many thanks to <span class="citation" data-cites="wirhabenzeit">@wirhabenzeit</span> and <span class="citation" data-cites="harrylojames">@harrylojames</span> for the idea, the underlying code and the feedback.</li>
<li>Update Observable Plot to 0.6.14</li>
<li>Migrate build system from hatch to rye</li>
</ul>
</section>
<section id="pyobsplot-0.4.2" class="level2">
Expand Down
8 changes: 4 additions & 4 deletions development.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ <h2 class="anchored" data-anchor-id="install-fom-source">Install fom source</h2>
<p>If you want to build <code>pyobsplot</code> from source, you’ll have to follow these steps:</p>
<ul>
<li>Install <a href="https://nodejs.org/en">node.js</a></li>
<li>Install <a href="https://hatch.pypa.io/latest/">hatch</a> dependency management system</li>
<li>Install <a href="https://rye.astral.sh/guide/installation/">rye</a> dependency management system</li>
<li>Clone the <a href="https://github.com/juba/pyobsplot">pyobsplot</a> repository</li>
<li>Install Python dependencies with : <code>hatch shell</code></li>
<li>Install Python dependencies with : <code>rye sync</code></li>
<li>Install <code>pyobsplot-js</code> JavaScript dependencies with : <code>npm install --workspaces</code></li>
<li>Install <code>pyobsplot</code> dependencies with : <code>npm install</code></li>
</ul>
Expand Down Expand Up @@ -266,7 +266,7 @@ <h2 class="anchored" data-anchor-id="tests">Tests</h2>
<h2 class="anchored" data-anchor-id="debug-mode">Debug mode</h2>
<p>“Debug mode” outputs the computed JavaScript plot structure (the one passed to <code>Plot.plot</code>).</p>
<p>To activate it, add <code>debug=True</code> when creating your plot generator object:</p>
<div id="0af2da70" class="cell" data-execution_count="1">
<div id="638005a0" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>op <span class="op">=</span> Obsplot(render<span class="op">=</span><span class="st">"widget"</span>, debug<span class="op">=</span><span class="va">True</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>If using the <code>widget</code> renderer, debug output will be displayed in JavaScript console. With the <code>jsdom</code> renderer, it will be displayed directly in the notebook.</p>
Expand All @@ -279,7 +279,7 @@ <h3 class="anchored" data-anchor-id="releases">Releases</h3>
<li>If necessary release the npm package with <code>npm publish</code> in <code>packages/pyobsplot-js</code></li>
<li>Check that the <code>min_npm_version</code> value in <code>.utils</code> is correct</li>
<li>Change version in <code>NEWS.md</code> and <code>src/pyobsplot/__about__.py</code></li>
<li>Release the Python package with <code>hatch build</code> and <code>hatch publish</code> in <code>pyobsplot</code></li>
<li>Release the Python package with <code>rye build</code> and <code>rye publish</code> in <code>pyobsplot</code></li>
<li>Tag the version in git</li>
<li>Create a release on Github</li>
<li>Bump to dev version in <code>pyproject.toml</code> and <code>NEWS.md</code></li>
Expand Down
8 changes: 4 additions & 4 deletions gallery_geo.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ <h1 class="title">Mapping and spatial data</h1>
<h2 class="anchored" data-anchor-id="geo-mark">Geo mark</h2>
<p>The <a href="https://observablehq.com/@observablehq/plot-geo?collection=@observablehq/plot">Geo mark</a> allows to draw geographic features such as points, lines and polygons. These marks data are passed as GeoJSON.</p>
<p>This allows to create choropleth maps such as the following:</p>
<div id="be2516ce" class="cell" data-execution_count="2">
<div id="3b4af257" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> pyobsplot <span class="im">import</span> Obsplot, Plot</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> geopandas <span class="im">as</span> gpd</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> pandas <span class="im">as</span> pd</span>
Expand Down Expand Up @@ -268,7 +268,7 @@ <h2 class="anchored" data-anchor-id="geo-mark">Geo mark</h2>
</div>
</div>
<p>Of course other marks can be used in conjunction with geo marks. This example represents the density of Walmarts supermarkets and is taken from the <a href="https://observablehq.com/@observablehq/plot-mapping?collection=@observablehq/plot">Mapping notebook</a>.</p>
<div id="75076e32" class="cell" data-execution_count="3">
<div id="a08cca37" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Load US states from TopoJson with geopandas and convert to GeoJson</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>states <span class="op">=</span> gpd.read_file(<span class="st">"data/us-counties-10m.json"</span>, layer<span class="op">=</span><span class="st">"states"</span>).to_json()</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>nation <span class="op">=</span> gpd.read_file(<span class="st">"data/us-counties-10m.json"</span>, layer<span class="op">=</span><span class="st">"nation"</span>).to_json()</span>
Expand Down Expand Up @@ -306,7 +306,7 @@ <h2 class="anchored" data-anchor-id="geo-mark">Geo mark</h2>
<h2 class="anchored" data-anchor-id="raster-mark">Raster mark</h2>
<p>The <a href="https://observablehq.com/@observablehq/plot-raster?collection=@observablehq/plot">Raster mark</a> creates an image from spatial data.</p>
<p>Plot allows to do different type of spatial interpolations, such as <em>nearest</em>, which draws voronoi cells around values:</p>
<div id="637efbd8" class="cell" data-execution_count="4">
<div id="67f1dd04" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" 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="im">import</span> polars <span class="im">as</span> pl</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>ca55 <span class="op">=</span> pl.read_csv(<span class="st">"data/ca55-south.csv"</span>)</span>
Expand Down Expand Up @@ -347,7 +347,7 @@ <h2 class="anchored" data-anchor-id="raster-mark">Raster mark</h2>
</div>
</div>
<p>Or the more recent random walk interpolation:</p>
<div id="3ae49f9e" class="cell" data-execution_count="5">
<div id="154b32bd" class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>flare_map(<span class="st">"random-walk"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display">
<div>
Expand Down
14 changes: 7 additions & 7 deletions gallery_interaction.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions gallery_marks.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ <h1 class="title">Marks</h1>
<section id="cell-mark" class="level2">
<h2 class="anchored" data-anchor-id="cell-mark">Cell mark</h2>
<p>The following chart, taken from the <a href="https://observablehq.com/@observablehq/plot-cell?collection=@observablehq/plot">Cell Mark notebook</a>, shows the rating of every episode of <em>The Simpsons</em>.</p>
<div id="057d3c97" class="cell" data-execution_count="2">
<div id="b8d33583" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> polars <span class="im">as</span> pl</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> pyobsplot <span class="im">import</span> Plot, d3, Math, js</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down Expand Up @@ -260,7 +260,7 @@ <h2 class="anchored" data-anchor-id="cell-mark">Cell mark</h2>
<section id="faceting" class="level2">
<h2 class="anchored" data-anchor-id="faceting">Faceting</h2>
<p><em>Faceting</em> allows to easily produce multiple plots by partitioning data. The following facet plot is taken from the <a href="https://observablehq.com/@observablehq/plot-facets?collection=@observablehq/plot">Facets notebook</a>.</p>
<div id="837b4f6a" class="cell" data-execution_count="3">
<div id="190a91b7" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>penguins <span class="op">=</span> pl.read_csv(<span class="st">"data/penguins.csv"</span>)</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>Plot.plot(</span>
Expand Down Expand Up @@ -306,7 +306,7 @@ <h2 class="anchored" data-anchor-id="faceting">Faceting</h2>
<section id="arrow-mark" class="level2">
<h2 class="anchored" data-anchor-id="arrow-mark">Arrow mark</h2>
<p>Some marks allow for nice representation of complex data. The following plot, taken from the <a href="https://observablehq.com/@observablehq/plot-arrow?collection=@observablehq/plot">Arrow mark notebook</a>, shows the evolution of inequality and population in various U.S. cities.</p>
<div id="b915802f" class="cell" data-execution_count="4">
<div id="8635f496" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" 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>metros <span class="op">=</span> pl.read_csv(<span class="st">"data/metros.csv"</span>)</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>Plot.plot(</span>
Expand Down Expand Up @@ -378,7 +378,7 @@ <h2 class="anchored" data-anchor-id="arrow-mark">Arrow mark</h2>
<section id="contour-mark" class="level2">
<h2 class="anchored" data-anchor-id="contour-mark">Contour mark</h2>
<p>The contour mark allows for nice representations of spatial data. The following example taken from the <a href="https://observablehq.com/@observablehq/plot-contour?collection=@observablehq/plot">Contour mark notebook</a> shows water vapor data from november 2022 (note that data processing and plot code are slightly modified to adapt to <code>pyobsplot</code> specificities).</p>
<div id="11c1bc28" class="cell" data-execution_count="5">
<div id="e32b2a5c" class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>vapor <span class="op">=</span> (</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> pl.read_csv(<span class="st">"data/vapor.csv"</span>, has_header<span class="op">=</span><span class="va">False</span>, null_values<span class="op">=</span><span class="st">"99999.0"</span>)</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> .transpose()</span>
Expand Down
14 changes: 7 additions & 7 deletions gallery_themes.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions gallery_transforms.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h1 class="title">Transforms</h1>
<section id="group-transform" class="level2">
<h2 class="anchored" data-anchor-id="group-transform">Group transform</h2>
<p><a href="https://observablehq.com/@observablehq/plot-group?collection=@observablehq/plot">Group transform</a> allows to compute summary values before plotting them. It is often used to make bar charts.</p>
<div id="d0068b20" class="cell" data-execution_count="2">
<div id="2d8004e0" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> polars <span class="im">as</span> pl</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> pyobsplot <span class="im">import</span> Plot, d3, Math, js</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down Expand Up @@ -250,7 +250,7 @@ <h2 class="anchored" data-anchor-id="group-transform">Group transform</h2>
<section id="dodge-transform" class="level2">
<h2 class="anchored" data-anchor-id="dodge-transform">Dodge transform</h2>
<p>The <a href="https://observablehq.com/@observablehq/plot-dodge?collection=@observablehq/plot">Dodge transform</a> allows to pack marks without overlapping. The following chart shows data about IPO offerings in the US.</p>
<div id="49318be0" class="cell" data-execution_count="3">
<div id="18f4bbe7" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> datetime <span class="im">import</span> datetime</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>ipos <span class="op">=</span> pl.read_csv(<span class="st">"data/ipos.csv"</span>, try_parse_dates<span class="op">=</span><span class="va">True</span>).<span class="bu">filter</span>(</span>
Expand Down Expand Up @@ -295,7 +295,7 @@ <h2 class="anchored" data-anchor-id="dodge-transform">Dodge transform</h2>
<section id="hexbin-transform" class="level2">
<h2 class="anchored" data-anchor-id="hexbin-transform">Hexbin transform</h2>
<p>The <a href="https://observablehq.com/@observablehq/plot-hexbin?collection=@observablehq/plot">Hexbin transform</a> aggregates two dimensional points into hexagonal bins.</p>
<div id="8c7666a4" class="cell" data-execution_count="4">
<div id="b9ecaae2" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" 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>Plot.plot(</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> {</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"inset"</span>: <span class="dv">10</span>,</span>
Expand Down Expand Up @@ -355,7 +355,7 @@ <h2 class="anchored" data-anchor-id="hexbin-transform">Hexbin transform</h2>
<section id="map-transform" class="level2">
<h2 class="anchored" data-anchor-id="map-transform">Map transform</h2>
<p><a href="https://observablehq.com/@observablehq/plot-map?collection=@observablehq/plot">Map transform</a> family can be used to normalize values.</p>
<div id="2f31ae17" class="cell" data-execution_count="5">
<div id="096751fc" class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>stocks <span class="op">=</span> pl.read_csv(<span class="st">"data/stocks.csv"</span>, try_parse_dates<span class="op">=</span><span class="va">True</span>)</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>Plot.plot(</span>
Expand Down Expand Up @@ -402,7 +402,7 @@ <h2 class="anchored" data-anchor-id="map-transform">Map transform</h2>
<section id="transforms-composition" class="level2">
<h2 class="anchored" data-anchor-id="transforms-composition">Transforms composition</h2>
<p>Several group and map transforms can be applied and composed to create complex representations, such as this distribution of group ages by US states adapted from the <a href="https://observablehq.com/@observablehq/plot-map?collection=@observablehq/plot">Map transform</a> notebook.</p>
<div id="d7cb7996" class="cell" data-execution_count="6">
<div id="2ee46fac" class="cell" data-execution_count="6">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Load and prepare data</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>stateage <span class="op">=</span> (</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> pl.read_csv(<span class="st">"data/us-population-state-age.csv"</span>)</span>
Expand Down
Loading

0 comments on commit dad67c8

Please sign in to comment.