first pkgdown site
@@ -5,3 +5,5 @@ admin_color_tools
|
||||
^_pkgdown\.yml$
|
||||
^docs$
|
||||
^pkgdown$
|
||||
^doc$
|
||||
^Meta$
|
||||
|
||||
2
.gitignore
vendored
@@ -66,3 +66,5 @@ test_*
|
||||
brickr.Rproj
|
||||
brickr_colors.png
|
||||
inst/doc
|
||||
doc
|
||||
Meta
|
||||
|
||||
1
docs/CNAME
Normal file
@@ -0,0 +1 @@
|
||||
brickr.org
|
||||
@@ -121,7 +121,7 @@
|
||||
<a class="sourceLine" id="cb1-6" title="6"><span class="st"> </span><span class="kw"><a href="../reference/scale_fill_brick.html">scale_fill_brick</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb1-7" title="7"><span class="st"> </span><span class="kw"><a href="../reference/coord-brick.html">coord_brick</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb1-8" title="8"><span class="st"> </span><span class="kw"><a href="../reference/theme_brick.html">theme_brick</a></span>()</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/graphs_files/figure-html/getting_started-1.png" width="384"></p>
|
||||
<p><img src="graphs_files/figure-html/getting_started-1.png" width="384"></p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#geoms"><code><a href="../reference/geom_brick_col.html">geom_brick_col()</a></code></a> draws data columns as bricks.</li>
|
||||
@@ -164,7 +164,7 @@
|
||||
<a class="sourceLine" id="cb2-6" title="6"><span class="st"> </span><span class="kw"><a href="../reference/scale_fill_brick.html">scale_fill_brick</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb2-7" title="7"><span class="st"> </span><span class="kw"><a href="../reference/coord-brick.html">coord_brick</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb2-8" title="8"><span class="st"> </span><span class="kw"><a href="../reference/theme_brick.html">theme_brick</a></span>()</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/graphs_files/figure-html/geom_brick-1.png" width="480"></p>
|
||||
<p><img src="graphs_files/figure-html/geom_brick-1.png" width="480"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="coords" class="section level2">
|
||||
@@ -180,7 +180,7 @@
|
||||
<a class="sourceLine" id="cb3-6" title="6"><span class="st"> </span><span class="kw"><a href="../reference/coord-brick.html">coord_brick_flip</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb3-7" title="7"><span class="st"> </span><span class="kw"><a href="../reference/theme_brick.html">theme_brick</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb3-8" title="8"><span class="st"> </span><span class="kw">theme</span>(<span class="dt">legend.position =</span> <span class="st">"none"</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/graphs_files/figure-html/coord-1.png" width="480"></p>
|
||||
<p><img src="graphs_files/figure-html/coord-1.png" width="480"></p>
|
||||
</div>
|
||||
<div id="scale-and-themes" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
@@ -200,14 +200,14 @@
|
||||
<a class="sourceLine" id="cb4-8" title="8"><span class="st"> </span><span class="kw"><a href="../reference/coord-brick.html">coord_brick</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb4-9" title="9"><span class="st"> </span><span class="kw"><a href="../reference/theme_brick.html">theme_brick</a></span>(<span class="dt">brick_theme =</span> use_theme) <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb4-10" title="10"><span class="st"> </span><span class="kw">labs</span>(<span class="dt">title =</span> use_theme)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/graphs_files/figure-html/scales-1.png" width="384"></p>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/graphs_files/figure-html/scales2-1.png" width="960"></p>
|
||||
<p><img src="graphs_files/figure-html/scales-1.png" width="384"></p>
|
||||
<p><img src="graphs_files/figure-html/scales2-1.png" width="960"></p>
|
||||
</div>
|
||||
<div id="themes" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#themes" class="anchor"></a>Themes</h3>
|
||||
<p>For a complete list of available themes, use <code><a href="../reference/build_themes.html">build_themes()</a></code>.</p>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/graphs_files/figure-html/themes-1.png" width="672"></p>
|
||||
<p><img src="graphs_files/figure-html/themes-1.png" width="672"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 241 KiB After Width: | Height: | Size: 241 KiB |
|
Before Width: | Height: | Size: 337 KiB After Width: | Height: | Size: 337 KiB |
|
Before Width: | Height: | Size: 364 KiB After Width: | Height: | Size: 364 KiB |
@@ -134,7 +134,7 @@
|
||||
<a class="sourceLine" id="cb1-13" title="13"><span class="st"> </span><span class="kw"><a href="../reference/build_bricks.html">build_bricks</a></span>(<span class="dt">brick_res =</span> <span class="st">"hd"</span>, <span class="dt">phi =</span> <span class="dv">30</span>, <span class="dt">theta =</span> <span class="dv">30</span>)</a>
|
||||
<a class="sourceLine" id="cb1-14" title="14"></a>
|
||||
<a class="sourceLine" id="cb1-15" title="15">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/models-from-program_files/figure-html/bricks_6-1.png" width="384"></p>
|
||||
<p><img src="models-from-program_files/figure-html/bricks_6-1.png" width="384"></p>
|
||||
<p>Using the same logic, we can build a sphere with a specified radius, and then apply rules to color each brick based on its coordinates.</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1">radius <-<span class="st"> </span><span class="dv">4</span></a>
|
||||
<a class="sourceLine" id="cb2-2" title="2">sphere_coords <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expand.grid">expand.grid</a></span>(</a>
|
||||
@@ -157,7 +157,7 @@
|
||||
<a class="sourceLine" id="cb2-19" title="19"><span class="st"> </span><span class="kw"><a href="../reference/build_bricks.html">build_bricks</a></span>(<span class="dt">brick_res =</span> <span class="st">"hd"</span>, <span class="dt">phi =</span> <span class="dv">30</span>, <span class="dt">theta =</span> <span class="dv">30</span>)</a>
|
||||
<a class="sourceLine" id="cb2-20" title="20"></a>
|
||||
<a class="sourceLine" id="cb2-21" title="21">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/models-from-program_files/figure-html/bricks_7-1.png" width="384"></p>
|
||||
<p><img src="models-from-program_files/figure-html/bricks_7-1.png" width="384"></p>
|
||||
</div>
|
||||
<div id="it-takes-a-village" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
@@ -195,7 +195,7 @@
|
||||
<a class="sourceLine" id="cb3-29" title="29"><span class="kw">brick_house</span>() <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/bricks_from_coords.html">bricks_from_coords</a></span>() <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb3-30" title="30"><span class="st"> </span><span class="kw"><a href="../reference/build_bricks.html">build_bricks</a></span>(<span class="dt">theta =</span> <span class="dv">225</span>)</a>
|
||||
<a class="sourceLine" id="cb3-31" title="31">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/models-from-program_files/figure-html/bricks_8-1.png" width="384"></p>
|
||||
<p><img src="models-from-program_files/figure-html/bricks_8-1.png" width="384"></p>
|
||||
<p>Next, we write one more function, <code>brick_street()</code> to build a road and grass foundation. The, for an arbitrary number of houses and neighborhood size, use <code><a href="https://purrr.tidyverse.org/reference/map2.html">purrr::pmap_df</a></code> to generate many houses and place them along the road.</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">brick_street <-<span class="st"> </span><span class="cf">function</span>(<span class="dt">width =</span> <span class="dv">100</span>, <span class="dt">length =</span> <span class="dv">40</span>){</a>
|
||||
<a class="sourceLine" id="cb4-2" title="2"> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expand.grid">expand.grid</a></span>(<span class="dt">x=</span><span class="dv">1</span><span class="op">:</span>width, <span class="dt">y=</span><span class="dv">1</span><span class="op">:</span>length, <span class="dt">z=</span><span class="dv">1</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
@@ -225,7 +225,7 @@
|
||||
<a class="sourceLine" id="cb4-26" title="26"></a>
|
||||
<a class="sourceLine" id="cb4-27" title="27">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_camera">render_camera</a></span>(<span class="dt">theta =</span> <span class="dv">60</span>, <span class="dt">phi =</span> <span class="dv">20</span>, <span class="dt">zoom =</span> <span class="fl">0.75</span>)</a>
|
||||
<a class="sourceLine" id="cb4-28" title="28">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/models-from-program_files/figure-html/bricks_9-1.png" width="384"></p>
|
||||
<p><img src="models-from-program_files/figure-html/bricks_9-1.png" width="384"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 152 KiB |
@@ -138,7 +138,7 @@
|
||||
<a class="sourceLine" id="cb1-15" title="15"><span class="st"> </span><span class="kw"><a href="../reference/build_bricks.html">build_bricks</a></span>(<span class="dt">brick_res =</span> <span class="st">"hd"</span>) <span class="co">#Bricks available in standard def, high def, and ultra hd. </span></a>
|
||||
<a class="sourceLine" id="cb1-16" title="16"></a>
|
||||
<a class="sourceLine" id="cb1-17" title="17">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>( <span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/models-from-tables_files/figure-html/bricks_1-1.png" width="288"></p>
|
||||
<p><img src="models-from-tables_files/figure-html/bricks_1-1.png" width="288"></p>
|
||||
<p>Stack many bricks by changing the ‘Level’ value in the data frame. The script below uses <code><a href="https://purrr.tidyverse.org/reference/map.html">purrr::map_df()</a></code> to avoid copying and pasting. Changing the numeric values inside the data frame for each level creates different colors.</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="dv">1</span><span class="op">:</span><span class="dv">10</span> <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb2-2" title="2"><span class="st"> </span>purrr<span class="op">::</span><span class="kw"><a href="https://purrr.tidyverse.org/reference/map.html">map_df</a></span>(<span class="op">~</span>dplyr<span class="op">::</span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(brick,</a>
|
||||
@@ -149,7 +149,7 @@
|
||||
<a class="sourceLine" id="cb2-7" title="7"><span class="st"> </span><span class="kw"><a href="../reference/build_bricks.html">build_bricks</a></span>(<span class="dt">brick_res =</span> <span class="st">"hd"</span>)</a>
|
||||
<a class="sourceLine" id="cb2-8" title="8"></a>
|
||||
<a class="sourceLine" id="cb2-9" title="9">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>( <span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/models-from-tables_files/figure-html/bricks_2-1.png" width="288"></p>
|
||||
<p><img src="models-from-tables_files/figure-html/bricks_2-1.png" width="288"></p>
|
||||
</div>
|
||||
<div id="full-models" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
@@ -200,7 +200,7 @@
|
||||
<a class="sourceLine" id="cb3-42" title="42"><span class="st"> </span><span class="kw"><a href="../reference/build_bricks.html">build_bricks</a></span>(<span class="dt">theta =</span> <span class="dv">210</span>, <span class="dt">phi =</span> <span class="dv">20</span>, <span class="dt">brick_res =</span> <span class="st">"hd"</span>)</a>
|
||||
<a class="sourceLine" id="cb3-43" title="43"></a>
|
||||
<a class="sourceLine" id="cb3-44" title="44">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/models-from-tables_files/figure-html/bricks_5-1.png" width="384"></p>
|
||||
<p><img src="models-from-tables_files/figure-html/bricks_5-1.png" width="384"></p>
|
||||
<div id="plates-instead-of-bricks" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#plates-instead-of-bricks" class="anchor"></a>Plates instead of bricks</h3>
|
||||
@@ -218,7 +218,7 @@
|
||||
<a class="sourceLine" id="cb4-10" title="10"><span class="st"> </span><span class="kw"><a href="../reference/build_bricks.html">build_bricks</a></span>(<span class="dt">theta =</span> <span class="dv">210</span>, <span class="dt">phi =</span> <span class="dv">10</span>, <span class="dt">brick_res =</span> <span class="st">"hd"</span>, <span class="dt">brick_type=</span><span class="st">"plate"</span>)</a>
|
||||
<a class="sourceLine" id="cb4-11" title="11"></a>
|
||||
<a class="sourceLine" id="cb4-12" title="12">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/models-from-tables_files/figure-html/bricks_5a-1.png" width="384"></p>
|
||||
<p><img src="models-from-tables_files/figure-html/bricks_5a-1.png" width="384"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bricks-from-excel" class="section level2">
|
||||
|
||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
@@ -118,12 +118,12 @@
|
||||
<a class="sourceLine" id="cb1-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/image_to_mosaic.html">image_to_mosaic</a></span>()</a>
|
||||
<a class="sourceLine" id="cb1-3" title="3"></a>
|
||||
<a class="sourceLine" id="cb1-4" title="4">mosaic <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="../reference/build_mosaic.html">build_mosaic</a></span>()</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/mosaics_files/figure-html/g1-1.png" width="700"></p>
|
||||
<p><img src="mosaics_files/figure-html/g1-1.png" width="700"></p>
|
||||
<p>The default is to create a mosaic with 48 knobs (brick studs) on each side. Change this using the <code>img_size</code> input. A single value will create a square mosaic, while an array of two values represent the width and length.</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1">png<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/png/topics/readPNG">readPNG</a></span>(<span class="st">"../Images/mf_unicorn.PNG"</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb2-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/image_to_mosaic.html">image_to_mosaic</a></span>(<span class="dt">img_size =</span> <span class="dv">32</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb2-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/build_mosaic.html">build_mosaic</a></span>()</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/mosaics_files/figure-html/g2-1.png" width="700"></p>
|
||||
<p><img src="mosaics_files/figure-html/g2-1.png" width="700"></p>
|
||||
</div>
|
||||
<div id="colors" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
@@ -156,7 +156,7 @@
|
||||
<a class="sourceLine" id="cb3-7" title="7"><span class="st"> </span><span class="kw"><a href="../reference/build_mosaic.html">build_mosaic</a></span>(<span class="dt">title =</span> <span class="st">"universal"</span>)</a>
|
||||
<a class="sourceLine" id="cb3-8" title="8"></a>
|
||||
<a class="sourceLine" id="cb3-9" title="9">gridExtra<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/gridExtra/topics/arrangeGrob">grid.arrange</a></span>(p1, p2, <span class="dt">layout_matrix =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/matrix">matrix</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">1</span>,<span class="dv">2</span>), <span class="dt">ncol=</span><span class="dv">2</span>))</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/mosaics_files/figure-html/c_palettes-1.png" width="576"></p>
|
||||
<p><img src="mosaics_files/figure-html/c_palettes-1.png" width="576"></p>
|
||||
</div>
|
||||
<div id="grayscale" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
@@ -165,7 +165,7 @@
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">png<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/png/topics/readPNG">readPNG</a></span>(<span class="st">"../Images/mf_unicorn.PNG"</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/image_to_mosaic.html">image_to_mosaic</a></span>(<span class="dv">32</span>, <span class="dt">color_palette =</span> <span class="st">'bw'</span>, <span class="dt">contrast =</span> <span class="fl">1.1</span>)<span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-3" title="3"><span class="st"> </span><span class="kw"><a href="../reference/build_mosaic.html">build_mosaic</a></span>()</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/mosaics_files/figure-html/c_bw-1.png" width="700"></p>
|
||||
<p><img src="mosaics_files/figure-html/c_bw-1.png" width="700"></p>
|
||||
</div>
|
||||
<div id="custom-color-palettes" class="section level4">
|
||||
<h4 class="hasAnchor">
|
||||
@@ -178,7 +178,7 @@
|
||||
<a class="sourceLine" id="cb5-5" title="5">png<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/png/topics/readPNG">readPNG</a></span>(<span class="st">"../Images/mf_unicorn.PNG"</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb5-6" title="6"><span class="st"> </span><span class="kw"><a href="../reference/image_to_mosaic.html">image_to_mosaic</a></span>(<span class="dv">32</span>, <span class="dt">color_table =</span> lego_colors_wo_blue)<span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb5-7" title="7"><span class="st"> </span><span class="kw"><a href="../reference/build_mosaic.html">build_mosaic</a></span>(<span class="dt">title =</span> <span class="st">"Mosaic without blue or azur"</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/mosaics_files/figure-html/c_custom-1.png" width="700"></p>
|
||||
<p><img src="mosaics_files/figure-html/c_custom-1.png" width="700"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="color-matching" class="section level3">
|
||||
@@ -192,7 +192,7 @@
|
||||
<a class="sourceLine" id="cb6-4" title="4"><span class="st"> </span><span class="kw"><a href="../reference/build_mosaic.html">build_mosaic</a></span>(<span class="dt">title =</span> .x )) -><span class="st"> </span>mosaics_by_method</a>
|
||||
<a class="sourceLine" id="cb6-5" title="5"></a>
|
||||
<a class="sourceLine" id="cb6-6" title="6">gridExtra<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/gridExtra/topics/arrangeGrob">grid.arrange</a></span>(<span class="dt">grobs =</span> mosaics_by_method, <span class="dt">layout_matrix =</span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/cbind">rbind</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">1</span>,<span class="dv">2</span>),<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">3</span>,<span class="dv">4</span>)))</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/mosaics_files/figure-html/c_methods-1.png" width="480"></p>
|
||||
<p><img src="mosaics_files/figure-html/c_methods-1.png" width="480"></p>
|
||||
</div>
|
||||
<div id="dithering" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@@ -204,7 +204,7 @@
|
||||
<a class="sourceLine" id="cb7-4" title="4"><span class="st"> </span><span class="kw"><a href="../reference/build_mosaic.html">build_mosaic</a></span>(<span class="dt">title =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(<span class="st">"dithering ="</span>, .x))) -><span class="st"> </span>mosaics_by_dither</a>
|
||||
<a class="sourceLine" id="cb7-5" title="5"></a>
|
||||
<a class="sourceLine" id="cb7-6" title="6">gridExtra<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/gridExtra/topics/arrangeGrob">grid.arrange</a></span>(<span class="dt">grobs =</span> mosaics_by_dither, <span class="dt">layout_matrix =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/matrix">matrix</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">1</span>,<span class="dv">2</span>), <span class="dt">ncol=</span><span class="dv">2</span>))</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/mosaics_files/figure-html/c_dither-1.png" width="576"></p>
|
||||
<p><img src="mosaics_files/figure-html/c_dither-1.png" width="576"></p>
|
||||
</div>
|
||||
<div id="other-color-options" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@@ -223,7 +223,7 @@
|
||||
<a class="sourceLine" id="cb8-5" title="5"></a>
|
||||
<a class="sourceLine" id="cb8-6" title="6">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_camera">render_camera</a></span>(<span class="dt">theta =</span> <span class="dv">15</span>)</a>
|
||||
<a class="sourceLine" id="cb8-7" title="7">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../../OneDrive%20-%20LEGO/Documents/brickr/docs/articles/mosaics_files/figure-html/c_threed-1.png" width="700"></p>
|
||||
<p><img src="mosaics_files/figure-html/c_threed-1.png" width="700"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 222 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 206 KiB |
@@ -106,7 +106,7 @@
|
||||
|
||||
<div id="brickr" class="section level1">
|
||||
<div class="page-header"><h1 class="hasAnchor">
|
||||
<a href="#brickr" class="anchor"></a>brickr <img src="../../../Onedrive%20-%20LEGO/Documents/brickr/man/figures/logo.png" align="right" height="138">
|
||||
<a href="#brickr" class="anchor"></a>brickr <img src="reference/figures/logo.png" align="right" height="138">
|
||||
</h1></div>
|
||||
<!-- <!-- badges: start -->
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
<a class="sourceLine" id="cb2-3" title="3"></a>
|
||||
<a class="sourceLine" id="cb2-4" title="4"><span class="co">#Plot 2D mosaic</span></a>
|
||||
<a class="sourceLine" id="cb2-5" title="5">mosaic1 <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="reference/build_mosaic.html">build_mosaic</a></span>()</a></code></pre></div>
|
||||
<p><img src="../../../OneDrive%20-%20LEGO/Documents/brickr/docs/index_files/figure-html/m1_set-1.png" width="288"></p>
|
||||
<p><img src="index_files/figure-html/m1_set-1.png" width="288"></p>
|
||||
<p>In general, any {brickr} function that begins with <code>build_</code> generates a graphical output from a {brickr} list object from other functions.</p>
|
||||
<div id="customization" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@@ -192,7 +192,7 @@
|
||||
<a class="sourceLine" id="cb3-12" title="12"><span class="st"> </span><span class="kw"><a href="reference/build_bricks.html">build_bricks</a></span>(<span class="dt">brick_res =</span> <span class="st">"uhd"</span>)</a>
|
||||
<a class="sourceLine" id="cb3-13" title="13"></a>
|
||||
<a class="sourceLine" id="cb3-14" title="14">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>( <span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../OneDrive%20-%20LEGO/Documents/brickr/docs/index_files/figure-html/bricks_1-1.png" width="288"></p>
|
||||
<p><img src="index_files/figure-html/bricks_1-1.png" width="288"></p>
|
||||
<div id="stacking-bricks" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#stacking-bricks" class="anchor"></a>Stacking bricks</h3>
|
||||
@@ -233,7 +233,7 @@
|
||||
<a class="sourceLine" id="cb4-33" title="33"><span class="st"> </span><span class="kw"><a href="reference/build_bricks.html">build_bricks</a></span>(<span class="dt">theta =</span> <span class="dv">210</span>, <span class="dt">brick_res =</span> <span class="st">"hd"</span>)</a>
|
||||
<a class="sourceLine" id="cb4-34" title="34"></a>
|
||||
<a class="sourceLine" id="cb4-35" title="35">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../OneDrive%20-%20LEGO/Documents/brickr/docs/index_files/figure-html/bricks_5-1.png" width="384"></p>
|
||||
<p><img src="index_files/figure-html/bricks_5-1.png" width="384"></p>
|
||||
</div>
|
||||
<div id="programmatically-build-models" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@@ -260,7 +260,7 @@
|
||||
<a class="sourceLine" id="cb5-19" title="19"><span class="st"> </span><span class="kw"><a href="reference/build_bricks.html">build_bricks</a></span>(<span class="dt">phi =</span> <span class="dv">30</span>, <span class="dt">theta =</span> <span class="dv">30</span>)</a>
|
||||
<a class="sourceLine" id="cb5-20" title="20"></a>
|
||||
<a class="sourceLine" id="cb5-21" title="21">rayshader<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/rayshader/topics/render_snapshot">render_snapshot</a></span>(<span class="dt">clear =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
|
||||
<p><img src="../../../OneDrive%20-%20LEGO/Documents/brickr/docs/index_files/figure-html/bricks_6-1.png" width="480"></p>
|
||||
<p><img src="index_files/figure-html/bricks_6-1.png" width="480"></p>
|
||||
</div>
|
||||
<div id="examples" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
@@ -289,7 +289,7 @@
|
||||
<a class="sourceLine" id="cb6-6" title="6"><span class="st"> </span><span class="kw"><a href="reference/scale_fill_brick.html">scale_fill_brick</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb6-7" title="7"><span class="st"> </span><span class="kw"><a href="reference/coord-brick.html">coord_brick</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb6-8" title="8"><span class="st"> </span><span class="kw"><a href="reference/theme_brick.html">theme_brick</a></span>()</a></code></pre></div>
|
||||
<p><img src="../../../OneDrive%20-%20LEGO/Documents/brickr/docs/index_files/figure-html/geom_brick-1.png" width="384"></p>
|
||||
<p><img src="index_files/figure-html/geom_brick-1.png" width="384"></p>
|
||||
<p>Both <code><a href="reference/scale_fill_brick.html">scale_fill_brick()</a></code> and <code><a href="reference/theme_brick.html">theme_brick()</a></code> take an input ‘brick_theme’, which ensures all colors match official LEGO brick colors. See <code><a href="reference/build_themes.html">build_themes()</a></code> for a sample of all available brick theme.</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1">df <-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/data.frame">data.frame</a></span>(<span class="dt">trt =</span> letters[<span class="dv">1</span><span class="op">:</span><span class="dv">6</span>], <span class="dt">outcome =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/Normal">rnorm</a></span>(<span class="dv">6</span>, <span class="dt">mean =</span> <span class="dv">5</span>, <span class="dt">sd =</span> <span class="dv">2</span>))</a>
|
||||
<a class="sourceLine" id="cb7-2" title="2"></a>
|
||||
@@ -301,7 +301,7 @@
|
||||
<a class="sourceLine" id="cb7-8" title="8"><span class="st"> </span><span class="kw"><a href="reference/coord-brick.html">coord_brick_flip</a></span>() <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb7-9" title="9"><span class="st"> </span><span class="kw"><a href="reference/theme_brick.html">theme_brick</a></span>(use_theme) <span class="op">+</span></a>
|
||||
<a class="sourceLine" id="cb7-10" title="10"><span class="st"> </span><span class="kw">theme</span>(<span class="dt">legend.position =</span> <span class="st">"none"</span>)</a></code></pre></div>
|
||||
<p><img src="../../../OneDrive%20-%20LEGO/Documents/brickr/docs/index_files/figure-html/geom_brick2-1.png" width="384"></p>
|
||||
<p><img src="index_files/figure-html/geom_brick2-1.png" width="384"></p>
|
||||
</div>
|
||||
<div id="irl" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
@@ -312,14 +312,14 @@
|
||||
<a href="#instructions" class="anchor"></a>Instructions</h3>
|
||||
<p>Use <code><a href="reference/build_instructions.html">build_instructions()</a></code> to break the mosaics and 3D models into easier-to-read steps for building the set. This defaults to 6 steps, but passing any integer value will generate that many steps.</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1">mosaic1 <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="reference/build_instructions.html">build_instructions</a></span>(<span class="dv">9</span>)</a></code></pre></div>
|
||||
<p><img src="../../../OneDrive%20-%20LEGO/Documents/brickr/docs/index_files/figure-html/m1_instructions-1.png" width="768"></p>
|
||||
<p><img src="index_files/figure-html/m1_instructions-1.png" width="768"></p>
|
||||
</div>
|
||||
<div id="piece-list-and-count" class="section level3">
|
||||
<h3 class="hasAnchor">
|
||||
<a href="#piece-list-and-count" class="anchor"></a>Piece list and count</h3>
|
||||
<p>Use <code><a href="reference/build_pieces.html">build_pieces()</a></code> to generate a graphic and count of all required plates or bricks (for stacked mosaics). These are sorted by color and size for easy purchase on LEGO.com’s <a href="https://shop.lego.com/en-US/Pick-a-Brick">Pick-a-Brick</a> section using the advanced search option. Alternatively, use <code>table_pieces()</code> to produce a data frame table of all required bricks.</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1">mosaic1 <span class="op">%>%</span><span class="st"> </span><span class="kw"><a href="reference/build_pieces.html">build_pieces</a></span>()</a></code></pre></div>
|
||||
<p><img src="../../../OneDrive%20-%20LEGO/Documents/brickr/docs/index_files/figure-html/m1_pieces-1.png" width="768"></p>
|
||||
<p><img src="index_files/figure-html/m1_pieces-1.png" width="768"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
@@ -196,13 +196,14 @@
|
||||
<a href="#to-do" class="anchor"></a>TO DO</h2>
|
||||
<ul>
|
||||
<li><p>ggplot - continuous scale</p></li>
|
||||
<li>Vignettes
|
||||
<li>
|
||||
<p>Vignettes</p>
|
||||
<ul>
|
||||
<li>3D model from mosaics + rayshader</li>
|
||||
<li>IRL</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Website</li>
|
||||
<li><p>Website</p></li>
|
||||
<li><p>Check() breaks at the size check</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
pandoc: '2.6'
|
||||
pandoc: '2.7'
|
||||
pkgdown: 1.3.0
|
||||
pkgdown_sha: ~
|
||||
articles:
|
||||
graphs: ../../../../Onedrive - LEGO/Documents/brickr/vignettes/graphs.html
|
||||
models-from-other: ../../../../Onedrive - LEGO/Documents/brickr/vignettes/models-from-other.html
|
||||
models-from-program: ../../../../Onedrive - LEGO/Documents/brickr/vignettes/models-from-program.html
|
||||
models-from-tables: ../../../../Onedrive - LEGO/Documents/brickr/vignettes/models-from-tables.html
|
||||
mosaics: ../../../../Onedrive - LEGO/Documents/brickr/vignettes/mosaics.html
|
||||
graphs: graphs.html
|
||||
models-from-other: models-from-other.html
|
||||
models-from-program: models-from-program.html
|
||||
models-from-tables: models-from-tables.html
|
||||
mosaics: mosaics.html
|
||||
urls:
|
||||
reference: http://brickr.org/reference
|
||||
article: http://brickr.org/articles
|
||||
|
||||
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
@@ -174,7 +174,8 @@ data. All objects will be fortified to produce a data frame. See
|
||||
<code>fortify()</code> for which variables will be created.</p>
|
||||
<p>A <code>function</code> will be called with a single argument,
|
||||
the plot data. The return value must be a <code>data.frame</code>, and
|
||||
will be used as the layer data.</p></td>
|
||||
will be used as the layer data. A <code>function</code> can be created
|
||||
from a <code>formula</code> (e.g. <code>~ head(.x, 10)</code>).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>position</th>
|
||||
|
||||
@@ -173,7 +173,8 @@ data. All objects will be fortified to produce a data frame. See
|
||||
<code>fortify()</code> for which variables will be created.</p>
|
||||
<p>A <code>function</code> will be called with a single argument,
|
||||
the plot data. The return value must be a <code>data.frame</code>, and
|
||||
will be used as the layer data.</p></td>
|
||||
will be used as the layer data. A <code>function</code> can be created
|
||||
from a <code>formula</code> (e.g. <code>~ head(.x, 10)</code>).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>stat</th>
|
||||
@@ -208,6 +209,10 @@ to the paired geom/stat.</p></td>
|
||||
<th>use_bricks</th>
|
||||
<td><p>Array of brick sizes to use in mosaic. Defaults to <code><a href='https://www.rdocumentation.org/packages/base/topics/c'>c('4x2', '2x2', '3x1', '2x1', '1x1')</a></code>`.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>linejoin</th>
|
||||
<td><p>Line join style (round, mitre, bevel).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>na.rm</th>
|
||||
<td><p>If <code>FALSE</code>, the default, missing values are removed with
|
||||
|
||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
@@ -27,7 +27,8 @@ data. All objects will be fortified to produce a data frame. See
|
||||
|
||||
A \code{function} will be called with a single argument,
|
||||
the plot data. The return value must be a \code{data.frame}, and
|
||||
will be used as the layer data.}
|
||||
will be used as the layer data. A \code{function} can be created
|
||||
from a \code{formula} (e.g. \code{~ head(.x, 10)}).}
|
||||
|
||||
\item{position}{It it not recommended to use \code{position = "stack"}.}
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ data. All objects will be fortified to produce a data frame. See
|
||||
|
||||
A \code{function} will be called with a single argument,
|
||||
the plot data. The return value must be a \code{data.frame}, and
|
||||
will be used as the layer data.}
|
||||
will be used as the layer data. A \code{function} can be created
|
||||
from a \code{formula} (e.g. \code{~ head(.x, 10)}).}
|
||||
|
||||
\item{stat}{The statistical transformation to use on the data for this
|
||||
layer, as a string.}
|
||||
@@ -49,6 +50,8 @@ to the paired geom/stat.}
|
||||
|
||||
\item{use_bricks}{Array of brick sizes to use in mosaic. Defaults to \code{c('4x2', '2x2', '3x1', '2x1', '1x1')}`.}
|
||||
|
||||
\item{linejoin}{Line join style (round, mitre, bevel).}
|
||||
|
||||
\item{na.rm}{If \code{FALSE}, the default, missing values are removed with
|
||||
a warning. If \code{TRUE}, missing values are silently removed.}
|
||||
|
||||
|
||||