apexcharter/docs/articles/shiny-integration.html

378 lines
152 KiB
HTML
Raw Normal View History

2020-03-20 10:17:30 +01:00
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shiny integration • apexcharter</title>
2020-05-27 16:29:28 +02:00
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="../css/theme.css" rel="stylesheet">
<style>
#pkgdown-sidebar {
z-index: 100;
background: #FFF;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- Font --><link href="../css/montserrat.css" rel="stylesheet">
2020-03-20 10:17:30 +01:00
<style>body {font-family: 'Montserrat', sans-serif;}</style>
2020-05-27 16:29:28 +02:00
<!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><!-- Particles --><script src="../js/particles.min.js"></script><style>
2020-03-20 10:17:30 +01:00
html,
body {
margin: 0;
padding: 0;
}
.contents {
opacity: 1;
background-color: #FFF;
z-index: 1;
}
#sidebar {
opacity: 1;
background-color: #FFF;
z-index: 1;
}
footer {
z-index: 1;
}
#particles {
position: fixed;
display: block;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 0;
}
.background {
position: absolute;
display: block;
top: 0;
left: 0;
z-index: 0;
}
</style>
<!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/all.min.css" integrity="sha256-nAmazAk6vS34Xqo0BSrTb+abbtFlgsFK7NKSi6o7Y78=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/v4-shims.min.css" integrity="sha256-6qHlizsOWFskGlwVOKuns+D1nB6ssZrHQrNj1wGplHc=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/headroom.min.js" integrity="sha256-DJFC1kqIhelURkuza0AvYal5RxMtpzLjFhsnVIeuk+U=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Shiny integration">
2020-04-16 17:09:40 +02:00
<meta property="og:description" content="apexcharter">
2020-03-20 10:17:30 +01:00
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="body">
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand hidden-xs hidden-sm" style="padding: 10px 15px !important;">
<img src="https://github.com/dreamRs.png" class="hidden-xs hidden-sm" style="height: 50px;display: inline;vertical-align: middle;"><a class="navbar-link" href="../index.html">apexcharter</a>
2020-08-03 10:08:02 +02:00
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.1.5.910</span>
2020-03-20 10:17:30 +01:00
</span>
<span class="navbar-brand hidden-md hidden-lg">
<a class="navbar-link" href="../index.html">apexcharter</a>
2020-08-03 10:08:02 +02:00
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.1.5.910</span>
2020-03-20 10:17:30 +01:00
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa fas fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../articles/apexcharter.html">Get started</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/articles/advanced-configuration.html">Advanced configuration examples</a>
</li>
<li>
2020-05-27 16:29:28 +02:00
<a href="../articles/chart-options.html">Chart options</a>
2020-03-20 10:17:30 +01:00
</li>
<li>
<a href="../articles/shiny-integration.html">Shiny integration</a>
</li>
2020-04-16 17:09:40 +02:00
<li>
<a href="../articles/spark-box.html">Spark boxes</a>
</li>
2020-03-20 10:17:30 +01:00
<li>
<a href="../articles/sync-charts.html">Syncing charts</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
2020-04-16 17:09:40 +02:00
<a href="https://github.com/dreamRs/apexcharter/">
2020-03-20 10:17:30 +01:00
<span class="fab fa fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
2020-08-03 10:08:02 +02:00
</header><script src="shiny-integration_files/htmlwidgets-1.5.1/htmlwidgets.js"></script><script src="shiny-integration_files/apexcharts-3.20.0/apexcharts.min.js"></script><link href="shiny-integration_files/apexcharter-css-0.1.0/apexcharter.css" rel="stylesheet">
<script src="shiny-integration_files/d3-format-1.4.2/d3-format.min.js"></script><script src="shiny-integration_files/apexcharter-binding-0.1.5.910/apexcharter.js"></script><div class="row">
2020-03-20 10:17:30 +01:00
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Shiny integration</h1>
<small class="dont-index">Source: <a href="https://github.com/dreamRs/apexcharter/blob/master/vignettes/shiny-integration.Rmd"><code>vignettes/shiny-integration.Rmd</code></a></small>
<div class="hidden name"><code>shiny-integration.Rmd</code></div>
</div>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb1"><html><body><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="no">apexcharter</span>)</pre></body></html></div>
2020-03-20 10:17:30 +01:00
<div id="charts" class="section level2">
<h2 class="hasAnchor">
<a href="#charts" class="anchor"></a>Charts</h2>
<div id="create-and-update-or-destroy-and-re-create" class="section level3">
<h3 class="hasAnchor">
<a href="#create-and-update-or-destroy-and-re-create" class="anchor"></a>Create and update (or destroy and re-create)</h3>
<p>When a graph has been generated in Shiny, if the values change (via a reactive function), the graph is <em>not regenerated</em>, only the data is <em>updated</em>. If you have changed specific options in the graphic (such as maximum y axis value, charts title, …) these will not be updated. This behavior can be controlled with <code>auto_update</code> argument (available in <code><a href="../reference/apexchart.html">apexchart()</a></code> and <code><a href="../reference/apex.html">apex()</a></code>) :</p>
<p>By default, <code>auto_update</code> is <code>TRUE</code> :</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb2"><html><body><pre class="r"><span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="no">...</span>, <span class="kw">auto_update</span> <span class="kw">=</span> <span class="fl">TRUE</span>)</pre></body></html></div>
2020-03-20 10:17:30 +01:00
<p>If you want to re-create the whole chart, set the option to <code>FALSE</code>:</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb3"><html><body><pre class="r"><span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="no">...</span>, <span class="kw">auto_update</span> <span class="kw">=</span> <span class="fl">FALSE</span>)</pre></body></html></div>
2020-03-20 10:17:30 +01:00
<p>You can also use <code><a href="../reference/config_update.html">config_update()</a></code> to specify what to update :</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb4"><html><body><pre class="r"><span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="no">...</span>, <span class="kw">auto_update</span> <span class="kw">=</span> <span class="fu"><a href="../reference/config_update.html">config_update</a></span>(<span class="kw">update_options</span> <span class="kw">=</span> <span class="fl">TRUE</span>))</pre></body></html></div>
2020-03-20 10:17:30 +01:00
</div>
<div id="proxy" class="section level3">
<h3 class="hasAnchor">
<a href="#proxy" class="anchor"></a>Proxy</h3>
<p>A proxy is also implemented to update charts manually server-side. You can update data:</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb5"><html><body><pre class="r"><span class="no">output</span>$<span class="no">my_chart</span> <span class="kw">&lt;-</span> <span class="fu"><a href="../reference/apexcharter-shiny.html">renderApexchart</a></span>({
<span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="kw">data</span> <span class="kw">=</span> <span class="fu">isolate</span>(<span class="fu">data_reactive</span>()), <span class="no">...</span>, <span class="kw">auto_update</span> <span class="kw">=</span> <span class="fl">FALSE</span>)
})
<span class="fu">observeEvent</span>(<span class="no">input</span>$<span class="no">update</span>, {
<span class="fu"><a href="../reference/apexchartProxy.html">apexchartProxy</a></span>(<span class="st">"my_chart"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/ax_proxy_series.html">ax_proxy_series</a></span>(<span class="fu">data_reactive</span>())
})</pre></body></html></div>
2020-03-20 10:17:30 +01:00
<p>Be sure to use <code><a href="https://rdrr.io/pkg/shiny/man/isolate.html">shiny::isolate()</a></code> to block any reactivity in <code>renderApexchart</code> function and to set <code>auto_update</code> to FALSE to prevent updating twice. Then you can use in an observe function (or any reactive function) <code><a href="../reference/apexchartProxy.html">apexchartProxy()</a></code> with the output id to get the chart instance and <code><a href="../reference/ax_proxy_series.html">ax_proxy_series()</a></code> to update data.</p>
<p>If you want to update charts options, use :</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb6"><html><body><pre class="r"><span class="fu">observeEvent</span>(<span class="no">input</span>$<span class="no">update</span>, {
<span class="fu"><a href="../reference/apexchartProxy.html">apexchartProxy</a></span>(<span class="st">"my_chart"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/ax_proxy_options.html">ax_proxy_options</a></span>(<span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(
<span class="kw">title</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(
<span class="kw">text</span> <span class="kw">=</span> <span class="st">"New title"</span>
),
<span class="kw">xaxis</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span>(
<span class="kw">max</span> <span class="kw">=</span> <span class="no">NEW_VALUE</span>
)
))
})</pre></body></html></div>
2020-03-20 10:17:30 +01:00
</div>
</div>
<div id="interactions" class="section level2">
<h2 class="hasAnchor">
<a href="#interactions" class="anchor"></a>Interactions</h2>
<div id="click" class="section level3">
<h3 class="hasAnchor">
<a href="#click" class="anchor"></a>Click</h3>
<p>Click on a chart to select a data point and retrieve value server side with <code><a href="../reference/set_input_click.html">set_input_click()</a></code> :</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb7"><html><body><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span>(
<span class="kw">month</span> <span class="kw">=</span> <span class="no">month.abb</span>,
<span class="kw">value</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/sample.html">sample</a></span>(<span class="fl">1</span>:<span class="fl">100</span>, <span class="fl">12</span>)
) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="fu"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="no">month</span>, <span class="no">value</span>), <span class="kw">height</span> <span class="kw">=</span> <span class="st">"250px"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/ax_title.html">ax_title</a></span>(<span class="st">"Click a bar:"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/set_input_click.html">set_input_click</a></span>(<span class="st">"click"</span>)</pre></body></html></div>
2020-08-03 10:08:02 +02:00
<div id="htmlwidget-90c299a8b681c1b69870" style="width:100%;height:250px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-90c299a8b681c1b69870">{"x":{"ax_opts":{"chart":{"type":"bar"},"series":[{"name":"value","type":"bar","data":[{"x":"Jan","y":3},{"x":"Feb","y":30},{"x":"Mar","y":88},{"x":"Apr","y":71},{"x":"May","y":34},{"x":"Jun","y":55},{"x":"Jul","y":75},{"x":"Aug","y":90},{"x":"Sep","y":25},{"x":"Oct","y":14},{"x":"Nov","y":18},{"x":"Dec","y":54}]}],"dataLabels":{"enabled":false},"plotOptions":{"bar":{"horizontal":false}},"tooltip":{"shared":true,"followCursor":true},"yaxis":{"labels":{"style":{"colors":"#848484"}}},"xaxis":{"labels":{"style":{"colors":"#848484"}}},"title":{"text":"Click a bar:"},"states":{"active":{"allowMultipleDataPointsSelection":false,"filter":{"type":"darken","value":0.35}}}},"auto_update":{"series_animate":true,"update_options":false,"options_animate":true,"options_redrawPaths":true,"update_synced_charts":false},"sparkbox":false,"shinyEvents":{"click":{"inputId":"click"}}},"evals":[],"jsHooks":[]}</script><p>Value server-side will be available through <code>input$click</code>.</p>
2020-03-20 10:17:30 +01:00
<p>Depending on the type of graphic, you can retrieve :</p>
<ul>
<li>
<strong>bar and column:</strong> category (x-axis).</li>
<li>
<strong>pie and donut:</strong> label.</li>
<li>
<strong>time-series:</strong> retrieve x-axis value, you have to display markers with size &gt; 0 and set tooltips options <code>intersect = TRUE</code> and <code>shared = FALSE</code>.</li>
<li>
<strong>scatter:</strong> retrieve XY coordinates.</li>
</ul>
<p>Multiple selection is possible and you can change the darken effect of selected bars :</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb8"><html><body><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span>(
<span class="kw">month</span> <span class="kw">=</span> <span class="no">month.abb</span>,
<span class="kw">value</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/sample.html">sample</a></span>(<span class="fl">1</span>:<span class="fl">100</span>, <span class="fl">12</span>)
) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="fu"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="no">month</span>, <span class="no">value</span>), <span class="kw">height</span> <span class="kw">=</span> <span class="st">"250px"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/ax_title.html">ax_title</a></span>(<span class="st">"Click several bars:"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/set_input_click.html">set_input_click</a></span>(
<span class="kw">inputId</span> <span class="kw">=</span> <span class="st">"click"</span>,
<span class="kw">multiple</span> <span class="kw">=</span> <span class="fl">TRUE</span>,
<span class="kw">effect_value</span> <span class="kw">=</span> <span class="fl">0.1</span>
)</pre></body></html></div>
2020-08-03 10:08:02 +02:00
<div id="htmlwidget-7d30a3562082f85c57ff" style="width:100%;height:250px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-7d30a3562082f85c57ff">{"x":{"ax_opts":{"chart":{"type":"bar"},"series":[{"name":"value","type":"bar","data":[{"x":"Jan","y":17},{"x":"Feb","y":67},{"x":"Mar","y":26},{"x":"Apr","y":41},{"x":"May","y":55},{"x":"Jun","y":2},{"x":"Jul","y":66},{"x":"Aug","y":96},{"x":"Sep","y":25},{"x":"Oct","y":49},{"x":"Nov","y":36},{"x":"Dec","y":87}]}],"dataLabels":{"enabled":false},"plotOptions":{"bar":{"horizontal":false}},"tooltip":{"shared":true,"followCursor":true},"yaxis":{"labels":{"style":{"colors":"#848484"}}},"xaxis":{"labels":{"style":{"colors":"#848484"}}},"title":{"text":"Click several bars:"},"states":{"active":{"allowMultipleDataPointsSelection":true,"filter":{"type":"darken","value":0.1}}}},"auto_update":{"series_animate":true,"update_options":false,"options_animate":true,"options_redrawPaths":true,"update_synced_charts":false},"sparkbox":false,"shinyEvents":{"click":{"inputId":"click"}}},"evals":[],"jsHooks":[]}</script><p>More examples are available with:</p>
<div class="sourceCode" id="cb9"><html><body><pre class="r"><span class="fu">run_input_demo</span>(<span class="st">"click"</span>)</pre></body></html></div>
2020-03-20 10:17:30 +01:00
</div>
<div id="zoom" class="section level3">
<h3 class="hasAnchor">
<a href="#zoom" class="anchor"></a>Zoom</h3>
<p>Retrieve the coordinates of the axes when the graph is zoomed in:</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb10"><html><body><pre class="r"><span class="fu"><a href="https://rdrr.io/r/utils/data.html">data</a></span>(<span class="st">"economics"</span>, <span class="kw">package</span> <span class="kw">=</span> <span class="st">"ggplot2"</span>)
<span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="no">economics</span>, <span class="fu"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="no">date</span>, <span class="no">psavert</span>), <span class="kw">type</span> <span class="kw">=</span> <span class="st">"line"</span>, <span class="kw">height</span> <span class="kw">=</span> <span class="st">"250px"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/set_input_zoom.html">set_input_zoom</a></span>(<span class="st">"zoom"</span>)</pre></body></html></div>
2020-08-03 10:08:02 +02:00
<div id="htmlwidget-e5294dd08ee9d3b24db9" style="width:100%;height:250px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-e5294dd08ee9d3b24db9">{"x":{"ax_opts":{"chart":{"type":"line"},"series":[{"name":"psavert","type":"line","data":[["new Date('1967-07-01').getTime()",12.6],["new Date('1967-08-01').getTime()",12.6],["new Date('1967-09-01').getTime()",11.9],["new Date('1967-10-01').getTime()",12.9],["new Date('1967-11-01').getTime()",12.8],["new Date('1967-12-01').getTime()",11.8],["new Date('1968-01-01').getTime()",11.7],["new Date('1968-02-01').getTime()",12.3],["new Date('1968-03-01').getTime()",11.7],["new Date('1968-04-01').getTime()",12.3],["new Date('1968-05-01').getTime()",12],["new Date('1968-06-01').getTime()",11.7],["new Date('1968-07-01').getTime()",10.7],["new Date('1968-08-01').getTime()",10.5],["new Date('1968-09-01').getTime()",10.6],["new Date('1968-10-01').getTime()",10.8],["new Date('1968-11-01').getTime()",10.6],["new Date('1968-12-01').getTime()",11.1],["new Date('1969-01-01').getTime()",10.3],["new Date('1969-02-01').getTime()",9.7],["new Date('1969-03-01').getTime()",10.2],["new Date('1969-04-01').getTime()",9.7],["new Date('1969-05-01').getTime()",10.1],["new Date('1969-06-01').getTime()",11.1],["new Date('1969-07-01').getTime()",11.8],["new Date('1969-08-01').getTime()",11.5],["new Date('1969-09-01').getTime()",11.6],["new Date('1969-10-01').getTime()",11.4],["new Date('1969-11-01').getTime()",11.6],["new Date('1969-12-01').getTime()",11.8],["new Date('1970-01-01').getTime()",11.8],["new Date('1970-02-01').getTime()",11.7],["new Date('1970-03-01').getTime()",12.4],["new Date('1970-04-01').getTime()",13.3],["new Date('1970-05-01').getTime()",12.4],["new Date('1970-06-01').getTime()",12.3],["new Date('1970-07-01').getTime()",13.5],["new Date('1970-08-01').getTime()",13.4],["new Date('1970-09-01').getTime()",12.9],["new Date('1970-10-01').getTime()",13.1],["new Date('1970-11-01').getTime()",13.6],["new Date('1970-12-01').getTime()",13.2],["new Date('1971-01-01').getTime()",13.3],["new Date('1971-02-01').getTime()",13.3],["new Date('1971-03-01').getTime()",13.5],["new Date('1971-04-01').getTime()",13.2],["new Date('1971-05-01').getTime()",13.6],["new Date('1971-06-01').getTime()",14.7],["new Date('1971-07-01').getTime()",13.8],["new Date('1971-08-01').getTime()",13.6],["new Date('1971-09-01').getTime()",13.3],["new Date('1971-10-01').getTime()",13.3],["new Date('1971-11-01').getTime()",13.1],["new Date('1971-12-01').getTime()",13],["new Date('1972-01-01').getTime()",12.5],["new Date('1972-02-01').getTime()",12.8],["new Date('1972-03-01').getTime()",11.8],["new Date('1972-04-01').getTime()",11.5],["new Date('1972-05-01').getTime()",11.7],["new Date('1972-06-01').getTime()",11.7],["new Date('1972-07-01').getTime()",11.7],["new Date('1972-08-01').getTime()",12],["new Date('1972-09-01').getTime()",12.2],["new Date('1972-10-01').getTime()",13],["new Date('1972-11-01').getTime()",13.6],["new Date('1972-12-01').getTime()",13.7],["new Date('1973-01-01').getTime()",12.4],["new Date('1973-02-01').getTime()",12.5],["new Date('1973-03-01').getTime()",12.7],["new Date('1973-04-01').getTime()",13.2],["new Date('1973-05-01').getTime()",13.2],["new Date('1973-06-01').getTime()",13.6],["new Date('1973-07-01').getTime()",13.2],["new Date('1973-08-01').getTime()",13.9],["new Date('1973-09-01').getTime()",13.1],["new Date('1973-10-01').getTime()",14.4],["new Date('1973-11-01').getTime()",14.4],["new Date('1973-12-01').getTime()",14.8],["new Date('1974-01-01').getTime()",14.3],["new Date('1974-02-01').getTime()",14.2],["new Date('1974-03-01').getTime()",13.4],["new Date('1974-04-01').getTime()",13.1],["new Date('1974-05-01').getTime()",12.8],["new Date('1974-06-01').getTime()",12.8],["new Date('1974-07-01').getTime()",12.8],["new Date('1974-08-01').getTime()",12.1],["new Date('1974-09-01').getTime()",12.9],["new Date('1974-10-01').getTime()",13.4],["new Date('1974-11-01').getTime()",13.8],["new Date('1974-12-01').getTime()",14],["new Date('1975-01-01').getTime()",13.2],["new Date('1975-02-01').getTime()",12.5],["new Date('1975-03-01').getTime()",12.7],["new Date('1975-04-01').getTime()"
2020-03-20 10:17:30 +01:00
<pre><code>#&gt; $x
#&gt; $x$min
#&gt; [1] "1981-10-24 15:41:16 UTC"
#&gt;
#&gt; $x$max
#&gt; [1] "1992-01-24 06:40:22 UTC"
#&gt;
#&gt;
#&gt; $y
#&gt; $y$min
#&gt; NULL
#&gt;
#&gt; $y$max
#&gt; NULL</code></pre>
<p>Here values for <code>y</code> are <code>NULL</code> because zoom is only possible on x-axis, but for a scatter chart for example you can zoom on both axis.</p>
<p>More examples are available with:</p>
2020-08-03 10:08:02 +02:00
<div class="sourceCode" id="cb12"><html><body><pre class="r"><span class="fu">run_input_demo</span>(<span class="st">"zoom"</span>)</pre></body></html></div>
2020-03-20 10:17:30 +01:00
</div>
<div id="selection" class="section level3">
<h3 class="hasAnchor">
<a href="#selection" class="anchor"></a>Selection</h3>
<p>Retrieve the coordinates of the axes when user select an area on a chart (without zooming):</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb13"><html><body><pre class="r"><span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="no">economics</span>, <span class="fu"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="no">date</span>, <span class="no">psavert</span>), <span class="kw">type</span> <span class="kw">=</span> <span class="st">"line"</span>, <span class="kw">height</span> <span class="kw">=</span> <span class="st">"250px"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/set_input_selection.html">set_input_selection</a></span>(<span class="st">"selection"</span>)</pre></body></html></div>
2020-08-03 10:08:02 +02:00
<div id="htmlwidget-72fe04d2151f8008c5f8" style="width:100%;height:250px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-72fe04d2151f8008c5f8">{"x":{"ax_opts":{"chart":{"type":"line","selection":{"enabled":true,"type":"x","fill":{"color":"#24292e","opacity":0.1},"stroke":{"width":1,"dashArray":3,"color":"#24292e","opacity":0.4}},"toolbar":{"autoSelected":"selection"}},"series":[{"name":"psavert","type":"line","data":[["new Date('1967-07-01').getTime()",12.6],["new Date('1967-08-01').getTime()",12.6],["new Date('1967-09-01').getTime()",11.9],["new Date('1967-10-01').getTime()",12.9],["new Date('1967-11-01').getTime()",12.8],["new Date('1967-12-01').getTime()",11.8],["new Date('1968-01-01').getTime()",11.7],["new Date('1968-02-01').getTime()",12.3],["new Date('1968-03-01').getTime()",11.7],["new Date('1968-04-01').getTime()",12.3],["new Date('1968-05-01').getTime()",12],["new Date('1968-06-01').getTime()",11.7],["new Date('1968-07-01').getTime()",10.7],["new Date('1968-08-01').getTime()",10.5],["new Date('1968-09-01').getTime()",10.6],["new Date('1968-10-01').getTime()",10.8],["new Date('1968-11-01').getTime()",10.6],["new Date('1968-12-01').getTime()",11.1],["new Date('1969-01-01').getTime()",10.3],["new Date('1969-02-01').getTime()",9.7],["new Date('1969-03-01').getTime()",10.2],["new Date('1969-04-01').getTime()",9.7],["new Date('1969-05-01').getTime()",10.1],["new Date('1969-06-01').getTime()",11.1],["new Date('1969-07-01').getTime()",11.8],["new Date('1969-08-01').getTime()",11.5],["new Date('1969-09-01').getTime()",11.6],["new Date('1969-10-01').getTime()",11.4],["new Date('1969-11-01').getTime()",11.6],["new Date('1969-12-01').getTime()",11.8],["new Date('1970-01-01').getTime()",11.8],["new Date('1970-02-01').getTime()",11.7],["new Date('1970-03-01').getTime()",12.4],["new Date('1970-04-01').getTime()",13.3],["new Date('1970-05-01').getTime()",12.4],["new Date('1970-06-01').getTime()",12.3],["new Date('1970-07-01').getTime()",13.5],["new Date('1970-08-01').getTime()",13.4],["new Date('1970-09-01').getTime()",12.9],["new Date('1970-10-01').getTime()",13.1],["new Date('1970-11-01').getTime()",13.6],["new Date('1970-12-01').getTime()",13.2],["new Date('1971-01-01').getTime()",13.3],["new Date('1971-02-01').getTime()",13.3],["new Date('1971-03-01').getTime()",13.5],["new Date('1971-04-01').getTime()",13.2],["new Date('1971-05-01').getTime()",13.6],["new Date('1971-06-01').getTime()",14.7],["new Date('1971-07-01').getTime()",13.8],["new Date('1971-08-01').getTime()",13.6],["new Date('1971-09-01').getTime()",13.3],["new Date('1971-10-01').getTime()",13.3],["new Date('1971-11-01').getTime()",13.1],["new Date('1971-12-01').getTime()",13],["new Date('1972-01-01').getTime()",12.5],["new Date('1972-02-01').getTime()",12.8],["new Date('1972-03-01').getTime()",11.8],["new Date('1972-04-01').getTime()",11.5],["new Date('1972-05-01').getTime()",11.7],["new Date('1972-06-01').getTime()",11.7],["new Date('1972-07-01').getTime()",11.7],["new Date('1972-08-01').getTime()",12],["new Date('1972-09-01').getTime()",12.2],["new Date('1972-10-01').getTime()",13],["new Date('1972-11-01').getTime()",13.6],["new Date('1972-12-01').getTime()",13.7],["new Date('1973-01-01').getTime()",12.4],["new Date('1973-02-01').getTime()",12.5],["new Date('1973-03-01').getTime()",12.7],["new Date('1973-04-01').getTime()",13.2],["new Date('1973-05-01').getTime()",13.2],["new Date('1973-06-01').getTime()",13.6],["new Date('1973-07-01').getTime()",13.2],["new Date('1973-08-01').getTime()",13.9],["new Date('1973-09-01').getTime()",13.1],["new Date('1973-10-01').getTime()",14.4],["new Date('1973-11-01').getTime()",14.4],["new Date('1973-12-01').getTime()",14.8],["new Date('1974-01-01').getTime()",14.3],["new Date('1974-02-01').getTime()",14.2],["new Date('1974-03-01').getTime()",13.4],["new Date('1974-04-01').getTime()",13.1],["new Date('1974-05-01').getTime()",12.8],["new Date('1974-06-01').getTime()",12.8],["new Date('1974-07-01').getTime()",12.8],["new Date('1974-08-01').getTime()",12.1],["new Date('1974-09-01').getTime()",12.9],["new Date('1974-10-01').getTime()",13.4],["new Date('1974-11-01').getTime()",13.8],["new Date('19
2020-03-20 10:17:30 +01:00
<pre><code>#&gt; $x
#&gt; $x$min
#&gt; [1] "1981-10-24 15:41:16 UTC"
#&gt;
#&gt; $x$max
#&gt; [1] "1992-01-24 06:40:22 UTC"</code></pre>
<p>You can define a selected area at start:</p>
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb15"><html><body><pre class="r"><span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="no">economics</span>, <span class="fu"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="no">date</span>, <span class="no">psavert</span>), <span class="kw">type</span> <span class="kw">=</span> <span class="st">"line"</span>, <span class="kw">height</span> <span class="kw">=</span> <span class="st">"250px"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/set_input_selection.html">set_input_selection</a></span>(
<span class="kw">inputId</span> <span class="kw">=</span> <span class="st">"selection"</span>,
<span class="kw">xmin</span> <span class="kw">=</span> <span class="fu"><a href="../reference/format_date.html">format_date</a></span>(<span class="st">"1980-01-01"</span>),
<span class="kw">xmax</span> <span class="kw">=</span> <span class="fu"><a href="../reference/format_date.html">format_date</a></span>(<span class="st">"1985-01-01"</span>)
)</pre></body></html></div>
2020-08-03 10:08:02 +02:00
<div id="htmlwidget-4171b3e691263be78188" style="width:100%;height:250px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-4171b3e691263be78188">{"x":{"ax_opts":{"chart":{"type":"line","selection":{"enabled":true,"type":"x","fill":{"color":"#24292e","opacity":0.1},"stroke":{"width":1,"dashArray":3,"color":"#24292e","opacity":0.4},"xaxis":{"min":"new Date('1980-01-01').getTime()","max":"new Date('1985-01-01').getTime()"}},"toolbar":{"autoSelected":"selection"}},"series":[{"name":"psavert","type":"line","data":[["new Date('1967-07-01').getTime()",12.6],["new Date('1967-08-01').getTime()",12.6],["new Date('1967-09-01').getTime()",11.9],["new Date('1967-10-01').getTime()",12.9],["new Date('1967-11-01').getTime()",12.8],["new Date('1967-12-01').getTime()",11.8],["new Date('1968-01-01').getTime()",11.7],["new Date('1968-02-01').getTime()",12.3],["new Date('1968-03-01').getTime()",11.7],["new Date('1968-04-01').getTime()",12.3],["new Date('1968-05-01').getTime()",12],["new Date('1968-06-01').getTime()",11.7],["new Date('1968-07-01').getTime()",10.7],["new Date('1968-08-01').getTime()",10.5],["new Date('1968-09-01').getTime()",10.6],["new Date('1968-10-01').getTime()",10.8],["new Date('1968-11-01').getTime()",10.6],["new Date('1968-12-01').getTime()",11.1],["new Date('1969-01-01').getTime()",10.3],["new Date('1969-02-01').getTime()",9.7],["new Date('1969-03-01').getTime()",10.2],["new Date('1969-04-01').getTime()",9.7],["new Date('1969-05-01').getTime()",10.1],["new Date('1969-06-01').getTime()",11.1],["new Date('1969-07-01').getTime()",11.8],["new Date('1969-08-01').getTime()",11.5],["new Date('1969-09-01').getTime()",11.6],["new Date('1969-10-01').getTime()",11.4],["new Date('1969-11-01').getTime()",11.6],["new Date('1969-12-01').getTime()",11.8],["new Date('1970-01-01').getTime()",11.8],["new Date('1970-02-01').getTime()",11.7],["new Date('1970-03-01').getTime()",12.4],["new Date('1970-04-01').getTime()",13.3],["new Date('1970-05-01').getTime()",12.4],["new Date('1970-06-01').getTime()",12.3],["new Date('1970-07-01').getTime()",13.5],["new Date('1970-08-01').getTime()",13.4],["new Date('1970-09-01').getTime()",12.9],["new Date('1970-10-01').getTime()",13.1],["new Date('1970-11-01').getTime()",13.6],["new Date('1970-12-01').getTime()",13.2],["new Date('1971-01-01').getTime()",13.3],["new Date('1971-02-01').getTime()",13.3],["new Date('1971-03-01').getTime()",13.5],["new Date('1971-04-01').getTime()",13.2],["new Date('1971-05-01').getTime()",13.6],["new Date('1971-06-01').getTime()",14.7],["new Date('1971-07-01').getTime()",13.8],["new Date('1971-08-01').getTime()",13.6],["new Date('1971-09-01').getTime()",13.3],["new Date('1971-10-01').getTime()",13.3],["new Date('1971-11-01').getTime()",13.1],["new Date('1971-12-01').getTime()",13],["new Date('1972-01-01').getTime()",12.5],["new Date('1972-02-01').getTime()",12.8],["new Date('1972-03-01').getTime()",11.8],["new Date('1972-04-01').getTime()",11.5],["new Date('1972-05-01').getTime()",11.7],["new Date('1972-06-01').getTime()",11.7],["new Date('1972-07-01').getTime()",11.7],["new Date('1972-08-01').getTime()",12],["new Date('1972-09-01').getTime()",12.2],["new Date('1972-10-01').getTime()",13],["new Date('1972-11-01').getTime()",13.6],["new Date('1972-12-01').getTime()",13.7],["new Date('1973-01-01').getTime()",12.4],["new Date('1973-02-01').getTime()",12.5],["new Date('1973-03-01').getTime()",12.7],["new Date('1973-04-01').getTime()",13.2],["new Date('1973-05-01').getTime()",13.2],["new Date('1973-06-01').getTime()",13.6],["new Date('1973-07-01').getTime()",13.2],["new Date('1973-08-01').getTime()",13.9],["new Date('1973-09-01').getTime()",13.1],["new Date('1973-10-01').getTime()",14.4],["new Date('1973-11-01').getTime()",14.4],["new Date('1973-12-01').getTime()",14.8],["new Date('1974-01-01').getTime()",14.3],["new Date('1974-02-01').getTime()",14.2],["new Date('1974-03-01').getTime()",13.4],["new Date('1974-04-01').getTime()",13.1],["new Date('1974-05-01').getTime()",12.8],["new Date('1974-06-01').getTime()",12.8],["new Date('1974-07-01').getTime()",12.8],["new Date('1974-08-01').getTime()",12.1],["new Date('1974-09-01').getTime()",12.9],["new
2020-04-16 17:09:40 +02:00
<div class="sourceCode" id="cb16"><html><body><pre class="r"><span class="fu"><a href="../reference/apex.html">apex</a></span>(<span class="no">iris</span>, <span class="fu"><a href="../reference/apexcharter-exports.html">aes</a></span>(<span class="no">Sepal.Length</span>, <span class="no">Sepal.Width</span>), <span class="kw">type</span> <span class="kw">=</span> <span class="st">"scatter"</span>, <span class="kw">height</span> <span class="kw">=</span> <span class="st">"250px"</span>) <span class="kw">%&gt;%</span>
<span class="fu"><a href="../reference/set_input_selection.html">set_input_selection</a></span>(<span class="st">"selection_scatter"</span>, <span class="kw">type</span> <span class="kw">=</span> <span class="st">"xy"</span>)</pre></body></html></div>
2020-08-03 10:08:02 +02:00
<div id="htmlwidget-4d9af275ef1b4e73e247" style="width:100%;height:250px;" class="apexcharter html-widget"></div>
<script type="application/json" data-for="htmlwidget-4d9af275ef1b4e73e247">{"x":{"ax_opts":{"chart":{"type":"scatter","selection":{"enabled":true,"type":"xy","fill":{"color":"#24292e","opacity":0.1},"stroke":{"width":1,"dashArray":3,"color":"#24292e","opacity":0.4}},"toolbar":{"autoSelected":"selection"}},"series":[{"name":"Sepal.Width","type":"scatter","data":[{"x":5.1,"y":3.5},{"x":4.9,"y":3},{"x":4.7,"y":3.2},{"x":4.6,"y":3.1},{"x":5,"y":3.6},{"x":5.4,"y":3.9},{"x":4.6,"y":3.4},{"x":5,"y":3.4},{"x":4.4,"y":2.9},{"x":4.9,"y":3.1},{"x":5.4,"y":3.7},{"x":4.8,"y":3.4},{"x":4.8,"y":3},{"x":4.3,"y":3},{"x":5.8,"y":4},{"x":5.7,"y":4.4},{"x":5.4,"y":3.9},{"x":5.1,"y":3.5},{"x":5.7,"y":3.8},{"x":5.1,"y":3.8},{"x":5.4,"y":3.4},{"x":5.1,"y":3.7},{"x":4.6,"y":3.6},{"x":5.1,"y":3.3},{"x":4.8,"y":3.4},{"x":5,"y":3},{"x":5,"y":3.4},{"x":5.2,"y":3.5},{"x":5.2,"y":3.4},{"x":4.7,"y":3.2},{"x":4.8,"y":3.1},{"x":5.4,"y":3.4},{"x":5.2,"y":4.1},{"x":5.5,"y":4.2},{"x":4.9,"y":3.1},{"x":5,"y":3.2},{"x":5.5,"y":3.5},{"x":4.9,"y":3.6},{"x":4.4,"y":3},{"x":5.1,"y":3.4},{"x":5,"y":3.5},{"x":4.5,"y":2.3},{"x":4.4,"y":3.2},{"x":5,"y":3.5},{"x":5.1,"y":3.8},{"x":4.8,"y":3},{"x":5.1,"y":3.8},{"x":4.6,"y":3.2},{"x":5.3,"y":3.7},{"x":5,"y":3.3},{"x":7,"y":3.2},{"x":6.4,"y":3.2},{"x":6.9,"y":3.1},{"x":5.5,"y":2.3},{"x":6.5,"y":2.8},{"x":5.7,"y":2.8},{"x":6.3,"y":3.3},{"x":4.9,"y":2.4},{"x":6.6,"y":2.9},{"x":5.2,"y":2.7},{"x":5,"y":2},{"x":5.9,"y":3},{"x":6,"y":2.2},{"x":6.1,"y":2.9},{"x":5.6,"y":2.9},{"x":6.7,"y":3.1},{"x":5.6,"y":3},{"x":5.8,"y":2.7},{"x":6.2,"y":2.2},{"x":5.6,"y":2.5},{"x":5.9,"y":3.2},{"x":6.1,"y":2.8},{"x":6.3,"y":2.5},{"x":6.1,"y":2.8},{"x":6.4,"y":2.9},{"x":6.6,"y":3},{"x":6.8,"y":2.8},{"x":6.7,"y":3},{"x":6,"y":2.9},{"x":5.7,"y":2.6},{"x":5.5,"y":2.4},{"x":5.5,"y":2.4},{"x":5.8,"y":2.7},{"x":6,"y":2.7},{"x":5.4,"y":3},{"x":6,"y":3.4},{"x":6.7,"y":3.1},{"x":6.3,"y":2.3},{"x":5.6,"y":3},{"x":5.5,"y":2.5},{"x":5.5,"y":2.6},{"x":6.1,"y":3},{"x":5.8,"y":2.6},{"x":5,"y":2.3},{"x":5.6,"y":2.7},{"x":5.7,"y":3},{"x":5.7,"y":2.9},{"x":6.2,"y":2.9},{"x":5.1,"y":2.5},{"x":5.7,"y":2.8},{"x":6.3,"y":3.3},{"x":5.8,"y":2.7},{"x":7.1,"y":3},{"x":6.3,"y":2.9},{"x":6.5,"y":3},{"x":7.6,"y":3},{"x":4.9,"y":2.5},{"x":7.3,"y":2.9},{"x":6.7,"y":2.5},{"x":7.2,"y":3.6},{"x":6.5,"y":3.2},{"x":6.4,"y":2.7},{"x":6.8,"y":3},{"x":5.7,"y":2.5},{"x":5.8,"y":2.8},{"x":6.4,"y":3.2},{"x":6.5,"y":3},{"x":7.7,"y":3.8},{"x":7.7,"y":2.6},{"x":6,"y":2.2},{"x":6.9,"y":3.2},{"x":5.6,"y":2.8},{"x":7.7,"y":2.8},{"x":6.3,"y":2.7},{"x":6.7,"y":3.3},{"x":7.2,"y":3.2},{"x":6.2,"y":2.8},{"x":6.1,"y":3},{"x":6.4,"y":2.8},{"x":7.2,"y":3},{"x":7.4,"y":2.8},{"x":7.9,"y":3.8},{"x":6.4,"y":2.8},{"x":6.3,"y":2.8},{"x":6.1,"y":2.6},{"x":7.7,"y":3},{"x":6.3,"y":3.4},{"x":6.4,"y":3.1},{"x":6,"y":3},{"x":6.9,"y":3.1},{"x":6.7,"y":3.1},{"x":6.9,"y":3.1},{"x":5.8,"y":2.7},{"x":6.8,"y":3.2},{"x":6.7,"y":3.3},{"x":6.7,"y":3},{"x":6.3,"y":2.5},{"x":6.5,"y":3},{"x":6.2,"y":3.4},{"x":5.9,"y":3}]}],"dataLabels":{"enabled":false},"xaxis":{"type":"numeric","min":4,"max":8,"crosshairs":{"show":true,"stroke":{"dashArray":0}},"labels":{"style":{"colors":"#848484"}}},"yaxis":{"min":2,"max":4.5,"decimalsInFloat":3,"tooltip":{"enabled":true},"labels":{"style":{"colors":"#848484"}}},"grid":{"xaxis":{"lines":{"show":true}}}},"auto_update":{"series_animate":true,"update_options":false,"options_animate":true,"options_redrawPaths":true,"update_synced_charts":false},"sparkbox":false,"xaxis":{"min":4.3,"max":7.9},"shinyEvents":{"selection":{"inputId":"selection_scatter","type":"xy"}}},"evals":[],"jsHooks":[]}</script><p>In this case, input value will look like this:</p>
2020-03-20 10:17:30 +01:00
<pre><code>#&gt; $x
#&gt; $x$min
#&gt; [1] 5.130187
#&gt;
#&gt; $x$max
#&gt; [1] 5.541228
#&gt;
#&gt;
#&gt; $y
#&gt; $y$min
#&gt; [1] 2.959623
#&gt;
#&gt; $y$max
#&gt; [1] 3.860357</code></pre>
<p>More examples are available with:</p>
2020-08-03 10:08:02 +02:00
<div class="sourceCode" id="cb18"><html><body><pre class="r"><span class="fu">run_input_demo</span>(<span class="st">"selection"</span>)</pre></body></html></div>
2020-03-20 10:17:30 +01:00
</div>
</div>
</div>
2020-05-27 16:29:28 +02:00
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
2020-03-20 10:17:30 +01:00
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
2020-05-27 16:29:28 +02:00
<li>
<a href="#charts">Charts</a><ul class="nav nav-pills nav-stacked">
<li><a href="#create-and-update-or-destroy-and-re-create">Create and update (or destroy and re-create)</a></li>
<li><a href="#proxy">Proxy</a></li>
</ul>
</li>
<li>
<a href="#interactions">Interactions</a><ul class="nav nav-pills nav-stacked">
<li><a href="#click">Click</a></li>
<li><a href="#zoom">Zoom</a></li>
<li><a href="#selection">Selection</a></li>
</ul>
</li>
2020-03-20 10:17:30 +01:00
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by <a href="https://twitter.com/_pvictorr"><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"> Victor Perrier</a>, <a href="https://twitter.com/_mfaan"><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg"> Fanny Meyer</a>.</p>
</div>
<div class="pkgdown">
2020-05-27 16:29:28 +02:00
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
2020-03-20 10:17:30 +01:00
</div>
</footer>
</div>
<div id="particles"></div>
<script>
window.onload = function() {
2020-03-27 14:57:19 +01:00
var config = {"particles":{"number":{"value":90,"density":{"enable":true,"value_area":1200}},"color":{"value":"#112446"},"shape":{"type":"circle","stroke":{"width":0,"color":"#000000"},"polygon":{"nb_sides":5},"image":{"src":"img/github.svg","width":100,"height":100}},"opacity":{"value":0.8,"random":false,"anim":{"enable":false,"speed":1,"opacity_min":0.1,"sync":false}},"size":{"value":3,"random":true,"anim":{"enable":false,"speed":40,"size_min":0.1,"sync":false}},"line_linked":{"enable":true,"distance":150,"color":"#112446","opacity":0.6,"width":1},"move":{"enable":true,"speed":5,"direction":"none","random":false,"straight":false,"out_mode":"out","bounce":false,"attract":{"enable":false,"rotateX":600,"rotateY":1200}}},"interactivity":{"detect_on":"canvas","events":{"onhover":{"enable":true,"mode":"repulse"},"onclick":{"enable":true,"mode":"push"},"resize":true}},"modes":{"grab":{"distance":400,"line_linked":{"opacity":1}},"bubble":{"distance":400,"size":40,"duration":2,"opacity":8,"speed":3},"repulse":{"distance":200,"duration":0.4},"push":{"particles_nb":4},"remove":{"particles_nb":2}},"retina_detect":true} ;
2020-03-20 10:17:30 +01:00
particlesJS("particles", config);
};
</script>
</body>
</html>