Skip to content

Commit

Permalink
Update handsontable from 6.1.1 to 7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
trshafer committed Jun 23, 2019
1 parent 3b7e855 commit 730a156
Show file tree
Hide file tree
Showing 16 changed files with 289 additions and 199 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ Suggests:
rstudioapi (>= 0.6),
htmltools
VignetteBuilder: knitr
RoxygenNote: 6.1.1
RoxygenNote: 7.1.0
Encoding: UTF-8
56 changes: 28 additions & 28 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<link href="libs/highlightjs-9.12.0/default.css" rel="stylesheet" />
<script src="libs/highlightjs-9.12.0/highlight.js"></script>
<script src="libs/htmlwidgets-1.3/htmlwidgets.js"></script>
<link href="libs/handsontable-6.1.1/handsontable.full.min.css" rel="stylesheet" />
<script src="libs/handsontable-6.1.1/handsontable.full.min.js"></script>
<script src="libs/handsontable-6.1.1/all.min.js"></script>
<link href="libs/handsontable-7.1.0/handsontable.full.min.css" rel="stylesheet" />
<script src="libs/handsontable-7.1.0/handsontable.full.min.js"></script>
<script src="libs/handsontable-7.1.0/all.min.js"></script>
<script src="libs/numbro.languages-2.0.6/languages.min.js"></script>
<script src="libs/chroma-1.3.3/chroma.min.js"></script>
<script src="libs/sparkline-2.1.2/jquery.sparkline.min.js"></script>
Expand Down Expand Up @@ -251,11 +251,11 @@ <h2>Types</h2>
<p>rhandsontable attempts to map R classes to an appropriate handsontable type. Factors will be mapped to <code>dropdown</code>, with the choices specified by <code>level</code> and <code>allowInvalid</code> set to <code>FALSE</code>. To allow new levels, set <code>allowInvalid</code> to <code>TRUE</code> (using <code>hot_col</code>; it may also be desirable to set <code>strict</code> to <code>FALSE</code>). When running in <code>shiny</code>, using <code>hot_to_r</code> will preserve custom factor ordering, and if new levels are allowed, they will be added to the end.</p>
<pre class="r"><code>DF = data.frame(integer = 1:10,
numeric = rnorm(10),
logical = rep(TRUE, 10),
logical = rep(TRUE, 10),
character = LETTERS[1:10],
factor = factor(letters[1:10], levels = letters[10:1],
factor = factor(letters[1:10], levels = letters[10:1],
ordered = TRUE),
factor_allow = factor(letters[1:10], levels = letters[10:1],
factor_allow = factor(letters[1:10], levels = letters[10:1],
ordered = TRUE),
date = seq(from = Sys.Date(), by = &quot;days&quot;, length.out = 10),
stringsAsFactors = FALSE)
Expand All @@ -265,16 +265,16 @@ <h2>Types</h2>
<div id="htmlwidget-36bb0e18445d8b19ac01" style="width:600px;height:300px;" class="rhandsontable html-widget"></div>
<script type="application/json" data-for="htmlwidget-36bb0e18445d8b19ac01">{"x":{"data":[{"integer":1,"numeric":1.7207,"logical":true,"character":"A","factor":"a","factor_allow":"a","date":"11/18/2018"},{"integer":2,"numeric":0.6275,"logical":true,"character":"B","factor":"b","factor_allow":"b","date":"11/19/2018"},{"integer":3,"numeric":-0.3375,"logical":true,"character":"C","factor":"c","factor_allow":"c","date":"11/20/2018"},{"integer":4,"numeric":-1.6382,"logical":true,"character":"D","factor":"d","factor_allow":"d","date":"11/21/2018"},{"integer":5,"numeric":-0.2922,"logical":true,"character":"E","factor":"e","factor_allow":"e","date":"11/22/2018"},{"integer":6,"numeric":-0.36,"logical":true,"character":"F","factor":"f","factor_allow":"f","date":"11/23/2018"},{"integer":7,"numeric":-0.9067,"logical":true,"character":"G","factor":"g","factor_allow":"g","date":"11/24/2018"},{"integer":8,"numeric":1.9596,"logical":true,"character":"H","factor":"h","factor_allow":"h","date":"11/25/2018"},{"integer":9,"numeric":1.5781,"logical":true,"character":"I","factor":"i","factor_allow":"i","date":"11/26/2018"},{"integer":10,"numeric":-1.4774,"logical":true,"character":"J","factor":"j","factor_allow":"j","date":"11/27/2018"}],"rClass":"data.frame","rColClasses":{"integer":"integer","numeric":"numeric","logical":"logical","character":"character","factor":"factor","factor_allow":"factor","date":"Date"},"rColnames":["integer","numeric","logical","character","factor","factor_allow","date"],"rColHeaders":["integer","numeric","logical","character","factor","factor_allow","date"],"rRowHeaders":null,"rDataDim":[10,7],"selectCallback":false,"colHeaders":["integer","numeric","logical","character","factor","factor_allow","date"],"rowHeaders":["1","2","3","4","5","6","7","8","9","10"],"columns":[{"type":"numeric","numericFormat":{"pattern":"0"},"renderer":"customRenderer","default":null},{"type":"numeric","numericFormat":{"pattern":"0.00"},"renderer":"customRenderer","default":null},{"type":"checkbox","renderer":"customRenderer","default":null},{"type":"text","renderer":"customRenderer","default":null},{"type":"dropdown","source":["j","i","h","g","f","e","d","c","b","a"],"allowInvalid":false,"renderer":"customRenderer","default":null},{"type":"dropdown","source":["j","i","h","g","f","e","d","c","b","a"],"allowInvalid":true,"renderer":"customRenderer","default":null},{"type":"date","correctFormat":true,"dateFormat":"MM/DD/YYYY","renderer":"customRenderer","default":null}],"width":600,"height":300,"debug":0,"search":false,"stretchH":"none","comments":false,"contextMenu":{"items":{"row_above":[],"row_below":[],"remove_row":[],"hsep3":{"name":"---------"},"undo":[],"redo":[],"hsep4":{"name":"---------"},"alignment":[]}}},"evals":["columns.0.renderer","columns.1.renderer","columns.2.renderer","columns.3.renderer","columns.4.renderer","columns.5.renderer","columns.6.renderer"],"jsHooks":[]}</script>
<p>To improve readability, <code>NA</code> values will be displayed as blank cells. This requires converting columns containing <code>NA</code> to characters, and in the case of factors and Dates, may not display the data in the desired format. It may be beneficial to concert these type of columns to character before passing to <code>rhandsontable</code>.</p>
<pre class="r"><code>DF_na = data.frame(integer = c(NA, 2:10),
logical = c(NA, rep(TRUE, 9)),
<pre class="r"><code>DF_na = data.frame(integer = c(NA, 2:10),
logical = c(NA, rep(TRUE, 9)),
character = c(NA, LETTERS[1:9]),
factor = c(NA, factor(letters[1:9])),
date = c(NA, seq(from = Sys.Date(), by = &quot;days&quot;,
date = c(NA, seq(from = Sys.Date(), by = &quot;days&quot;,
length.out = 9)),
stringsAsFactors = FALSE)

DF_na$factor_ch = as.character(DF_na$factor)
DF_na$date_ch = c(NA, as.character(seq(from = Sys.Date(), by = &quot;days&quot;,
DF_na$date_ch = c(NA, as.character(seq(from = Sys.Date(), by = &quot;days&quot;,
length.out = 9)))

rhandsontable(DF_na, width = 550, height = 300)</code></pre>
Expand Down Expand Up @@ -347,7 +347,7 @@ <h3>Custom Renderer</h3>
&quot;I would rate it &amp;#x2605;&amp;#x2605;&amp;#x2605;&amp;#x2605;&amp;#x2606;&quot;,
&quot;This is the book about JavaScript&quot;,
&quot;I&#39;ve never actually read it, but the &lt;a href=&#39;http://shop.oreilly.com/product/9780596805531.do&#39;&gt;comments&lt;/a&gt; are highly &lt;strong&gt;positive&lt;/strong&gt;.&quot;
),
),
cover = c(
&quot;http://ecx.images-amazon.com/images/I/51bRhyVTVGL._SL50_.jpg&quot;,
&quot;http://ecx.images-amazon.com/images/I/51gdVAEfPUL._SL50_.jpg&quot;,
Expand All @@ -356,7 +356,7 @@ <h3>Custom Renderer</h3>
stringsAsFactors = FALSE
)

rhandsontable(DF, allowedTags = &quot;&lt;em&gt;&lt;b&gt;&lt;strong&gt;&lt;a&gt;&lt;big&gt;&quot;,
rhandsontable(DF, allowedTags = &quot;&lt;em&gt;&lt;b&gt;&lt;strong&gt;&lt;a&gt;&lt;big&gt;&quot;,
width = 800, height = 450, rowHeaders = FALSE) %&gt;%
hot_cols(colWidths = c(200, 200, 200, 80)) %&gt;%
hot_col(1:2, renderer = &quot;html&quot;) %&gt;%
Expand All @@ -365,23 +365,23 @@ <h3>Custom Renderer</h3>
function(instance, td, row, col, prop, value, cellProperties) {
var escaped = Handsontable.helper.stringify(value),
img;

if (escaped.indexOf(&#39;http&#39;) === 0) {
img = document.createElement(&#39;IMG&#39;);
img.src = value;

Handsontable.dom.addEvent(img, &#39;mousedown&#39;, function (e){
e.preventDefault(); // prevent selection quirk
});

Handsontable.dom.empty(td);
td.appendChild(img);
}
else {
// render as text
Handsontable.renderers.TextRenderer.apply(this, arguments);
}

return td;
}&quot;)</code></pre>
<div id="htmlwidget-9e5eac81a394c5bf1f1a" style="width:800px;height:450px;" class="rhandsontable html-widget"></div>
Expand All @@ -398,19 +398,19 @@ <h4>Custom Renderer using an R Parameter</h4>
col_highlight = 2
row_highlight = c(5, 7)

rhandsontable(DF, col_highlight = col_highlight,
rhandsontable(DF, col_highlight = col_highlight,
row_highlight = row_highlight,
width = 550, height = 300) %&gt;%
hot_cols(renderer = &quot;
function(instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);

tbl = this.HTMLWidgets.widgets[0]

hcols = tbl.params.col_highlight
hcols = hcols instanceof Array ? hcols : [hcols]
hcols = hcols instanceof Array ? hcols : [hcols]
hrows = tbl.params.row_highlight
hrows = hrows instanceof Array ? hrows : [hrows]
hrows = hrows instanceof Array ? hrows : [hrows]

if (hcols.includes(col) &amp;&amp; hrows.includes(row)) {
td.style.background = &#39;red&#39;;
Expand All @@ -421,7 +421,7 @@ <h4>Custom Renderer using an R Parameter</h4>
else if (hrows.includes(row)) {
td.style.background = &#39;pink&#39;;
}

return td;
}&quot;)</code></pre>
<div id="htmlwidget-8bd4afb9a57d75471177" style="width:550px;height:300px;" class="rhandsontable html-widget"></div>
Expand Down Expand Up @@ -772,25 +772,25 @@ <h2>Shiny</h2>
<p>The data grid will be editable by default and can be used as input to a <code>shiny</code> app. A few <code>shiny</code> and <code>shinydashboard</code> example links are listed below. Note that the shinyapps.io links may not work if the has hit the monthly usage limit.</p>
<ul>
<li><p><a href="https://jrowen.shinyapps.io/rhandsontable_output">Output only</a></p>
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
subdir = &quot;inst/examples/rhandsontable_output&quot;)</code></pre></li>
<li><p><a href="https://jrowen.shinyapps.io/rhandsontable_datafile">Date file editor</a></p>
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
subdir = &quot;inst/examples/rhandsontable_datafile&quot;)</code></pre></li>
<li><p><a href="https://jrowen.shinyapps.io/rhandsontable_portfolio">Calculation input</a></p>
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
subdir = &quot;inst/examples/rhandsontable_portfolio&quot;)</code></pre></li>
<li><p><a href="https://jrowen.shinyapps.io/rhandsontable_corr">Table callback linked to chart</a></p>
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
subdir = &quot;inst/examples/rhandsontable_corr&quot;)</code></pre></li>
<li><p><a href="https://jrowen.shinyapps.io/rhandsontable_frontier">Multiple input tables</a></p>
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
subdir = &quot;inst/examples/rhandsontable_frontier&quot;)</code></pre></li>
<li><p><a href="https://jrowen.shinyapps.io/rhandsontable_dash">A shinydashboard app</a></p>
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
subdir=&quot;inst/examples/rhandsontable_dash&quot;)</code></pre></li>
<li><p><a href="https://ginberg.shinyapps.io/rhandsontable_search/">Table with Search</a></p>
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
<pre><code>shiny::runGitHub(&quot;rhandsontable&quot;, &quot;jrowen&quot;,
subdir=&quot;inst/examples/rhandsontable_search&quot;)</code></pre></li>
</ul>
<div id="bookmarks" class="section level3">
Expand Down
1 change: 0 additions & 1 deletion docs/libs/handsontable-6.1.1/all.min.js

This file was deleted.

37 changes: 0 additions & 37 deletions docs/libs/handsontable-6.1.1/handsontable.full.min.css

This file was deleted.

34 changes: 0 additions & 34 deletions docs/libs/handsontable-6.1.1/handsontable.full.min.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/libs/handsontable-7.1.0/all.min.js

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions docs/libs/handsontable-7.1.0/handsontable.full.min.css

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions docs/libs/handsontable-7.1.0/handsontable.full.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/libs/rhandsontable-0.3.7/lib/handsontable/all.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/libs/rhandsontable-0.3.7/rhandsontable.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# (uncomment to add a dependency)
dependencies:
- name: handsontable
version: 6.1.1
version: 7.1.0
src: "htmlwidgets/lib/handsontable"
script:
- handsontable.full.min.js
Expand Down
2 changes: 1 addition & 1 deletion inst/htmlwidgets/lib/handsontable/all.min.js

Large diffs are not rendered by default.

66 changes: 42 additions & 24 deletions inst/htmlwidgets/lib/handsontable/handsontable.full.min.css

Large diffs are not rendered by default.

58 changes: 35 additions & 23 deletions inst/htmlwidgets/lib/handsontable/handsontable.full.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/htmlwidgets/rhandsontable.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# (uncomment to add a dependency)
dependencies:
- name: handsontable
version: 6.1.1
version: 7.1.0
src: "htmlwidgets/lib/handsontable"
script:
- handsontable.full.min.js
Expand Down

0 comments on commit 730a156

Please sign in to comment.