Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

294: Improve breaks and bins for probability chart #33

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion 294-basic-ridgeline-plot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ data <- data %>%
data %>%
mutate(text = fct_reorder(text, value)) %>%
ggplot( aes(y=text, x=value, fill=text)) +
geom_density_ridges(alpha=0.6, stat="binline", bins=20) +
geom_density_ridges(alpha=0.6, stat="binline", binwidth=5) +
scale_x_continuous(breaks=seq(0,100,25)) +
scale_y_discrete(expand=expansion(add=c(0,1))) +
theme_ridges() +
theme(
legend.position="none",
Expand Down
124 changes: 64 additions & 60 deletions 294-basic-ridgeline-plot.html

Large diffs are not rendered by default.

Binary file modified 294-basic-ridgeline-plot_files/figure-html/unnamed-chunk-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 294-basic-ridgeline-plot_files/figure-html/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 294-basic-ridgeline-plot_files/figure-html/unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions libs/header-attrs-2.6/header-attrs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
10 changes: 5 additions & 5 deletions libs/navigation-1.1/codefolding.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ window.initializeCodeFolding = function(show) {
var currentIndex = 1;

// select all R code blocks
var rCodeBlocks = $('pre.r, pre.python, pre.bash, pre.sql, pre.cpp, pre.stan, pre.julia');
var rCodeBlocks = $('pre.r, pre.python, pre.bash, pre.sql, pre.cpp, pre.stan, pre.julia, pre.foldable');
rCodeBlocks.each(function() {

// create a collapsable div to wrap the code in
var div = $('<div class="collapse r-code-collapse"></div>');
if (show)
div.addClass('in');
var showThis = (show || $(this).hasClass('fold-show')) && !$(this).hasClass('fold-hide');
if (showThis) div.addClass('in');
var id = 'rcode-643E0F36' + currentIndex++;
div.attr('id', id);
$(this).before(div);
$(this).detach().appendTo(div);

// add a show code button right above
var showCodeText = $('<span>' + (show ? 'Hide' : 'Code') + '</span>');
var showCodeText = $('<span>' + (showThis ? 'Hide' : 'Code') + '</span>');
var showCodeButton = $('<button type="button" class="btn btn-default btn-xs code-folding-btn pull-right"></button>');
showCodeButton.append(showCodeText);
showCodeButton
.attr('data-toggle', 'collapse')
.attr('data-target', '#' + id)
.attr('aria-expanded', show)
.attr('aria-expanded', showThis)
.attr('aria-controls', id);

var buttonRow = $('<div class="row"></div>');
Expand Down
10 changes: 6 additions & 4 deletions libs/tocify-1.9.1/jquery.tocify.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
margin-left: 2%;
position: fixed;
border: 1px solid #ccc;
webkit-border-radius: 6px;
moz-border-radius: 6px;
border-radius: 6px;
}

Expand Down Expand Up @@ -45,11 +43,15 @@
.tocify-subheader .tocify-subheader {
text-indent: 30px;
}

/* Further indents third level subheader elements. You can continue this pattern if you have more nested elements. */
.tocify-subheader .tocify-subheader .tocify-subheader {
text-indent: 40px;
}
.tocify-subheader .tocify-subheader .tocify-subheader .tocify-subheader {
text-indent: 50px;
}
.tocify-subheader .tocify-subheader .tocify-subheader .tocify-subheader .tocify-subheader {
text-indent: 60px;
}

/* Twitter Bootstrap Override Style */
.tocify .tocify-item > a, .tocify .nav-list .nav-header {
Expand Down
4 changes: 2 additions & 2 deletions libs/tocify-1.9.1/jquery.tocify.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,13 @@

item.append($("<a/>", {

"text": self.text()
"html": self.html()

}));

} else {

item.text(self.text());
item.html(self.html());

}

Expand Down