tag:blogger.com,1999:blog-76308106066542500772024-02-01T22:55:14.953-08:00Timely Portfolioklrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.comBlogger383125tag:blogger.com,1999:blog-7630810606654250077.post-23705641829483065682017-03-23T10:45:00.002-07:002017-03-23T10:45:46.441-07:00Picking the TopIn <a href="http://timelyportfolio.blogspot.com/2017/02/shorting-with-reckless-abandon.html">Shorting With Reckless Abandon</a> I expressed my views. I have now started documenting my journey at <a href="http://pickingthetop.com">Picking The Top</a> for anyone who wants to see my foolishness in realtime.klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-19142378269357930662017-03-15T13:10:00.000-07:002017-03-15T13:19:48.866-07:00Puts as Protection<p>Many asset management firms are happily enjoying record revenue and profits driven not by inorganic growth or skillful portfolio management but by a seemingly endless increase in US equity prices. These firms are effectively commodity producers entirely dependent on the price of an index over which the firm has no control. The options market presents an easy, cheap, and liquid form of protection in the form of puts with which the firm could hedge its revenues, its clients, or both. However, many of these firms in blissful disregard for the brutality of asymmetric arithmetic choose to ignore this opportunity for protection.</p>
<p>Here is some very quick and ugly code with which anyone can evaluate various put options for the hedge and their potential outcomes. I hope someone, somewhere might benefit from the idea</p>
<div id="load-our-helpful-packages" class="section level3">
<h3>Load Our Helpful Packages</h3>
<pre class="r"><code class="r"><span class="keyword">library</span><span class="paren">(</span><span class="identifier">quantmod</span><span class="paren">)</span>
<span class="keyword">library</span><span class="paren">(</span><span class="identifier">purrr</span><span class="paren">)</span>
<span class="keyword">library</span><span class="paren">(</span><span class="identifier">dplyr</span><span class="paren">)</span>
<span class="keyword">library</span><span class="paren">(</span><span class="identifier">pipeR</span><span class="paren">)</span>
<span class="keyword">library</span><span class="paren">(</span><span class="identifier">tibble</span><span class="paren">)</span></code></pre>
</div>
<div id="use-quantmod-to-gather-data" class="section level3">
<h3>Use quantmod To Gather Data</h3>
<pre class="r"><code class="r"><span class="identifier">getSymbols</span><span class="paren">(</span><span class="string">"SPY"</span><span class="paren">)</span></code></pre>
<pre><code>## [1] "SPY"</code></pre>
<pre class="r"><code class="r"><span class="identifier">spy_opts</span> <span class="operator"><-</span> <span class="identifier">getOptionChain</span><span class="paren">(</span><span class="string">"SPY"</span>, <span class="identifier">Exp</span> <span class="operator">=</span> <span class="string">"2017-12-15"</span><span class="paren">)</span></code></pre>
</div>
<div id="construct-simple-hedged-portfolio" class="section level3">
<h3>Construct Simple Hedged Portfolio</h3>
<pre class="r"><code class="r"><span class="identifier">outcomes</span> <span class="operator"><-</span> <span class="identifier">spy_opts</span><span class="operator">$</span><span class="identifier">puts</span> <span class="operator">%>%</span>
<span class="identifier">tbl_df</span><span class="paren">(</span><span class="paren">)</span> <span class="operator">%>%</span>
<span class="identifier">filter</span><span class="paren">(</span><span class="identifier">Strike</span> <span class="operator">>=</span> <span class="number">230</span>, <span class="identifier">Strike</span> <span class="operator"><=</span> <span class="number">260</span>, <span class="identifier">Ask</span> <span class="operator">></span> <span class="number">0</span><span class="paren">)</span> <span class="operator">%>%</span>
<span class="identifier">mutate</span><span class="paren">(</span>
<span class="identifier">spy_pos</span> <span class="operator">=</span> <span class="identifier">floor</span><span class="paren">(</span><span class="number">100</span><span class="operator">*</span><span class="identifier">tail</span><span class="paren">(</span><span class="identifier">SPY</span>,<span class="number">1</span><span class="paren">)</span><span class="paren">[</span><span class="paren">[</span><span class="number">4</span><span class="paren">]</span><span class="paren">]</span><span class="operator">-</span><span class="number">100</span><span class="operator">*</span><span class="identifier">Ask</span><span class="paren">)</span>,
<span class="identifier">option_pos</span> <span class="operator">=</span> <span class="identifier">ceiling</span><span class="paren">(</span><span class="number">100</span><span class="operator">*</span><span class="identifier">Ask</span><span class="paren">)</span>
<span class="paren">)</span> <span class="operator">%>%</span>
<span class="identifier">select</span><span class="paren">(</span><span class="identifier">Strike</span>, <span class="identifier">spy_pos</span>, <span class="identifier">option_pos</span><span class="paren">)</span>
<span class="identifier">portfolio</span> <span class="operator"><-</span> <span class="identifier">map</span><span class="paren">(</span>
<span class="identifier">seq_len</span><span class="paren">(</span><span class="identifier">nrow</span><span class="paren">(</span><span class="identifier">outcomes</span><span class="paren">)</span><span class="paren">)</span>,
<span class="operator">~</span><span class="identifier">.x</span> <span class="operator">%>>%</span>
<span class="paren">{</span><span class="identifier">outcomes</span><span class="paren">[</span>.,<span class="paren">]</span><span class="paren">}</span> <span class="operator">%>>%</span>
<span class="paren">(</span><span class="identifier">strike</span><span class="operator">~</span><span class="paren">{</span>
<span class="identifier">map</span><span class="paren">(</span>
<span class="identifier">seq</span><span class="paren">(</span><span class="operator">-</span><span class="number">50</span>,<span class="number">50</span>,<span class="number">5</span><span class="paren">)</span>,
<span class="operator">~</span><span class="identifier">tibble</span><span class="paren">(</span>
<span class="identifier">outcome</span> <span class="operator">=</span> <span class="identifier">.x</span>,
<span class="identifier">value</span> <span class="operator">=</span> <span class="identifier">strike</span><span class="operator">$</span><span class="identifier">spy_pos</span> <span class="operator">*</span> <span class="paren">(</span><span class="number">1</span><span class="operator">+</span><span class="identifier">.x</span><span class="operator">/</span><span class="number">100</span><span class="paren">)</span> <span class="operator">+</span>
<span class="identifier">max</span><span class="paren">(</span><span class="identifier">c</span><span class="paren">(</span><span class="identifier">strike</span><span class="operator">$</span><span class="identifier">Strike</span> <span class="operator">-</span> <span class="identifier">tail</span><span class="paren">(</span><span class="identifier">SPY</span><span class="paren">)</span><span class="paren">[</span><span class="paren">[</span><span class="number">4</span><span class="paren">]</span><span class="paren">]</span> <span class="operator">*</span> <span class="paren">(</span><span class="number">1</span><span class="operator">+</span><span class="identifier">.x</span><span class="operator">/</span><span class="number">100</span><span class="paren">)</span>,<span class="number">0</span><span class="paren">)</span><span class="paren">)</span> <span class="operator">*</span> <span class="number">100</span>
<span class="paren">)</span>
<span class="paren">)</span> <span class="operator">%>>%</span>
<span class="identifier">bind_rows</span><span class="paren">(</span><span class="paren">)</span>
<span class="paren">}</span><span class="paren">)</span>
<span class="paren">)</span>
<span class="identifier">strike_port</span> <span class="operator"><-</span> <span class="identifier">tibble</span><span class="paren">(</span>
<span class="identifier">strike</span> <span class="operator">=</span> <span class="identifier">outcomes</span><span class="operator">$</span><span class="identifier">Strike</span>,
<span class="identifier">outcomes</span> <span class="operator">=</span> <span class="identifier">map</span><span class="paren">(</span><span class="identifier">portfolio</span>, <span class="operator">~</span><span class="identifier">.x</span><span class="paren">)</span>
<span class="paren">)</span></code></pre>
</div>
<div id="plot-outcomes-in" class="section level3">
<h3>Plot Outcomes in $</h3>
<pre class="r"><code class="r"><span class="identifier">plot</span><span class="paren">(</span>
<span class="identifier">value</span> <span class="operator">~</span> <span class="identifier">outcome</span>,
<span class="identifier">data</span> <span class="operator">=</span> <span class="identifier">strike_port</span><span class="paren">[</span><span class="number">1</span>,<span class="paren">]</span><span class="operator">$</span><span class="identifier">outcomes</span><span class="paren">[</span><span class="paren">[</span><span class="number">1</span><span class="paren">]</span><span class="paren">]</span>,
<span class="identifier">ylim</span> <span class="operator">=</span> <span class="identifier">c</span><span class="paren">(</span><span class="number">0</span>,<span class="number">40000</span><span class="paren">)</span>,
<span class="identifier">type</span> <span class="operator">=</span> <span class="string">"l"</span>
<span class="paren">)</span>
<span class="identifier">walk</span><span class="paren">(</span>
<span class="identifier">seq_len</span><span class="paren">(</span><span class="identifier">nrow</span><span class="paren">(</span><span class="identifier">strike_port</span><span class="paren">)</span><span class="paren">)</span>,
<span class="operator">~</span><span class="identifier">lines</span><span class="paren">(</span><span class="identifier">value</span> <span class="operator">~</span> <span class="identifier">outcome</span>, <span class="identifier">data</span> <span class="operator">=</span> <span class="identifier">strike_port</span><span class="paren">[</span><span class="identifier">.x</span>,<span class="paren">]</span><span class="operator">$</span><span class="identifier">outcomes</span><span class="paren">[</span><span class="paren">[</span><span class="number">1</span><span class="paren">]</span><span class="paren">]</span><span class="paren">)</span>
<span class="paren">)</span></code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAPACAMAAADDuCPrAAAAV1BM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uf/33bX589/FsIElDqc5XLfyxsBXX8+9+7f9mZAz519DgomE1DqsIng8Zr47ihxUkAvbns9oGfX4AWURwkodVjqCPQwFBQgoFTi7H3M3TWi2Hugu9vePIX36U9KEVAqcXYlfb3r5Ok482117Sr87jpQ77bXA9p9DNR3OClEQKlE77OcXQt3WTx+qvMQ0NPP7no59DnQKwHtYns4BPUxJh4koNTi/NtE21y+7f/itGzI8UPw+28idf/c1vDytjcCur0M/30/iA/S8xABpRaX32c/+4v/u//w5u4S+qfvwh+/mnT5XfhrAT1+pf54Y4gSUKpxsaLSKXXfDp9+//fHoXrHn/02eNtbAT37JJN+8hgBpSK9dTq7U/PNafbx60Pbgn45/ezZBfXL9UCvB3S/PKhvIfEwAQUIElCAIAEFCBJQgCABBQgSUIAgAQUIElCAIAEFCBJQgCABBQgSUIAgAQUIElCAIAEFCBJQgCABBQgSUIAgAQUIElCAIAEFCBJQgCABBQgSUIAgAQUIElCAIAEFCBJQgCABBQgSUIAgAQUIElCAIAEFCBJQgCABBQgSUIAgAQUIElCAIAEFCBJQgCABBQgSUIAgAQUIElCAIAEFCBJQgCABBQgSUIAgAQUI+l/V0sDUVmvRYAAAAABJRU5ErkJggg==" width="672"></p>
</div>
<div id="make-outcomes-interactive-in-plotly" class="section level3">
<h3>Make Outcomes Interactive in Plotly</h3>
<pre class="r"><code class="r"><span class="keyword">library</span><span class="paren">(</span><span class="identifier">plotly</span><span class="paren">)</span>
<span class="identifier">pltly</span> <span class="operator"><-</span> <span class="identifier">reduce</span><span class="paren">(</span>
<span class="number">1</span><span class="operator">:</span><span class="identifier">nrow</span><span class="paren">(</span><span class="identifier">strike_port</span><span class="paren">)</span>,
<span class="keyword">function</span><span class="paren">(</span><span class="identifier">left</span>, <span class="identifier">right</span><span class="paren">)</span> <span class="paren">{</span>
<span class="identifier">left</span> <span class="operator">%>%</span>
<span class="identifier">add_lines</span><span class="paren">(</span>
<span class="identifier">x</span> <span class="operator">=</span> <span class="identifier">strike_port</span><span class="paren">[</span><span class="identifier">right</span>,<span class="paren">]</span><span class="operator">$</span><span class="identifier">outcomes</span><span class="paren">[</span><span class="paren">[</span><span class="number">1</span><span class="paren">]</span><span class="paren">]</span><span class="operator">$</span><span class="identifier">outcome</span>,
<span class="identifier">y</span> <span class="operator">=</span> <span class="identifier">strike_port</span><span class="paren">[</span><span class="identifier">right</span>,<span class="paren">]</span><span class="operator">$</span><span class="identifier">outcomes</span><span class="paren">[</span><span class="paren">[</span><span class="number">1</span><span class="paren">]</span><span class="paren">]</span><span class="operator">$</span><span class="identifier">value</span><span class="operator">/</span><span class="paren">(</span><span class="number">100</span><span class="operator">*</span><span class="identifier">tail</span><span class="paren">(</span><span class="identifier">SPY</span>,<span class="number">1</span><span class="paren">)</span><span class="paren">[</span><span class="paren">[</span><span class="number">4</span><span class="paren">]</span><span class="paren">]</span><span class="paren">)</span> <span class="operator">-</span> <span class="number">1</span>,
<span class="identifier">inherit</span> <span class="operator">=</span> <span class="literal">FALSE</span>,
<span class="identifier">name</span> <span class="operator">=</span> <span class="identifier">strike_port</span><span class="paren">[</span><span class="identifier">right</span>,<span class="paren">]</span><span class="operator">$</span><span class="identifier">strike</span>
<span class="paren">)</span>
<span class="paren">}</span>,
<span class="identifier">.init</span> <span class="operator">=</span> <span class="identifier">plot_ly</span><span class="paren">(</span><span class="paren">)</span>
<span class="paren">)</span></code></pre>
</div>
<a href="https://bl.ocks.org/timelyportfolio/raw/153eb2a6f42a74196985771fd4192b0b/">Live Plotly Example</a>klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-27278148327619509292017-02-28T10:56:00.002-08:002017-02-28T10:57:29.744-08:00Shorting with Reckless AbandonAs always, anything you read on this blog will likely lead to significant losses, and anyone with any sense will just ignore my silliness and move on. However, just for posterity, I am beginning to short US equities with reckless abandon. Beyond that, I realize that I have lost a lot of respect for investors and speculators that I have admired over the years. In time, we shall see.klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-72863649466635079882016-07-26T09:49:00.000-07:002016-07-26T09:49:29.645-07:00Ooms Magical Polyglot World<i><a href="http://www.buildingwidgets.com/blog/2016/7/25/ooms-magical-polyglot-world">crossposted from BuildingWidgets</a></i><br/>
<hr/>
<p>Jeroen Ooms (<a href="https://jeroenooms.github.io/">@opencpu</a>) provides <code>R</code>
users a magical polyglot world of R, JavaScript, C, and C++. This is my
attempt to both thank him and highlight some of all that he has done.
Much of my new R depends on his work.</p>
<h2>Ooms' Packages</h2>
<p><a href="http://www.r-pkg.org/">metacran</a> provides a list of all <a href="http://www.r-pkg.org/maint/jeroen.ooms@stat.ucla.edu">Jeroen's CRAN
packages</a>. Now, I
wonder if any of his packages are in the <em>Top Downloads</em>.</p>
<h3>jsonlite</h3>
<p>Let's leverage the helpful meta again from
<a href="http://www.r-pkg.org/">metacran</a> and very quickly get some assistance
from <em>hint-hint</em>
<a href="https://cran.r-project.org/web/packages/jsonlite/index.html"><code>jsonlite</code></a>.</p>
<pre><code>library(jsonlite)
library(formattable)
library(tibble)
library(magrittr)
fromJSON("http://cranlogs.r-pkg.org/top/last-month/9") %>%
{as_tibble(rank=rownames(.$downloads),.$downloads)} %>%
rownames_to_column(var = "rank") %>%
format_table(
formatters = list(
area(row=which(.$package=="jsonlite")) ~ formatter("span", style="background-color:#D4F; width:100%")
)
)
</code></pre>
<table class="table table-condensed">
<thead>
<tr>
<th style="text-align:right;">
rank
</th>
<th style="text-align:right;">
package
</th>
<th style="text-align:right;">
downloads
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
Rcpp
</td>
<td style="text-align:right;">
236316
</td>
</tr>
<tr>
<td style="text-align:right;">
2
</td>
<td style="text-align:right;">
plyr
</td>
<td style="text-align:right;">
208609
</td>
</tr>
<tr>
<td style="text-align:right;">
3
</td>
<td style="text-align:right;">
ggplot2
</td>
<td style="text-align:right;">
201959
</td>
</tr>
<tr>
<td style="text-align:right;">
4
</td>
<td style="text-align:right;">
stringi
</td>
<td style="text-align:right;">
188252
</td>
</tr>
<tr>
<td style="text-align:right;">
<span style="background-color:#D4F; width:100%">5 </span>
</td>
<td style="text-align:right;">
<span style="background-color:#D4F; width:100%">jsonlite</span>
</td>
<td style="text-align:right;">
<span style="background-color:#D4F; width:100%">175853 </span>
</td>
</tr>
<tr>
<td style="text-align:right;">
6
</td>
<td style="text-align:right;">
digest
</td>
<td style="text-align:right;">
174714
</td>
</tr>
<tr>
<td style="text-align:right;">
7
</td>
<td style="text-align:right;">
stringr
</td>
<td style="text-align:right;">
173835
</td>
</tr>
<tr>
<td style="text-align:right;">
8
</td>
<td style="text-align:right;">
magrittr
</td>
<td style="text-align:right;">
166437
</td>
</tr>
<tr>
<td style="text-align:right;">
9
</td>
<td style="text-align:right;">
scales
</td>
<td style="text-align:right;">
156694
</td>
</tr>
</tbody>
</table>
`jsonlite` is an ultra-fast reliable tool to convert and create `json`
in `R`. It's fast because like much Jeroen's work, he leverages
`C`/`C++` libraries. `shiny` and `htmlwidgets` both depend on
`jsonlite`.
<h3>V8</h3>
<p><a href="https://github.com/jeroenooms/V8"><code>V8</code></a> gives <code>R</code> its own embedded
JavaScript engine to leverage functionality in JavaScript that might not
exist in <code>R</code>. For example, the
<a href="http://marvl.infotech.monash.edu/webcola"><code>WebCola</code></a> constraint-based
layout engine offers valuable technology not available within R. Let's
partially recreate the <a href="http://marvl.infotech.monash.edu/webcola/examples/smallgroups.html">smallgroups
example</a>
all in R. You might notice that the previously mentioned <code>jsonlite</code> is
essential to this workflow.</p>
<pre><code>library(V8)
library(jsonlite)
library(scales)
ctx = new_context(global="window")
ctx$source("https://cdn.rawgit.com/tgdwyer/WebCola/master/WebCola/cola.min.js")
## [1] "true"
### small grouped example
group_json <- fromJSON(
system.file(
"htmlwidgets/lib/WebCola/examples/graphdata/smallgrouped.json",
package = "colaR"
)
)
# need to get forEach polyfill
ctx$source(
"https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.10/es5-shim.min.js"
)
# code to recreate small group example
js_group <- '
// console.assert does not exists
console = {}
console.assert = function(){};
var width = 960,
height = 500
graph = {
"nodes":[
{"name":"a","width":60,"height":40},
{"name":"b","width":60,"height":40},
{"name":"c","width":60,"height":40},
{"name":"d","width":60,"height":40},
{"name":"e","width":60,"height":40},
{"name":"f","width":60,"height":40},
{"name":"g","width":60,"height":40}
],
"links":[
{"source":1,"target":2},
{"source":2,"target":3},
{"source":3,"target":4},
{"source":0,"target":1},
{"source":2,"target":0},
{"source":3,"target":5},
{"source":0,"target":5}
],
"groups":[
{"leaves":[0], "groups":[1]},
{"leaves":[1,2]},
{"leaves":[3,4]}
]
}
var g_cola = new cola.Layout()
.linkDistance(100)
.avoidOverlaps(true)
.handleDisconnected(false)
.size([width, height]);
g_cola
.nodes(graph.nodes)
.links(graph.links)
.groups(graph.groups)
.start()
'
# run the small group JS code in V8
ctx$eval(js_group)
## [1] "[object Object]"
</code></pre>
<p>Now, <code>WebCola</code> has done the hard work and laid out our nodes and links,
so let's get their positions.</p>
<pre><code>nodes <- ctx$get('
graph.nodes.map(function(d){
return {name: d.name, x: d.x, y: d.y, height: d.height, width: d.width};
})
')
links <- ctx$get('
graph.links.map(function(d){
return {x1: d.source.x, y1: d.source.y, x2: d.target.x, y2: d.target.y}
})
')
</code></pre>
<p>Some great examples of packages employing <code>V8</code> are
<a href="http://www.r-pkg.org/pkg/geojsonio"><code>geojsonio</code></a>,
<a href="https://github.com/ropensci/lawn"><code>lawn</code></a>,
<a href="http://www.r-pkg.org/pkg/DiagrammeRsvg"><code>DiagrammeRsvg</code></a>,
<a href="https://github.com/ateucher/rmapshaper"><code>rmapshaper</code></a>, and
<a href="https://github.com/edwindj/daff"><code>daff</code></a>.</p>
<h3>rjade</h3>
<p>We got layout coordinates above. Let's use another one of Jeroen's
packages <a href="https://github.com/jeroenooms/rjade"><code>rjade</code></a> that provides
<a href="http://jade-lang.com/"><code>jade</code></a> (now called
<a href="https://github.com/pugjs/pug">pug</a>) templates through <code>V8</code>. <code>rjade</code>
will let us build a <code>SVG</code> graph with our layout.</p>
<pre><code>library(rjade)
library(htmltools)
svg <- jade_compile(
'
doctype xml
svg(version="1.1",xmlns="http://www.w3.org/2000/svg",xmlns:xlink="http://www.w3.org/1999/xlink",width="960px",height="500px")
each l in lines
line(style={fill:none, stroke:"lightgray"})&attributes({"x1": l.x1, "x2": l.x2, "y1": l.y1, "y2": l.y2})
each val in rects
g
rect(style={fill: fillColor})&attributes({"x": val.x - val.width/2, "y": val.y - val.height/2, "height": val.height - 6, "width": val.width - 6, rx: 5, ry: 5})
text&attributes({"x": val.x, "y": val.y, "dy": ".2em", "text-anchor":"middle"})= val.name
'
,pretty=T
)(rects = nodes, lines = links, fillColor = "lightgray")
HTML(svg)
</code></pre>
<?xml version="1.0" encoding="utf-8" ?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="960px" height="500px">
<line style="fill:undefined;stroke:lightgray" x1="390.24" x2="417.6291" y1="333.6926" y2="240.0374"></line>
<line style="fill:undefined;stroke:lightgray" x1="417.6291" x2="495.0286" y1="240.0374" y2="161.6408"></line>
<line style="fill:undefined;stroke:lightgray" x1="495.0286" x2="495.0286" y1="161.6408" y2="58.0727"></line>
<line style="fill:undefined;stroke:lightgray" x1="488.7193" x2="390.24" y1="322.5478" y2="333.6926"></line>
<line style="fill:undefined;stroke:lightgray" x1="417.6291" x2="488.7193" y1="240.0374" y2="322.5478"></line>
<line style="fill:undefined;stroke:lightgray" x1="495.0286" x2="566.5713" y1="161.6408" y2="244.9418"></line>
<line style="fill:undefined;stroke:lightgray" x1="488.7193" x2="566.5713" y1="322.5478" y2="244.9418"></line>
<g>
<rect style="fill:lightgray" x="458.7193" y="302.5478" height="34" width="54" rx="5" ry="5"></rect>
<text x="488.7193" y="322.5478" dy=".2em" text-anchor="middle">a</text>
</g> <g>
<rect style="fill:lightgray" x="360.24" y="313.6926" height="34" width="54" rx="5" ry="5"></rect>
<text x="390.24" y="333.6926" dy=".2em" text-anchor="middle">b</text>
</g> <g>
<rect style="fill:lightgray" x="387.6291" y="220.0374" height="34" width="54" rx="5" ry="5"></rect>
<text x="417.6291" y="240.0374" dy=".2em" text-anchor="middle">c</text>
</g> <g>
<rect style="fill:lightgray" x="465.0286" y="141.6408" height="34" width="54" rx="5" ry="5"></rect>
<text x="495.0286" y="161.6408" dy=".2em" text-anchor="middle">d</text>
</g> <g>
<rect style="fill:lightgray" x="465.0286" y="38.0727" height="34" width="54" rx="5" ry="5"></rect>
<text x="495.0286" y="58.0727" dy=".2em" text-anchor="middle">e</text>
</g> <g>
<rect style="fill:lightgray" x="536.5713" y="224.9418" height="34" width="54" rx="5" ry="5"></rect>
<text x="566.5713" y="244.9418" dy=".2em" text-anchor="middle">f</text>
</g> <g>
<rect style="fill:lightgray" x="449.9339" y="355.6926" height="34" width="54" rx="5" ry="5"></rect>
<text x="479.9339" y="375.6926" dy=".2em" text-anchor="middle">g</text>
</g>
</svg>
<h3>rsvg</h3>
<p>If we are not in the browser though with inline <code>SVG</code> support, we very
likely will want a static image format such as <code>png</code> or <code>jpeg</code>. Of
course, Jeroen has that covered also with the crazy-speedy
<a href="https://github.com/jeroenooms/rsvg"><code>rsvg</code></a>. Jeroen offers
<a href="https://github.com/jeroenooms/base64"><code>base64</code></a>, but in this case we
will use <code>base64enc</code>, since it allows <code>raw</code>.</p>
<pre><code>library(rsvg)
library(base64enc)
graph_png <- rsvg_png(charToRaw(svg))
tags$img(src=dataURI(graph_png), mime="image/png")
</code></pre>
<!--html_preserve-->
<p><img src="data:;base64,iVBORw0KGgoAAAANSUhEUgAAA8AAAAH0CAYAAADyokQJAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nO3df5xcd33f+8/37GolGZkfxUChwWBjxbJnZiWDmgRH+BGHSw1WQtJe4QRjNQ9+JIY2jwD5ZXqdRg+lN/SqaW5u2tsYHrkpUItAHIcmgA0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Wq1jkbEWO+gXNf1wxGxanp6+lvjPA4ArEQugQYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAAwAA0AgCGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAAwAA0AgCGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAAwAA0AgCGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAAwAA0AgCGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAAwAA0AgCGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAAwAA0AgCGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAAwAA0AgCGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAAwAA0AgCGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABohFR6AACsBPv37/87q1atesX8/PzqMR/q76eU1uac/3hEr3d0YmJiX6vVOjii1wOAJUsAA8Bp2Ldv37MnJib+IKX0s7G8f65+bGpq6urzzz//odJDAGBclvMPagAoau/evWvPPPPML0bEK0pvGYWc82BqauqVGzZsOFR6CwCMg+8AA8ACrVu37p2xQuI3IiKl1HrkkUeuKb0DAMZFAAPAAqWU3lh6wxhcWXoAAIyLAAaAhTu39IAxeMkNN9wwUXoEAIyDAAaAhVtVesAYVBdddNFk6REAMA4CGAAAgEYQwAAAADSCAAYAAKARBDAAAACNIIABAABoBAEMAABAIwhgAAAAGkEAA8CyczB2b98euw+W3gEAy4sABoBlZs/OrbFrf+kVALD8CGAAWGa27LgprtlUegUALD+TpQcAACdpz87ovOPG47/YFNcUHQMAy48zwACwHBzcHdvfEXFdXUd90zXhBDAAnDoBDADLwMHbb4m45s2xJSLi7EviMgUMAKdMAAMAANAIAhgA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FANAoAhgAFsvBiMtuqqOuH/3n6rg9JDAALB4BDACL4mDsfv8tJ/x6T9wfl4SLoQFg8fgOMAAsirPjqqvPi87WTuyKiIhtcV29o/AmAGiWVHoAAJTS6/Wek1L6ZukdY/CtTqfzt0qPAIClxiXQAAAANIIABgAAoBEEMACNNT8/n0tvGJOV+r4A4LQIYAAaa9OmTd+JiCOld4zBV0sPAIClSAAD0FgppWFEfK70jjH4TOkBALAUCWAAGm04HP5mrKyzwN9YtWrVvyg9AgCWIgEMQKNt3LjxjqqqroiI75Tecrpyzg9UVXX5hg0bHii9BQCWIs8BBoCI6Ha7z6+q6uciYmNKaar0nlORc344Iv5jVVXXt1qtw6X3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALNz/Bxekj68pSqHbAAAAAElFTkSuQmCC" mime="image/png"/><!--/html_preserve--></p>
<h3>magick</h3>
<p>Jeroen's newest package <a href="https://github.com/jeroenooms/magick"><code>magick</code></a>
is in my mind the coolest. <code>magick</code> gives us all the power of
<a href="http://www.imagemagick.org/script/index.php"><code>ImageMagick</code></a> as easy <code>R</code>
functions, and is pure wizardry. I am still shocked that it compiled
first try with absolutely no problems.</p>
<pre><code>library(magick)
graph_img <- image_read(graph_png)
wizard_img <- image_read("http://www.imagemagick.org/image/wizard.png")
images <- image_annotate(
image_append(
c(
image_scale(image_crop(wizard_img, "600x600+100+100"), "100"),
image_crop(graph_img, "400x400+200+0")
)
),
"Ooms is a Wizard!",
size = 20,
color = "blue",
location = "+100+200"
)
tags$img(src=dataURI(image_write(images)), mime="image/png")
</code></pre>
<!--html_preserve-->
<p><img src="data:;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAGQCAYAAABYs5LGAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACW9GRnMAAABVAAAARAASfKWLAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH4AcZER0OQJH9ewAAAAl2cEFnAAADmAAAA9QAMh2N+AAAaXVJREFUeNrt3XmcXFWd///XuUvtvS/Z9z3d1QkQkF0RESGDoAIiA6OOOsroz2XUwRlGEWd0BnWcrzru4wq4gRubsiPEANIk6a50FhKy7713Vdd67z2/P6o6hJCQrTu3u/J5Ph5Fdddy+3NvN3nXOfecc5XWWnOcht6qlDreTYiDKDmYQgghjoNxIm+W7BFCCCFGhxMKdJBQF0IIIUaDEw50IYQQQvhPAv0QTmBYgRBCCOELCfRDkNMIQgghxhoJdCGEEKIM+BLonuf5vd9CCCFEWfEl0A1DOgaEEEKI4STJKoQQQpSBVwW6jPAWQgghxp5XBfpIjPCWDwlCCCHEyDopXe4yDUwIIYQYWXIOXQghhCgDEuhCCCFEGTjmQNdav+rmF9d1ffvZQgghxGiijvZ66C++uJ5UKsfQ2XDTMlEKqqoqicViRCIRQqGg3/sz5sn10IUQQhwP60gv0Frzq1/dzy9+D66OsWjOE1z4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QQQpQBCXQhhBCiDEigCyGEEGVAAl0IIYQoAxLoQgghRBmQQBdCCCHKgAS6EEIIUQYk0IUQoqxt484b48TjQ7fbWOZ3SWJESKALIUQZ23bnLdw++zskEg9w8+LF3PzArZzvd1FiREigCyFEGZs6fbbfJYiTxPK7ACGEECPo/Pdy8/eWEo8DV3+HxFS/CxIjRQJdCCHK2bIf89ClD5C4Q5K83EmXuxBClLOps+D2pfsHxd145za/KxIjRAJdCCHK2Ta49IEEiUTx9kGeQiK9PEmgCyFE2drGnd976IDvl7GFC5HO9/Ik59CFEKJsTeWGD84mvjTO7QBczXcSt/pdlBghSmut/S5CvEwppfyuQQgxctrb22uUUj1+1zECeuPxeK3fRZzKpMtdCCGEKAMS6EIIIUQZkEAXQoiTyHXdcj3NWa77NWZIoAshxEm0ePHiASDndx0jYK/fBZzqJNCFEOIkUkp5wKN+1zECHva7gFOdBLoQQpxknud9jvJqpXfbtv1lv4s41UmgCyHESbZo0aIVhmFcCwz4XcuJ0lrvMgzj8vnz5+/yu5ZTncxDH2VkHroQp462trZGwzDeDSxSSgX8rudYaK0zwLOGYdzR1NSU8rseIYE+6kigCyGEOB7S5S6EEEKUAQl0IYQQogxIoAshhBBlQAJdCCGEKAMS6EIIIUQZkEAXQgghyoAEuhBCCFEGJNCFEEKIMiCBLoQQQpSB/x8EE1KAp/zz1wAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wNy0yNVQxNzoyOToxNC0wNTowMHG0gVIAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDctMjVUMTc6Mjk6MTQtMDU6MDAA6TnuAAAAAElFTkSuQmCC" mime="image/png"/><!--/html_preserve--></p>
<h3>commonmark</h3>
<p>I should note that this document was assembled in <code>rmarkdown</code>. RStudio
gives us lots of tools for working with <code>rmarkdown</code>, but Jeroen gives us
a powerful tool
<a href="https://github.com/jeroenooms/commonmark"><code>commonmark</code></a>. Let's use it
to give our readers other options for output.</p>
<pre><code>library(commonmark)
rmarkdown::render("Readme.Rmd", "Readme.md", output_format="md_document")
tex <- markdown_latex(readLines("Readme.md"))
cat(tex, file="Readme.tex")
</code></pre>
<!--html_preserve-->
<p>This would convert markdown to LaTeX. As a test, I used <code>commonmark</code> to make the html for this post.</p>
<h2>Conclusion and Thanks</h2>
<p>There are of course more packages, but I'll stop here. Jeroen Ooms truly
is a wizard, and the <code>R</code> community is extraordinarily blessed to have
him. Thanks so much Jeroen.</p>
<p>For even more wizardry, be sure to check out
<a href="https://www.opencpu.org/apps.html">opencpu</a> from Jeroen, which makes R
available as a web service.</p>
klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-24693435656975740972015-05-22T13:30:00.001-07:002015-05-22T13:30:41.871-07:00visNetwork, Currencies, and Minimum Spanning Trees<p>Just because I’m ignorant doesn’t mean I won’t try things. Feel free to correct any ignorance that follows. More than anything I would like to feature the new htmlwidget <a href="http://dataknowledge.github.io/visNetwork" target="_blank">visNetwork</a>. I thought the example from <a href="https://mktstk.wordpress.com/2015/01/03/minimum-spanning-trees-in-r/" target="_blank">Minimum Spanning Trees in R</a> applied to currency data (similar to this research paper <a href="http://www.nbs.sk/_img/Documents/_PUBLIK_NBS_FSR/Biatec/Rok2013/07-2013/05_biatec13-7_resovsky_EN.pdf" target="_blank">Minimum Spanning Tree Application in the Currency Market</a>) would be a good way to demonstrate this fancy new widget. We’ll grab the currency data from FRED using quantmod code from this old post <a href="http://timelyportfolio.blogspot.com/2011/05/eigen-who-how-can-i-write-about-eigen.html" target="_blank">Eigen-who?</a>.</p><iframe src="http://bl.ocks.org/timelyportfolio/raw/0b4f25d9cfca0e326934/" style="height: 600px; width: 100%" src=""></iframe><em>Code</em> <pre><code><br /># get MST using code from this post<br /># https://mktstk.wordpress.com/2015/01/03/minimum-spanning-trees-in-r/<br /><br />library(quantmod)<br /># #get currency data from the FED FRED data series<br />Korea <- getSymbols("DEXKOUS",src="FRED",auto.assign=FALSE) #load Korea<br />Malaysia <- getSymbols("DEXMAUS",src="FRED",auto.assign=FALSE) #load Malaysia<br />Singapore <- getSymbols("DEXSIUS",src="FRED",auto.assign=FALSE) #load Singapore<br />Taiwan <- getSymbols("DEXTAUS",src="FRED",auto.assign=FALSE) #load Taiwan<br />China <- getSymbols("DEXCHUS",src="FRED",auto.assign=FALSE) #load China<br />Japan <- getSymbols("DEXJPUS",src="FRED",auto.assign=FALSE) #load Japan<br />Thailand <- getSymbols("DEXTHUS",src="FRED",auto.assign=FALSE) #load Thailand<br />Brazil <- getSymbols("DEXBZUS",src="FRED",auto.assign=FALSE) #load Brazil<br />Mexico <- getSymbols("DEXMXUS",src="FRED",auto.assign=FALSE) #load Mexico<br />India <- getSymbols("DEXINUS",src="FRED",auto.assign=FALSE) #load India<br />USDOther <- getSymbols("DTWEXO",src="FRED",auto.assign=FALSE) #load US Dollar Other Trading Partners<br />USDBroad <- getSymbols("DTWEXB",src="FRED",auto.assign=FALSE) #load US Dollar Broad<br />#combine all the currencies into one big currency xts<br />currencies<-merge(Korea, Malaysia, Singapore, Taiwan,<br /> China, Japan, Thailand, Brazil, Mexico, India,<br /> USDOther, USDBroad)<br /><br />currencies<-na.omit(currencies)<br /><br />colnames(currencies)<-c("Korea", "Malaysia", "Singapore", "Taiwan",<br /> "China", "Japan", "Thailand", "Brazil", "Mexico", "India",<br /> "USDOther", "USDBroad")<br />#get daily percent changes<br />currencies <- currencies/lag(currencies)-1 <br />currencies[1,] <- 0<br /><br />cor.distance <- cor(currencies)<br />corrplot::corrplot(cor.distance)<br /><br />library(igraph)<br />g1 <- graph.adjacency(cor.distance, weighted = T, mode = "undirected", add.colnames = "label")<br />mst <- minimum.spanning.tree(g1)<br />plot(mst)<br /><br />library(visNetwork)<br />mst_df <- get.data.frame( mst, what = "both" )<br />visNetwork( <br /> data.frame(<br /> id = 1:nrow(mst_df$vertices) <br /> ,label = mst_df$vertices<br /> )<br /> , mst_df$edges<br />) %>%<br /> visOptions( highlightNearest = TRUE, navigation = T )<br /></code><br /></pre> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-37720484976806757722015-03-11T21:43:00.001-07:002015-03-11T21:53:38.789-07:00Extracting Heatmap<p>Inspired by this tweet, I wanted to try to do something similar in JavaScript.</p> <blockquote lang="en" class="twitter-tweet"> <p>Very cool hack: Extracting the original data from a heatmap image with R vector ops <a href="https://twitter.com/hashtag/rstats?src=hash">#rstats</a> <a href="http://t.co/Lbi6FCXdrI">http://t.co/Lbi6FCXdrI</a> <a href="http://t.co/LCabkMGjXY">pic.twitter.com/LCabkMGjXY</a></p>— Gregory Piatetsky (@kdnuggets) <a href="https://twitter.com/kdnuggets/status/573913182110154752">March 6, 2015</a></blockquote> <p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>Fortunately, I had this old post <a href="http://timelyportfolio.blogspot.com/2014/07/chart-from-r-color-from-javascript.html">Chart from R + Color from Javascript</a> to serve as a reference, and I got lots of help from these links.</p> <ul> <li><a href="http://stackoverflow.com/questions/6735470/get-pixel-color-from-canvas-on-mouseover">http://stackoverflow.com/questions/6735470/get-pixel-color-from-canvas-on-mouseover</a> <li><a href="http://bl.ocks.org/jinroh/4666920">http://bl.ocks.org/jinroh/4666920</a> <li><a href="https://github.com/dtao/nearest-color">https://github.com/dtao/nearest-color</a> <li><a href="https://github.com/Nycto/PicoModal">https://github.com/Nycto/PicoModal</a> </li></ul> <p>In a couple of hours, I got this crude but working <a href="http://timelyportfolio.github.io/rCharts_color_thief/index_jsfeat.html" target="_blank">rendering</a> complete with a d3.js brush to get the scale. Then since this is sort of a finance blog, I imagined we found an old correlation heatmap like the one in <a href="http://timelyportfolio.blogspot.com/2012/06/pretty-correlation-map-of-pimco-funds.html">Pretty Correlation Map of PIMCO Funds</a>. Although, we could guess at the correlation values, I thought it would be a lot more fun to get live values. Try it out below.</p> <ol> <li>Brush over the scale / legend</li> <li>Input scale min and max</li> <li>Mouseover color areas in the chart</li></ol> <p> As I said, it is rough, but it works. It needs a little UI work :)</p><iframe style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" height="600" src="http://timelyportfolio.github.io/rCharts_color_thief/index_corr_heatmap.html" width="750"></iframe> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com1tag:blogger.com,1999:blog-7630810606654250077.post-50411155084427958322015-03-05T10:56:00.001-08:002015-03-05T11:01:24.791-08:00Is Time Series Clustering Meaningless? (lots of dplyr)<p>A kind reader directed me in a comment on <a href="http://timelyportfolio.blogspot.com/2015/03/experiments-in-time-series-clustering.html">Experiments in Time Series Clustering</a> to this paper.</p> <blockquote> <p>Clustering of Time Series Subsequences is Meaningless: Implications for Previous and Future Research </p> <p><font size="2">Eamonn Keogh and Jessica Lin</font></p> <p><font size="2">Computer Science & Engineering Department University of California – Riverside </font></p> <p><a title="http://www.cs.ucr.edu/~eamonn/meaningless.pdf" href="http://www.cs.ucr.edu/~eamonn/meaningless.pdf"><font size="2">http://www.cs.ucr.edu/~eamonn/meaningless.pdf</font></a></p></blockquote> <p>As I said in my last post, I don’t know what I’m doing, so I have no basis for discussing or arguing time series clustering. After reading the paper a couple of times, I think I understand their points, and I do not think what I am doing is “meaningless”. In their financial time series examples, they use prices and speak of trying to find patterns. I simply want to classify which years are most alike by various characteristics, such as autocorrelation of <strong>returns</strong> not prices, distribution of returns, and all sorts of other classifiers.</p> <p>More than anything this whole exercise gave me a good excuse to dig much, much deeper. Iongtime readers might be wondering where are the interactive plots. I wanted to share what I have done so far hoping that readers might elaborate, argue, or point me in good directions.</p> <p>Regardless of your interest in time series clustering, you might enjoy the dplyr and piping that I used to generate the results. Also, I have not seen dplyr <code>do</code> applied to autocorrelation <code>ACF</code>, so you might want to check that out in the last snippet of code.</p> <p>All of the code for this post and last post is in this <a href="https://github.com/timelyportfolio/TSclust_experiments">Github repo</a>.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwSif_WWnYlk1HqSxfwAaJJnkzxav7_p-JTi4ySlMmCa3lJN1CpIGHA6Go2MRcNI49NiyHTuU6HbtnEzGzP-YNCE1CMey_0YoGVKzjidXGBIyH1qeix4J188wvUWgbA2XHMBWAxO1Myg/s1600-h/image%25255B3%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUbQJSihyNjssf7S01W0KPd9SFfpM0q_3jpG6LwVVM8Oub2BpmZtYJ-qm0Wzql46AtsIx4pi8fOuuSFM_jPPACblf4vb0NUyQ73fH7LaQrwqiyNEIsFqoOZ6BSrEfUZ7ykesEGZ78cKQ/?imgmax=800" width="579" height="696"></a></p> <p> </p><pre><code><br />library(TSclust)<br />library(quantmod)<br />library(dplyr)<br />library(pipeR)<br />library(tidyr)<br /><br />sp5 <- getSymbols("^GSPC",auto.assign=F,from="1900-01-01")[,4]<br /><br />sp5 %>>%<br /> # dplyr doesn't like xts, so make a data.frame<br /> (<br /> data.frame(<br /> date = index(.)<br /> ,price = .[,1,drop=T]<br /> )<br /> ) %>>%<br /> # add a column for Year<br /> mutate( year = as.numeric(format(date,"%Y"))) %>>%<br /> # group by our new Year column<br /> group_by( year ) %>>%<br /> # within each year, find what day in the year so we can join<br /> mutate( pos = rank(date) ) %>>%<br /> mutate( roc = price/lag(price,k=1) - 1 ) %>>%<br /> # can remove date<br /> select( -c(date,price) ) %>>%<br /> as.data.frame %>>%<br /> # years as columns as pos as row<br /> spread( year, roc ) %>>%<br /> # remove last year since assume not complete<br /> ( .[,-ncol(.)] ) %>>%<br /> # remove pos since index will be same<br /> select( -pos ) %>>%<br /> # fill nas with previous value<br /> na.fill( 0 ) %>>%<br /> t %>>%<br />(~sp_wide) %>>%<br /> # use TSclust diss; notes lots of METHOD options<br /> diss( METHOD="ACF" ) %>>%<br /> hclust %>>%<br />(~hc) %>>%<br /> ape::as.phylo() %>>% <br /> treewidget #%>>%<br /> #htmlwidgets::as.iframe(file="index.html",selfcontained=F,libdir = "./lib")<br /><br />library(lattice)<br />library(ggplot2)<br /># get wide to long the hard way<br /># could have easily changed to above pipe to save long<br /># as an intermediate step<br /># but this makes for a fun lapply<br /># and also we can add in our cluster here<br />sp_wide %>>%<br /> (<br /> lapply(<br /> rownames(.)<br /> ,function(yr){<br /> data.frame(<br /> year = as.Date(paste0(yr,"-01-01"),"%Y-%m-%d")<br /> ,cluster = cutree(hc,10)[yr]<br /> ,pos = 1:length(.[yr,])<br /> ,roc = .[yr,]<br /> )<br /> }<br /> )<br /> ) %>>%<br /> (do.call(rbind,.)) %>>%<br />(~sp_long)<br /><br /><br />sp_long %>>%<br /> ggplot( aes( x = roc, group = year, color = factor(cluster) ) ) %>>%<br /> + geom_density() %>>%<br /> + facet_wrap( ~ cluster, ncol = 1 ) %>>%<br /> + xlim(-0.05,0.05) %>>%<br /> + labs(title='Density of S&P 500 Years Clustered by TSclust') %>>%<br /> + theme_bw() %>>%<br /> # thanks to my friend Zev Ross for his cheatsheet<br /> + theme( plot.title = element_text(size=15, face="bold", hjust=0) ) %>>%<br /> + theme( legend.position="none" ) %>>%<br /> + scale_color_brewer( palette="Paired" )<br /> <br /><br /></code></pre><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPhHFGdmddjO-yr2TvxVACQP1u03lH-NIWXF0ZQ6dx0qXxSNNCWCZYocEv1a0J1cMBq3ez-sme5pUutT-JFWB_E06WHP71p-71ULETsOCsIRNJf5JOFkVOb-2lKwsTTQ5PQQfp2-2_qg/s1600-h/acf_plot%25255B3%25255D.png"><img title="acf_plot" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="acf_plot" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPqma7zz1BwnqhPI4Je9Un4CKvP-8zKk4B76mXk8py4JEYyf3RiKkCcHRWBZz0qux5QzNwfOA_-50ekCBiC62E3c8_T_qwowhWEzI9A39ZdrCCBTijJhuNnnRi8gYSKbBlmQTJWshOcA/?imgmax=800" width="704" height="604"></a></p><pre><code><br /># explore autocorrelations<br />sp5 %>>%<br /> # dplyr doesn't like xts, so make a data.frame<br /> (<br /> data.frame(<br /> date = index(.)<br /> ,price = .[,1,drop=T]<br /> )<br /> ) %>>%<br /> # add a column for Year<br /> mutate( year = as.numeric(format(date,"%Y"))) %>>%<br /> # group by our new Year column<br /> group_by( year ) %>>%<br /> # within each year, find what day in the year so we can join<br /> mutate( pos = rank(date) ) %>>%<br /> mutate( roc = price/lag(price,k=1) - 1 ) %>>%<br /> # can remove date<br /> select( -c(date,price) ) %>>%<br /> as.data.frame %>>%<br /> # years as columns as pos as row<br /> spread( year, roc ) %>>%<br /> # remove last year since assume not complete<br /> ( .[,-ncol(.)] ) %>>% t -> sP<br /><br />sp_long %>>%<br /> group_by( cluster, year ) %>>%<br /> do(<br /> . %>>%<br /> (<br /> clustd ~ <br /> acf(clustd$roc,plot=F) %>>%<br /> (a ~<br /> data.frame(<br /> cluster = clustd[1,2]<br /> ,year = clustd[1,1]<br /> ,lag = a$lag[-1]<br /> ,acf = a$acf[-1]<br /> )<br /> )<br /> )<br /> ) %>>%<br /> as.data.frame %>>%<br /> ggplot( aes( x = factor(cluster), y = acf, color = factor(cluster) ) ) %>>%<br /> + geom_point() %>>%<br /> + facet_wrap( ~lag, ncol = 4 ) %>>%<br /> + labs(title='ACF of S&P 500 Years Clustered by TSclust') %>>%<br /> + theme_bw() %>>%<br /> # thanks to my friend Zev Ross for his cheatsheet<br /> + theme(<br /> plot.title = element_text(size=15, face="bold", hjust=0)<br /> ,legend.title=element_blank()<br /> ) %>>%<br /> + theme(legend.position="none") %>>%<br /> + scale_color_brewer(palette="Paired")<br /><br /></code></pre><br />If you’ve made it this far, I would love to hear from you. klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com1tag:blogger.com,1999:blog-7630810606654250077.post-6178670436630071932015-03-02T08:04:00.001-08:002015-03-02T13:06:24.322-08:00Experiments in Time Series Clustering<p>Last night I spotted this tweet about the R package <a href="http://cran.r-project.org/web/packages/TSclust/index.html" target="_blank">TSclust</a>.</p> <blockquote lang="en" class="twitter-tweet"> <p>Thank you Pablo and Jose for <a href="https://twitter.com/hashtag/TSclust?src=hash">#TSclust</a> - time series clustering package in <a href="https://twitter.com/hashtag/rstats?src=hash">#rstats</a> ! <a href="http://t.co/GBQtQnQ8Lr">http://t.co/GBQtQnQ8Lr</a></p>— Pasha Roberts (@pasharoberts) <a href="https://twitter.com/pasharoberts/status/572208755129122816">March 2, 2015</a></blockquote> <p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>I should start by saying that I really don’t know what I’m doing, <strong>so be warned</strong>. I thought it would interesting to apply TSclust to the S&P 500 price time series. I took the 1-day simple rate of change, grouped by year with dplyr, and then indexed by the day of the year all in one <a href="http://renkun.me/pipeR-tutorial/" target="_blank">pipeR</a> pipeline. Since the TSclust paper</p> <blockquote> <p>TSclust: An R Package for Time Series Clustering</p> <p>Journal of Statistical Software, Volume 62, Issue 1</p> <p>November 2014</p> <p><a title="http://www.jstatsoft.org/v62/i01/paper" href="http://www.jstatsoft.org/v62/i01/paper">http://www.jstatsoft.org/v62/i01/paper</a></p></blockquote> <p>demonstrates interoperability with hclust in their OECD interest rate example ( Section 5.2 ), I thought I could visualize the results nicely with <a href="http://www.buildingwidgets.com/blog/2015/2/26/week-08-interactive-phylogeny" target="_blank">treewidget from the epiwidgets package</a>. Just because the htmlwidget was designed for phylogeny doesn’t mean we can’t use it for finance. Here is the result.</p><iframe height=1000" src="http://timelyportfolio.github.io/TSclust_experiments" width="750" seamless></iframe> <p>For reference and searching, I’ll copy the code below, but all of this can be found in this <a href="https://github.com/timelyportfolio/TSclust_experiments" target="_blank">Github repo</a>.</p><pre><code><br />library(TSclust)
library(quantmod)
library(dplyr)
library(pipeR)
library(tidyr)
library(epiwidgets)
sp5 <- getSymbols("^GSPC",auto.assign=F,from="1900-01-01")[,4]
sp5 %>>%
# dplyr doesn't like xts, so make a data.frame
(
data.frame(
date = index(.)
,price = .[,1,drop=T]
)
) %>>%
# add a column for Year
mutate( year = as.numeric(format(date,"%Y"))) %>>%
# group by our new Year column
group_by( year ) %>>%
# within each year, find what day in the year so we can join
mutate( pos = rank(date) ) %>>%
mutate( roc = price/lag(price,k=1) - 1 ) %>>%
# can remove date
select( -c(date,price) ) %>>%
as.data.frame %>>%
# years as columns as pos as row
spread( year, roc ) %>>%
# remove last year since assume not complete
( .[,-ncol(.)] ) %>>%
# remove pos since index will be same
select( -pos ) %>>%
# fill nas with previous value
na.fill( 0 ) %>>%
t %>>%
# use TSclust diss; notes lots of METHOD options
diss( METHOD="ACF" ) %>>%
hclust %>>%
ape::as.phylo() %>>%
treewidget</code><br /></pre> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com4tag:blogger.com,1999:blog-7630810606654250077.post-23039634650780817242015-02-03T20:37:00.001-08:002015-02-03T20:38:28.521-08:00Financial Charts | Pan and Zoom<p>The <a href="http://htmlwidgets.org" target="_blank">htmlwidget</a> for Week 2 over at <a href="http://buildingwidgets.com/blog" target="_blank">Building Widgets</a> claims to add pan and zoom interactivity to almost all R charts. Since their were no tests on financial charts, I thought I would try it out on a couple. It really does work. </p> <p>Here is an example on an efficient frontier plotted from fPortfolio.</p> <iframe style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" seamless height="550" width="100%" src="http://bl.ocks.org/timelyportfolio/raw/e2349d1e850313fcb1c6/index.html"></iframe> <p>When we combine pipeR and htmlwidgets, we get a solid result from what I think is fairly elegant and understandable code.</p><pre><code>svgPanZoom(<br /> svgPlot({<br /> returns %>>%<br /> (cumprod( 1 + . )) %>>%<br /> (.[endpoints(.,<span class="str">"months"</span>)]) %>>%<br /> ( ./lag(.,k=1) - 1 ) %>>%<br /> chart.SnailTrail(<br /> colorset = RColorBrewer::brewer.pal(9,<span class="str">"Set1"</span>)[-6]<br /> ,add.names=<span class="str">"none"</span><br /> ,width = 36<br /> ,step = 36<br /> ,legend.loc = <span class="str">"topright"</span><br /> )<br /> },height= 10, width = 16)<br />)</code></pre><iframe style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-top-width: 0px" seamless height="550" width="100%" src="http://bl.ocks.org/timelyportfolio/raw/e2349d1e850313fcb1c6/index2.html"></iframe><br /><p>An even more challenging test was chartSeries, and <code>svgPanZoom</code> still passed the test beautifully. See if it works on your machine. </p><pre><code><br />getSymbols("SPY")<br />svgPanZoom(svgPlot({chartSeries(SPY)},width = 12, height = 8))<br /></code></pre><br /><p>If you would like to reproduce the plots, all the code is in this <a href="https://gist.github.com/timelyportfolio/e2349d1e850313fcb1c6" target="_blank">Gist</a>.</p> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com1tag:blogger.com,1999:blog-7630810606654250077.post-5115364638676592332015-01-02T09:33:00.001-08:002015-01-02T09:33:59.234-08:00Will I fail?<p>I have committed to building an <a href="http://htmlwidgets.org" target="_blank">htmlwidget</a> a week in 2015. To isolate and separate the commitment from this blog, I set up a new site <a href="http://buildingwidgets.com" target="_blank">Building Widgets</a> and Github <a href="http://github.com/timelyportfolio/buildingwidgets" target="_blank">repo</a>. The first post <a href="http://www.buildingwidgets.com/blog/2015/1/2/can-i-commit" target="_blank">Can I Commit?</a> provides meta introspection on commitment.</p> <blockquote> <p>Can I commit to building an <a href="http://htmlwidgets.org/">htmlwidget</a> a week in the year 2015? <p> <p>It seems we humans all struggle internally with commitment, and at the beginning of each year, we often become even more aware of this struggle in the form of <a href="http://fivethirtyeight.com/datalab/how-fast-youll-abandon-your-new-years-resolutions/">New Year's Resolutions</a>. This site is not really a New Year's Resolution. It is more a resolution that coincidentally falls at the beginning of the year, since <a href="http://htmlwidgets.org/">htmlwidgets</a> was released December 17. <p> <p>I know through plenty of experiences with commitment failure that the pattern of commitment failure will assert itself throughout the life of this project… <em><font color="#a5a5a5" size="1"><a href="http://www.buildingwidgets.com/blog/2015/1/2/can-i-commit" target="_blank">Building Widgets “Can I Commit?”</a></font></em></p></blockquote> <p>I promise this will be the only crosspost. Any future posts on this blog about htmlwidgets will only be application of the widgets, most likely for finance.</p> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com1tag:blogger.com,1999:blog-7630810606654250077.post-72899661189806711502014-12-30T08:53:00.001-08:002014-12-30T09:02:56.154-08:00Widgets For Christmas<p>For Christmas, I generally want electronic widgets, but after <a href="https://github.com/ramnathv/htmlwidgets/commit/9b39806e6dfb3105cd875aa7103190ba2c3f98ab" target="_blank">six months of development</a>, all I wanted this Christmas was <a href="http://www.htmlwidgets.org" target="_blank">htmlwidgets</a>, and Santa <a href="http://rstudio.com/" target="_blank">RStudio</a>/jj,joe,yihui and Santa <a href="https://github.com/ramnathv" target="_blank">Ramnath</a> delivered early with this RStudio tweet on December 17th.</p> <blockquote lang="en" class="twitter-tweet"> <p>htmlwidgets: Bring the best of JavaScript data visualization to R <a href="http://t.co/a16qlLxuLz">http://t.co/a16qlLxuLz</a> <a href="https://twitter.com/hashtag/rstats?src=hash">#rstats</a></p>— RStudio (@rstudio) <a href="https://twitter.com/rstudio/status/545264256934240256">December 17, 2014</a></blockquote> <p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>The major benefit of htmlwidgets is it provides all three methods of bridging R with JavaScript/HTML mentioned in my Aug. 16, 2013 post <a href="http://timelyportfolio.blogspot.com/2013/08/gridsvganother-glue-for-r-to-svg.html" target="_blank">I Want ggplot2/lattice and d3 (gridSVG–The Glue)</a>. For htmlwidgets to be successful though, not only do htmlwidgets need to work, <a href="http://www.htmlwidgets.org/develop_intro.html" target="_blank">easy creation of widgets is absolutely essential</a>.</p> <p>As a quick example, we can look at the <a href="http://github.com/rich-iannone/DiagrammeR" target="_blank">DiagrammeR</a> package released yesterday by <a href="http://about.me/rich_i/">Richard Iannone</a>. DiagrammeR <a href="https://github.com/rich-iannone/DiagrammeR/commit/656116cc73941f176e93c88990603b2d5ebf38a5" target="_blank">launched</a> in non-htmlwidgets form severely hampering its ability to be easily used in multiple contexts. Converting it to htmlwidgets seemed like a great opportunity to illustrate both the ease of htmlwidgets creation and the powerful infrastructure offered by htmlwidgets. So, in a couple hours—easy to create, check—yesterday (most of the time spent on examples, documentation, and testing) with only a <a href="https://github.com/rich-iannone/DiagrammeR/blob/master/inst/htmlwidgets/DiagrammeR.js#L23-L40" target="_blank">couple of lines of JavaScript</a>—easy to create, check again—I was able to transform the DiagrammeR package into htmlwidgets.</p> <p>I thought a finance diagram would be a great example for this blog, so off to Google Images I went looking for a good and also simple application and chose <a href="http://www.fin.gc.ca/treas/evaluations/eaafefa-ecracfc-eng.asp" target="_blank">this</a> from the Department of Finance Canada.</p> <p><a href="http://www.fin.gc.ca/treas/evaluations/eaafefa-ecracfc-eng.asp"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8YYz3916gmygL0ERXZgCnS4tM3yDXDRIRTwHjSWZR_7VS14ZbeMIYKtxSQA3QjNL1Nik2GLwxVqGKmys7plIiRP8quRHtqARGGGdAMLoGdt7kftQgp3fHHtRakqBb49J0Ey01CLymDw/?imgmax=800" width="574" height="390"></a></p> <p>Here is what it looks like with DiagrammeR + mermaid.js.</p><iframe height="700" src="http://bl.ocks.org/timelyportfolio/b35fe527f2b153369bb6" width="800"></iframe> <p> </p> <p>If I can come up with the resolve and commitment, I might have an announcement for 2015 – the year of the widget.</p> <p>Happy New Year, and thanks for 4 good years of TimelyPortfolio.</p> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-87241127681202535422014-12-11T08:04:00.001-08:002014-12-11T08:12:38.078-08:00Out of Nowhere–Explore Text on a Path<p>I had not really stopped to think of this until I listened to this <a href="http://5by5.tv/webahead/81" target="_blank">The Web Ahead podcast</a> with <a href="http://sarasoueidan.com" target="_blank">Sara Soueidan</a>. What is really interesting about the tech world is how experts can seemingly pop up out of nowhere and become the authority on a topic. In the podcast, this was the case with the interviewee <a href="http://sarasoueidan.com" target="_blank">Sara Soueidan</a>. We can find a similar example in <a href="http://jonibologna.com/portfolio/" target="_blank">Joni "Bologna" Trythall</a> with SVG.</p> <p>I find it even more fun when I can incorporate these experts’ content into R. Let’s animate some text on a path as Joni does in her article <a href="http://jonibologna.com/svg-text-along-a-path/" target="_blank">"Animating SVG text On A Path"</a>, but instead of an arbitrary path, let’s use a line in a plot.</p> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="432pt" height="432pt" viewBox="0 0 432 432" version="1.1"> <display xmlns:r="http://www.r-project.org" usr="-0.88,49.88,-1.07599413731093,1.0794031315166"></display> <defs> <g> <symbol overflow="visible" id="glyph0-0"> <path style="stroke:none;" d="M 0.519531 -4.414063 C 0.515625 -5.46875 0.625 -6.320313 0.84375 -6.964844 C 1.0625 -7.609375 1.386719 -8.105469 1.816406 -8.457031 C 2.246094 -8.804688 2.785156 -8.980469 3.4375 -8.984375 C 3.914063 -8.980469 4.335938 -8.886719 4.699219 -8.695313 C 5.058594 -8.5 5.355469 -8.21875 5.59375 -7.859375 C 5.828125 -7.492188 6.015625 -7.050781 6.152344 -6.527344 C 6.285156 -6.003906 6.351563 -5.296875 6.355469 -4.414063 C 6.351563 -3.359375 6.242188 -2.511719 6.03125 -1.871094 C 5.8125 -1.222656 5.492188 -0.726563 5.0625 -0.375 C 4.632813 -0.0234375 4.089844 0.152344 3.4375 0.152344 C 2.570313 0.152344 1.890625 -0.15625 1.402344 -0.773438 C 0.808594 -1.515625 0.515625 -2.726563 0.519531 -4.414063 Z M 1.648438 -4.414063 C 1.644531 -2.941406 1.816406 -1.964844 2.164063 -1.480469 C 2.503906 -0.992188 2.929688 -0.75 3.4375 -0.75 C 3.9375 -0.75 4.359375 -0.992188 4.707031 -1.480469 C 5.050781 -1.96875 5.226563 -2.945313 5.226563 -4.414063 C 5.226563 -5.882813 5.050781 -6.863281 4.707031 -7.347656 C 4.359375 -7.832031 3.933594 -8.074219 3.425781 -8.074219 C 2.917969 -8.074219 2.515625 -7.859375 2.214844 -7.433594 C 1.835938 -6.886719 1.644531 -5.878906 1.648438 -4.414063 Z M 1.648438 -4.414063 "></path> </symbol> <symbol overflow="visible" id="glyph0-1"> <path style="stroke:none;" d="M 4.65625 0 L 3.558594 0 L 3.558594 -7 C 3.289063 -6.746094 2.941406 -6.492188 2.515625 -6.242188 C 2.085938 -5.988281 1.703125 -5.800781 1.359375 -5.675781 L 1.359375 -6.738281 C 1.972656 -7.027344 2.507813 -7.375 2.972656 -7.789063 C 3.429688 -8.195313 3.757813 -8.59375 3.949219 -8.984375 L 4.65625 -8.984375 Z M 4.65625 0 "></path> </symbol> <symbol overflow="visible" id="glyph0-2"> <path style="stroke:none;" d="M 6.292969 -1.054688 L 6.292969 0 L 0.378906 0 C 0.367188 -0.265625 0.410156 -0.519531 0.507813 -0.761719 C 0.65625 -1.164063 0.898438 -1.558594 1.230469 -1.953125 C 1.558594 -2.339844 2.035156 -2.792969 2.667969 -3.308594 C 3.636719 -4.101563 4.292969 -4.734375 4.636719 -5.203125 C 4.976563 -5.667969 5.148438 -6.105469 5.152344 -6.523438 C 5.148438 -6.957031 4.992188 -7.324219 4.683594 -7.625 C 4.371094 -7.921875 3.96875 -8.074219 3.46875 -8.074219 C 2.9375 -8.074219 2.511719 -7.914063 2.195313 -7.597656 C 1.878906 -7.277344 1.71875 -6.839844 1.714844 -6.28125 L 0.585938 -6.398438 C 0.664063 -7.238281 0.953125 -7.878906 1.457031 -8.320313 C 1.960938 -8.761719 2.640625 -8.980469 3.492188 -8.984375 C 4.347656 -8.980469 5.023438 -8.742188 5.527344 -8.269531 C 6.027344 -7.789063 6.28125 -7.199219 6.28125 -6.5 C 6.28125 -6.140625 6.207031 -5.789063 6.058594 -5.445313 C 5.910156 -5.09375 5.664063 -4.730469 5.328125 -4.351563 C 4.984375 -3.964844 4.421875 -3.441406 3.636719 -2.777344 C 2.976563 -2.222656 2.554688 -1.84375 2.367188 -1.648438 C 2.179688 -1.449219 2.023438 -1.253906 1.90625 -1.054688 Z M 6.292969 -1.054688 "></path> </symbol> <symbol overflow="visible" id="glyph0-3"> <path style="stroke:none;" d="M 0.523438 -2.363281 L 1.625 -2.507813 C 1.746094 -1.882813 1.960938 -1.433594 2.265625 -1.160156 C 2.566406 -0.886719 2.9375 -0.75 3.375 -0.75 C 3.890625 -0.75 4.324219 -0.925781 4.683594 -1.285156 C 5.035156 -1.640625 5.214844 -2.085938 5.21875 -2.617188 C 5.214844 -3.121094 5.050781 -3.539063 4.722656 -3.867188 C 4.394531 -4.195313 3.976563 -4.359375 3.46875 -4.359375 C 3.257813 -4.359375 2.996094 -4.316406 2.691406 -4.234375 L 2.8125 -5.199219 C 2.882813 -5.1875 2.941406 -5.183594 2.992188 -5.1875 C 3.457031 -5.183594 3.878906 -5.308594 4.253906 -5.554688 C 4.628906 -5.796875 4.816406 -6.171875 4.816406 -6.683594 C 4.816406 -7.085938 4.679688 -7.417969 4.40625 -7.683594 C 4.132813 -7.945313 3.78125 -8.078125 3.351563 -8.082031 C 2.921875 -8.078125 2.5625 -7.945313 2.28125 -7.675781 C 1.992188 -7.40625 1.8125 -7.003906 1.734375 -6.46875 L 0.632813 -6.664063 C 0.765625 -7.398438 1.070313 -7.96875 1.550781 -8.375 C 2.023438 -8.777344 2.617188 -8.980469 3.328125 -8.984375 C 3.8125 -8.980469 4.261719 -8.875 4.675781 -8.667969 C 5.085938 -8.457031 5.398438 -8.171875 5.617188 -7.8125 C 5.832031 -7.445313 5.941406 -7.0625 5.945313 -6.660156 C 5.941406 -6.269531 5.835938 -5.917969 5.632813 -5.601563 C 5.421875 -5.28125 5.117188 -5.027344 4.710938 -4.847656 C 5.238281 -4.722656 5.648438 -4.46875 5.941406 -4.085938 C 6.234375 -3.695313 6.378906 -3.214844 6.382813 -2.644531 C 6.378906 -1.859375 6.09375 -1.199219 5.527344 -0.65625 C 4.957031 -0.113281 4.238281 0.15625 3.367188 0.160156 C 2.582031 0.15625 1.929688 -0.0742188 1.410156 -0.542969 C 0.890625 -1.007813 0.59375 -1.613281 0.523438 -2.363281 Z M 0.523438 -2.363281 "></path> </symbol> <symbol overflow="visible" id="glyph0-4"> <path style="stroke:none;" d="M 4.039063 0 L 4.039063 -2.140625 L 0.160156 -2.140625 L 0.160156 -3.148438 L 4.242188 -8.949219 L 5.140625 -8.949219 L 5.140625 -3.148438 L 6.347656 -3.148438 L 6.347656 -2.140625 L 5.140625 -2.140625 L 5.140625 0 Z M 4.039063 -3.148438 L 4.039063 -7.183594 L 1.238281 -3.148438 Z M 4.039063 -3.148438 "></path> </symbol> <symbol overflow="visible" id="glyph0-5"> <path style="stroke:none;" d="M 1.164063 0 L 1.164063 -8.949219 L 2.351563 -8.949219 L 2.351563 0 Z M 1.164063 0 "></path> </symbol> <symbol overflow="visible" id="glyph0-6"> <path style="stroke:none;" d="M 0.824219 0 L 0.824219 -6.480469 L 1.8125 -6.480469 L 1.8125 -5.558594 C 2.285156 -6.269531 2.972656 -6.625 3.875 -6.628906 C 4.261719 -6.625 4.621094 -6.554688 4.953125 -6.417969 C 5.277344 -6.273438 5.523438 -6.089844 5.6875 -5.863281 C 5.847656 -5.632813 5.960938 -5.363281 6.03125 -5.054688 C 6.066406 -4.847656 6.085938 -4.492188 6.089844 -3.984375 L 6.089844 0 L 4.992188 0 L 4.992188 -3.941406 C 4.992188 -4.386719 4.949219 -4.722656 4.863281 -4.945313 C 4.777344 -5.167969 4.625 -5.34375 4.40625 -5.476563 C 4.1875 -5.605469 3.933594 -5.671875 3.644531 -5.675781 C 3.175781 -5.671875 2.769531 -5.523438 2.429688 -5.230469 C 2.089844 -4.929688 1.921875 -4.367188 1.921875 -3.539063 L 1.921875 0 Z M 0.824219 0 "></path> </symbol> <symbol overflow="visible" id="glyph0-7"> <path style="stroke:none;" d="M 5.03125 0 L 5.03125 -0.816406 C 4.617188 -0.171875 4.011719 0.144531 3.214844 0.148438 C 2.695313 0.144531 2.21875 0.0078125 1.789063 -0.277344 C 1.351563 -0.558594 1.015625 -0.957031 0.78125 -1.472656 C 0.539063 -1.980469 0.421875 -2.570313 0.425781 -3.234375 C 0.421875 -3.882813 0.53125 -4.46875 0.75 -4.996094 C 0.964844 -5.519531 1.285156 -5.921875 1.71875 -6.207031 C 2.148438 -6.484375 2.632813 -6.625 3.167969 -6.628906 C 3.554688 -6.625 3.902344 -6.542969 4.210938 -6.378906 C 4.511719 -6.210938 4.761719 -5.996094 4.957031 -5.738281 L 4.957031 -8.949219 L 6.046875 -8.949219 L 6.046875 0 Z M 1.554688 -3.234375 C 1.550781 -2.402344 1.726563 -1.78125 2.078125 -1.371094 C 2.425781 -0.960938 2.839844 -0.753906 3.320313 -0.757813 C 3.796875 -0.753906 4.203125 -0.949219 4.542969 -1.34375 C 4.875 -1.734375 5.042969 -2.335938 5.046875 -3.144531 C 5.042969 -4.027344 4.875 -4.675781 4.535156 -5.09375 C 4.191406 -5.507813 3.769531 -5.71875 3.273438 -5.71875 C 2.78125 -5.71875 2.371094 -5.519531 2.046875 -5.121094 C 1.714844 -4.722656 1.550781 -4.09375 1.554688 -3.234375 Z M 1.554688 -3.234375 "></path> </symbol> <symbol overflow="visible" id="glyph0-8"> <path style="stroke:none;" d="M 5.261719 -2.085938 L 6.398438 -1.945313 C 6.21875 -1.28125 5.886719 -0.765625 5.402344 -0.402344 C 4.917969 -0.0351563 4.296875 0.144531 3.546875 0.148438 C 2.59375 0.144531 1.84375 -0.144531 1.289063 -0.726563 C 0.734375 -1.3125 0.457031 -2.132813 0.457031 -3.1875 C 0.457031 -4.273438 0.734375 -5.117188 1.296875 -5.722656 C 1.855469 -6.324219 2.585938 -6.625 3.484375 -6.628906 C 4.347656 -6.625 5.054688 -6.332031 5.609375 -5.742188 C 6.15625 -5.152344 6.433594 -4.320313 6.433594 -3.253906 C 6.433594 -3.183594 6.429688 -3.085938 6.425781 -2.960938 L 1.59375 -2.960938 C 1.632813 -2.242188 1.832031 -1.699219 2.195313 -1.324219 C 2.558594 -0.945313 3.011719 -0.753906 3.550781 -0.757813 C 3.953125 -0.753906 4.296875 -0.859375 4.582031 -1.074219 C 4.867188 -1.28125 5.09375 -1.621094 5.261719 -2.085938 Z M 1.652344 -3.863281 L 5.273438 -3.863281 C 5.222656 -4.402344 5.082031 -4.8125 4.859375 -5.089844 C 4.503906 -5.511719 4.050781 -5.722656 3.496094 -5.726563 C 2.992188 -5.722656 2.570313 -5.554688 2.226563 -5.21875 C 1.882813 -4.878906 1.691406 -4.425781 1.652344 -3.863281 Z M 1.652344 -3.863281 "></path> </symbol> <symbol overflow="visible" id="glyph0-9"> <path style="stroke:none;" d="M 0.0898438 0 L 2.460938 -3.367188 L 0.269531 -6.480469 L 1.640625 -6.480469 L 2.636719 -4.960938 C 2.824219 -4.667969 2.972656 -4.425781 3.089844 -4.234375 C 3.261719 -4.503906 3.425781 -4.742188 3.582031 -4.949219 L 4.675781 -6.480469 L 5.988281 -6.480469 L 3.746094 -3.429688 L 6.160156 0 L 4.808594 0 L 3.480469 -2.015625 L 3.125 -2.558594 L 1.421875 0 Z M 0.0898438 0 "></path> </symbol> <symbol overflow="visible" id="glyph1-0"> <path style="stroke:none;" d="M -2.6875 -0.398438 L -3.789063 -0.398438 L -3.789063 -3.773438 L -2.683594 -3.773438 Z M -2.6875 -0.398438 "></path> </symbol> <symbol overflow="visible" id="glyph1-1"> <path style="stroke:none;" d="M 0 -4.65625 L 0 -3.558594 L -7 -3.558594 C -6.746094 -3.289063 -6.492188 -2.941406 -6.242188 -2.515625 C -5.988281 -2.085938 -5.800781 -1.703125 -5.675781 -1.359375 L -6.738281 -1.359375 C -7.027344 -1.972656 -7.375 -2.507813 -7.789063 -2.972656 C -8.195313 -3.429688 -8.59375 -3.757813 -8.984375 -3.949219 L -8.984375 -4.65625 Z M 0 -4.65625 "></path> </symbol> <symbol overflow="visible" id="glyph1-2"> <path style="stroke:none;" d="M 0 -1.136719 L -1.25 -1.136719 L -1.25 -2.386719 L 0 -2.386719 Z M 0 -1.136719 "></path> </symbol> <symbol overflow="visible" id="glyph1-3"> <path style="stroke:none;" d="M -4.414063 -0.519531 C -5.46875 -0.515625 -6.320313 -0.625 -6.964844 -0.84375 C -7.609375 -1.0625 -8.105469 -1.386719 -8.457031 -1.816406 C -8.804688 -2.246094 -8.980469 -2.785156 -8.984375 -3.4375 C -8.980469 -3.914063 -8.886719 -4.335938 -8.695313 -4.699219 C -8.5 -5.058594 -8.21875 -5.355469 -7.859375 -5.59375 C -7.492188 -5.828125 -7.050781 -6.015625 -6.527344 -6.152344 C -6.003906 -6.285156 -5.296875 -6.351563 -4.414063 -6.355469 C -3.359375 -6.351563 -2.511719 -6.242188 -1.871094 -6.03125 C -1.222656 -5.8125 -0.726563 -5.492188 -0.375 -5.0625 C -0.0234375 -4.632813 0.152344 -4.089844 0.152344 -3.4375 C 0.152344 -2.570313 -0.15625 -1.890625 -0.773438 -1.402344 C -1.515625 -0.808594 -2.726563 -0.515625 -4.414063 -0.519531 Z M -4.414063 -1.648438 C -2.941406 -1.644531 -1.964844 -1.816406 -1.480469 -2.164063 C -0.992188 -2.503906 -0.75 -2.929688 -0.75 -3.4375 C -0.75 -3.9375 -0.992188 -4.359375 -1.480469 -4.707031 C -1.96875 -5.050781 -2.945313 -5.226563 -4.414063 -5.226563 C -5.882813 -5.226563 -6.863281 -5.050781 -7.347656 -4.707031 C -7.832031 -4.359375 -8.074219 -3.933594 -8.074219 -3.425781 C -8.074219 -2.917969 -7.859375 -2.515625 -7.433594 -2.214844 C -6.886719 -1.835938 -5.878906 -1.644531 -4.414063 -1.648438 Z M -4.414063 -1.648438 "></path> </symbol> <symbol overflow="visible" id="glyph1-4"> <path style="stroke:none;" d="M -2.34375 -0.519531 L -2.441406 -1.671875 C -1.875 -1.753906 -1.453125 -1.953125 -1.171875 -2.265625 C -0.890625 -2.574219 -0.75 -2.949219 -0.75 -3.394531 C -0.75 -3.917969 -0.949219 -4.367188 -1.347656 -4.734375 C -1.746094 -5.101563 -2.273438 -5.285156 -2.9375 -5.285156 C -3.558594 -5.285156 -4.054688 -5.109375 -4.417969 -4.757813 C -4.777344 -4.40625 -4.957031 -3.945313 -4.960938 -3.375 C -4.957031 -3.019531 -4.875 -2.699219 -4.71875 -2.414063 C -4.554688 -2.128906 -4.347656 -1.90625 -4.09375 -1.746094 L -4.230469 -0.714844 L -8.824219 -1.582031 L -8.824219 -6.03125 L -7.777344 -6.03125 L -7.777344 -2.460938 L -5.371094 -1.976563 C -5.742188 -2.511719 -5.929688 -3.078125 -5.933594 -3.667969 C -5.929688 -4.449219 -5.660156 -5.105469 -5.121094 -5.644531 C -4.578125 -6.179688 -3.882813 -6.449219 -3.035156 -6.453125 C -2.222656 -6.449219 -1.519531 -6.214844 -0.933594 -5.742188 C -0.207031 -5.167969 0.152344 -4.382813 0.152344 -3.394531 C 0.152344 -2.574219 -0.0742188 -1.910156 -0.53125 -1.398438 C -0.984375 -0.882813 -1.589844 -0.589844 -2.34375 -0.519531 Z M -2.34375 -0.519531 "></path> </symbol> <symbol overflow="visible" id="glyph1-5"> <path style="stroke:none;" d="M -1.933594 -0.382813 L -2.105469 -1.472656 C -1.667969 -1.527344 -1.335938 -1.699219 -1.105469 -1.980469 C -0.871094 -2.257813 -0.753906 -2.644531 -0.757813 -3.148438 C -0.753906 -3.648438 -0.859375 -4.023438 -1.066406 -4.273438 C -1.269531 -4.515625 -1.507813 -4.640625 -1.789063 -4.640625 C -2.03125 -4.640625 -2.226563 -4.53125 -2.375 -4.316406 C -2.46875 -4.164063 -2.59375 -3.789063 -2.746094 -3.191406 C -2.945313 -2.382813 -3.121094 -1.824219 -3.273438 -1.515625 C -3.417969 -1.203125 -3.625 -0.96875 -3.890625 -0.808594 C -4.152344 -0.644531 -4.441406 -0.5625 -4.761719 -0.566406 C -5.046875 -0.5625 -5.3125 -0.628906 -5.5625 -0.765625 C -5.804688 -0.894531 -6.011719 -1.074219 -6.175781 -1.304688 C -6.300781 -1.472656 -6.40625 -1.707031 -6.496094 -2.003906 C -6.582031 -2.300781 -6.625 -2.617188 -6.628906 -2.953125 C -6.625 -3.460938 -6.550781 -3.90625 -6.40625 -4.292969 C -6.257813 -4.675781 -6.0625 -4.960938 -5.8125 -5.144531 C -5.5625 -5.328125 -5.226563 -5.453125 -4.808594 -5.523438 L -4.664063 -4.449219 C -4.996094 -4.394531 -5.253906 -4.253906 -5.445313 -4.023438 C -5.628906 -3.789063 -5.722656 -3.460938 -5.726563 -3.035156 C -5.722656 -2.527344 -5.640625 -2.164063 -5.476563 -1.953125 C -5.308594 -1.734375 -5.113281 -1.628906 -4.890625 -1.628906 C -4.746094 -1.628906 -4.617188 -1.671875 -4.503906 -1.765625 C -4.382813 -1.851563 -4.285156 -1.992188 -4.210938 -2.183594 C -4.167969 -2.292969 -4.074219 -2.617188 -3.929688 -3.15625 C -3.722656 -3.929688 -3.554688 -4.472656 -3.421875 -4.78125 C -3.289063 -5.085938 -3.09375 -5.324219 -2.84375 -5.503906 C -2.585938 -5.675781 -2.273438 -5.765625 -1.902344 -5.769531 C -1.535156 -5.765625 -1.191406 -5.65625 -0.867188 -5.445313 C -0.542969 -5.226563 -0.292969 -4.917969 -0.117188 -4.519531 C 0.0585938 -4.113281 0.144531 -3.660156 0.148438 -3.15625 C 0.144531 -2.308594 -0.0273438 -1.664063 -0.375 -1.226563 C -0.726563 -0.78125 -1.246094 -0.5 -1.933594 -0.382813 Z M -1.933594 -0.382813 "></path> </symbol> <symbol overflow="visible" id="glyph1-6"> <path style="stroke:none;" d="M -7.683594 -0.832031 L -8.949219 -0.832031 L -8.949219 -1.929688 L -7.683594 -1.929688 Z M 0 -0.828125 L -6.480469 -0.832031 L -6.480469 -1.929688 L 0 -1.929688 Z M 0 -0.828125 "></path> </symbol> <symbol overflow="visible" id="glyph1-7"> <path style="stroke:none;" d="M 0 -0.824219 L -6.480469 -0.824219 L -6.480469 -1.8125 L -5.558594 -1.8125 C -6.269531 -2.285156 -6.625 -2.972656 -6.628906 -3.875 C -6.625 -4.261719 -6.554688 -4.621094 -6.417969 -4.953125 C -6.273438 -5.277344 -6.089844 -5.523438 -5.863281 -5.6875 C -5.632813 -5.847656 -5.363281 -5.960938 -5.054688 -6.03125 C -4.847656 -6.066406 -4.492188 -6.085938 -3.984375 -6.089844 L 0 -6.089844 L 0 -4.992188 L -3.941406 -4.992188 C -4.386719 -4.992188 -4.722656 -4.949219 -4.945313 -4.863281 C -5.167969 -4.777344 -5.34375 -4.625 -5.476563 -4.40625 C -5.605469 -4.1875 -5.671875 -3.933594 -5.675781 -3.644531 C -5.671875 -3.175781 -5.523438 -2.769531 -5.230469 -2.429688 C -4.929688 -2.089844 -4.367188 -1.921875 -3.539063 -1.921875 L 0 -1.921875 Z M 0 -0.824219 "></path> </symbol> <symbol overflow="visible" id="glyph1-8"> <path style="stroke:none;" d="M 2.628906 -2.921875 C 1.863281 -2.316406 0.972656 -1.804688 -0.0546875 -1.386719 C -1.078125 -0.964844 -2.140625 -0.753906 -3.242188 -0.757813 C -4.207031 -0.753906 -5.136719 -0.910156 -6.023438 -1.226563 C -7.054688 -1.589844 -8.078125 -2.15625 -9.101563 -2.921875 L -9.101563 -3.710938 C -8.25 -3.214844 -7.648438 -2.890625 -7.289063 -2.734375 C -6.726563 -2.484375 -6.140625 -2.289063 -5.53125 -2.148438 C -4.765625 -1.972656 -4 -1.886719 -3.234375 -1.886719 C -1.277344 -1.886719 0.675781 -2.492188 2.628906 -3.710938 Z M 2.628906 -2.921875 "></path> </symbol> <symbol overflow="visible" id="glyph1-9"> <path style="stroke:none;" d="M -2.085938 -5.261719 L -1.945313 -6.398438 C -1.28125 -6.21875 -0.765625 -5.886719 -0.402344 -5.402344 C -0.0351563 -4.917969 0.144531 -4.296875 0.148438 -3.546875 C 0.144531 -2.59375 -0.144531 -1.84375 -0.726563 -1.289063 C -1.3125 -0.734375 -2.132813 -0.457031 -3.1875 -0.457031 C -4.273438 -0.457031 -5.117188 -0.734375 -5.722656 -1.296875 C -6.324219 -1.855469 -6.625 -2.585938 -6.628906 -3.484375 C -6.625 -4.347656 -6.332031 -5.054688 -5.742188 -5.609375 C -5.152344 -6.15625 -4.320313 -6.433594 -3.253906 -6.433594 C -3.183594 -6.433594 -3.085938 -6.429688 -2.960938 -6.425781 L -2.960938 -1.59375 C -2.242188 -1.632813 -1.699219 -1.832031 -1.324219 -2.195313 C -0.945313 -2.558594 -0.753906 -3.011719 -0.757813 -3.550781 C -0.753906 -3.953125 -0.859375 -4.296875 -1.074219 -4.582031 C -1.28125 -4.867188 -1.621094 -5.09375 -2.085938 -5.261719 Z M -3.863281 -1.652344 L -3.863281 -5.273438 C -4.402344 -5.222656 -4.8125 -5.082031 -5.089844 -4.859375 C -5.511719 -4.503906 -5.722656 -4.050781 -5.726563 -3.496094 C -5.722656 -2.992188 -5.554688 -2.570313 -5.21875 -2.226563 C -4.878906 -1.882813 -4.425781 -1.691406 -3.863281 -1.652344 Z M -3.863281 -1.652344 "></path> </symbol> <symbol overflow="visible" id="glyph1-10"> <path style="stroke:none;" d="M 2.484375 -4.957031 L -0.691406 -4.957031 C -0.449219 -4.785156 -0.246094 -4.542969 -0.0898438 -4.238281 C 0.0703125 -3.925781 0.144531 -3.601563 0.148438 -3.257813 C 0.144531 -2.488281 -0.160156 -1.824219 -0.773438 -1.273438 C -1.386719 -0.714844 -2.226563 -0.4375 -3.300781 -0.441406 C -3.949219 -0.4375 -4.535156 -0.550781 -5.050781 -0.777344 C -5.566406 -1 -5.957031 -1.328125 -6.226563 -1.761719 C -6.492188 -2.1875 -6.625 -2.660156 -6.628906 -3.175781 C -6.625 -3.972656 -6.289063 -4.601563 -5.617188 -5.066406 L -6.480469 -5.066406 L -6.480469 -6.054688 L 2.484375 -6.054688 Z M -3.257813 -1.570313 C -2.421875 -1.570313 -1.796875 -1.742188 -1.382813 -2.09375 C -0.964844 -2.4375 -0.753906 -2.859375 -0.757813 -3.351563 C -0.753906 -3.820313 -0.953125 -4.222656 -1.351563 -4.558594 C -1.746094 -4.894531 -2.347656 -5.0625 -3.160156 -5.066406 C -4.019531 -5.0625 -4.671875 -4.882813 -5.109375 -4.53125 C -5.542969 -4.171875 -5.757813 -3.753906 -5.761719 -3.277344 C -5.757813 -2.796875 -5.554688 -2.394531 -5.152344 -2.066406 C -4.746094 -1.734375 -4.117188 -1.570313 -3.257813 -1.570313 Z M -3.257813 -1.570313 "></path> </symbol> <symbol overflow="visible" id="glyph1-11"> <path style="stroke:none;" d="M 0 -1.109375 L -1.25 -1.109375 L -1.25 -2.363281 L 0 -2.363281 C 0.460938 -2.359375 0.832031 -2.277344 1.113281 -2.117188 C 1.394531 -1.953125 1.613281 -1.695313 1.769531 -1.34375 L 1.300781 -1.039063 C 1.199219 -1.265625 1.046875 -1.4375 0.851563 -1.550781 C 0.648438 -1.65625 0.367188 -1.71875 0 -1.734375 Z M 0 -1.109375 "></path> </symbol> <symbol overflow="visible" id="glyph1-12"> <path style="stroke:none;" d=""></path> </symbol> <symbol overflow="visible" id="glyph1-13"> <path style="stroke:none;" d="M 2.484375 -0.824219 L -6.480469 -0.824219 L -6.480469 -1.824219 L -5.640625 -1.824219 C -5.964844 -2.058594 -6.210938 -2.328125 -6.378906 -2.625 C -6.542969 -2.921875 -6.625 -3.28125 -6.628906 -3.703125 C -6.625 -4.257813 -6.484375 -4.746094 -6.199219 -5.167969 C -5.914063 -5.589844 -5.511719 -5.910156 -4.996094 -6.128906 C -4.476563 -6.34375 -3.90625 -6.449219 -3.289063 -6.453125 C -2.621094 -6.449219 -2.023438 -6.332031 -1.496094 -6.09375 C -0.964844 -5.855469 -0.558594 -5.507813 -0.277344 -5.054688 C 0.0078125 -4.597656 0.144531 -4.121094 0.148438 -3.625 C 0.144531 -3.257813 0.0703125 -2.929688 -0.0820313 -2.640625 C -0.238281 -2.347656 -0.433594 -2.109375 -0.671875 -1.921875 L 2.484375 -1.921875 Z M -3.203125 -1.820313 C -2.367188 -1.816406 -1.75 -1.984375 -1.355469 -2.324219 C -0.953125 -2.660156 -0.753906 -3.070313 -0.757813 -3.550781 C -0.753906 -4.039063 -0.960938 -4.457031 -1.375 -4.804688 C -1.785156 -5.152344 -2.425781 -5.324219 -3.296875 -5.328125 C -4.121094 -5.324219 -4.738281 -5.15625 -5.152344 -4.816406 C -5.558594 -4.476563 -5.765625 -4.070313 -5.769531 -3.601563 C -5.765625 -3.128906 -5.546875 -2.714844 -5.113281 -2.359375 C -4.671875 -1.996094 -4.035156 -1.816406 -3.203125 -1.820313 Z M -3.203125 -1.820313 "></path> </symbol> <symbol overflow="visible" id="glyph1-14"> <path style="stroke:none;" d="M -7.304688 -0.390625 L -8.171875 -0.671875 C -7.941406 -1.316406 -7.746094 -1.785156 -7.582031 -2.082031 C -8.316406 -2 -8.820313 -1.960938 -9.101563 -1.960938 L -9.101563 -2.84375 C -8.695313 -2.828125 -8.191406 -2.78125 -7.585938 -2.703125 C -7.792969 -3.117188 -7.988281 -3.597656 -8.171875 -4.144531 L -7.304688 -4.425781 C -7.132813 -3.902344 -7.019531 -3.398438 -6.964844 -2.90625 C -6.746094 -3.152344 -6.363281 -3.5 -5.8125 -3.957031 L -5.292969 -3.222656 C -5.609375 -2.984375 -6.046875 -2.703125 -6.605469 -2.386719 C -6.027344 -2.082031 -5.589844 -1.820313 -5.292969 -1.59375 L -5.8125 -0.871094 C -6.390625 -1.34375 -6.773438 -1.683594 -6.964844 -1.886719 C -7.0625 -1.359375 -7.175781 -0.859375 -7.304688 -0.390625 Z M -7.304688 -0.390625 "></path> </symbol> <symbol overflow="visible" id="glyph1-15"> <path style="stroke:none;" d="M -2.363281 -0.523438 L -2.507813 -1.625 C -1.882813 -1.746094 -1.433594 -1.960938 -1.160156 -2.265625 C -0.886719 -2.566406 -0.75 -2.9375 -0.75 -3.375 C -0.75 -3.890625 -0.925781 -4.324219 -1.285156 -4.683594 C -1.640625 -5.035156 -2.085938 -5.214844 -2.617188 -5.21875 C -3.121094 -5.214844 -3.539063 -5.050781 -3.867188 -4.722656 C -4.195313 -4.394531 -4.359375 -3.976563 -4.359375 -3.46875 C -4.359375 -3.257813 -4.316406 -2.996094 -4.234375 -2.691406 L -5.199219 -2.8125 C -5.1875 -2.882813 -5.183594 -2.941406 -5.1875 -2.992188 C -5.183594 -3.457031 -5.308594 -3.878906 -5.554688 -4.253906 C -5.796875 -4.628906 -6.171875 -4.816406 -6.683594 -4.816406 C -7.085938 -4.816406 -7.417969 -4.679688 -7.683594 -4.40625 C -7.945313 -4.132813 -8.078125 -3.78125 -8.082031 -3.351563 C -8.078125 -2.921875 -7.945313 -2.5625 -7.675781 -2.28125 C -7.40625 -1.992188 -7.003906 -1.8125 -6.46875 -1.734375 L -6.664063 -0.636719 C -7.398438 -0.765625 -7.96875 -1.070313 -8.375 -1.550781 C -8.777344 -2.023438 -8.980469 -2.617188 -8.984375 -3.328125 C -8.980469 -3.8125 -8.875 -4.261719 -8.667969 -4.675781 C -8.457031 -5.085938 -8.171875 -5.398438 -7.8125 -5.617188 C -7.445313 -5.832031 -7.0625 -5.941406 -6.660156 -5.945313 C -6.269531 -5.941406 -5.917969 -5.835938 -5.601563 -5.632813 C -5.28125 -5.421875 -5.027344 -5.117188 -4.847656 -4.710938 C -4.722656 -5.238281 -4.46875 -5.648438 -4.085938 -5.941406 C -3.695313 -6.234375 -3.214844 -6.378906 -2.644531 -6.382813 C -1.859375 -6.378906 -1.199219 -6.09375 -0.65625 -5.527344 C -0.113281 -4.957031 0.15625 -4.238281 0.160156 -3.367188 C 0.15625 -2.582031 -0.0742188 -1.929688 -0.542969 -1.414063 C -1.007813 -0.890625 -1.613281 -0.59375 -2.363281 -0.523438 Z M -2.363281 -0.523438 "></path> </symbol> <symbol overflow="visible" id="glyph1-16"> <path style="stroke:none;" d="M -1.054688 -6.292969 L 0 -6.292969 L 0 -0.378906 C -0.265625 -0.367188 -0.519531 -0.410156 -0.761719 -0.507813 C -1.164063 -0.65625 -1.558594 -0.898438 -1.953125 -1.230469 C -2.339844 -1.558594 -2.792969 -2.035156 -3.308594 -2.667969 C -4.101563 -3.636719 -4.734375 -4.292969 -5.203125 -4.636719 C -5.667969 -4.976563 -6.105469 -5.148438 -6.523438 -5.152344 C -6.957031 -5.148438 -7.324219 -4.992188 -7.625 -4.683594 C -7.921875 -4.371094 -8.074219 -3.96875 -8.074219 -3.46875 C -8.074219 -2.9375 -7.914063 -2.511719 -7.597656 -2.195313 C -7.277344 -1.878906 -6.839844 -1.71875 -6.28125 -1.714844 L -6.398438 -0.585938 C -7.238281 -0.664063 -7.878906 -0.953125 -8.320313 -1.457031 C -8.761719 -1.960938 -8.980469 -2.640625 -8.984375 -3.492188 C -8.980469 -4.347656 -8.742188 -5.023438 -8.269531 -5.527344 C -7.789063 -6.027344 -7.199219 -6.28125 -6.5 -6.28125 C -6.140625 -6.28125 -5.789063 -6.207031 -5.445313 -6.058594 C -5.09375 -5.910156 -4.730469 -5.664063 -4.351563 -5.328125 C -3.964844 -4.984375 -3.441406 -4.421875 -2.777344 -3.636719 C -2.222656 -2.976563 -1.84375 -2.554688 -1.648438 -2.367188 C -1.449219 -2.179688 -1.253906 -2.023438 -1.054688 -1.90625 Z M -1.054688 -6.292969 "></path> </symbol> <symbol overflow="visible" id="glyph1-17"> <path style="stroke:none;" d="M 2.628906 -1.542969 L 2.628906 -0.757813 C 0.675781 -1.96875 -1.277344 -2.578125 -3.234375 -2.582031 C -4 -2.578125 -4.757813 -2.492188 -5.511719 -2.320313 C -6.117188 -2.179688 -6.703125 -1.984375 -7.269531 -1.738281 C -7.632813 -1.578125 -8.242188 -1.25 -9.101563 -0.757813 L -9.101563 -1.542969 C -8.078125 -2.304688 -7.054688 -2.871094 -6.023438 -3.242188 C -5.136719 -3.550781 -4.207031 -3.707031 -3.242188 -3.710938 C -2.140625 -3.707031 -1.078125 -3.496094 -0.0546875 -3.078125 C 0.972656 -2.65625 1.863281 -2.144531 2.628906 -1.542969 Z M 2.628906 -1.542969 "></path> </symbol> </g> <clipPath id="clip1"> <path d="M 59.039063 59.039063 L 402.757813 59.039063 L 402.757813 359.558594 L 59.039063 359.558594 Z M 59.039063 59.039063 "></path> </clipPath> </defs> <g id="surface231"> <rect x="0" y="0" width="432" height="432" style="fill: rgb(100%,100%,100%); fill-opacity: 1; stroke: none;"></rect> <g clip-path="url(#clip1)" clip-rule="nonzero"> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 71.734375 209.035156 L 78.484375 181.429688 L 85.238281 154.921875 L 91.988281 130.574219 L 98.742188 109.351563 L 105.492188 92.105469 L 112.242188 79.519531 L 118.996094 72.097656 L 125.746094 70.132813 L 132.5 73.707031 L 139.25 82.679688 L 146.003906 96.6875 L 152.753906 115.171875 L 159.507813 137.402344 L 166.257813 162.484375 L 173.011719 189.425781 L 179.761719 217.148438 L 186.511719 244.546875 L 193.265625 270.53125 L 200.015625 294.0625 L 206.769531 314.203125 L 213.519531 330.152344 L 220.273438 341.273438 L 227.023438 347.121094 L 233.777344 347.464844 L 240.527344 342.292969 L 247.28125 331.804688 L 254.03125 316.421875 L 260.78125 296.757813 L 267.535156 273.597656 L 274.285156 247.863281 L 281.039063 220.582031 L 287.789063 192.839844 L 294.542969 165.746094 L 301.292969 140.375 L 308.046875 117.738281 L 314.796875 98.746094 L 321.550781 84.148438 L 328.300781 74.53125 L 335.050781 70.277344 L 341.804688 71.554688 L 348.554688 78.308594 L 355.308594 90.28125 L 362.058594 106.984375 L 368.8125 127.753906 L 375.5625 151.769531 L 382.316406 178.0625 L 389.066406 205.59375 " id="ourline"></path> </g> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 64.980469 358.558594 L 335.050781 358.558594 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 64.980469 358.558594 L 64.980469 365.761719 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 132.5 358.558594 L 132.5 365.761719 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 200.015625 358.558594 L 200.015625 365.761719 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 267.535156 358.558594 L 267.535156 365.761719 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 335.050781 358.558594 L 335.050781 365.761719 "></path> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph0-0" x="61.503906" y="385.921875"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph0-1" x="125.546875" y="385.921875"></use> <use xlink:href="#glyph0-0" x="132.498779" y="385.921875"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph0-2" x="193.0625" y="385.921875"></use> <use xlink:href="#glyph0-0" x="200.014404" y="385.921875"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph0-3" x="260.582031" y="385.921875"></use> <use xlink:href="#glyph0-0" x="267.533936" y="385.921875"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph0-4" x="328.097656" y="385.921875"></use> <use xlink:href="#glyph0-0" x="335.049561" y="385.921875"></use> </g> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 59.039063 348 L 59.039063 70.074219 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 59.039063 348 L 51.839844 348 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 59.039063 278.519531 L 51.839844 278.519531 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 59.039063 209.035156 L 51.839844 209.035156 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 59.039063 139.554688 L 51.839844 139.554688 "></path> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 59.039063 70.074219 L 51.839844 70.074219 "></path> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph1-0" x="43.199219" y="358.769531"></use> <use xlink:href="#glyph1-1" x="43.199219" y="354.606934"></use> <use xlink:href="#glyph1-2" x="43.199219" y="347.655029"></use> <use xlink:href="#glyph1-3" x="43.199219" y="344.182129"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph1-0" x="43.199219" y="289.289063"></use> <use xlink:href="#glyph1-3" x="43.199219" y="285.126465"></use> <use xlink:href="#glyph1-2" x="43.199219" y="278.174561"></use> <use xlink:href="#glyph1-4" x="43.199219" y="274.70166"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph1-3" x="43.199219" y="217.722656"></use> <use xlink:href="#glyph1-2" x="43.199219" y="210.770752"></use> <use xlink:href="#glyph1-3" x="43.199219" y="207.297852"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph1-3" x="43.199219" y="148.242188"></use> <use xlink:href="#glyph1-2" x="43.199219" y="141.290283"></use> <use xlink:href="#glyph1-4" x="43.199219" y="137.817383"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph1-1" x="43.199219" y="78.761719"></use> <use xlink:href="#glyph1-2" x="43.199219" y="71.809814"></use> <use xlink:href="#glyph1-3" x="43.199219" y="68.336914"></use> </g> <path style="fill:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 59.039063 358.558594 L 401.761719 358.558594 L 401.761719 59.039063 L 59.039063 59.039063 L 59.039063 358.558594 "></path> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph0-5" x="215.109375" y="414.71875"></use> <use xlink:href="#glyph0-6" x="218.582275" y="414.71875"></use> <use xlink:href="#glyph0-7" x="225.53418" y="414.71875"></use> <use xlink:href="#glyph0-8" x="232.486084" y="414.71875"></use> <use xlink:href="#glyph0-9" x="239.437988" y="414.71875"></use> </g> <g style="fill:rgb(0%,0%,0%);fill-opacity:1;"> <use xlink:href="#glyph1-5" x="14.398438" y="268.546875"></use> <use xlink:href="#glyph1-6" x="14.398438" y="262.296875"></use> <use xlink:href="#glyph1-7" x="14.398438" y="259.519775"></use> <use xlink:href="#glyph1-8" x="14.398438" y="252.567871"></use> <use xlink:href="#glyph1-5" x="14.398438" y="248.405273"></use> <use xlink:href="#glyph1-9" x="14.398438" y="242.155273"></use> <use xlink:href="#glyph1-10" x="14.398438" y="235.203369"></use> <use xlink:href="#glyph1-8" x="14.398438" y="228.251465"></use> <use xlink:href="#glyph1-3" x="14.398438" y="224.088867"></use> <use xlink:href="#glyph1-11" x="14.398438" y="217.136963"></use> <use xlink:href="#glyph1-12" x="14.398438" y="213.664063"></use> <use xlink:href="#glyph1-13" x="14.398438" y="210.191162"></use> <use xlink:href="#glyph1-6" x="14.398438" y="203.239258"></use> <use xlink:href="#glyph1-12" x="14.398438" y="200.462158"></use> <use xlink:href="#glyph1-14" x="14.398438" y="196.989258"></use> <use xlink:href="#glyph1-12" x="14.398438" y="192.124756"></use> <use xlink:href="#glyph1-15" x="14.398438" y="188.651855"></use> <use xlink:href="#glyph1-11" x="14.398438" y="181.699951"></use> <use xlink:href="#glyph1-12" x="14.398438" y="178.227051"></use> <use xlink:href="#glyph1-3" x="14.398438" y="174.75415"></use> <use xlink:href="#glyph1-2" x="14.398438" y="167.802246"></use> <use xlink:href="#glyph1-16" x="14.398438" y="164.329346"></use> <use xlink:href="#glyph1-17" x="14.398438" y="157.377441"></use> <use xlink:href="#glyph1-17" x="14.398438" y="153.214844"></use> </g> </g> <text> <textPath xlink:href="#ourline" startOffset="0.955991">some text on a path<animate attributeName="startOffset" values="0;0.7;1" dur="8s" repeatCount="indefinite" keyTimes="0;0.2;1"></animate></textPath> </text> </svg> <p>I’ll copy the code below. Let me know if a tutorial would be helpful.</p><code><pre>library(SVGAnnotation)<br />library(pipeR)<br />library(htmltools)<br /><br /># make as basic a line plot as I know how in R<br />svg = svgPlot(plot(sin(seq(0,pi*3,0.2)),type="l")) %>>%<br /> # extract the XML and use htmlParse<br /> # to overcome namespace confusion and difficulty<br /> saveXML %>>% htmlParse<br /><br /># with base R plots, we get clues with clip-path attributes<br /># in this case we know with some inspection<br /># there will be one g with a clip-path attribute<br /># and that g will contain our plotted line<br />getNodeSet(svg,"//g[contains(@clip-path,'url')]//path")[[1]] %>>%<br /> # let's add an id so we can reference this later<br /> ( addAttributes( node=., id = "ourline" ) )<br /><br /># first step in adding text to a path<br /># make a new text node<br />textOnPath = newXMLNode("text")<br /># now the critical part to join the text to the path<br />addChildren(<br /> textOnPath<br /> , newXMLNode(<br /> "textPath"<br /> ,attrs=c( "xlink:href" = "#ourline" ) #our id given above<br /> ,"some text on a path" #some very creative saying<br /> )<br />)<br /><br /># add our text node to the svg plot<br />addChildren(<br /> getNodeSet(svg,"//svg")[[1]]<br /> ,kids = list(textOnPath)<br />)<br /># see if it works by sending to our viewer/browser<br />getNodeSet(svg,"//svg")[[1]] %>>%<br /> saveXML %>>% HTML %>>% html_print<br /><br /># let's continue our journey by exploring the startOffset attribute<br /># startOffset says where on the path to start our text<br /># what happens if we add startOffset = 30%<br />getNodeSet(svg, "//textPath")[[1]] %>>%<br /> ( addAttributes( node = . , startOffset = "30%" ) )<br /># find out the effect of startOffset by browsing<br />getNodeSet(svg,"//svg")[[1]] %>>%<br /> saveXML %>>% HTML %>>% html_print<br /><br /># for our grand finale we can animate the text<br /># note: this might not work in your browser, so use Chrome<br /># add a child animate node with the same attributes as Joni's tutorial<br />getNodeSet(svg, "//textPath")[[1]] %>>%<br /> (<br /> addChildren(<br /> node = .<br /> , newXMLNode(<br /> "animate"<br /> ,attrs = c(<br /> attributeName="startOffset"<br /> ,values = "0;0.7;1"<br /> ,dur = "8s"<br /> ,repeatCount = "indefinite"<br /> ,keyTimes = "0;0.2;1"<br /> )<br /> )<br /> )<br /> )<br /># see the animated text<br />getNodeSet(svg,"//svg")[[1]] %>>%<br /> saveXML %>>% HTML %>>% html_print(viewer=utils::browseURL)<br /></pre></code> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-82004114134819779962014-12-04T11:23:00.001-08:002014-12-04T11:33:43.091-08:00No Reason to Read, Just Need an Outlet<p>Don’t intend for this to be a bitch and moan post, and I’m not sure there is really any real objective other than I feel like I need an outlet. This happens to be my only one,.</p> <p>For those out there not engaged in money management, it can be pleasantly simple and maybe even entertaining to poke fun at those of us who foolishly choose to call ourselves portfolio managers. However, this business can be excrutiating, depressing, and frustrating. Generally, our biggest benefit to our clients is insulating themselves from their own stupidity, but often this task becomes impossible, usually at the time when client stupidity results in the most amount of damage to themselves.</p> <p>While distracting myself with my insatiable curiosity through academic research, technology, and data visualization (just look at the last couple of years of posts) helps, I cannot forget that I get paid to manage money, which generally just ain’t no fun as failing is the norm, and the brief moments of “success” go unnoticed and disappear with no lasting memory or permanent effect. </p> <p>Most would naively say go do something else, but I still feel this delusional quest really can help those few clients who trust and endure.</p> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com4tag:blogger.com,1999:blog-7630810606654250077.post-86759331280383579752014-12-02T15:17:00.001-08:002017-05-19T17:32:17.121-07:00Much Better Animated Paths | Christmas SVG<p>Just after I made my really ugly animated turkey sketch (see <a href="http://timelyportfolio.blogspot.com/2014/11/happy-thanksgiving-more-examples-of-xml.html" target="_blank">post</a>), I saw this much better set of Christmas icons in the Smashing Magazine Article <a href="http://www.smashingmagazine.com/2014/11/25/freebie-christmas-icon-set-ai-psd-eps-pdf-svg-png/">Freebie Christmas Icon Set</a> from <a href="http://mokreo.com/" target="_blank">Manuela Langella</a>. While I still remember how to do this, I thought I would use the same techniques in R using <code><a href="http://blog.rstudio.org/2014/11/24/rvest-easy-web-scraping-with-r/">rvest</a></code> + <code><a href="http://www.amazon.com/gp/product/1461478995/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1461478995&linkCode=as2&tag=timelyp-20&linkId=FZJTULMKOUP5KIXE">XML</a> + <a href="http://github.com/rstudio/htmltools" target="_blank">htmltools</a> </code>to animate the paths with <a href="http://maxwellito.github.io/vivus/" target="_blank">vivus.js</a>. In the iframe below is the <a href="https://bl.ocks.org/39394d6e37a7fd878cab" target="_blank">result</a> on the Santa icon.</p> <p><iframe height="500" src="https://bl.ocks.org/viewer/?39394d6e37a7fd878cab" width="750"></iframe></p> <p>Code: <a title="http://gist.github.com/39394d6e37a7fd878cab" href="http://gist.github.com/39394d6e37a7fd878cab" target="_blank">http://gist.github.com/39394d6e37a7fd878cab#file-code-R</a></p> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-74629890780674998292014-11-26T12:34:00.001-08:002014-11-26T12:34:01.034-08:00Happy Thanksgiving | More Examples of XML + rvest with SVG<p>I did not intend for this little experiment to become a post, but I think the code builds nicely on the XML + rvest combination (also see yesterday’s <a href="http://timelyportfolio.blogspot.com/2014/11/slightly-advanced-rvest-with-help-from_26.html" target="_blank">post</a>) for working with XML/HTML/SVG documents in R.</p> <p>It all started when I was playing on my iPhone in the <a href="https://itunes.apple.com/us/app/autodesk-sketchbook/id883738213?mt=8" target="_blank">Sketchbook app</a> and drew a really bad turkey. Even though, the turkey was bad, I thought it would be fun to combine with <a href="http://maxwellito.github.io/vivus/" target="_blank">vivus.js</a>. However, Sketchbook does not export SVG, so I exported as PDF and imported into <a href="http://inkscape.org" target="_blank">Inkscape</a>. The end result was a still very messy SVG file, so I thought it would be a great test / application of my new skills with <code><a href="http://blog.rstudio.org/2014/11/24/rvest-easy-web-scraping-with-r/" target="_blank">rvest</a></code> + <code><a href="http://www.amazon.com/gp/product/1461478995/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1461478995&linkCode=as2&tag=timelyp-20&linkId=FZJTULMKOUP5KIXE">XML</a></code>. The code opens the SVG, grabs all the <code>path</code> nodes, assembles those into a <code>svg</code> tag with id = "turkey", and then adds a script to use the <code>addDependency</code> for vivus.js.</p> <p>Happy Thanksgiving to all the US readers out there.</p><iframe style="margin: auto" height="600" src="http://bl.ocks.org/timelyportfolio/9a07c4b0bd514479399d" width="750"></iframe> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-31339130025296350242014-11-26T10:16:00.001-08:002014-11-26T10:16:05.321-08:00Slightly Advanced rvest with Help from htmltools + XML + pipeR<p><a href="https://github.com/hadley" target="_blank">Hadley Wickham’s</a> post “<a href="http://blog.rstudio.org/2014/11/24/rvest-easy-web-scraping-with-r/">rvest: easy web scraping with R</a>” introduces the fine new package <code><a href="http://github.com/hadley/rvest" target="_blank">rvest</a></code> very well. For those now yearning a slightly more advanced example with a little help from <code><a href="http://renkun.me/pipeR-tutorial/" target="_blank">pipeR</a> + <a href="http://github.com/rstudio/htmltools" target="_blank">htmltools</a> + <a href="https://github.com/omegahat/XML" target="_blank">XML</a></code>, I thought this might fill your yearn. The code grabs css information running the fancy new site <a href="http://cssstats.com/" target="_blank">cssstats.com</a> on my blog site. With the background colors, it makes and labels some swatches and outputs them to the RStudio viewer--if installed--or your browser if not.</p><pre class="csharpcode">library(pipeR)<br />library(htmltools)<br />library(rvest)<br />library(XML)<br /><br /># some slightly more advanced exercises<br /># <span class="kwrd">using</span> rvest, XML, and htmltools<br /><br /># <span class="kwrd">this</span> one takes all the svg nodes <span class="kwrd">in</span> the section<br /># with id unique-background-colors from the <br /># site cssstats.com run on timelyportfolio.blogspot.com<br /># 1) removes attributes<br /># 2) sizes them at 85px x 64px<br /># 3) add <span class="kwrd">new</span> text node with fill value<br /># 4) combines them into a single div<br /># 5) with some meta information<br /><span class="str">"http://cssstats.com/stats?url=http%3A%2F%2Ftimelyportfolio.blogspot.com"</span> %>>%<br /> html %>>%<br /> html_nodes( <span class="str">"#unique-background-colors svg"</span> ) %>>%<br /> xmlApply( <span class="kwrd">function</span>(x){<br /> removeAttributes(x)<br /> addAttributes(x,style=<span class="str">"display:inline-block;height:85px;width:64px"</span>)<br /> fillNode = newXMLNode(<br /> <span class="str">"text"</span><br /> ,html_attr(html_node(x,<span class="str">"rect"</span>),<span class="str">"fill"</span>)<br /> ,attrs=c(x=0,y=75,style=<span class="str">"font-size:70%"</span>)<br /> )<br /> addChildren(x,fillNode)<br /> saveXML(x) %>>% HTML<br /> } ) %>>%<br /> (tags$div(<br /> style=<span class="str">"display:inline-block;height:100%;width:100%"</span><br /> ,list(<br /> tags$h3(<br /> <span class="str">"Colors of TimelyPortfolio from "</span><br /> ,tags$a(href=<span class="str">"http://cssstats.com"</span>,<span class="str">"cssstats"</span>)<br /> )<br /> ,.<br /> )<br /> )) %>>%<br /> tagList %>>%<br /> html_print<br /></pre><br /><p>I just copied the <code>div</code> output below in Windows Live Writer (notably from JJ Allaire and Joe Cheng of RStudio).</p><br /><div style="height: 100%; width: 100%; display: inline-block"><br /><h3>Colors of TimelyPortfolio from <a href="http://cssstats.com">cssstats</a> </h3><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="transparent" /><text style="font-size: 70%" x="0" y="75">transparent</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#fff" /><text style="font-size: 70%" x="0" y="75">#fff</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#ffffff" /><text style="font-size: 70%" x="0" y="75">#ffffff</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#fcfcfc" /><text style="font-size: 70%" x="0" y="75">#fcfcfc</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#eeeeee" /><text style="font-size: 70%" x="0" y="75">#eeeeee</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#fcf8e3" /><text style="font-size: 70%" x="0" y="75">#fcf8e3</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#f2dede" /><text style="font-size: 70%" x="0" y="75">#f2dede</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#dff0d8" /><text style="font-size: 70%" x="0" y="75">#dff0d8</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#d9edf7" /><text style="font-size: 70%" x="0" y="75">#d9edf7</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#f5f5f5" /><text style="font-size: 70%" x="0" y="75">#f5f5f5</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#a9dba9" /><text style="font-size: 70%" x="0" y="75">#a9dba9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#f9f9f9" /><text style="font-size: 70%" x="0" y="75">#f9f9f9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#d0e9c6" /><text style="font-size: 70%" x="0" y="75">#d0e9c6</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#ebcccc" /><text style="font-size: 70%" x="0" y="75">#ebcccc</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#faf2cc" /><text style="font-size: 70%" x="0" y="75">#faf2cc</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#c4e3f3" /><text style="font-size: 70%" x="0" y="75">#c4e3f3</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#e5e5e5" /><text style="font-size: 70%" x="0" y="75">#e5e5e5</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#0081c2" /><text style="font-size: 70%" x="0" y="75">#0081c2</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#e6e6e6" /><text style="font-size: 70%" x="0" y="75">#e6e6e6</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#cccccc \9" /><text style="font-size: 70%" x="0" y="75">#cccccc \9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#006dcc" /><text style="font-size: 70%" x="0" y="75">#006dcc</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#0044cc" /><text style="font-size: 70%" x="0" y="75">#0044cc</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#003399 \9" /><text style="font-size: 70%" x="0" y="75">#003399 \9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#faa732" /><text style="font-size: 70%" x="0" y="75">#faa732</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#f89406" /><text style="font-size: 70%" x="0" y="75">#f89406</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#c67605 \9" /><text style="font-size: 70%" x="0" y="75">#c67605 \9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#da4f49" /><text style="font-size: 70%" x="0" y="75">#da4f49</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#bd362f" /><text style="font-size: 70%" x="0" y="75">#bd362f</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#942a25 \9" /><text style="font-size: 70%" x="0" y="75">#942a25 \9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#5bb75b" /><text style="font-size: 70%" x="0" y="75">#5bb75b</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#51a351" /><text style="font-size: 70%" x="0" y="75">#51a351</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#408140 \9" /><text style="font-size: 70%" x="0" y="75">#408140 \9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#49afcd" /><text style="font-size: 70%" x="0" y="75">#49afcd</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#2f96b4" /><text style="font-size: 70%" x="0" y="75">#2f96b4</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#24748c \9" /><text style="font-size: 70%" x="0" y="75">#24748c \9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#363636" /><text style="font-size: 70%" x="0" y="75">#363636</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#222222" /><text style="font-size: 70%" x="0" y="75">#222222</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#080808 \9" /><text style="font-size: 70%" x="0" y="75">#080808 \9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#0088cc" /><text style="font-size: 70%" x="0" y="75">#0088cc</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#999999" /><text style="font-size: 70%" x="0" y="75">#999999</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#fafafa" /><text style="font-size: 70%" x="0" y="75">#fafafa</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#ededed" /><text style="font-size: 70%" x="0" y="75">#ededed</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#1b1b1b" /><text style="font-size: 70%" x="0" y="75">#1b1b1b</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#111111" /><text style="font-size: 70%" x="0" y="75">#111111</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#515151" /><text style="font-size: 70%" x="0" y="75">#515151</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#0e0e0e" /><text style="font-size: 70%" x="0" y="75">#0e0e0e</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#040404" /><text style="font-size: 70%" x="0" y="75">#040404</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#000000 \9" /><text style="font-size: 70%" x="0" y="75">#000000 \9</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#000000" /><text style="font-size: 70%" x="0" y="75">#000000</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#f7f7f7" /><text style="font-size: 70%" x="0" y="75">#f7f7f7</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#b94a48" /><text style="font-size: 70%" x="0" y="75">#b94a48</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#953b39" /><text style="font-size: 70%" x="0" y="75">#953b39</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#c67605" /><text style="font-size: 70%" x="0" y="75">#c67605</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#468847" /><text style="font-size: 70%" x="0" y="75">#468847</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#356635" /><text style="font-size: 70%" x="0" y="75">#356635</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#3a87ad" /><text style="font-size: 70%" x="0" y="75">#3a87ad</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#2d6987" /><text style="font-size: 70%" x="0" y="75">#2d6987</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#333333" /><text style="font-size: 70%" x="0" y="75">#333333</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#1a1a1a" /><text style="font-size: 70%" x="0" y="75">#1a1a1a</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#0e90d2" /><text style="font-size: 70%" x="0" y="75">#0e90d2</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#149bdf" /><text style="font-size: 70%" x="0" y="75">#149bdf</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#dd514c" /><text style="font-size: 70%" x="0" y="75">#dd514c</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#ee5f5b" /><text style="font-size: 70%" x="0" y="75">#ee5f5b</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#5eb95e" /><text style="font-size: 70%" x="0" y="75">#5eb95e</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#62c462" /><text style="font-size: 70%" x="0" y="75">#62c462</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#4bb1cf" /><text style="font-size: 70%" x="0" y="75">#4bb1cf</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#5bc0de" /><text style="font-size: 70%" x="0" y="75">#5bc0de</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#fbb450" /><text style="font-size: 70%" x="0" y="75">#fbb450</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#ccc" /><text style="font-size: 70%" x="0" y="75">#ccc</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="rgba(255, 255, 255, 0.25)" /><text style="font-size: 70%" x="0" y="75">rgba(255, 255, 255, 0.25)</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#2288bb" /><text style="font-size: 70%" x="0" y="75">#2288bb</text> </svg><svg style="height: 85px; width: 64px; display: inline-block"><rect width="64" height="64" fill="#ffff00" /><text style="font-size: 70%" x="0" y="75">#ffff00</text> </svg></div> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-61926495961846009222014-11-24T14:28:00.001-08:002014-11-26T10:07:46.181-08:00Secret to Making Things Appear in RStudio Viewer<p>I am by no means an authoritative source on this, but I think I found out the secret behind htmltools <code>html_print</code> that chooses the RStudio Viewer browser rather than your default browser like <code>utils::browseURL</code>. Here is a quick code snippet that hopefully explains what is happening. It appears you just need a temp directory with the pattern starting with <code>viewhtml*</code>.</p><pre>library(htmltools)<br />library(pipeR)<br /><br /># htmltools from RStudio very nicely<br /># makes things appear <span class="kwrd">in</span> the Viewer Window<br /><span class="str">"<h3>Hello in RStudio Viewer</h3>"</span> %>>%<br /> HTML %>>%<br /> html_print<br /><br /><br /># there <span class="kwrd">is</span> a little secret to doing the same<br /># without htmltools<br /><span class="str">"<h3>Hello in RStudio Viewer</h3>"</span> %>>%<br /> HTML %>>%<br /> # and the secret <span class="kwrd">is</span> to place <span class="kwrd">in</span> a temp directory<br /> # with the pattern viewhtml<br /> (<br /> ht ~<br /> tempfile(<span class="str">"viewhtml"</span>) %>>%<br /> (~ dir.create(.) ) %>>%<br /> (~ save_html(ht, file = file.path(.,<span class="str">"index.html"</span>)) ) %>>%<br /> ( getOption(<span class="str">"viewer"</span>)(file.path(.,<span class="str">"index.html"</span>)) )<br /> )<br /> <br /># to see it <span class="kwrd">in</span> action look at the code change<br /># <span class="kwrd">in</span> <span class="kwrd">this</span> project<br />utils::browseURL(<span class="str">"https://github.com/bryanhanson/exCon/pull/1/files"</span>)<br /></pre>The only reason I mention it is that I much prefer to stay in the RStudio environment instead of switching contexts to a browser. I still <strong>firmly recommend using tags from htmltools</strong> as the best method to make all this work seamlessly and as intended by the experts at RStudio. klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-9766927204033090392014-11-24T13:49:00.001-08:002014-11-25T12:32:09.341-08:00Pipeline to Plot Annual % Change<p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOhWTd0T4x6C1NeYkpH_rASqNKMIBQd8pt5hhXpF90H81RQFgVpnrUaip2nx0i7NIUlYRUmPtT-lIRw4EflpzmVVO52c7nezqvwZautdYvRoh2FtoBYo30jz-drML38GtzCNdQTeWR5Q/s1600-h/image%25255B4%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIwHdtUgXANogPchrCPgMO8_YnBkuW4GEd9G9vro0u_oTAaSkkFJO9PUbU65SASQwKDwQST7v-1eCnrZX7mZ9SQV5LQFWGAh2fUiymRh2QR03WPSQEKGStAUwciv97s0nJaTYrqizvjQ/?imgmax=800" width="750" height="400"></a></p> <p><em><font color="#777777" size="1">(thanks <a href="http://tradeblotter.wordpress.com" target="_blank">tradeblotter</a> for pointing out error in code in first release)</font></em></p> <p>Pipes in R make my life incredibly easy, and I think my code easier to read. Note, there are a couple different flavors of pipes (see <a href="https://github.com/smbache/magrittr" target="_blank">magrittr</a> and <a href="http://renkun.me/pipeR-tutorial/" target="_blank">pipeR</a>). For now, I choose pipeR.</p><pre class="csharpcode">library(quantmod)<br />library(pipeR)<br />library(ggplot2)<br /><br />getSymbols(<span class="str">"^GSPC"</span>,from=<span class="str">"1900-01-01"</span>,auto.assign=F) %>>% #get S&P 500 from Yahoo!Finance<br /> ( .[endpoints(.,<span class="str">"years"</span>),4] ) %>>% #get end of year<br /> ROC( type=<span class="str">"discrete"</span>, n=1 ) %>>% #get one year rate of change<br /> na.fill(0) %>>% #fill first year with 0<br /> ( #make data.frame<br /> data.frame(<br /> date = as.Date(format(index(.),"%Y-01-01"))<br /> ,.<br /> )<br /> ) %>>%<br /> structure( #hard way to <span class="kwrd">do</span> colnames()<br /> names = c(<span class="str">"date"</span>,<span class="str">"change"</span>)<br /> ) %>>%<br /> ggplot( #start our plot pipe<br /> aes( y= change, x= date)<br /> ) %>>%<br /> + geom_bar( stat=<span class="str">"identity"</span> ) %>>% #choose bar<br /> + labs( title = <span class="str">"Annual Change of the S&P 500"</span> ) #give plot a title</pre><br /><p>Or if we wanted to use the new pipeline syntax for the plot portion.</p><pre class="csharpcode">library(quantmod)<br />library(pipeR)<br />library(ggplot2)<br /><br />getSymbols(<span class="str">"^GSPC"</span>,from=<span class="str">"1900-01-01"</span>,auto.assign=F) %>>% #get S&P 500 from Yahoo!Finance<br /> ( .[endpoints(.,<span class="str">"years"</span>),4] ) %>>% #get end of year<br /> ROC( type=<span class="str">"discrete"</span>, n=1 ) %>>% #get one year rate of change<br /> na.fill(0) %>>% #fill first year with 0<br /> ( #make data.frame<br /> data.frame(<br /> date = as.Date(format(index(.),"%Y-01-01"))<br /> ,.<br /> )<br /> ) %>>%<br /> structure( #hard way to <span class="kwrd">do</span> colnames()<br /> names = c(<span class="str">"date"</span>,<span class="str">"change"</span>)<br /> ) %>>%<br /> (<br /> pipeline({<br /> ggplot(., aes( y= change, x= date) )<br /> + geom_bar( stat=<span class="str">"identity"</span> )<br /> + labs( title = <span class="str">"Annual Change of the S&P 500 (source: Yahoo! Finance)"</span> )<br /> })<br /> )</pre> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-71694337669862589292014-11-05T07:56:00.001-08:002014-11-05T07:56:18.857-08:00Update on JGBs versus USTs<p>Given the recent selloff in the Yen, I thought now would be a good time to update my favorite chart from <a href="http://timelyportfolio.blogspot.com/2013/05/intended-or-unintended-consequences.html">Intended or Unintended Consequences</a>.</p> <h5><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3g_HUgQ4PyE7IsxfcJ-fq5dx6XWXth80G9OaTpShy6QwCSvGcmSh1IMyAmLoALdYzgxBgj-8uzlEyMGZVk1mj1bynSpmvjIhkTCvbBO_Btv0SLK0UsVnvXGDgKh5e6-nbFjRLOUabMA/s1600-h/image%25255B4%25255D.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidEe0MouDi5go4CFYtMtLzsKtcGcPIr5lByAKjzIaMAUbhIhd3L-ug4IA2YJuxWBE1-kHU36UQuFPDm89VtNwEkPT0lg1VijTwX4d0b62jICvKWi98u5zulXmelhalwdZC_RS_wApRIw/?imgmax=800" width="1266" height="791"></a></h5> <p>For a true currency death spiral, rates need to move up rather than down. It appears we are long way from that.</p> <p>Long-time readers will know that I have been keenly interested in the Yen for the entire history of this blog <a title="http://timelyportfolio.blogspot.com/search?q=yen" href="http://timelyportfolio.blogspot.com/search?q=yen">http://timelyportfolio.blogspot.com/search?q=yen</a>.</p> <p>Code for this post: <a href="https://gist.github.com/timelyportfolio/5665790">https://gist.github.com/timelyportfolio/5665790</a></p> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-71194715521284625382014-10-22T13:03:00.001-07:002014-10-22T13:39:17.280-07:00Postive Feedback in R with a Little Javascript<p>Let’s face it, sometimes the struggle in R can become frustrating, depressing, daunting, or just monotonous. For those moments when you need a little positive feedback, some encouragement, or a pat on the back, I thought this might help. Maybe I should make this into a package.</p> <p>I found this from <a href="http://lipis.github.io/bootstrap-sweetalert/" target="_blank">Sweet Alert for Bootstrap</a> forked from <a href="https://twitter.com/t4t5" target="_blank">Tristan Edwards</a> non-bootstrap <a href="http://tristanedwards.me/sweetalert" target="_blank">SweetAlert</a>. This builds on the technique used in my previous post <a href="http://timelyportfolio.blogspot.com/2014/10/svg-little-extra-d3js-in-rstudio.html" target="_blank">SVG + a little extra (d3.js) in RStudio Browser | No Pipes This Time</a>.</p> <p> </p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKxVbKOGAWY_ZOGmwaNMx5AQ5QDuQxmyElkn9oRQ6b0AFlldc1vx7yw8DBs6Tur4vWgPo4yQjRFssjRODQjIQ3Fl8RQBTAN0zLnl2084qWwM6zHICO1uT4y9M4yWU1uN25xfFTelBBOQ/s1600-h/positive_feedback_sweetalert_r%25255B9%25255D.gif"><img title="positive_feedback_sweetalert_r" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="positive_feedback_sweetalert_r" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW1q84Kb3JDr9hX4MvdZVIhHCAm5s0mQBz-rXVvEaT34hI2bWfTzK2b0eJ6s7zA_0_V7bB3X2d300GqSSzpQxgf1F-kG2CAWoyjRAU9CaYq045zcn4HFYsPiGD-CWRrNBD0Mo7_ZU17w/?imgmax=800" width="793" height="690"></a></p><pre class="csharpcode"># give yourself some positive feedback <span class="kwrd">in</span> R<br /># <span class="kwrd">as</span> you toil away on some difficult, but worthwhile task<br /># uses javascript sweet-alert https:<span class="rem">//github.com/t4t5/sweetalert</span><br /><br />library(htmltools)<br />library(pipeR)<br /><br />tagList(<br /> tags$script(<br /> <span class="str">'<br /> document.addEventListener("DOMContentLoaded", function(event) { <br /> swal("Good job! Brilliant!", "You\'re doing worthwhile things.", "success")<br /> });<br /> '</span><br /> )<br />) %>>%<br /> attachDependencies(<br /> htmlDependency(<br /> name=<span class="str">"sweet-alert"</span><br /> ,version=<span class="str">"0.2.1"</span><br /> ,src=c(<span class="str">"href"</span>=<br /> <span class="str">"http://timelyportfolio.github.io/sweetalert/lib"</span><br /> )<br /> ,script = <span class="str">"sweet-alert.min.js"</span><br /> ,style = <span class="str">"sweet-alert.css"</span><br /> )<br /> ) %>>%<br /> html_print</pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com1tag:blogger.com,1999:blog-7630810606654250077.post-50492952953972644502014-10-10T08:02:00.001-07:002014-10-10T08:09:25.942-07:00SVG + Javascript Ekholm Decomposition in RStudio Browser<p>Our topics this week seem unrelated, but in an effort to bridge the two</p> <p><font size="1">another random project – make website in R for these SVGs of Portland Vector Bridges <br>result: <a href="http://timelyportfolio.github.io/portland_vector_bridges" target="_blank">Portland Bridges in SVG</a><br>code: <a href="https://github.com/timelyportfolio/portland_vector_bridges/blob/gh-pages/code.R" target="_blank">R to make simple site</a><br></font><br>Ekholm decomposition</p> <blockquote> <h5><a href="http://timelyportfolio.blogspot.com/2014/10/selectionshare-timingshare-masterfully.html">SelectionShare & TimingShare | Masterfully Written by Delightfully Responsive Author</a></h5> <h5><a href="http://timelyportfolio.blogspot.com/2014/10/popular-mutual-funds-decomposed-with.html">Popular Mutual Funds Decomposed With Ekholm (2014)</a></h5></blockquote> <p>Responsive SVG in the browser</p> <blockquote> <h5><a href="http://timelyportfolio.blogspot.com/2014/10/reponsive-svg-in-your-rstudio-browser.html">Responsive SVG in Your RStudio Browser</a></h5> <h5><a href="http://timelyportfolio.blogspot.com/2014/10/svg-little-extra-d3js-in-rstudio.html">SVG + a little extra (d3.js) in RStudio Browser | No Pipes This Time</a></h5></blockquote> <p>let’s build a website in R with htmltools to calculate the Ekholm decomposition in Javascript using this nifty <a href="http://www.macwright.org/simple-statistics/" target="_blank">simple-statistics.js</a> from the brilliant <a href="http://www.macwright.org/about/" target="_blank">Tom Macwright</a>. The result will not be beautiful and I’ll leave out a fancy interactive chart, but that is intentional to reduce the amount of code and dependencies.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1AX6MabEEEt5WLuFOSRo2tOQvD6RKsjx_oBoheQaG1_NsEWyXa3tXR0koXTK6-NaIFpfUb4eFHmjnSD10o1yeKSqtW2BCl97VKndLOl4emrUxOjanoTp7yIwIC0mDlHc8xYd9K3EQ5A/s1600-h/r_ekholm_js%25255B3%25255D.gif"><img title="r_ekholm_js" style="display: inline" alt="r_ekholm_js" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu6J1lG_TXqKwRJgzmA5I2zz4hRXTDvynAfHVnXerWNbATBHqnBV9F5yeXIyS93RByDP8Y5mntLkLW-mLfjoPsQJyvZs_moU7mmPxntU23w0mMjggjpj02ZLoF0HUztcYdrEvQveSGdw/?imgmax=800" width="1048" height="722"></a></p> <p>I wonder what I’ll get into next week.</p> <p><a href="http://github.com/timelyportfolio/rCharts_factor_analytics" target="_blank">Github Repo</a></p><pre class="csharpcode">library(htmltools)<br />library(pipeR)<br />library(jsonlite)<br />library(Quandl)<br />library(xts)<br /><br /># use Quandl Kenneth French Fama/French factors<br /># http:<span class="rem">//www.quandl.com/KFRENCH/FACTORS_D</span><br />#f <- Quandl(<span class="str">"KFRENCH/FACTORS_D"</span>,type = <span class="str">"xts"</span>, start_date=<span class="str">"2010-12-31"</span>) / 100<br /> <br />tagList(<br /> #pull <span class="kwrd">in</span> the bridge to span all the week<span class="str">'s topics<br /> #Portland Vector Bridges http://timelyportfolio.github.io/portland_vector_bridges<br /> tags$div( style = "height:15%;width:100%"<br /> ,readLines(<br /> "http://timelyportfolio.github.io/portland_vector_bridges/Burnside Bridge.svg"<br /> ) %>>% HTML<br /> )<br /> ,tags$h1( "Sparsest Test in Javascript of Ekholm")<br /> , tags$div( style = "width:100%"<br /> ,tags$div( style = "background-color:red;"<br /> ,"Note: Date range currently limited to one year, but there is a fairly easy workaround<br /> for the next version."<br /> )<br /> ,tags$div(<br /> style = "display:inline-block; width: 25%;float:left;"<br /> ,"Mutual Fund Symbol", tags$input( id = "mfsymbol" )<br /> ,tags$br()<br /> ,"Start Date "<br /> , tags$span( style="font-size:75%;fill:lightgray", "(2013-08-29)" )<br /> , tags$input( type = "date", id = "stdate" )<br /> ,tags$br()<br /> ,"End Date"<br /> ,tags$span( style="font-size:75%;fill:lightgray", "(2014-08-29)" )<br /> , tags$input( type = "date", id= "enddate" )<br /> ,tags$br()<br /> ,tags$input(<br /> type="submit", id = "calc", value = "Calculate"<br /> )<br /> ,tags$br()<br /> )<br /> , tags$div(style = "display:inline-block;height:100%;width:60%;margin-left:30px"<br /> , tags$textarea(id = "results", style="width:100%; height:150px")<br /> )<br /> )<br /> ,tags$script(sprintf(<br />'</span><br /> <span class="kwrd">var</span> french = %s;<br /><span class="str">' <br /> , toJSON(data.frame("Date"=index(f),f)) %>>% HTML<br /> ))<br /> ,tags$script(<br />'</span><br /> <span class="kwrd">function</span> calculateEkholm( data ) { <span class="rem">// data in form of x,y or fund-rf, mkt-rf</span><br /> <span class="rem">/* get an error with regression.js</span><br /><span class="rem"> var myReg = regression(</span><br /><span class="rem"> "linear",</span><br /><span class="rem"> data</span><br /><span class="rem"> )</span><br /><span class="rem"> */</span><br /> <br /> <span class="rem">// so use the great simple-statistics library</span><br /> <span class="kwrd">var</span> myReg = ss.linear_regression().data(data);<br /> <br /> <span class="rem">//get residuals</span><br /> <span class="kwrd">var</span> resid = data.map(<span class="kwrd">function</span>(p){<span class="kwrd">return</span> myReg.line()(p[0]) - p[1]});<br /> <br /> <span class="rem">//regress residuals^2 on (mkt-rf)^2</span><br /> <span class="kwrd">var</span> myReg2 = ss.linear_regression().data(<br /> data.map(<span class="kwrd">function</span>(d,i){<br /> <span class="kwrd">return</span> [ Math.pow(d[0],2), Math.pow(resid[i],2) ]<br /> })<br /> )<br /> <span class="rem">//coefficients ^ 1/2 will give us ActiveAlpha and ActiveBeta</span><br /> <span class="kwrd">var</span> activeAlpha = Math.pow( myReg2.b(), 0.5 );<br /> <span class="kwrd">var</span> activeBeta = Math.pow( myReg2.m(), 0.5 );<br /> <br /> <span class="rem">//now do the next step to get ActiveShare and SelectionShare</span><br /> <span class="kwrd">var</span> selectionShare = Math.pow(activeAlpha, 2 ) / ( ss.variance(data.map(<span class="kwrd">function</span>(d){<span class="kwrd">return</span> d[1]})) * (data.length - 1) / data.length )<br /> <span class="kwrd">var</span> timingShare = Math.pow(activeBeta, 2 ) * ss.mean( data.map(<span class="kwrd">function</span>(d){<span class="kwrd">return</span> Math.pow(d[0],2)}) ) / ( ss.variance(data.map(<span class="kwrd">function</span>(d){<span class="kwrd">return</span> d[1]})) * (data.length - 1) / data.length )<br /> <br /> <span class="rem">//pass correlation result also</span><br /> <span class="kwrd">var</span> correlation = ss.sample_correlation(data.map(<span class="kwrd">function</span>(d){<span class="kwrd">return</span> d[0]}),data.map(<span class="kwrd">function</span>(d){<span class="kwrd">return</span> d[1]}));<br /> <br /> <span class="kwrd">return</span> { <br /> regression: myReg,<br /> correlation: correlation,<br /> activeAlpha: activeAlpha,<br /> activeBeta: activeBeta,<br /> selectionShare: selectionShare,<br /> timingShare: timingShare<br /> }<br /> }<br /> <br /><br /> <span class="rem">// thanks https://gist.github.com/fincluster/6145995</span><br /> <span class="kwrd">function</span> getStock(opts, type, complete) {<br /> <span class="kwrd">var</span> defs = {<br /> desc: <span class="kwrd">false</span>,<br /> baseURL: <span class="str">"http://query.yahooapis.com/v1/public/yql?q="</span>,<br /> query: {<br /> quotes: \<span class="str">'select * from yahoo.finance.quotes where symbol = \"{stock}\" | sort(field=\"{sortBy}\", descending=\"{desc}\")\',<br /> historicaldata: \'select * from yahoo.finance.historicaldata where symbol = \"{stock}\" and startDate = \"{startDate}\" and endDate = \"{endDate}\"\'<br /> },<br /> suffixURL: {<br /> quotes: "&env=store://datatables.org/alltableswithkeys&format=json&callback=?",<br /> historicaldata: "&env=store://datatables.org/alltableswithkeys&format=json"<br /> }<br /> };<br /> <br /> opts = opts || {};<br /> <br /> if (!opts.stock) {<br /> complete("No stock defined");<br /> return;<br /> }<br /> <br /> var query = defs.query[type]<br /> .replace("{stock}", opts.stock)<br /> .replace("{sortBy}", defs.sortBy)<br /> .replace("{desc}", defs.desc)<br /> .replace("{startDate}", opts.startDate)<br /> .replace("{endDate}", opts.endDate)<br /> <br /> var url = defs.baseURL + query + (defs.suffixURL[type] || "");<br /> <br /> return url;<br /> }<br /> <br /> <br /> d3.select("#calc").on("click",function(){<br /> calculateFund(<br /> d3.select("#mfsymbol")[0][0].value,<br /> d3.select("#stdate")[0][0].value,<br /> d3.select("#enddate")[0][0].value<br /> )<br /> })<br /> <br /> function calculateFund( symbol, startdate, enddate ) {<br /> <br /> d3.json(getStock({stock:symbol.toUpperCase(),startDate:startdate,endDate:enddate},"historicaldata"), function(e1,fund){<br /> <br /> <br /> if( e1 || !fund.query.results ) {<br /> updateResults ( {e1:e1, e2:e2, queryresults: "query problems"} );<br /> } else {<br /> var fund_factor = [];<br /> <br /> //manipulate data to join fund with factors<br /> //would be nice to have a xts merge in javascript<br /> <br /> <br /> // query.results.quote will have the data stripped of meta<br /> // also we will sort date ascending<br /> fund = fund.query.results.quote<br /> .sort(function(a,b){<br /> return d3.ascending(<br /> d3.time.format("%Y-%m-%d").parse(a.Date),<br /> d3.time.format("%Y-%m-%d").parse(b.Date)<br /> )<br /> } );<br /> <br /> <br /> <br /> <br /> // now lets go period by period with fund.map<br /> fund.map( function(per, i){<br /> if( i > 0 ) {<br /> var frenchThisPer = french.filter(function(d){return d.Date == per.Date})[0];<br /> fund_factor.push([<br /> //Date: per.Date,<br /> //FundPrice: <br /> per.Adj_Close / fund[ i - 1 ].Adj_Close - 1 - frenchThisPer["RF"],<br /> //Rm_Rf:<br /> +frenchThisPer["Mkt.RF"],<br /> //Rf: +frenchThisPer["RF"]/100<br /> ])<br /> }<br /> })<br /> <br /> updateResults( calculateEkholm( fund_factor ) );<br /> }<br /> <br /> })<br /> }<br /> <br /> function updateResults( ekholmCalc ){<br /> var ekhArr = [];<br /> Object.keys(ekholmCalc).map(function(k){<br /> ekhArr.push( [ k,": ", ekholmCalc[k] ].join("") )<br /> })<br /> d3.select("#results").text(ekhArr.join("\\n"))<br /> }<br /> '</span> %>>% HTML )<br />) %>>%<br /> attachDependencies(<br /> list(<br /> htmlDependency(<br /> name=<span class="str">"d3"</span><br /> ,version=<span class="str">"3.4"</span><br /> ,src=c(<span class="str">"href"</span>=<span class="str">"http://d3js.org/"</span>)<br /> ,script=<span class="str">"d3.v3.min.js"</span><br /> )<br /> ,htmlDependency(<br /> name=<span class="str">"simple_statistics"</span><br /> ,version=<span class="str">"0.1"</span><br /> ,src=c(<span class="str">"href"</span>=<br /> <span class="str">"http://timelyportfolio.github.io/rCharts_factor_analytics/js"</span><br /> )<br /> ,script = <span class="str">"simple_statistics.js"</span><br /> )<br /> )<br /> ) %>>% html_print</pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com1tag:blogger.com,1999:blog-7630810606654250077.post-91871867154616110962014-10-09T09:20:00.001-07:002014-10-21T12:31:14.963-07:00SVG + a little extra (d3.js) in RStudio Browser | No Pipes This Time<p>I’m guessing here, but yesterday’s post <a href="http://timelyportfolio.blogspot.com/2014/10/reponsive-svg-in-your-rstudio-browser.html">Responsive SVG in Your RStudio Browser</a> might have inspired some “but,…)”s, “yes plus I need”s, “what the %>>% with the pipe”s, etc. I’ll attempt to address a couple of these in this quick post.</p> <p>First, if you don’t like pipes, here is the non-piped version of the code. I also made one change, which assumes that you want the SVG to fill the <div> container. This is helpful if you think you will only have one plot and nothing else in your HTML. </p><pre class="csharpcode">library(SVGAnnotation)<br />library(htmltools)<br /><br />respXML <- <span class="kwrd">function</span>( svg_xml, height = NULL, width = <span class="str">"100%"</span>, print = T, ... ){<br /> # svg_xml should be an XML document<br /> library(htmltools)<br /> library(XML)<br /> <br /> svg <- structure(<br /> ifelse(<br /> length(getDefaultNamespace(svg_xml)) > 0<br /> ,getNodeSet(svg_xml,<span class="str">"//x:svg"</span>, <span class="str">"x"</span>)<br /> ,getNodeSet(svg_xml,<span class="str">"//svg"</span>)<br /> )<br /> ,<span class="kwrd">class</span>=<span class="str">"XMLNodeSet"</span><br /> )<br /> <br /> xmlApply(<br /> svg<br /> ,<span class="kwrd">function</span>(s){<br /> a = xmlAttrs(s)<br /> removeAttributes(s)<br /> xmlAttrs(s) <- a[-(1:2)]<br /> xmlAttrs(s) <- c(<br /> style = paste0(<br /> <span class="str">"height:100%;width:100%;"</span><br /> )<br /> )<br /> }<br /> )<br /> <br /> svg <- HTML( saveXML( svg_xml) )<br /> <br /> svg <- tags$div(<br /> style = paste(<br /> sprintf(<span class="str">'width:%s;'</span>,width)<br /> ,ifelse(!<span class="kwrd">is</span>.<span class="kwrd">null</span>(height),sprintf(<span class="str">'height:%s;'</span>,height),<span class="str">""</span>)<br /> )<br /> ,svg<br /> )<br /> <br /> <span class="kwrd">if</span>(print) html_print(svg) <br /> <br /> <span class="kwrd">return</span>( invisible( svg ) )<br />}<br /></pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><p>Second, I like it but I’m helpless without my Javascript helper libraries, such as <a href="http://d3js.org" target="_blank">d3.js</a>, <a href="http://snapsvg.io" target="_blank">Snap.svg</a>, <a href="http://raphaeljs.com/" target="_blank">Raphaël</a>, etc. htmltools makes it fairly easy to attach dependencies. Let’s add <a href="http://d3js.org" target="_blank">d3.js</a> in this example.</p><br /><p>Third, I want to use my helper library to add some script to make something awesome. I can’t help with the awesome part, but I can show you how to add a little bit of code. This time we’ll take the simple pan/zoom code from <a href="http://timelyportfolio.blogspot.com/2013/08/ggplot2-meet-d3.html">ggplot2 meet d3</a>, and here is the result. Please understand that this is only 4 lines of Javascript, so the pan/zoom is not nearly as refined as I would expect.</p><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOjxJKoUPuHkTNp1fN8YnvUX3SJ7SWRuY0ph7pVfZdh6HevzkAUAxPMrOAgK7Ycv3L3cF4BxHYdqf4c42CKA0ZE7DaJ8JG24bHolXsA3u82jZ-q_K4bgcGLznFPPD4XgVplw5d-L_uxA/s1600-h/R_svg_d3js%25255B4%25255D.gif"><img title="R_svg_d3js" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="R_svg_d3js" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitjFY9bvs51Xpsf49QbE4Fi4x5FrFefv58HzT_d4iAbDmVYU57Homi1DBmFHT41OTsSxW7nFVTg4Y388ayWFD5XWj-h3iE065RnHGHmLek_1cKrQbp5ext5INycqeb99YOytd9APIV9w/?imgmax=800" width="1001" height="620"></a></p><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><pre class="csharpcode"># make our plot here<br /># since we will need to manipulate to add a g container<br /># <span class="kwrd">for</span> smoother d3 pan/zoom<br />sP = respXML( <br /> svgPlot(<br /> dotchart(<br /> t(VADeaths)<br /> , xlim = c(0,100)<br /> , main = <span class="str">"Death Rates in Virginia - 1940"</span><br /> )<br /> )<br /> , height = <span class="str">"100%"</span><br /> , print = F<br />)<br /><br /># parse the plot html with rvest<br />sP = html(<span class="kwrd">as</span>.character(sP))<br /># add a g node to contain the plot<br /># <span class="kwrd">for</span> smoother d3 pan / zoom<br />g = newXMLNode(<span class="str">"g"</span>)<br /># add the old g to our <span class="kwrd">new</span> g container<br />addChildren(g, html_nodes(sP,<span class="str">"svg > g"</span>))<br /># add our <span class="kwrd">new</span> g container to our svg<br />addChildren(html_nodes(sP,<span class="str">"svg"</span>)[[1]],g)<br /><br />html_print(attachDependencies(<br /> tagList(<br /> # get the div with our modified svg<br /> HTML(saveXML(html_nodes(sP,<span class="str">"div"</span>)[[1]]))<br /> , tags$script(<br /> HTML(<br /> <span class="str">'<br /> var g = d3.select("svg > g");<br /> var zoom = d3.behavior.zoom().scaleExtent([1, 8]).on("zoom", zoomed)<br /> g.call(zoom)<br /> <br /> function zoomed() {<br /> g.select("g")<br /> .attr(<br /> "transform",<br /> "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"<br /> );<br /> }<br /> '</span><br /> )<br /> )<br /> )<br /> ,htmlDependency(<br /> name=<span class="str">"d3"</span><br /> ,version=<span class="str">"3.0"</span><br /> ,src=c(<span class="str">"href"</span>=<span class="str">"http://d3js.org/"</span>)<br /> ,script=<span class="str">"d3.v3.js"</span><br /> )<br /> ))</pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-37297473173794338392014-10-08T09:10:00.001-07:002014-10-08T11:54:21.130-07:00Responsive SVG in Your RStudio Browser<p>For those readers who are unaware, SVG is absolutely amazing, and if you need some convincing see this 2009 paper/talk from David Dailey <a href="http://www.svgopen.org/2009/papers/26-Why_is_SVG_going_to_be_REALLY_BIG_/" target="_blank">Why is SVG Going to Be REALLY BIG?</a> Most R users should be very well acquainted with graphics and plots magically appearing on the screen with certain commands. These graphics though are rasters, so when you resize, the graphics are re-rendered to scale. Let’s have a look with a simple plot.</p><pre class="csharpcode">plot(x=1:10,y=1:10,type=<span class="str">"b"</span>)</pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLjD7-l6uFyEUsI0nsqmCHUO8T29m78Rd1XkjkY-1uO4ue5B_UAXcfQKtUKsycTF26y1gvMkQOcA0O2I-7BpTsY0p8l2C8ct4lZVSjnLdb4GgDYJ4l3080gfCiWQBUBTpHzTy9wx6zQA/s1600-h/R_raster_resize%25255B4%25255D.gif"><img title="R_raster_resize" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="R_raster_resize" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMB7Pgo5XURWi0tiEpVXgDX-fsxQ-ufXeKJy7K653TUjnDxacOrW2nPFKPhXvA21XHSkxJsCWy8l5da7yxacihrIZOiIQ7G0FZdMzl5v0w1dAKVx8LfarGCTsDqL886LG5uy04BtN4RQ/?imgmax=800" width="943" height="433"></a></p><br /><p>One of the beauties of SVG is that it will scale without re-rendering. The old way to create SVG in R was to do something like this which produces an svg file that we can use, adjust, and share.</p><pre class="csharpcode">svg(<span class="str">"svgplot.svg"</span>)<br />plot(x=1:10,y=1:10,type=<span class="str">"b"</span>)<br />dev.off()</pre><br /><p>However, the integrated browser window in <a href="http://rstudio.com" target="_blank">RStudio</a> combined with the <a href="http://github.com/rstudio/htmltools" target="_blank">HTML helper tools</a> from <a href="http://rstudio.com" target="_blank">RStudio</a> lets us produce and see SVGs in real-time. Let’s look again at our simple plot, but this time as an SVG in our RStudio browser window. We will also use the precocious packages <a href="https://github.com/duncantl/SVGAnnotation" target="_blank">SVGAnnotation</a> and <a href="http://cran.r-project.org/web/packages/XML/index.html" target="_blank">XML</a> from Duncan Temple Lang.</p><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZH15LxxEGyGT6j4DB_4nOjynUAeJp5NkiZib53Hxo_PnfA6SVvh4NvX-cv-6nZP4etjPJ8LfBibXqaXKFNAiUMyyUpBryM1_ee0Dbz5lNP4zuPApsSm3iBYDesDeF_UIZAzGfDWkmbA/s1600-h/R_svg_1%25255B4%25255D.gif"><img title="R_svg_1" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="R_svg_1" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5erjjtTB2IcSCl4NQxBY50xRSnY9tLa3zknE9_I1g-fCPOF8FHx9M3dXV726HsJJxO6uzSQcktXh0L73YkIJgsBtScp441TOD2UufQuTpSDCQqsAxSWS8Qo96COPrPgMMXPTvt3KeUA/?imgmax=800" width="943" height="433"></a></p><br /><p><strong></strong> </p><br /><p><strong>But where is the magic resizability ?</strong></p><br /><p><strong></strong> </p><br /><p>This is where we will use some help from</p><br /><blockquote><br /><p>Sara Soueidan - <a href="http://sarasoueidan.com/blog/svg-coordinate-systems/" target="_blank">Understanding SVG Coordinate Systems & Transformations (Part 1) – The viewport, viewBox, & preserveAspectRatio</a></p></blockquote><br /><blockquote><br /><p>Dudley Storey - <a href="http://demosthenes.info/blog/744/Make-SVG-Responsive">Make SVG Responsive</a></p></blockquote><br /><p>We can make a simple function to help us change the attributes and style to get a fancy responsive SVG real-time.</p><pre class="csharpcode">#even better make it responsive<br />#use <span class="kwrd">this</span> post <span class="kwrd">as</span> a guide<br />#http:<span class="rem">//demosthenes.info/blog/744/Make-SVG-Responsive</span><br />respXML <- <span class="kwrd">function</span>( svg_xml, height = NULL, width = <span class="str">"100%"</span>, print = T, ... ){<br /> # svg_xml should be an XML document<br /> library(htmltools)<br /> library(pipeR)<br /> library(XML)<br /> <br /> tags$div(<br /> style = paste(<br /> sprintf(<span class="str">'width:%s;'</span>,width)<br /> ,ifelse(!<span class="kwrd">is</span>.<span class="kwrd">null</span>(height),sprintf(<span class="str">'height:%s;'</span>,height),<span class="str">""</span>)<br /> ,<span class="str">"display: inline-block;"</span><br /> ,<span class="str">"position: relative;"</span><br /> ,<span class="str">"padding-bottom: 100%;"</span><br /> ,<span class="str">"vertical-align: middle;"</span><br /> ,<span class="str">"overflow: hidden;"</span><br /> )<br /> , ...<br /> ,svg_xml %>>%<br /> (~svg ~<br /> structure(ifelse(<br /> length(getDefaultNamespace(svg)) > 0<br /> ,getNodeSet(svg,<span class="str">"//x:svg"</span>, <span class="str">"x"</span>)<br /> ,getNodeSet(svg,<span class="str">"//svg"</span>)<br /> ),<span class="kwrd">class</span>=<span class="str">"XMLNodeSet"</span>) %>>%<br /> xmlApply(<br /> <span class="kwrd">function</span>(s){<br /> a = xmlAttrs(s)<br /> removeAttributes(s)<br /> xmlAttrs(s) <- a[-(1:2)]<br /> xmlAttrs(s) <- c(<br /> style = paste0(<br /> #<span class="str">"height:100%;width:100%;"</span><br /> <span class="str">"display: inline-block;"</span><br /> #post says use these but will not fit viewer<br /> #,<span class="str">"position: absolute;"</span><br /> #,<span class="str">"top: 0;"</span><br /> #,<span class="str">"left: 0;"</span><br /> )<br /> #,preserveAspectRatio=<span class="str">"xMidYMid meet"</span><br /> )<br /> }<br /> )<br /> ) %>>%<br /> saveXML %>>%<br /> HTML<br /> ) %>>%<br /> ( ~ <span class="kwrd">if</span>(print) html_print(.) ) %>>% <br /> ( <span class="kwrd">return</span>( invisible( . ) ) )</pre><br /><p>Let’s test our fancy new function.</p><br /><p><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /></p><br /><p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHJIra4LEmwDqGqayhMsilZb4LiZda01ia04kYPjtermBB1K3uTSMKMCAOxCM0PJVeGYMf6-dfTvbvqHBpI7vY8LXnQUztWuQCEbNxU-KPPl7K9TQKLi48MNIUAu7rg71Yw3PfUmPalQ/s1600-h/R_svg_2%25255B4%25255D.gif"><img title="R_svg_2" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="R_svg_2" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnJz7YC87bOXpbnzlr13IeJdsqAxoY__VxzTy3dO-T0KzpS_8vxwmO2Y0GdwowNFlMPWoeewAfdtWGw4golhzDBeE2nXC4jBDO5EZ0O1me6rJmNppO3A3ktdEWLJb5I-uqOseSaVZusA/?imgmax=800" width="943" height="458"></a></p><br /><p> </p><br /><p>That’s more like it. Let’s abandon the animated GIFs and embed a SVG below (copied/pasted straight from R into this post). Resize your browser and test the result.</p><br /><p><font color="#8fb08c">Actually, it appears I lied. The SVG does not resize like it would outside the Blogger container. See <a title="http://bl.ocks.org/timelyportfolio/raw/560e50e437d4bb1b9142/" href="http://bl.ocks.org/timelyportfolio/raw/560e50e437d4bb1b9142/">http://bl.ocks.org/timelyportfolio/raw/560e50e437d4bb1b9142/</a> for the SVG in a standalone document for resizing.</font></p><pre class="csharpcode"># example <span class="kwrd">using</span> dotchart documentation<br /># <span class="kwrd">in</span> R graphics package<br /># ?graphics::dotchart<br />svgPlot(<br /> dotchart(<br /> t(VADeaths)<br /> , xlim = c(0,100)<br /> , main = <span class="str">"Death Rates in Virginia - 1940"</span><br /> )<br />) %>>%<br /> respXML</pre><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><div style="overflow: hidden; height: 50%; width: 100%; vertical-align: middle; position: relative; padding-bottom: 100%; display: inline-block"><?xml version="1.0" encoding="UTF-8"?><?XML:NAMESPACE PREFIX = "[default] http://www.w3.org/2000/svg" NS = "http://www.w3.org/2000/svg" /><svg style="position: absolute; left: 0px; display: inline-block; top: 0px" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 432 432" preserveaspectratio="xMinYMin meet"><display usr="-4,104,0,30" xmlns:r="http://www.r-project.org"></display><defs><g><symbol id="glyph0-0" overflow="visible"><path style="stroke: none" d="M 0.984375 0 L 0.984375 -8.949219 L 4.949219 -8.949219 C 5.742188 -8.945313 6.347656 -8.867188 6.765625 -8.707031 C 7.179688 -8.542969 7.511719 -8.257813 7.761719 -7.855469 C 8.007813 -7.445313 8.132813 -6.996094 8.136719 -6.507813 C 8.132813 -5.871094 7.925781 -5.335938 7.519531 -4.902344 C 7.105469 -4.464844 6.472656 -4.1875 5.617188 -4.070313 C 5.925781 -3.917969 6.164063 -3.769531 6.328125 -3.625 C 6.671875 -3.304688 7 -2.90625 7.3125 -2.433594 L 8.867188 0 L 7.378906 0 L 6.195313 -1.863281 C 5.84375 -2.398438 5.558594 -2.808594 5.339844 -3.09375 C 5.113281 -3.378906 4.914063 -3.578125 4.738281 -3.691406 C 4.558594 -3.804688 4.378906 -3.882813 4.199219 -3.929688 C 4.0625 -3.957031 3.84375 -3.972656 3.539063 -3.972656 L 2.167969 -3.972656 L 2.167969 0 Z M 2.167969 -5 L 4.710938 -5 C 5.25 -4.996094 5.671875 -5.054688 5.980469 -5.167969 C 6.28125 -5.277344 6.511719 -5.453125 6.675781 -5.703125 C 6.832031 -5.945313 6.914063 -6.214844 6.914063 -6.507813 C 6.914063 -6.925781 6.757813 -7.273438 6.453125 -7.550781 C 6.140625 -7.820313 5.65625 -7.957031 5 -7.960938 L 2.167969 -7.960938 Z M 2.167969 -5 "></path></symbol><symbol id="glyph0-1" overflow="visible"><path style="stroke: none" d="M 5.070313 0 L 5.070313 -0.953125 C 4.5625 -0.21875 3.878906 0.144531 3.015625 0.148438 C 2.628906 0.144531 2.269531 0.0742188 1.941406 -0.0703125 C 1.605469 -0.21875 1.359375 -0.402344 1.203125 -0.625 C 1.039063 -0.84375 0.929688 -1.117188 0.867188 -1.441406 C 0.820313 -1.65625 0.796875 -1.996094 0.800781 -2.464844 L 0.800781 -6.480469 L 1.898438 -6.480469 L 1.898438 -2.886719 C 1.898438 -2.3125 1.917969 -1.925781 1.964844 -1.726563 C 2.03125 -1.433594 2.179688 -1.207031 2.40625 -1.046875 C 2.628906 -0.878906 2.90625 -0.796875 3.234375 -0.800781 C 3.5625 -0.796875 3.871094 -0.878906 4.164063 -1.050781 C 4.449219 -1.214844 4.652344 -1.445313 4.777344 -1.742188 C 4.894531 -2.03125 4.957031 -2.453125 4.957031 -3.007813 L 4.957031 -6.480469 L 6.054688 -6.480469 L 6.054688 0 Z M 5.070313 0 "></path></symbol><symbol id="glyph0-2" overflow="visible"><path style="stroke: none" d="M 0.8125 0 L 0.8125 -6.480469 L 1.800781 -6.480469 L 1.800781 -5.5 C 2.050781 -5.957031 2.285156 -6.257813 2.5 -6.40625 C 2.710938 -6.550781 2.945313 -6.625 3.203125 -6.628906 C 3.570313 -6.625 3.945313 -6.507813 4.332031 -6.273438 L 3.953125 -5.253906 C 3.683594 -5.410156 3.414063 -5.488281 3.148438 -5.492188 C 2.90625 -5.488281 2.691406 -5.417969 2.5 -5.273438 C 2.308594 -5.128906 2.171875 -4.929688 2.09375 -4.675781 C 1.96875 -4.285156 1.910156 -3.855469 1.910156 -3.394531 L 1.910156 0 Z M 0.8125 0 "></path></symbol><symbol id="glyph0-3" overflow="visible"><path style="stroke: none" d="M 5.054688 -0.800781 C 4.644531 -0.453125 4.253906 -0.207031 3.878906 -0.0664063 C 3.5 0.078125 3.09375 0.144531 2.667969 0.148438 C 1.949219 0.144531 1.402344 -0.0273438 1.023438 -0.375 C 0.640625 -0.722656 0.449219 -1.167969 0.453125 -1.710938 C 0.449219 -2.023438 0.523438 -2.3125 0.667969 -2.578125 C 0.8125 -2.839844 1 -3.050781 1.234375 -3.210938 C 1.464844 -3.367188 1.730469 -3.484375 2.027344 -3.570313 C 2.242188 -3.625 2.566406 -3.679688 3.003906 -3.734375 C 3.886719 -3.835938 4.539063 -3.964844 4.960938 -4.113281 C 4.964844 -4.261719 4.96875 -4.355469 4.96875 -4.402344 C 4.96875 -4.84375 4.863281 -5.160156 4.65625 -5.347656 C 4.371094 -5.59375 3.953125 -5.71875 3.40625 -5.71875 C 2.882813 -5.71875 2.5 -5.625 2.257813 -5.445313 C 2.007813 -5.261719 1.828125 -4.941406 1.714844 -4.484375 L 0.640625 -4.632813 C 0.734375 -5.089844 0.894531 -5.460938 1.121094 -5.746094 C 1.339844 -6.027344 1.664063 -6.246094 2.089844 -6.398438 C 2.511719 -6.550781 3.003906 -6.625 3.5625 -6.628906 C 4.117188 -6.625 4.566406 -6.5625 4.914063 -6.433594 C 5.257813 -6.300781 5.511719 -6.136719 5.675781 -5.941406 C 5.835938 -5.742188 5.949219 -5.492188 6.019531 -5.195313 C 6.050781 -5.003906 6.070313 -4.664063 6.074219 -4.179688 L 6.074219 -2.714844 C 6.070313 -1.691406 6.09375 -1.046875 6.144531 -0.777344 C 6.1875 -0.503906 6.28125 -0.246094 6.421875 0 L 5.273438 0 C 5.15625 -0.226563 5.082031 -0.492188 5.054688 -0.800781 Z M 4.960938 -3.253906 C 4.558594 -3.085938 3.960938 -2.949219 3.167969 -2.839844 C 2.714844 -2.773438 2.394531 -2.699219 2.210938 -2.617188 C 2.019531 -2.535156 1.875 -2.417969 1.777344 -2.261719 C 1.671875 -2.105469 1.621094 -1.929688 1.625 -1.738281 C 1.621094 -1.445313 1.734375 -1.203125 1.957031 -1.007813 C 2.175781 -0.8125 2.5 -0.714844 2.929688 -0.714844 C 3.351563 -0.714844 3.726563 -0.804688 4.058594 -0.992188 C 4.386719 -1.171875 4.628906 -1.425781 4.785156 -1.75 C 4.898438 -1.996094 4.957031 -2.363281 4.960938 -2.851563 Z M 4.960938 -3.253906 "></path></symbol><symbol id="glyph0-4" overflow="visible"><path style="stroke: none" d="M 0.800781 0 L 0.800781 -8.949219 L 1.898438 -8.949219 L 1.898438 0 Z M 0.800781 0 "></path></symbol><symbol id="glyph0-5" overflow="visible"><path style="stroke: none" d=""></path></symbol><symbol id="glyph0-6" overflow="visible"><path style="stroke: none" d="M 0.929688 0 L 0.929688 -8.949219 L 2.710938 -8.949219 L 4.828125 -2.613281 C 5.023438 -2.019531 5.164063 -1.578125 5.253906 -1.289063 C 5.351563 -1.613281 5.511719 -2.089844 5.730469 -2.722656 L 7.875 -8.949219 L 9.464844 -8.949219 L 9.464844 0 L 8.324219 0 L 8.324219 -7.488281 L 5.726563 0 L 4.65625 0 L 2.070313 -7.617188 L 2.070313 0 Z M 0.929688 0 "></path></symbol><symbol id="glyph0-7" overflow="visible"><path style="stroke: none" d="M 5.261719 -2.085938 L 6.398438 -1.945313 C 6.21875 -1.28125 5.886719 -0.765625 5.402344 -0.402344 C 4.917969 -0.0351563 4.296875 0.144531 3.546875 0.148438 C 2.59375 0.144531 1.84375 -0.144531 1.289063 -0.726563 C 0.734375 -1.3125 0.457031 -2.132813 0.457031 -3.1875 C 0.457031 -4.273438 0.734375 -5.117188 1.296875 -5.722656 C 1.855469 -6.324219 2.585938 -6.625 3.484375 -6.628906 C 4.347656 -6.625 5.054688 -6.332031 5.609375 -5.742188 C 6.15625 -5.152344 6.433594 -4.320313 6.433594 -3.253906 C 6.433594 -3.183594 6.429688 -3.085938 6.425781 -2.960938 L 1.59375 -2.960938 C 1.632813 -2.242188 1.832031 -1.699219 2.195313 -1.324219 C 2.558594 -0.945313 3.011719 -0.753906 3.550781 -0.757813 C 3.953125 -0.753906 4.296875 -0.859375 4.582031 -1.074219 C 4.867188 -1.28125 5.09375 -1.621094 5.261719 -2.085938 Z M 1.652344 -3.863281 L 5.273438 -3.863281 C 5.222656 -4.402344 5.082031 -4.8125 4.859375 -5.089844 C 4.503906 -5.511719 4.050781 -5.722656 3.496094 -5.726563 C 2.992188 -5.722656 2.570313 -5.554688 2.226563 -5.21875 C 1.882813 -4.878906 1.691406 -4.425781 1.652344 -3.863281 Z M 1.652344 -3.863281 "></path></symbol><symbol id="glyph0-8" overflow="visible"><path style="stroke: none" d="M 1.023438 0 L 1.023438 -8.949219 L 7.0625 -8.949219 L 7.0625 -7.890625 L 2.210938 -7.890625 L 2.210938 -5.121094 L 6.410156 -5.121094 L 6.410156 -4.066406 L 2.210938 -4.066406 L 2.210938 0 Z M 1.023438 0 "></path></symbol><symbol id="glyph0-9" overflow="visible"><path style="stroke: none" d="M 0.824219 0 L 0.824219 -6.480469 L 1.804688 -6.480469 L 1.804688 -5.574219 C 2.007813 -5.886719 2.277344 -6.140625 2.617188 -6.335938 C 2.953125 -6.527344 3.339844 -6.625 3.773438 -6.628906 C 4.25 -6.625 4.640625 -6.527344 4.953125 -6.328125 C 5.257813 -6.128906 5.476563 -5.847656 5.601563 -5.492188 C 6.113281 -6.246094 6.78125 -6.625 7.605469 -6.628906 C 8.246094 -6.625 8.738281 -6.449219 9.085938 -6.09375 C 9.429688 -5.734375 9.601563 -5.183594 9.605469 -4.449219 L 9.605469 0 L 8.515625 0 L 8.515625 -4.082031 C 8.511719 -4.519531 8.476563 -4.835938 8.40625 -5.03125 C 8.332031 -5.222656 8.203125 -5.378906 8.019531 -5.496094 C 7.828125 -5.613281 7.609375 -5.671875 7.359375 -5.675781 C 6.902344 -5.671875 6.523438 -5.519531 6.222656 -5.21875 C 5.921875 -4.914063 5.769531 -4.429688 5.773438 -3.765625 L 5.773438 0 L 4.675781 0 L 4.675781 -4.210938 C 4.675781 -4.699219 4.585938 -5.066406 4.40625 -5.308594 C 4.226563 -5.550781 3.933594 -5.671875 3.527344 -5.675781 C 3.214844 -5.671875 2.925781 -5.589844 2.667969 -5.429688 C 2.402344 -5.265625 2.214844 -5.027344 2.097656 -4.71875 C 1.980469 -4.402344 1.921875 -3.953125 1.921875 -3.363281 L 1.921875 0 Z M 0.824219 0 "></path></symbol><symbol id="glyph0-10" overflow="visible"><path style="stroke: none" d="M 6.835938 -8.949219 L 8.019531 -8.949219 L 8.019531 -3.777344 C 8.015625 -2.875 7.914063 -2.160156 7.714844 -1.636719 C 7.507813 -1.105469 7.140625 -0.675781 6.613281 -0.34375 C 6.078125 -0.0117188 5.382813 0.152344 4.523438 0.152344 C 3.683594 0.152344 2.996094 0.0078125 2.464844 -0.28125 C 1.929688 -0.570313 1.550781 -0.988281 1.324219 -1.535156 C 1.097656 -2.082031 0.984375 -2.828125 0.984375 -3.777344 L 0.984375 -8.949219 L 2.167969 -8.949219 L 2.167969 -3.785156 C 2.167969 -3.003906 2.238281 -2.429688 2.382813 -2.066406 C 2.527344 -1.695313 2.777344 -1.410156 3.128906 -1.214844 C 3.480469 -1.011719 3.910156 -0.914063 4.417969 -0.914063 C 5.289063 -0.914063 5.910156 -1.109375 6.28125 -1.507813 C 6.648438 -1.898438 6.832031 -2.660156 6.835938 -3.785156 Z M 6.835938 -8.949219 "></path></symbol><symbol id="glyph0-11" overflow="visible"><path style="stroke: none" d="M 1.835938 0 L 0.816406 0 L 0.816406 -8.949219 L 1.917969 -8.949219 L 1.917969 -5.753906 C 2.378906 -6.335938 2.972656 -6.625 3.691406 -6.628906 C 4.089844 -6.625 4.464844 -6.546875 4.824219 -6.386719 C 5.175781 -6.222656 5.46875 -5.996094 5.703125 -5.707031 C 5.929688 -5.417969 6.109375 -5.066406 6.242188 -4.65625 C 6.367188 -4.242188 6.433594 -3.804688 6.4375 -3.339844 C 6.433594 -2.226563 6.160156 -1.367188 5.613281 -0.761719 C 5.066406 -0.15625 4.40625 0.144531 3.636719 0.148438 C 2.871094 0.144531 2.269531 -0.171875 1.835938 -0.8125 Z M 1.824219 -3.289063 C 1.820313 -2.507813 1.925781 -1.949219 2.140625 -1.605469 C 2.484375 -1.039063 2.953125 -0.753906 3.546875 -0.757813 C 4.023438 -0.753906 4.4375 -0.964844 4.789063 -1.382813 C 5.136719 -1.796875 5.3125 -2.417969 5.316406 -3.246094 C 5.3125 -4.089844 5.144531 -4.714844 4.8125 -5.121094 C 4.472656 -5.523438 4.066406 -5.722656 3.59375 -5.726563 C 3.109375 -5.722656 2.695313 -5.515625 2.347656 -5.097656 C 1.996094 -4.679688 1.820313 -4.074219 1.824219 -3.289063 Z M 1.824219 -3.289063 "></path></symbol><symbol id="glyph0-12" overflow="visible"><path style="stroke: none" d="M 0.824219 0 L 0.824219 -6.480469 L 1.8125 -6.480469 L 1.8125 -5.558594 C 2.285156 -6.269531 2.972656 -6.625 3.875 -6.628906 C 4.261719 -6.625 4.621094 -6.554688 4.953125 -6.417969 C 5.277344 -6.273438 5.523438 -6.089844 5.6875 -5.863281 C 5.847656 -5.632813 5.960938 -5.363281 6.03125 -5.054688 C 6.066406 -4.847656 6.085938 -4.492188 6.089844 -3.984375 L 6.089844 0 L 4.992188 0 L 4.992188 -3.941406 C 4.992188 -4.386719 4.949219 -4.722656 4.863281 -4.945313 C 4.777344 -5.167969 4.625 -5.34375 4.40625 -5.476563 C 4.1875 -5.605469 3.933594 -5.671875 3.644531 -5.675781 C 3.175781 -5.671875 2.769531 -5.523438 2.429688 -5.230469 C 2.089844 -4.929688 1.921875 -4.367188 1.921875 -3.539063 L 1.921875 0 Z M 0.824219 0 "></path></symbol><symbol id="glyph0-13" overflow="visible"><path style="stroke: none" d="M 0.519531 -2.34375 L 1.671875 -2.441406 C 1.753906 -1.875 1.953125 -1.453125 2.265625 -1.171875 C 2.574219 -0.890625 2.949219 -0.75 3.394531 -0.75 C 3.917969 -0.75 4.367188 -0.949219 4.734375 -1.347656 C 5.101563 -1.746094 5.285156 -2.273438 5.285156 -2.9375 C 5.285156 -3.558594 5.109375 -4.054688 4.757813 -4.417969 C 4.40625 -4.777344 3.945313 -4.957031 3.375 -4.960938 C 3.019531 -4.957031 2.699219 -4.875 2.414063 -4.71875 C 2.128906 -4.554688 1.90625 -4.347656 1.746094 -4.09375 L 0.714844 -4.230469 L 1.582031 -8.824219 L 6.03125 -8.824219 L 6.03125 -7.777344 L 2.460938 -7.777344 L 1.976563 -5.371094 C 2.507813 -5.742188 3.074219 -5.929688 3.667969 -5.933594 C 4.449219 -5.929688 5.105469 -5.660156 5.644531 -5.121094 C 6.179688 -4.578125 6.449219 -3.882813 6.453125 -3.035156 C 6.449219 -2.222656 6.214844 -1.519531 5.742188 -0.933594 C 5.167969 -0.207031 4.382813 0.152344 3.394531 0.152344 C 2.574219 0.152344 1.910156 -0.0742188 1.398438 -0.53125 C 0.882813 -0.984375 0.589844 -1.589844 0.519531 -2.34375 Z M 0.519531 -2.34375 "></path></symbol><symbol id="glyph0-14" overflow="visible"><path style="stroke: none" d="M 0.519531 -4.414063 C 0.515625 -5.46875 0.625 -6.320313 0.84375 -6.964844 C 1.0625 -7.609375 1.386719 -8.105469 1.816406 -8.457031 C 2.246094 -8.804688 2.785156 -8.980469 3.4375 -8.984375 C 3.914063 -8.980469 4.335938 -8.886719 4.699219 -8.695313 C 5.058594 -8.5 5.355469 -8.21875 5.59375 -7.859375 C 5.828125 -7.492188 6.015625 -7.050781 6.152344 -6.527344 C 6.285156 -6.003906 6.351563 -5.296875 6.355469 -4.414063 C 6.351563 -3.359375 6.242188 -2.511719 6.03125 -1.871094 C 5.8125 -1.222656 5.492188 -0.726563 5.0625 -0.375 C 4.632813 -0.0234375 4.089844 0.152344 3.4375 0.152344 C 2.570313 0.152344 1.890625 -0.15625 1.402344 -0.773438 C 0.808594 -1.515625 0.515625 -2.726563 0.519531 -4.414063 Z M 1.648438 -4.414063 C 1.644531 -2.941406 1.816406 -1.964844 2.164063 -1.480469 C 2.503906 -0.992188 2.929688 -0.75 3.4375 -0.75 C 3.9375 -0.75 4.359375 -0.992188 4.707031 -1.480469 C 5.050781 -1.96875 5.226563 -2.945313 5.226563 -4.414063 C 5.226563 -5.882813 5.050781 -6.863281 4.707031 -7.347656 C 4.359375 -7.832031 3.933594 -8.074219 3.425781 -8.074219 C 2.917969 -8.074219 2.515625 -7.859375 2.214844 -7.433594 C 1.835938 -6.886719 1.644531 -5.878906 1.648438 -4.414063 Z M 1.648438 -4.414063 "></path></symbol><symbol id="glyph0-15" overflow="visible"><path style="stroke: none" d="M 0.398438 -2.6875 L 0.398438 -3.789063 L 3.773438 -3.789063 L 3.773438 -2.6875 Z M 0.398438 -2.6875 "></path></symbol><symbol id="glyph0-16" overflow="visible"><path style="stroke: none" d="M 4.039063 0 L 4.039063 -2.140625 L 0.160156 -2.140625 L 0.160156 -3.148438 L 4.242188 -8.949219 L 5.140625 -8.949219 L 5.140625 -3.148438 L 6.347656 -3.148438 L 6.347656 -2.140625 L 5.140625 -2.140625 L 5.140625 0 Z M 4.039063 -3.148438 L 4.039063 -7.183594 L 1.238281 -3.148438 Z M 4.039063 -3.148438 "></path></symbol><symbol id="glyph0-17" overflow="visible"><path style="stroke: none" d="M 0.683594 -2.070313 L 1.738281 -2.167969 C 1.828125 -1.667969 2 -1.304688 2.25 -1.085938 C 2.5 -0.859375 2.824219 -0.75 3.222656 -0.75 C 3.558594 -0.75 3.851563 -0.824219 4.109375 -0.980469 C 4.359375 -1.132813 4.570313 -1.339844 4.734375 -1.601563 C 4.898438 -1.855469 5.035156 -2.207031 5.144531 -2.648438 C 5.253906 -3.085938 5.308594 -3.53125 5.308594 -3.992188 C 5.308594 -4.039063 5.304688 -4.113281 5.304688 -4.210938 C 5.078125 -3.859375 4.777344 -3.574219 4.402344 -3.359375 C 4.019531 -3.140625 3.609375 -3.035156 3.167969 -3.035156 C 2.425781 -3.035156 1.800781 -3.300781 1.289063 -3.839844 C 0.773438 -4.371094 0.515625 -5.082031 0.519531 -5.964844 C 0.515625 -6.871094 0.78125 -7.597656 1.320313 -8.152344 C 1.851563 -8.703125 2.523438 -8.980469 3.332031 -8.984375 C 3.914063 -8.980469 4.445313 -8.824219 4.929688 -8.511719 C 5.40625 -8.195313 5.773438 -7.75 6.027344 -7.171875 C 6.273438 -6.59375 6.398438 -5.753906 6.402344 -4.65625 C 6.398438 -3.511719 6.273438 -2.601563 6.027344 -1.925781 C 5.777344 -1.246094 5.410156 -0.730469 4.921875 -0.378906 C 4.429688 -0.0234375 3.855469 0.152344 3.199219 0.152344 C 2.496094 0.152344 1.921875 -0.0390625 1.480469 -0.429688 C 1.035156 -0.8125 0.769531 -1.359375 0.683594 -2.070313 Z M 5.183594 -6.019531 C 5.179688 -6.644531 5.011719 -7.144531 4.679688 -7.519531 C 4.339844 -7.886719 3.9375 -8.074219 3.46875 -8.074219 C 2.976563 -8.074219 2.550781 -7.875 2.191406 -7.476563 C 1.828125 -7.078125 1.644531 -6.558594 1.648438 -5.925781 C 1.644531 -5.351563 1.816406 -4.890625 2.164063 -4.535156 C 2.503906 -4.179688 2.929688 -4 3.4375 -4.003906 C 3.941406 -4 4.359375 -4.179688 4.691406 -4.535156 C 5.015625 -4.890625 5.179688 -5.382813 5.183594 -6.019531 Z M 5.183594 -6.019531 "></path></symbol><symbol id="glyph0-18" overflow="visible"><path style="stroke: none" d="M 6.21875 -6.757813 L 5.125 -6.671875 C 5.027344 -7.097656 4.890625 -7.410156 4.710938 -7.609375 C 4.414063 -7.921875 4.046875 -8.078125 3.613281 -8.082031 C 3.261719 -8.078125 2.953125 -7.980469 2.691406 -7.789063 C 2.339844 -7.53125 2.066406 -7.164063 1.871094 -6.683594 C 1.667969 -6.195313 1.566406 -5.503906 1.5625 -4.613281 C 1.824219 -5.011719 2.148438 -5.3125 2.53125 -5.511719 C 2.914063 -5.703125 3.3125 -5.800781 3.734375 -5.804688 C 4.464844 -5.800781 5.089844 -5.53125 5.605469 -4.996094 C 6.117188 -4.453125 6.375 -3.757813 6.378906 -2.90625 C 6.375 -2.34375 6.253906 -1.820313 6.015625 -1.339844 C 5.769531 -0.855469 5.4375 -0.484375 5.015625 -0.230469 C 4.59375 0.0273438 4.113281 0.152344 3.578125 0.152344 C 2.660156 0.152344 1.914063 -0.183594 1.335938 -0.855469 C 0.757813 -1.527344 0.46875 -2.636719 0.46875 -4.1875 C 0.46875 -5.914063 0.789063 -7.171875 1.429688 -7.960938 C 1.984375 -8.640625 2.734375 -8.980469 3.679688 -8.984375 C 4.382813 -8.980469 4.957031 -8.785156 5.410156 -8.390625 C 5.855469 -7.996094 6.125 -7.449219 6.21875 -6.757813 Z M 1.734375 -2.898438 C 1.734375 -2.519531 1.8125 -2.15625 1.972656 -1.8125 C 2.132813 -1.460938 2.359375 -1.199219 2.648438 -1.019531 C 2.9375 -0.839844 3.238281 -0.75 3.558594 -0.75 C 4.019531 -0.75 4.417969 -0.9375 4.753906 -1.3125 C 5.082031 -1.6875 5.25 -2.195313 5.253906 -2.839844 C 5.25 -3.453125 5.085938 -3.941406 4.757813 -4.300781 C 4.429688 -4.65625 4.015625 -4.832031 3.515625 -4.835938 C 3.015625 -4.832031 2.59375 -4.65625 2.25 -4.300781 C 1.90625 -3.941406 1.734375 -3.472656 1.734375 -2.898438 Z M 1.734375 -2.898438 "></path></symbol><symbol id="glyph0-19" overflow="visible"><path style="stroke: none" d="M 0.59375 -7.777344 L 0.59375 -8.832031 L 6.382813 -8.832031 L 6.382813 -7.976563 C 5.8125 -7.367188 5.25 -6.5625 4.691406 -5.558594 C 4.128906 -4.554688 3.695313 -3.523438 3.394531 -2.460938 C 3.167969 -1.710938 3.027344 -0.890625 2.972656 0 L 1.84375 0 C 1.855469 -0.703125 1.992188 -1.550781 2.257813 -2.550781 C 2.519531 -3.542969 2.898438 -4.503906 3.394531 -5.433594 C 3.886719 -6.355469 4.414063 -7.136719 4.972656 -7.777344 Z M 0.59375 -7.777344 "></path></symbol><symbol id="glyph0-20" overflow="visible"><path style="stroke: none" d="M 6.292969 -1.054688 L 6.292969 0 L 0.378906 0 C 0.367188 -0.265625 0.410156 -0.519531 0.507813 -0.761719 C 0.65625 -1.164063 0.898438 -1.558594 1.230469 -1.953125 C 1.558594 -2.339844 2.035156 -2.792969 2.667969 -3.308594 C 3.636719 -4.101563 4.292969 -4.734375 4.636719 -5.203125 C 4.976563 -5.667969 5.148438 -6.105469 5.152344 -6.523438 C 5.148438 -6.957031 4.992188 -7.324219 4.683594 -7.625 C 4.371094 -7.921875 3.96875 -8.074219 3.46875 -8.074219 C 2.9375 -8.074219 2.511719 -7.914063 2.195313 -7.597656 C 1.878906 -7.277344 1.71875 -6.839844 1.714844 -6.28125 L 0.585938 -6.398438 C 0.664063 -7.238281 0.953125 -7.878906 1.457031 -8.320313 C 1.960938 -8.761719 2.640625 -8.980469 3.492188 -8.984375 C 4.347656 -8.980469 5.023438 -8.742188 5.527344 -8.269531 C 6.027344 -7.789063 6.28125 -7.199219 6.28125 -6.5 C 6.28125 -6.140625 6.207031 -5.789063 6.058594 -5.445313 C 5.910156 -5.09375 5.664063 -4.730469 5.328125 -4.351563 C 4.984375 -3.964844 4.421875 -3.441406 3.636719 -2.777344 C 2.976563 -2.222656 2.554688 -1.84375 2.367188 -1.648438 C 2.179688 -1.449219 2.023438 -1.253906 1.90625 -1.054688 Z M 6.292969 -1.054688 "></path></symbol><symbol id="glyph0-21" overflow="visible"><path style="stroke: none" d="M 2.210938 -4.851563 C 1.75 -5.015625 1.414063 -5.253906 1.195313 -5.566406 C 0.976563 -5.875 0.867188 -6.242188 0.867188 -6.675781 C 0.867188 -7.324219 1.097656 -7.871094 1.566406 -8.316406 C 2.03125 -8.757813 2.65625 -8.980469 3.4375 -8.984375 C 4.214844 -8.980469 4.84375 -8.753906 5.320313 -8.304688 C 5.796875 -7.847656 6.035156 -7.296875 6.035156 -6.648438 C 6.035156 -6.230469 5.925781 -5.867188 5.707031 -5.5625 C 5.488281 -5.25 5.15625 -5.015625 4.71875 -4.851563 C 5.265625 -4.671875 5.683594 -4.382813 5.972656 -3.984375 C 6.253906 -3.585938 6.398438 -3.109375 6.402344 -2.558594 C 6.398438 -1.789063 6.128906 -1.144531 5.589844 -0.628906 C 5.046875 -0.105469 4.332031 0.152344 3.453125 0.152344 C 2.566406 0.152344 1.855469 -0.105469 1.316406 -0.628906 C 0.773438 -1.148438 0.503906 -1.800781 0.507813 -2.585938 C 0.503906 -3.164063 0.652344 -3.652344 0.949219 -4.050781 C 1.242188 -4.441406 1.660156 -4.710938 2.210938 -4.851563 Z M 1.988281 -6.714844 C 1.984375 -6.289063 2.121094 -5.941406 2.398438 -5.675781 C 2.667969 -5.40625 3.023438 -5.273438 3.460938 -5.273438 C 3.878906 -5.273438 4.226563 -5.40625 4.5 -5.671875 C 4.769531 -5.9375 4.902344 -6.261719 4.90625 -6.652344 C 4.902344 -7.050781 4.765625 -7.390625 4.488281 -7.667969 C 4.207031 -7.941406 3.859375 -8.078125 3.449219 -8.082031 C 3.027344 -8.078125 2.679688 -7.945313 2.402344 -7.675781 C 2.125 -7.40625 1.984375 -7.085938 1.988281 -6.714844 Z M 1.636719 -2.582031 C 1.632813 -2.265625 1.707031 -1.960938 1.859375 -1.671875 C 2.003906 -1.375 2.226563 -1.148438 2.519531 -0.992188 C 2.8125 -0.828125 3.128906 -0.75 3.46875 -0.75 C 3.992188 -0.75 4.421875 -0.917969 4.765625 -1.257813 C 5.105469 -1.59375 5.277344 -2.023438 5.28125 -2.546875 C 5.277344 -3.074219 5.101563 -3.511719 4.75 -3.855469 C 4.394531 -4.199219 3.953125 -4.371094 3.429688 -4.375 C 2.910156 -4.371094 2.484375 -4.199219 2.144531 -3.863281 C 1.804688 -3.519531 1.632813 -3.09375 1.636719 -2.582031 Z M 1.636719 -2.582031 "></path></symbol><symbol id="glyph0-22" overflow="visible"><path style="stroke: none" d="M 4.65625 0 L 3.558594 0 L 3.558594 -7 C 3.289063 -6.746094 2.941406 -6.492188 2.515625 -6.242188 C 2.085938 -5.988281 1.703125 -5.800781 1.359375 -5.675781 L 1.359375 -6.738281 C 1.972656 -7.027344 2.507813 -7.375 2.972656 -7.789063 C 3.429688 -8.195313 3.757813 -8.59375 3.949219 -8.984375 L 4.65625 -8.984375 Z M 4.65625 0 "></path></symbol><symbol id="glyph1-0" overflow="visible"><path style="stroke: none" d="M 1.078125 -10.664063 L 5.011719 -10.664063 C 5.894531 -10.664063 6.574219 -10.59375 7.042969 -10.460938 C 7.667969 -10.273438 8.203125 -9.945313 8.648438 -9.476563 C 9.09375 -9.003906 9.433594 -8.429688 9.667969 -7.75 C 9.902344 -7.066406 10.019531 -6.226563 10.019531 -5.230469 C 10.019531 -4.351563 9.910156 -3.59375 9.691406 -2.960938 C 9.421875 -2.179688 9.039063 -1.554688 8.546875 -1.078125 C 8.171875 -0.710938 7.667969 -0.425781 7.035156 -0.226563 C 6.558594 -0.0742188 5.921875 0 5.128906 0 L 1.078125 0 Z M 3.230469 -8.863281 L 3.230469 -1.796875 L 4.839844 -1.796875 C 5.441406 -1.792969 5.875 -1.828125 6.140625 -1.898438 C 6.488281 -1.984375 6.777344 -2.132813 7.007813 -2.34375 C 7.238281 -2.550781 7.425781 -2.890625 7.574219 -3.371094 C 7.71875 -3.847656 7.792969 -4.5 7.792969 -5.324219 C 7.792969 -6.148438 7.71875 -6.78125 7.574219 -7.222656 C 7.425781 -7.664063 7.222656 -8.007813 6.960938 -8.257813 C 6.699219 -8.5 6.367188 -8.667969 5.964844 -8.757813 C 5.664063 -8.824219 5.074219 -8.859375 4.199219 -8.863281 Z M 3.230469 -8.863281 "></path></symbol><symbol id="glyph1-1" overflow="visible"><path style="stroke: none" d="M 5.542969 -2.460938 L 7.582031 -2.117188 C 7.316406 -1.367188 6.902344 -0.800781 6.339844 -0.410156 C 5.773438 -0.0195313 5.066406 0.175781 4.21875 0.175781 C 2.875 0.175781 1.878906 -0.261719 1.238281 -1.140625 C 0.722656 -1.839844 0.46875 -2.726563 0.472656 -3.804688 C 0.46875 -5.082031 0.804688 -6.085938 1.476563 -6.8125 C 2.144531 -7.535156 2.988281 -7.898438 4.015625 -7.902344 C 5.164063 -7.898438 6.074219 -7.519531 6.738281 -6.761719 C 7.402344 -6.003906 7.71875 -4.839844 7.691406 -3.273438 L 2.566406 -3.273438 C 2.582031 -2.664063 2.746094 -2.191406 3.0625 -1.855469 C 3.375 -1.515625 3.769531 -1.347656 4.242188 -1.351563 C 4.5625 -1.347656 4.828125 -1.433594 5.046875 -1.613281 C 5.261719 -1.785156 5.429688 -2.070313 5.542969 -2.460938 Z M 5.660156 -4.523438 C 5.644531 -5.117188 5.488281 -5.566406 5.199219 -5.875 C 4.90625 -6.179688 4.554688 -6.332031 4.140625 -6.335938 C 3.691406 -6.332031 3.324219 -6.171875 3.035156 -5.847656 C 2.742188 -5.523438 2.597656 -5.082031 2.605469 -4.523438 Z M 5.660156 -4.523438 "></path></symbol><symbol id="glyph1-2" overflow="visible"><path style="stroke: none" d="M 2.597656 -5.371094 L 0.742188 -5.703125 C 0.949219 -6.445313 1.308594 -7 1.816406 -7.363281 C 2.324219 -7.71875 3.082031 -7.898438 4.089844 -7.902344 C 5 -7.898438 5.675781 -7.789063 6.125 -7.578125 C 6.570313 -7.359375 6.886719 -7.085938 7.066406 -6.753906 C 7.246094 -6.421875 7.335938 -5.8125 7.339844 -4.925781 L 7.320313 -2.539063 C 7.316406 -1.855469 7.351563 -1.355469 7.417969 -1.035156 C 7.480469 -0.710938 7.601563 -0.367188 7.785156 0 L 5.761719 0 C 5.707031 -0.132813 5.644531 -0.332031 5.566406 -0.605469 C 5.53125 -0.722656 5.503906 -0.804688 5.492188 -0.84375 C 5.140625 -0.503906 4.769531 -0.246094 4.371094 -0.078125 C 3.972656 0.09375 3.546875 0.175781 3.097656 0.175781 C 2.300781 0.175781 1.675781 -0.0390625 1.21875 -0.472656 C 0.757813 -0.902344 0.527344 -1.449219 0.53125 -2.109375 C 0.527344 -2.546875 0.632813 -2.933594 0.84375 -3.277344 C 1.050781 -3.613281 1.339844 -3.875 1.71875 -4.0625 C 2.09375 -4.242188 2.636719 -4.402344 3.347656 -4.539063 C 4.300781 -4.714844 4.964844 -4.882813 5.332031 -5.042969 L 5.332031 -5.246094 C 5.332031 -5.636719 5.234375 -5.917969 5.039063 -6.085938 C 4.84375 -6.25 4.476563 -6.332031 3.941406 -6.335938 C 3.578125 -6.332031 3.292969 -6.261719 3.089844 -6.121094 C 2.882813 -5.976563 2.71875 -5.726563 2.597656 -5.371094 Z M 5.332031 -3.710938 C 5.070313 -3.617188 4.65625 -3.511719 4.089844 -3.394531 C 3.519531 -3.269531 3.148438 -3.152344 2.976563 -3.042969 C 2.707031 -2.847656 2.570313 -2.609375 2.574219 -2.320313 C 2.570313 -2.03125 2.679688 -1.78125 2.894531 -1.578125 C 3.105469 -1.367188 3.375 -1.265625 3.710938 -1.265625 C 4.074219 -1.265625 4.425781 -1.386719 4.765625 -1.628906 C 5.007813 -1.8125 5.171875 -2.035156 5.253906 -2.304688 C 5.304688 -2.476563 5.332031 -2.8125 5.332031 -3.304688 Z M 5.332031 -3.710938 "></path></symbol><symbol id="glyph1-3" overflow="visible"><path style="stroke: none" d="M 4.613281 -7.726563 L 4.613281 -6.097656 L 3.214844 -6.097656 L 3.214844 -2.984375 C 3.210938 -2.351563 3.222656 -1.984375 3.253906 -1.878906 C 3.277344 -1.773438 3.339844 -1.6875 3.4375 -1.621094 C 3.527344 -1.550781 3.640625 -1.515625 3.78125 -1.519531 C 3.96875 -1.515625 4.246094 -1.582031 4.605469 -1.71875 L 4.78125 -0.132813 C 4.304688 0.0742188 3.765625 0.175781 3.164063 0.175781 C 2.796875 0.175781 2.464844 0.117188 2.167969 -0.0078125 C 1.871094 -0.128906 1.652344 -0.289063 1.515625 -0.488281 C 1.375 -0.683594 1.28125 -0.953125 1.230469 -1.289063 C 1.183594 -1.523438 1.160156 -2 1.164063 -2.726563 L 1.164063 -6.097656 L 0.226563 -6.097656 L 0.226563 -7.726563 L 1.164063 -7.726563 L 1.164063 -9.261719 L 3.214844 -10.453125 L 3.214844 -7.726563 Z M 4.613281 -7.726563 "></path></symbol><symbol id="glyph1-4" overflow="visible"><path style="stroke: none" d="M 3.105469 -10.664063 L 3.105469 -6.746094 C 3.765625 -7.511719 4.554688 -7.898438 5.472656 -7.902344 C 5.941406 -7.898438 6.363281 -7.8125 6.742188 -7.640625 C 7.121094 -7.464844 7.40625 -7.238281 7.597656 -6.96875 C 7.789063 -6.695313 7.921875 -6.394531 7.992188 -6.066406 C 8.0625 -5.734375 8.097656 -5.222656 8.097656 -4.53125 L 8.097656 0 L 6.054688 0 L 6.054688 -4.082031 C 6.050781 -4.890625 6.011719 -5.40625 5.9375 -5.625 C 5.855469 -5.84375 5.71875 -6.015625 5.523438 -6.144531 C 5.324219 -6.269531 5.078125 -6.332031 4.789063 -6.335938 C 4.445313 -6.332031 4.140625 -6.25 3.875 -6.089844 C 3.605469 -5.921875 3.410156 -5.675781 3.289063 -5.34375 C 3.164063 -5.007813 3.105469 -4.515625 3.105469 -3.871094 L 3.105469 0 L 1.0625 0 L 1.0625 -10.664063 Z M 3.105469 -10.664063 "></path></symbol><symbol id="glyph1-5" overflow="visible"><path style="stroke: none" d=""></path></symbol><symbol id="glyph1-6" overflow="visible"><path style="stroke: none" d="M 1.089844 0 L 1.089844 -10.664063 L 5.625 -10.664063 C 6.761719 -10.664063 7.585938 -10.566406 8.105469 -10.375 C 8.621094 -10.183594 9.035156 -9.84375 9.347656 -9.355469 C 9.65625 -8.863281 9.8125 -8.304688 9.816406 -7.675781 C 9.8125 -6.875 9.578125 -6.210938 9.109375 -5.691406 C 8.636719 -5.167969 7.933594 -4.839844 7 -4.707031 C 7.464844 -4.433594 7.847656 -4.136719 8.152344 -3.8125 C 8.449219 -3.484375 8.859375 -2.90625 9.378906 -2.082031 L 10.679688 0 L 8.105469 0 L 6.546875 -2.320313 C 5.992188 -3.148438 5.613281 -3.667969 5.410156 -3.886719 C 5.203125 -4.097656 4.988281 -4.246094 4.761719 -4.332031 C 4.53125 -4.410156 4.171875 -4.453125 3.679688 -4.453125 L 3.246094 -4.453125 L 3.246094 0 Z M 3.246094 -6.15625 L 4.839844 -6.15625 C 5.871094 -6.152344 6.515625 -6.195313 6.773438 -6.285156 C 7.03125 -6.371094 7.230469 -6.523438 7.375 -6.738281 C 7.519531 -6.949219 7.59375 -7.214844 7.59375 -7.539063 C 7.59375 -7.894531 7.496094 -8.183594 7.304688 -8.40625 C 7.113281 -8.625 6.84375 -8.765625 6.496094 -8.824219 C 6.320313 -8.847656 5.796875 -8.859375 4.925781 -8.863281 L 3.246094 -8.863281 Z M 3.246094 -6.15625 "></path></symbol><symbol id="glyph1-7" overflow="visible"><path style="stroke: none" d="M 0.347656 -2.203125 L 2.402344 -2.515625 C 2.488281 -2.117188 2.664063 -1.816406 2.929688 -1.609375 C 3.195313 -1.402344 3.566406 -1.300781 4.050781 -1.300781 C 4.574219 -1.300781 4.972656 -1.398438 5.246094 -1.59375 C 5.421875 -1.726563 5.511719 -1.90625 5.515625 -2.140625 C 5.511719 -2.289063 5.464844 -2.417969 5.371094 -2.523438 C 5.265625 -2.621094 5.035156 -2.710938 4.683594 -2.792969 C 3.03125 -3.15625 1.988281 -3.488281 1.550781 -3.789063 C 0.9375 -4.207031 0.632813 -4.785156 0.632813 -5.527344 C 0.632813 -6.195313 0.894531 -6.761719 1.425781 -7.21875 C 1.949219 -7.671875 2.769531 -7.898438 3.886719 -7.902344 C 4.941406 -7.898438 5.726563 -7.726563 6.242188 -7.382813 C 6.75 -7.039063 7.105469 -6.527344 7.304688 -5.855469 L 5.375 -5.5 C 5.289063 -5.800781 5.132813 -6.03125 4.90625 -6.191406 C 4.671875 -6.347656 4.34375 -6.425781 3.921875 -6.429688 C 3.378906 -6.425781 2.996094 -6.351563 2.765625 -6.207031 C 2.609375 -6.097656 2.53125 -5.960938 2.53125 -5.792969 C 2.53125 -5.644531 2.597656 -5.519531 2.734375 -5.421875 C 2.917969 -5.28125 3.554688 -5.089844 4.644531 -4.84375 C 5.730469 -4.59375 6.492188 -4.292969 6.925781 -3.9375 C 7.351563 -3.570313 7.5625 -3.0625 7.566406 -2.414063 C 7.5625 -1.703125 7.269531 -1.09375 6.679688 -0.585938 C 6.085938 -0.078125 5.207031 0.175781 4.050781 0.175781 C 2.996094 0.175781 2.164063 -0.0351563 1.550781 -0.464844 C 0.9375 -0.886719 0.535156 -1.46875 0.347656 -2.203125 Z M 0.347656 -2.203125 "></path></symbol><symbol id="glyph1-8" overflow="visible"><path style="stroke: none" d="M 1.070313 -8.773438 L 1.070313 -10.664063 L 3.113281 -10.664063 L 3.113281 -8.773438 Z M 1.070313 0 L 1.070313 -7.726563 L 3.113281 -7.726563 L 3.113281 0 Z M 1.070313 0 "></path></symbol><symbol id="glyph1-9" overflow="visible"><path style="stroke: none" d="M 8.097656 0 L 6.054688 0 L 6.054688 -3.941406 C 6.050781 -4.773438 6.007813 -5.3125 5.921875 -5.5625 C 5.832031 -5.804688 5.691406 -5.996094 5.496094 -6.132813 C 5.300781 -6.265625 5.0625 -6.332031 4.789063 -6.335938 C 4.429688 -6.332031 4.113281 -6.234375 3.835938 -6.042969 C 3.550781 -5.847656 3.355469 -5.59375 3.253906 -5.273438 C 3.144531 -4.953125 3.09375 -4.359375 3.097656 -3.5 L 3.097656 0 L 1.054688 0 L 1.054688 -7.726563 L 2.953125 -7.726563 L 2.953125 -6.589844 C 3.625 -7.460938 4.472656 -7.898438 5.5 -7.902344 C 5.949219 -7.898438 6.359375 -7.816406 6.734375 -7.65625 C 7.105469 -7.492188 7.390625 -7.285156 7.582031 -7.035156 C 7.773438 -6.78125 7.90625 -6.496094 7.984375 -6.175781 C 8.058594 -5.855469 8.097656 -5.394531 8.097656 -4.800781 Z M 8.097656 0 "></path></symbol><symbol id="glyph1-10" overflow="visible"><path style="stroke: none" d="M 3.804688 0 L -0.0078125 -10.664063 L 2.328125 -10.664063 L 5.027344 -2.773438 L 7.640625 -10.664063 L 9.921875 -10.664063 L 6.105469 0 Z M 3.804688 0 "></path></symbol><symbol id="glyph1-11" overflow="visible"><path style="stroke: none" d="M 3.027344 0 L 0.980469 0 L 0.980469 -7.726563 L 2.882813 -7.726563 L 2.882813 -6.628906 C 3.203125 -7.144531 3.492188 -7.488281 3.757813 -7.652344 C 4.015625 -7.816406 4.3125 -7.898438 4.640625 -7.902344 C 5.105469 -7.898438 5.554688 -7.769531 5.988281 -7.515625 L 5.355469 -5.734375 C 5.011719 -5.953125 4.691406 -6.0625 4.394531 -6.066406 C 4.105469 -6.0625 3.859375 -5.984375 3.664063 -5.828125 C 3.460938 -5.667969 3.304688 -5.382813 3.195313 -4.976563 C 3.078125 -4.5625 3.023438 -3.699219 3.027344 -2.386719 Z M 3.027344 0 "></path></symbol><symbol id="glyph1-12" overflow="visible"><path style="stroke: none" d="M 0.878906 0.507813 L 3.214844 0.792969 C 3.25 1.058594 3.339844 1.246094 3.484375 1.351563 C 3.675781 1.496094 3.980469 1.570313 4.402344 1.570313 C 4.933594 1.570313 5.335938 1.488281 5.601563 1.332031 C 5.78125 1.222656 5.914063 1.050781 6.007813 0.816406 C 6.070313 0.640625 6.105469 0.332031 6.105469 -0.125 L 6.105469 -1.25 C 5.492188 -0.414063 4.71875 0 3.789063 0 C 2.75 0 1.929688 -0.4375 1.324219 -1.316406 C 0.847656 -2.007813 0.609375 -2.871094 0.609375 -3.90625 C 0.609375 -5.199219 0.917969 -6.1875 1.542969 -6.875 C 2.164063 -7.554688 2.941406 -7.898438 3.871094 -7.902344 C 4.824219 -7.898438 5.613281 -7.476563 6.234375 -6.640625 L 6.234375 -7.726563 L 8.148438 -7.726563 L 8.148438 -0.792969 C 8.144531 0.121094 8.070313 0.796875 7.921875 1.25 C 7.773438 1.699219 7.5625 2.054688 7.289063 2.3125 C 7.015625 2.566406 6.652344 2.769531 6.203125 2.917969 C 5.746094 3.0625 5.171875 3.132813 4.480469 3.136719 C 3.167969 3.132813 2.238281 2.910156 1.691406 2.460938 C 1.140625 2.011719 0.867188 1.441406 0.871094 0.757813 C 0.867188 0.6875 0.871094 0.605469 0.878906 0.507813 Z M 2.707031 -4.023438 C 2.707031 -3.199219 2.863281 -2.597656 3.183594 -2.222656 C 3.496094 -1.839844 3.890625 -1.652344 4.359375 -1.652344 C 4.855469 -1.652344 5.273438 -1.847656 5.621094 -2.238281 C 5.964844 -2.628906 6.140625 -3.207031 6.140625 -3.972656 C 6.140625 -4.769531 5.972656 -5.363281 5.644531 -5.753906 C 5.3125 -6.140625 4.898438 -6.332031 4.394531 -6.335938 C 3.902344 -6.332031 3.496094 -6.144531 3.183594 -5.765625 C 2.863281 -5.382813 2.707031 -4.800781 2.707031 -4.023438 Z M 2.707031 -4.023438 "></path></symbol><symbol id="glyph1-13" overflow="visible"><path style="stroke: none" d="M 0.835938 -2.84375 L 0.835938 -4.890625 L 4.851563 -4.890625 L 4.851563 -2.84375 Z M 0.835938 -2.84375 "></path></symbol><symbol id="glyph1-14" overflow="visible"><path style="stroke: none" d="M 5.863281 0 L 3.820313 0 L 3.820313 -7.703125 C 3.070313 -7.003906 2.1875 -6.488281 1.179688 -6.15625 L 1.179688 -8.011719 C 1.710938 -8.183594 2.292969 -8.515625 2.917969 -9.003906 C 3.542969 -9.488281 3.972656 -10.058594 4.207031 -10.710938 L 5.863281 -10.710938 Z M 5.863281 0 "></path></symbol><symbol id="glyph1-15" overflow="visible"><path style="stroke: none" d="M 0.675781 -2.464844 L 2.65625 -2.683594 C 2.699219 -2.28125 2.824219 -1.980469 3.03125 -1.789063 C 3.234375 -1.59375 3.503906 -1.5 3.839844 -1.5 C 4.257813 -1.5 4.617188 -1.691406 4.917969 -2.082031 C 5.210938 -2.464844 5.402344 -3.269531 5.484375 -4.496094 C 4.96875 -3.894531 4.324219 -3.597656 3.558594 -3.601563 C 2.714844 -3.597656 1.992188 -3.921875 1.386719 -4.570313 C 0.773438 -5.21875 0.46875 -6.0625 0.472656 -7.101563 C 0.46875 -8.179688 0.789063 -9.050781 1.4375 -9.714844 C 2.078125 -10.378906 2.898438 -10.710938 3.890625 -10.710938 C 4.972656 -10.710938 5.859375 -10.289063 6.554688 -9.453125 C 7.246094 -8.613281 7.59375 -7.238281 7.59375 -5.324219 C 7.59375 -3.375 7.230469 -1.96875 6.507813 -1.105469 C 5.785156 -0.242188 4.84375 0.1875 3.6875 0.1875 C 2.851563 0.1875 2.179688 -0.03125 1.664063 -0.476563 C 1.148438 -0.914063 0.816406 -1.578125 0.675781 -2.464844 Z M 5.304688 -6.933594 C 5.300781 -7.589844 5.148438 -8.101563 4.847656 -8.46875 C 4.542969 -8.828125 4.195313 -9.011719 3.796875 -9.015625 C 3.417969 -9.011719 3.101563 -8.863281 2.855469 -8.566406 C 2.601563 -8.269531 2.476563 -7.78125 2.480469 -7.101563 C 2.476563 -6.410156 2.613281 -5.902344 2.886719 -5.582031 C 3.15625 -5.257813 3.496094 -5.097656 3.90625 -5.101563 C 4.296875 -5.097656 4.628906 -5.253906 4.898438 -5.566406 C 5.167969 -5.875 5.300781 -6.328125 5.304688 -6.933594 Z M 5.304688 -6.933594 "></path></symbol><symbol id="glyph1-16" overflow="visible"><path style="stroke: none" d="M 4.640625 0 L 4.640625 -2.144531 L 0.277344 -2.144531 L 0.277344 -3.9375 L 4.902344 -10.710938 L 6.621094 -10.710938 L 6.621094 -3.941406 L 7.945313 -3.941406 L 7.945313 -2.144531 L 6.621094 -2.144531 L 6.621094 0 Z M 4.640625 -3.941406 L 4.640625 -7.589844 L 2.191406 -3.941406 Z M 4.640625 -3.941406 "></path></symbol><symbol id="glyph1-17" overflow="visible"><path style="stroke: none" d="M 4.089844 -10.710938 C 5.121094 -10.710938 5.925781 -10.339844 6.511719 -9.601563 C 7.199219 -8.726563 7.546875 -7.28125 7.550781 -5.261719 C 7.546875 -3.242188 7.199219 -1.789063 6.503906 -0.910156 C 5.925781 -0.179688 5.121094 0.179688 4.089844 0.183594 C 3.050781 0.179688 2.210938 -0.214844 1.578125 -1.011719 C 0.9375 -1.808594 0.621094 -3.230469 0.625 -5.28125 C 0.621094 -7.285156 0.96875 -8.730469 1.671875 -9.617188 C 2.246094 -10.34375 3.054688 -10.710938 4.089844 -10.710938 Z M 4.089844 -9.015625 C 3.839844 -9.011719 3.617188 -8.933594 3.425781 -8.777344 C 3.230469 -8.621094 3.082031 -8.335938 2.976563 -7.929688 C 2.835938 -7.398438 2.765625 -6.511719 2.765625 -5.261719 C 2.765625 -4.007813 2.828125 -3.144531 2.953125 -2.679688 C 3.078125 -2.210938 3.234375 -1.902344 3.429688 -1.746094 C 3.617188 -1.589844 3.839844 -1.511719 4.089844 -1.511719 C 4.335938 -1.511719 4.554688 -1.589844 4.75 -1.746094 C 4.941406 -1.902344 5.09375 -2.183594 5.203125 -2.597656 C 5.34375 -3.117188 5.414063 -4.007813 5.414063 -5.261719 C 5.414063 -6.511719 5.347656 -7.371094 5.222656 -7.839844 C 5.09375 -8.308594 4.9375 -8.621094 4.746094 -8.777344 C 4.554688 -8.933594 4.335938 -9.011719 4.089844 -9.015625 Z M 4.089844 -9.015625 "></path></symbol></g><clippath id="clip1"><path d="M 145.4375 59.039063 L 402.757813 59.039063 L 402.757813 359.558594 L 145.4375 359.558594 Z M 145.4375 59.039063 "></path></clippath></defs><g id="surface46"><rect style="stroke: none; fill: rgb(100%,100%,100%); fill-opacity: 1" height="432" width="432" y="0" x="0"></rect><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="353.050781" x="59.039063" xlink:href="#glyph0-0"></use><use y="353.050781" x="68.066162" xlink:href="#glyph0-1"></use><use y="353.050781" x="75.018066" xlink:href="#glyph0-2"></use><use y="353.050781" x="79.180664" xlink:href="#glyph0-3"></use><use y="353.050781" x="86.132568" xlink:href="#glyph0-4"></use><use y="353.050781" x="88.909668" xlink:href="#glyph0-5"></use><use y="353.050781" x="92.382568" xlink:href="#glyph0-6"></use><use y="353.050781" x="102.795166" xlink:href="#glyph0-3"></use><use y="353.050781" x="109.74707" xlink:href="#glyph0-4"></use><use y="353.050781" x="112.52417" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="343.066406" x="59.039063" xlink:href="#glyph0-0"></use><use y="343.066406" x="68.066162" xlink:href="#glyph0-1"></use><use y="343.066406" x="75.018066" xlink:href="#glyph0-2"></use><use y="343.066406" x="79.180664" xlink:href="#glyph0-3"></use><use y="343.066406" x="86.132568" xlink:href="#glyph0-4"></use><use y="343.066406" x="88.909668" xlink:href="#glyph0-5"></use><use y="343.066406" x="92.382568" xlink:href="#glyph0-8"></use><use y="343.066406" x="100.018066" xlink:href="#glyph0-7"></use><use y="343.066406" x="106.969971" xlink:href="#glyph0-9"></use><use y="343.066406" x="117.382568" xlink:href="#glyph0-3"></use><use y="343.066406" x="124.334473" xlink:href="#glyph0-4"></use><use y="343.066406" x="127.111572" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="333.082031" x="59.039063" xlink:href="#glyph0-10"></use><use y="333.082031" x="68.066162" xlink:href="#glyph0-2"></use><use y="333.082031" x="72.22876" xlink:href="#glyph0-11"></use><use y="333.082031" x="79.180664" xlink:href="#glyph0-3"></use><use y="333.082031" x="86.132568" xlink:href="#glyph0-12"></use><use y="333.082031" x="93.084473" xlink:href="#glyph0-5"></use><use y="333.082031" x="96.557373" xlink:href="#glyph0-6"></use><use y="333.082031" x="106.969971" xlink:href="#glyph0-3"></use><use y="333.082031" x="113.921875" xlink:href="#glyph0-4"></use><use y="333.082031" x="116.698975" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="323.097656" x="59.039063" xlink:href="#glyph0-10"></use><use y="323.097656" x="68.066162" xlink:href="#glyph0-2"></use><use y="323.097656" x="72.22876" xlink:href="#glyph0-11"></use><use y="323.097656" x="79.180664" xlink:href="#glyph0-3"></use><use y="323.097656" x="86.132568" xlink:href="#glyph0-12"></use><use y="323.097656" x="93.084473" xlink:href="#glyph0-5"></use><use y="323.097656" x="96.557373" xlink:href="#glyph0-8"></use><use y="323.097656" x="104.192871" xlink:href="#glyph0-7"></use><use y="323.097656" x="111.144775" xlink:href="#glyph0-9"></use><use y="323.097656" x="121.557373" xlink:href="#glyph0-3"></use><use y="323.097656" x="128.509277" xlink:href="#glyph0-4"></use><use y="323.097656" x="131.286377" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="293.144531" x="59.039063" xlink:href="#glyph0-0"></use><use y="293.144531" x="68.066162" xlink:href="#glyph0-1"></use><use y="293.144531" x="75.018066" xlink:href="#glyph0-2"></use><use y="293.144531" x="79.180664" xlink:href="#glyph0-3"></use><use y="293.144531" x="86.132568" xlink:href="#glyph0-4"></use><use y="293.144531" x="88.909668" xlink:href="#glyph0-5"></use><use y="293.144531" x="92.382568" xlink:href="#glyph0-6"></use><use y="293.144531" x="102.795166" xlink:href="#glyph0-3"></use><use y="293.144531" x="109.74707" xlink:href="#glyph0-4"></use><use y="293.144531" x="112.52417" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="283.160156" x="59.039063" xlink:href="#glyph0-0"></use><use y="283.160156" x="68.066162" xlink:href="#glyph0-1"></use><use y="283.160156" x="75.018066" xlink:href="#glyph0-2"></use><use y="283.160156" x="79.180664" xlink:href="#glyph0-3"></use><use y="283.160156" x="86.132568" xlink:href="#glyph0-4"></use><use y="283.160156" x="88.909668" xlink:href="#glyph0-5"></use><use y="283.160156" x="92.382568" xlink:href="#glyph0-8"></use><use y="283.160156" x="100.018066" xlink:href="#glyph0-7"></use><use y="283.160156" x="106.969971" xlink:href="#glyph0-9"></use><use y="283.160156" x="117.382568" xlink:href="#glyph0-3"></use><use y="283.160156" x="124.334473" xlink:href="#glyph0-4"></use><use y="283.160156" x="127.111572" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="273.179688" x="59.039063" xlink:href="#glyph0-10"></use><use y="273.179688" x="68.066162" xlink:href="#glyph0-2"></use><use y="273.179688" x="72.22876" xlink:href="#glyph0-11"></use><use y="273.179688" x="79.180664" xlink:href="#glyph0-3"></use><use y="273.179688" x="86.132568" xlink:href="#glyph0-12"></use><use y="273.179688" x="93.084473" xlink:href="#glyph0-5"></use><use y="273.179688" x="96.557373" xlink:href="#glyph0-6"></use><use y="273.179688" x="106.969971" xlink:href="#glyph0-3"></use><use y="273.179688" x="113.921875" xlink:href="#glyph0-4"></use><use y="273.179688" x="116.698975" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="263.195313" x="59.039063" xlink:href="#glyph0-10"></use><use y="263.195313" x="68.066162" xlink:href="#glyph0-2"></use><use y="263.195313" x="72.22876" xlink:href="#glyph0-11"></use><use y="263.195313" x="79.180664" xlink:href="#glyph0-3"></use><use y="263.195313" x="86.132568" xlink:href="#glyph0-12"></use><use y="263.195313" x="93.084473" xlink:href="#glyph0-5"></use><use y="263.195313" x="96.557373" xlink:href="#glyph0-8"></use><use y="263.195313" x="104.192871" xlink:href="#glyph0-7"></use><use y="263.195313" x="111.144775" xlink:href="#glyph0-9"></use><use y="263.195313" x="121.557373" xlink:href="#glyph0-3"></use><use y="263.195313" x="128.509277" xlink:href="#glyph0-4"></use><use y="263.195313" x="131.286377" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="233.242188" x="59.039063" xlink:href="#glyph0-0"></use><use y="233.242188" x="68.066162" xlink:href="#glyph0-1"></use><use y="233.242188" x="75.018066" xlink:href="#glyph0-2"></use><use y="233.242188" x="79.180664" xlink:href="#glyph0-3"></use><use y="233.242188" x="86.132568" xlink:href="#glyph0-4"></use><use y="233.242188" x="88.909668" xlink:href="#glyph0-5"></use><use y="233.242188" x="92.382568" xlink:href="#glyph0-6"></use><use y="233.242188" x="102.795166" xlink:href="#glyph0-3"></use><use y="233.242188" x="109.74707" xlink:href="#glyph0-4"></use><use y="233.242188" x="112.52417" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="223.257813" x="59.039063" xlink:href="#glyph0-0"></use><use y="223.257813" x="68.066162" xlink:href="#glyph0-1"></use><use y="223.257813" x="75.018066" xlink:href="#glyph0-2"></use><use y="223.257813" x="79.180664" xlink:href="#glyph0-3"></use><use y="223.257813" x="86.132568" xlink:href="#glyph0-4"></use><use y="223.257813" x="88.909668" xlink:href="#glyph0-5"></use><use y="223.257813" x="92.382568" xlink:href="#glyph0-8"></use><use y="223.257813" x="100.018066" xlink:href="#glyph0-7"></use><use y="223.257813" x="106.969971" xlink:href="#glyph0-9"></use><use y="223.257813" x="117.382568" xlink:href="#glyph0-3"></use><use y="223.257813" x="124.334473" xlink:href="#glyph0-4"></use><use y="223.257813" x="127.111572" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="213.273438" x="59.039063" xlink:href="#glyph0-10"></use><use y="213.273438" x="68.066162" xlink:href="#glyph0-2"></use><use y="213.273438" x="72.22876" xlink:href="#glyph0-11"></use><use y="213.273438" x="79.180664" xlink:href="#glyph0-3"></use><use y="213.273438" x="86.132568" xlink:href="#glyph0-12"></use><use y="213.273438" x="93.084473" xlink:href="#glyph0-5"></use><use y="213.273438" x="96.557373" xlink:href="#glyph0-6"></use><use y="213.273438" x="106.969971" xlink:href="#glyph0-3"></use><use y="213.273438" x="113.921875" xlink:href="#glyph0-4"></use><use y="213.273438" x="116.698975" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="203.289063" x="59.039063" xlink:href="#glyph0-10"></use><use y="203.289063" x="68.066162" xlink:href="#glyph0-2"></use><use y="203.289063" x="72.22876" xlink:href="#glyph0-11"></use><use y="203.289063" x="79.180664" xlink:href="#glyph0-3"></use><use y="203.289063" x="86.132568" xlink:href="#glyph0-12"></use><use y="203.289063" x="93.084473" xlink:href="#glyph0-5"></use><use y="203.289063" x="96.557373" xlink:href="#glyph0-8"></use><use y="203.289063" x="104.192871" xlink:href="#glyph0-7"></use><use y="203.289063" x="111.144775" xlink:href="#glyph0-9"></use><use y="203.289063" x="121.557373" xlink:href="#glyph0-3"></use><use y="203.289063" x="128.509277" xlink:href="#glyph0-4"></use><use y="203.289063" x="131.286377" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="173.335938" x="59.039063" xlink:href="#glyph0-0"></use><use y="173.335938" x="68.066162" xlink:href="#glyph0-1"></use><use y="173.335938" x="75.018066" xlink:href="#glyph0-2"></use><use y="173.335938" x="79.180664" xlink:href="#glyph0-3"></use><use y="173.335938" x="86.132568" xlink:href="#glyph0-4"></use><use y="173.335938" x="88.909668" xlink:href="#glyph0-5"></use><use y="173.335938" x="92.382568" xlink:href="#glyph0-6"></use><use y="173.335938" x="102.795166" xlink:href="#glyph0-3"></use><use y="173.335938" x="109.74707" xlink:href="#glyph0-4"></use><use y="173.335938" x="112.52417" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="163.355469" x="59.039063" xlink:href="#glyph0-0"></use><use y="163.355469" x="68.066162" xlink:href="#glyph0-1"></use><use y="163.355469" x="75.018066" xlink:href="#glyph0-2"></use><use y="163.355469" x="79.180664" xlink:href="#glyph0-3"></use><use y="163.355469" x="86.132568" xlink:href="#glyph0-4"></use><use y="163.355469" x="88.909668" xlink:href="#glyph0-5"></use><use y="163.355469" x="92.382568" xlink:href="#glyph0-8"></use><use y="163.355469" x="100.018066" xlink:href="#glyph0-7"></use><use y="163.355469" x="106.969971" xlink:href="#glyph0-9"></use><use y="163.355469" x="117.382568" xlink:href="#glyph0-3"></use><use y="163.355469" x="124.334473" xlink:href="#glyph0-4"></use><use y="163.355469" x="127.111572" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="153.371094" x="59.039063" xlink:href="#glyph0-10"></use><use y="153.371094" x="68.066162" xlink:href="#glyph0-2"></use><use y="153.371094" x="72.22876" xlink:href="#glyph0-11"></use><use y="153.371094" x="79.180664" xlink:href="#glyph0-3"></use><use y="153.371094" x="86.132568" xlink:href="#glyph0-12"></use><use y="153.371094" x="93.084473" xlink:href="#glyph0-5"></use><use y="153.371094" x="96.557373" xlink:href="#glyph0-6"></use><use y="153.371094" x="106.969971" xlink:href="#glyph0-3"></use><use y="153.371094" x="113.921875" xlink:href="#glyph0-4"></use><use y="153.371094" x="116.698975" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="143.386719" x="59.039063" xlink:href="#glyph0-10"></use><use y="143.386719" x="68.066162" xlink:href="#glyph0-2"></use><use y="143.386719" x="72.22876" xlink:href="#glyph0-11"></use><use y="143.386719" x="79.180664" xlink:href="#glyph0-3"></use><use y="143.386719" x="86.132568" xlink:href="#glyph0-12"></use><use y="143.386719" x="93.084473" xlink:href="#glyph0-5"></use><use y="143.386719" x="96.557373" xlink:href="#glyph0-8"></use><use y="143.386719" x="104.192871" xlink:href="#glyph0-7"></use><use y="143.386719" x="111.144775" xlink:href="#glyph0-9"></use><use y="143.386719" x="121.557373" xlink:href="#glyph0-3"></use><use y="143.386719" x="128.509277" xlink:href="#glyph0-4"></use><use y="143.386719" x="131.286377" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="113.433594" x="59.039063" xlink:href="#glyph0-0"></use><use y="113.433594" x="68.066162" xlink:href="#glyph0-1"></use><use y="113.433594" x="75.018066" xlink:href="#glyph0-2"></use><use y="113.433594" x="79.180664" xlink:href="#glyph0-3"></use><use y="113.433594" x="86.132568" xlink:href="#glyph0-4"></use><use y="113.433594" x="88.909668" xlink:href="#glyph0-5"></use><use y="113.433594" x="92.382568" xlink:href="#glyph0-6"></use><use y="113.433594" x="102.795166" xlink:href="#glyph0-3"></use><use y="113.433594" x="109.74707" xlink:href="#glyph0-4"></use><use y="113.433594" x="112.52417" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="103.449219" x="59.039063" xlink:href="#glyph0-0"></use><use y="103.449219" x="68.066162" xlink:href="#glyph0-1"></use><use y="103.449219" x="75.018066" xlink:href="#glyph0-2"></use><use y="103.449219" x="79.180664" xlink:href="#glyph0-3"></use><use y="103.449219" x="86.132568" xlink:href="#glyph0-4"></use><use y="103.449219" x="88.909668" xlink:href="#glyph0-5"></use><use y="103.449219" x="92.382568" xlink:href="#glyph0-8"></use><use y="103.449219" x="100.018066" xlink:href="#glyph0-7"></use><use y="103.449219" x="106.969971" xlink:href="#glyph0-9"></use><use y="103.449219" x="117.382568" xlink:href="#glyph0-3"></use><use y="103.449219" x="124.334473" xlink:href="#glyph0-4"></use><use y="103.449219" x="127.111572" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="93.464844" x="59.039063" xlink:href="#glyph0-10"></use><use y="93.464844" x="68.066162" xlink:href="#glyph0-2"></use><use y="93.464844" x="72.22876" xlink:href="#glyph0-11"></use><use y="93.464844" x="79.180664" xlink:href="#glyph0-3"></use><use y="93.464844" x="86.132568" xlink:href="#glyph0-12"></use><use y="93.464844" x="93.084473" xlink:href="#glyph0-5"></use><use y="93.464844" x="96.557373" xlink:href="#glyph0-6"></use><use y="93.464844" x="106.969971" xlink:href="#glyph0-3"></use><use y="93.464844" x="113.921875" xlink:href="#glyph0-4"></use><use y="93.464844" x="116.698975" xlink:href="#glyph0-7"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="83.480469" x="59.039063" xlink:href="#glyph0-10"></use><use y="83.480469" x="68.066162" xlink:href="#glyph0-2"></use><use y="83.480469" x="72.22876" xlink:href="#glyph0-11"></use><use y="83.480469" x="79.180664" xlink:href="#glyph0-3"></use><use y="83.480469" x="86.132568" xlink:href="#glyph0-12"></use><use y="83.480469" x="93.084473" xlink:href="#glyph0-5"></use><use y="83.480469" x="96.557373" xlink:href="#glyph0-8"></use><use y="83.480469" x="104.192871" xlink:href="#glyph0-7"></use><use y="83.480469" x="111.144775" xlink:href="#glyph0-9"></use><use y="83.480469" x="121.557373" xlink:href="#glyph0-3"></use><use y="83.480469" x="128.509277" xlink:href="#glyph0-4"></use><use y="83.480469" x="131.286377" xlink:href="#glyph0-7"></use></g><g clip-rule="nonzero" clip-path="url(#clip1)"><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 348.574219 L 401.761719 348.574219 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 338.59375 L 401.761719 338.59375 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 328.609375 L 401.761719 328.609375 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 318.625 L 401.761719 318.625 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 288.671875 L 401.761719 288.671875 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 278.6875 L 401.761719 278.6875 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 268.703125 L 401.761719 268.703125 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 258.71875 L 401.761719 258.71875 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 228.769531 L 401.761719 228.769531 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 218.785156 L 401.761719 218.785156 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 208.800781 L 401.761719 208.800781 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 198.816406 L 401.761719 198.816406 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 168.863281 L 401.761719 168.863281 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 158.878906 L 401.761719 158.878906 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 148.894531 L 401.761719 148.894531 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 138.910156 L 401.761719 138.910156 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 108.960938 L 401.761719 108.960938 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 98.976563 L 401.761719 98.976563 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 88.992188 L 401.761719 88.992188 "></path><path style="stroke: rgb(74.509804%,74.509804%,74.509804%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-dasharray: 1,3; stroke-miterlimit: 10" d="M 145.4375 79.007813 L 401.761719 79.007813 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 314.773438 348.574219 C 314.773438 352.84375 308.375 352.84375 308.375 348.574219 C 308.375 344.308594 314.773438 344.308594 314.773438 348.574219 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 287.003906 338.59375 C 287.003906 342.859375 280.605469 342.859375 280.605469 338.59375 C 280.605469 334.324219 287.003906 334.324219 287.003906 338.59375 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 326.878906 328.609375 C 326.878906 332.875 320.476563 332.875 320.476563 328.609375 C 320.476563 324.339844 326.878906 324.339844 326.878906 328.609375 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 276.800781 318.625 C 276.800781 322.890625 270.398438 322.890625 270.398438 318.625 C 270.398438 314.355469 276.800781 314.355469 276.800781 318.625 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 255.441406 288.671875 C 255.441406 292.9375 249.039063 292.9375 249.039063 288.671875 C 249.039063 284.40625 255.441406 284.40625 255.441406 288.671875 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 231.46875 278.6875 C 231.46875 282.953125 225.070313 282.953125 225.070313 278.6875 C 225.070313 274.421875 231.46875 274.421875 231.46875 278.6875 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 287.71875 268.703125 C 287.71875 272.96875 281.316406 272.96875 281.316406 268.703125 C 281.316406 264.4375 287.71875 264.4375 287.71875 268.703125 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 241.4375 258.71875 C 241.4375 262.988281 235.035156 262.988281 235.035156 258.71875 C 235.035156 254.453125 241.4375 254.453125 241.4375 258.71875 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 221.976563 228.769531 C 221.976563 233.035156 215.574219 233.035156 215.574219 228.769531 C 215.574219 224.5 221.976563 224.5 221.976563 228.769531 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 206.3125 218.785156 C 206.3125 223.050781 199.910156 223.050781 199.910156 218.785156 C 199.910156 214.515625 206.3125 214.515625 206.3125 218.785156 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 245.945313 208.800781 C 245.945313 213.066406 239.546875 213.066406 239.546875 208.800781 C 239.546875 204.535156 245.945313 204.535156 245.945313 208.800781 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 203.9375 198.816406 C 203.9375 203.082031 197.539063 203.082031 197.539063 198.816406 C 197.539063 194.550781 203.9375 194.550781 203.9375 198.816406 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 201.089844 168.863281 C 201.089844 173.128906 194.691406 173.128906 194.691406 168.863281 C 194.691406 164.597656 201.089844 164.597656 201.089844 168.863281 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 185.902344 158.878906 C 185.902344 163.148438 179.5 163.148438 179.5 158.878906 C 179.5 154.613281 185.902344 154.613281 185.902344 158.878906 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 215.804688 148.894531 C 215.804688 153.164063 209.40625 153.164063 209.40625 148.894531 C 209.40625 144.628906 215.804688 144.628906 215.804688 148.894531 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 190.410156 138.910156 C 190.410156 143.179688 184.011719 143.179688 184.011719 138.910156 C 184.011719 134.644531 190.410156 134.644531 190.410156 138.910156 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 185.902344 108.960938 C 185.902344 113.226563 179.5 113.226563 179.5 108.960938 C 179.5 104.691406 185.902344 104.691406 185.902344 108.960938 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 178.78125 98.976563 C 178.78125 103.242188 172.378906 103.242188 172.378906 98.976563 C 172.378906 94.710938 178.78125 94.710938 178.78125 98.976563 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 194.683594 88.992188 C 194.683594 93.257813 188.28125 93.257813 188.28125 88.992188 C 188.28125 84.726563 194.683594 84.726563 194.683594 88.992188 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 178.070313 79.007813 C 178.070313 83.273438 171.667969 83.273438 171.667969 79.007813 C 171.667969 74.742188 178.070313 74.742188 178.070313 79.007813 "></path></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="73.496094" x="44.640625" xlink:href="#glyph0-13"></use><use y="73.496094" x="51.592529" xlink:href="#glyph0-14"></use><use y="73.496094" x="58.544434" xlink:href="#glyph0-15"></use><use y="73.496094" x="62.707031" xlink:href="#glyph0-13"></use><use y="73.496094" x="69.658936" xlink:href="#glyph0-16"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="133.402344" x="44.640625" xlink:href="#glyph0-13"></use><use y="133.402344" x="51.592529" xlink:href="#glyph0-13"></use><use y="133.402344" x="58.544434" xlink:href="#glyph0-15"></use><use y="133.402344" x="62.707031" xlink:href="#glyph0-13"></use><use y="133.402344" x="69.658936" xlink:href="#glyph0-17"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="193.304688" x="44.640625" xlink:href="#glyph0-18"></use><use y="193.304688" x="51.592529" xlink:href="#glyph0-14"></use><use y="193.304688" x="58.544434" xlink:href="#glyph0-15"></use><use y="193.304688" x="62.707031" xlink:href="#glyph0-18"></use><use y="193.304688" x="69.658936" xlink:href="#glyph0-16"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="253.210938" x="44.640625" xlink:href="#glyph0-18"></use><use y="253.210938" x="51.592529" xlink:href="#glyph0-13"></use><use y="253.210938" x="58.544434" xlink:href="#glyph0-15"></use><use y="253.210938" x="62.707031" xlink:href="#glyph0-18"></use><use y="253.210938" x="69.658936" xlink:href="#glyph0-17"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="313.113281" x="44.640625" xlink:href="#glyph0-19"></use><use y="313.113281" x="51.592529" xlink:href="#glyph0-14"></use><use y="313.113281" x="58.544434" xlink:href="#glyph0-15"></use><use y="313.113281" x="62.707031" xlink:href="#glyph0-19"></use><use y="313.113281" x="69.658936" xlink:href="#glyph0-16"></use></g><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 154.933594 358.558594 L 392.265625 358.558594 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 154.933594 358.558594 L 154.933594 365.761719 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 202.398438 358.558594 L 202.398438 365.761719 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 249.867188 358.558594 L 249.867188 365.761719 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 297.332031 358.558594 L 297.332031 365.761719 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 344.800781 358.558594 L 344.800781 365.761719 "></path><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 392.265625 358.558594 L 392.265625 365.761719 "></path><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="385.921875" x="151.457031" xlink:href="#glyph0-14"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="385.921875" x="195.445313" xlink:href="#glyph0-20"></use><use y="385.921875" x="202.397217" xlink:href="#glyph0-14"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="385.921875" x="242.914063" xlink:href="#glyph0-16"></use><use y="385.921875" x="249.865967" xlink:href="#glyph0-14"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="385.921875" x="290.378906" xlink:href="#glyph0-18"></use><use y="385.921875" x="297.330811" xlink:href="#glyph0-14"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="385.921875" x="337.847656" xlink:href="#glyph0-21"></use><use y="385.921875" x="344.799561" xlink:href="#glyph0-14"></use></g><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="385.921875" x="381.835938" xlink:href="#glyph0-22"></use><use y="385.921875" x="388.787842" xlink:href="#glyph0-14"></use><use y="385.921875" x="395.739746" xlink:href="#glyph0-14"></use></g><path style="stroke: rgb(0%,0%,0%); fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 1; stroke-miterlimit: 10" d="M 145.4375 358.558594 L 401.761719 358.558594 L 401.761719 59.039063 L 145.4375 59.039063 L 145.4375 358.558594 "></path><g style="fill: rgb(0%,0%,0%); fill-opacity: 1"><use y="34.851563" x="169.265625" xlink:href="#glyph1-0"></use><use y="34.851563" x="180.025928" xlink:href="#glyph1-1"></use><use y="34.851563" x="188.312598" xlink:href="#glyph1-2"></use><use y="34.851563" x="196.599268" xlink:href="#glyph1-3"></use><use y="34.851563" x="201.561084" xlink:href="#glyph1-4"></use><use y="34.851563" x="210.662598" xlink:href="#glyph1-5"></use><use y="34.851563" x="214.802295" xlink:href="#glyph1-6"></use><use y="34.851563" x="225.562598" xlink:href="#glyph1-2"></use><use y="34.851563" x="233.849268" xlink:href="#glyph1-3"></use><use y="34.851563" x="238.811084" xlink:href="#glyph1-1"></use><use y="34.851563" x="247.097754" xlink:href="#glyph1-7"></use><use y="34.851563" x="255.384424" xlink:href="#glyph1-5"></use><use y="34.851563" x="259.524121" xlink:href="#glyph1-8"></use><use y="34.851563" x="263.663818" xlink:href="#glyph1-9"></use><use y="34.851563" x="272.765332" xlink:href="#glyph1-5"></use><use y="34.851563" x="276.905029" xlink:href="#glyph1-10"></use><use y="34.851563" x="286.843213" xlink:href="#glyph1-8"></use><use y="34.851563" x="290.98291" xlink:href="#glyph1-11"></use><use y="34.851563" x="296.781396" xlink:href="#glyph1-12"></use><use y="34.851563" x="305.88291" xlink:href="#glyph1-8"></use><use y="34.851563" x="310.022607" xlink:href="#glyph1-9"></use><use y="34.851563" x="319.124121" xlink:href="#glyph1-8"></use><use y="34.851563" x="323.263818" xlink:href="#glyph1-2"></use><use y="34.851563" x="331.550488" xlink:href="#glyph1-5"></use><use y="34.851563" x="335.690186" xlink:href="#glyph1-13"></use><use y="34.851563" x="340.652002" xlink:href="#glyph1-5"></use><use y="34.851563" x="344.791699" xlink:href="#glyph1-14"></use><use y="34.851563" x="353.078369" xlink:href="#glyph1-15"></use><use y="34.851563" x="361.365039" xlink:href="#glyph1-16"></use><use y="34.851563" x="369.651709" xlink:href="#glyph1-17"></use></g></g></svg></div> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0tag:blogger.com,1999:blog-7630810606654250077.post-38441708661632691102014-10-06T19:33:00.001-07:002015-05-01T07:06:44.003-07:00Popular Mutual Funds Decomposed With Ekholm (2014)<p>While we have a foundation and momentum from the last post “<a href="http://timelyportfolio.blogspot.com/2014/10/selectionshare-timingshare-masterfully.html" target="_blank">SelectionShare & TimingShare | Masterfully Written by Delightfully Responsive Author</a>” , we can run the Ekholm calculations on some popular funds to see how they have evolved since the early 1980s. <strong>Remember these are my opinions and not investment advice. </strong>I chose these four funds for </p> <ol> <li>popularity in terms of Assets Under Management (AUM) <li>style (active) <li>tenure (old) <li>evolution ( 2 evolved in a bad way and 2 have stayed consistent in a good way ).</li></ol> <p>This will continue what I envision to be a whole series of posts experimenting with the <a href="http://ssrn.com/abstract=2463649" target="_blank">Ekholm (2014)</a> decomposition into SelectionShare and TimingShare and determining how to use it in a mutual fund selection process. Just as a reminder, below is the link to the very well-done paper by <a href="http://www.andersekholm.fi/" target="_blank">Anders Ekholm</a>.</p> <blockquote> <p>Ekholm, Anders G. <p>Components of Portfolio Variance: Systematic, Selection and Timing <p>August 8, 2014 <p><a href="http://ssrn.com/abstract=2463649">http://ssrn.com/abstract=2463649</a></p></blockquote> <p>See if you can make any conclusions after reading the paper and looking at the chart below on the 2 year rolling Ekholm decomposition of <a href="www.fpafunds.com/crescent" target="_blank"><em>FPA Crescent ® Fund</em></a> (FPACX), <a href="http://www.sequoiafund.com" target="_blank"><em>Sequoia ® Fund</em></a> (SEQUX), <em><a href="https://fundresearch.fidelity.com/mutual-funds/summary/316071109" target="_blank">Fidelity ® Contrafund ®</a></em> (FCNTX), and <a href="https://www.americanfunds.com/funds/details/gfa/a.html" target="_blank"><em>The Growth Fund of America ®</em></a> (AGTHX). <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrTUEGcMMY2pYyVg2NW-fGfRJQ8AVOCN6n5nRPw9uQ5UHgkHXq8W-I2dqVubY6SjOTMqpwGaXiVrH03G89molzEH7IR4rfU0mdHkQzq_HvMnhP_FbUQaZIHFHQZ80X_4OocjuEQK7cBA/s1600-h/image%25255B4%25255D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYbbtJTjYDw3eiC5TQQW3sDI7eTMwLMcm78TsYx9TxIGwDmKcwcsQDZZP-WAq8q9nrzSSiySJeTSlD4xbTUMuucxOyu_be3V7Vc5g-GIz9QTvLiGF6Ds0LjI3X-a3QgMAKs5deNhJd1g/?imgmax=800" width="1216" height="648"></a> <p>As always, I really would like for you to reproduce and extend. Please let me know if you do. Below is the code.</p><pre># perform Ekholm (2012,2014) analysis on some popular mutual funds<br /><br /># Ekholm, A.G., 2012<br /># Portfolio returns and manager activity:<br /># How to decompose tracking error into security selection and market timing<br /># Journal of Empirical Finance, Volume 19, pp 349-358<br /><br /># Ekholm, Anders G., July 21, 2014<br /># Components of Portfolio Variance:<br /># R2, SelectionShare and TimingShare<br /># Available at SSRN: http://ssrn.com/abstract=2463649<br /><br /><br />library(Quandl) # use to get Fama/French factors<br />library(pipeR) # pipes are the future or R<br />library(rlist) # rlist - like underscore/lodash for R lists<br />library(dplyr) # super fast and really powerful<br />library(tidyr) # next gen wide/long formatter package<br />library(latticeExtra) # old but still awesome<br />library(directlabels) # fantastic and works with ggplot & lattice<br />library(quantmod) # also will load xts<br /><br /># use Quandl Kenneth French Fama/French factors<br /># http://www.quandl.com/KFRENCH/FACTORS_D<br />f <- Quandl("KFRENCH/FACTORS_D",type = "xts") / 100<br /><br /># grab our function from post<br /># http://timelyportfolio.blogspot.com/2014/10/selectionshare-timingshare-masterfully.html<br />devtools::source_gist("e5728c8c7fb45dbdb6e0")<br /><br />tickers <- c( "FCNTX", "AGTHX", "SEQUX", "FPACX" )<br />ekFunds <- lapply(<br /> tickers<br /> ,function(ticker) {<br /> ticker %>>%<br /> getSymbols( from = "1896-01-01", auto.assign = F ) %>>%<br /> (fund ~ <br /> structure(<br /> fund[,6] / stats::lag( fund[,6], 1 ) - 1<br /> ,dimnames = list(NULL,gsub(x = colnames(fund)[6], pattern = "[\\.]Adjusted", replacement = ""))<br /> )<br /> ) %>>%<br /> merge( f ) %>>% # Quandl("KFRENCH/FACTORS_D",type = "xts") / 100<br /> na.omit %>>%<br /> rollapply (<br /> FUN= function(x){<br /> x %>>%<br /> jensen_ekholm %>>% <br /> ( data.frame( summary(.[["linmod"]])$"r.squared" , .$ekholm ) ) %>>%<br /> xts(order.by=tail(index(x),1)) -> return_df<br /> colnames(return_df)[1] <- "R_sq"<br /> return(return_df)<br /> }<br /> , width = 500<br /> #, by = 100<br /> , by.column=F<br /> , fill = NULL<br /> ) %>>%<br /> na.fill(0)<br /> }<br />)<br />names(ekFunds) <- tickers<br /><br />ekFunds %>>%<br /> list.map(<br /> {<br /> structure(<br /> data.frame(<br /> date = index(.)<br /> , fund = names(ekFunds)[.i]<br /> , .<br /> )<br /> ) %>>%<br /> gather(measure,value,-date,-fund)<br /> }<br /> ) %>>%<br /> (<br /> do.call( rbind , . )<br /> ) -> ekT<br /><br />ekT %>>%<br /> # just plot at R^2, SelectionShare, and TimingShare<br /> filter( measure %in% c("R_sq","SelectionShare","TimingShare") ) %>>%<br /> (<br /> xyplot(<br /> value ~ date | measure<br /> , groups = fund<br /> , data = .<br /> , type = "l"<br /> # using direct.label so not necessary<br /> , auto.key = list( space = "right" )<br /> # title our plot<br /> , main = paste(<br /> "Comparison of Ekholm Decomposition for Various Mutual Funds"<br /> ,paste0("2 Year Rolling since ",format(.$date[1],format="%b %d, %Y"))<br /> ,sep="\n"<br /> )<br /> # layout one on top of the other<br /> , layout = c(1,length(unique(.$measure)))<br /> )<br /> ) %>>%<br /> # I like labels on plot rather than legend<br /> directlabels::direct.label( method = "last.qp" ) %>>%<br /> # pretty it up with the latticeExtra Economist theme<br /> asTheEconomist<br /><br /></pre> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com4tag:blogger.com,1999:blog-7630810606654250077.post-34803570542569918192014-10-03T06:34:00.001-07:002014-10-03T06:34:29.580-07:00SelectionShare & TimingShare | Masterfully Written by Delightfully Responsive Author<p><a href="http://www.andersekholm.fi/" target="_blank">Anders Ekholm</a> has written a wonderful paper</p> <blockquote> <p>Ekholm, Anders G.</p> <p>Components of Portfolio Variance: Systematic, Selection and Timing</p> <p>August 8, 2014</p> <p><a href="http://ssrn.com/abstract=2463649">http://ssrn.com/abstract=2463649</a> </p></blockquote> <p>demonstrating how we might decompose a money manager’s performance with just a return stream. Since his method relies simply on the return stream, he overcomes one of the biggest challenges of the Petajisto / Cremers’ related concepts of Active Share and Tracking Error which is the lack of data due to lagged infrequent reporting and high cost. For other potential flaws in Active Share, see <a href="http://timelyportfolio.blogspot.com/2014/06/active-share-and-tracking-error-not.html" target="_blank">this post</a> summarizing some very good <a href="http://media.pimco.com/Documents/PIMCO_Quantitative_Research_Active_Share_Tracking_Error_Sapra_Hun.pdf" target="_blank">PIMCO research</a>.</p> <p>Also, fortunately for me and maybe my faithful readers, the author has been very kind and responsive helping me translate his example Excel sheet into R. Click on the screenshot below for the full details with replicable code and example with a real live mutual fund.</p> <p>Of course, this is simply the beginning of what will be a wonderful journey exploring both the simplicity and complexity of Ekholm’s brilliance.</p> <p><a href="http://timelyportfolio.github.io/rCharts_factor_analytics/ekholm_example1.html" target="_blank"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjqk543J9-b2jK2mw1XMtwpLia14w0ZRK3xJ9NLpnP1Ig6Xh2oY5nBKNrqhh_l5k4UnShCcSd0SB6N_s3hdORJjC0tlDdMUBkoKROlIlebza-JETFcPnP_wS2bnkgmBjIUzLwXAyWcyQ/?imgmax=800" width="1660" height="1125"></a></p> klrhttp://www.blogger.com/profile/08783806801212705259noreply@blogger.com0