Skip to content

Commit

Permalink
Fix Docs Responsivness
Browse files Browse the repository at this point in the history
  • Loading branch information
christianechevarria committed Apr 27, 2019
1 parent 53f18e9 commit 371790b
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 90 deletions.
4 changes: 2 additions & 2 deletions src/architecture/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ Network.prototype = {
* If both `iterations` and `error` options are unset, evolve will default to `iterations` as an end condition.
*
* @param {Array<{input:number[],output:number[]}>} set A set of input values and ideal output values to train the network with
* @param {object} [options] Configuration options
* @param {number} [options.iterations=500] Set the maximum amount of iterations/generations for the algorithm to run.
* @param {number} [options.error] Set the target error. The algorithm will stop once this target error has been reached.
* @param {number} [options.growth=0.0001] Set the penalty for large networks. Penalty calculation: penalty = (genome.nodes.length + genome.connectoins.length + genome.gates.length) * growth; This penalty will get added on top of the error. Your growth should be a very small number.
Expand All @@ -1177,15 +1178,14 @@ Network.prototype = {
* @param {number} [options.schedule.iterations] You can schedule tasks to happen every n iterations. Paired with `options.schedule.function`
* @param {schedule} [options.schedule.function] A function to run every n iterations as set by `options.schedule.iterations`. Passed as an object with a "function" property that contains the function to run.
* @param {boolean} [options.clear=false] If set to true, will clear the network after every activation. This is useful for evolving recurrent networks, more importantly for timeseries prediction.
*
* @param {boolean} [options.equal=false]
* @param {number} [options.popsize=50] Population size of each generation.
* @param {number} [options.elitism=0] Elitism of every evolution loop. [Elitism in genetic algorithms.](https://www.researchgate.net/post/What_is_meant_by_the_term_Elitism_in_the_Genetic_Algorithm)
* @param {number} [options.provenance=0] Number of genomes inserted the original network template (Network(input,output)) per evolution.
* @param {number} [options.mutationRate=0] Sets the mutation rate. If set to 0.3, 30% of the new population will be mutated. Default is 0.3.
* @param {number} [options.mutationAmount=1] If mutation occurs (randomNumber < mutationRate), sets amount of times a mutation method will be applied to the network.
* @param {boolean} [options.fitnessPopulation=false] When true, requires fitness function that takes an array of genomes as input and sets their .score property
* @param {string} [options.selection=Selection.FITNESS_PROPORTIONATE] [Selection method](selection) for evolution (e.g. Selection.FITNESS_PROPORTIONATE).
* @param {string} [options.selection=FITNESS_PROPORTIONATE] [Selection method](selection) for evolution (e.g. methods.Selection.FITNESS_PROPORTIONATE).
* @param {Array} [options.crossover] Sets allowed crossover methods for evolution.
* @param {Array} [options.mutation] Sets allowed [mutation methods](mutation) for evolution, a random mutation method will be chosen from the array when mutation occurs. Optional, but default methods are non-recurrent.
* @param {number} [options.maxNodes=Infinity] Maximum nodes for a potential network
Expand Down
6 changes: 3 additions & 3 deletions src/neat.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ var selection = methods.selection;
* @param {number} [options.mutationRate=0] Sets the mutation rate. If set to 0.3, 30% of the new population will be mutated. Default is 0.3.
* @param {number} [options.mutationAmount=1] If mutation occurs (randomNumber < mutationRate), sets amount of times a mutation method will be applied to the network.
* @param {boolean} [options.fitnessPopulation=false] When true, requires fitness function that takes an array of genomes as input and sets their .score property
* @param {string} [options.selection=Selection.FITNESS_PROPORTIONATE] [Selection method](selection) for evolution (e.g. Selection.FITNESS_PROPORTIONATE).
* @param {string} [options.selection=FITNESS_PROPORTIONATE] [Selection method](selection) for evolution (e.g. Selection.FITNESS_PROPORTIONATE).
* @param {Array} [options.crossover] Sets allowed crossover methods for evolution.
* @param {Array} [mutation] Sets allowed mutation methods for evolution, a random mutation method will be chosen from the array when mutation occurs. Optional, but default methods are non-recurrent.
* @param {Network} [options.network=false] Network to start evolution from
* @param {number} [options.maxNodes=Infinity] Maximum nodes for a potential network
* @param {number} [options.maxConns=Infinity] Maximum connections for a potential network
* @param {number} [options.maxGates=Infinity] Maximum gates for a potential network
* @param {function} [options.mutationSelection=] Custom mutation selection function if given
* @param {function} [options.mutationSelection=ALL] Custom mutation selection function if given
* @param {mutation[]} [options.mutation] Sets allowed [mutation methods](mutation) for evolution, a random mutation method will be chosen from the array when mutation occurs. Optional, but default methods are non-recurrent
*
* @prop {number} generation A count of the generations
*/
Expand Down
14 changes: 7 additions & 7 deletions theme/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ function needsSignature(doclet) {
}
}
}
// and namespaces that are functions get a signature (but finding them is a
// bit messy)
else if (doclet.kind === 'namespace' && doclet.meta && doclet.meta.code &&
doclet.meta.code.type && doclet.meta.code.type.match(/[Ff]unction/)) {
needsSig = true;
// and namespaces that are functions get a signature (but finding them is a
// bit messy)
else if (doclet.kind === 'namespace' && doclet.meta && doclet.meta.code &&
doclet.meta.code.type && doclet.meta.code.type.match(/[Ff]unction/)) {
needsSig = true;
}

return needsSig;
Expand Down Expand Up @@ -198,8 +198,8 @@ function addSignatureReturns(f) {
returnTypesString = util.format( ' &rarr; %s{%s}', attribsString, returnTypes.join('|') );
}

f.signature = '<span class="signature">' + (f.signature || '') + '</span>' +
'<span class="type-signature">' + returnTypesString + '</span>';
f.signature = '<span class="signature mobile-break">' + (f.signature || '') + '</span>' +
'<span class="type-signature mobile-break">' + returnTypesString + '</span>';
}

function addSignatureTypes(f) {
Expand Down
139 changes: 99 additions & 40 deletions theme/static/styles/jsdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ tt, code, kbd, samp {

#main {
float: right;
min-width: 360px;
width: calc(100% - 240px);
}

Expand Down Expand Up @@ -397,7 +396,6 @@ h4.name a.issue-button:hover {

.prettyprint {
font-size: 14px;
overflow: auto;
}

.prettyprint.source {
Expand All @@ -413,6 +411,7 @@ h4.name a.issue-button:hover {
display: block;
background-color: #0d152a;
color: #4D4E53;
overflow: auto;
}

.prettyprint > code {
Expand Down Expand Up @@ -469,6 +468,10 @@ table {
margin: 1em 0;
}

.table-overflow {
overflow: auto;
}

td, th {
margin: 0px;
text-align: left;
Expand All @@ -487,6 +490,11 @@ thead tr, thead tr {
white-space: pre;
}

.params .attribute {
font-size: 80%;
color: hsl(0, 0%, 56%);
}

.params .name, .props .name, .name code {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
font-size: 100%;
Expand Down Expand Up @@ -523,34 +531,34 @@ span.param-type, .params td .param-type, .param-type dd {
}

/* navicon button */
.navicon-button {
display: none;
position: relative;
padding: 2.0625rem 1.5rem;
transition: 0.25s;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
opacity: .8;
}
.navicon-button .navicon:before, .navicon-button .navicon:after {
transition: 0.25s;
}
.navicon-button:hover {
transition: 0.5s;
opacity: 1;
}
.navicon-button:hover .navicon:before, .navicon-button:hover .navicon:after {
transition: 0.25s;
}
.navicon-button:hover .navicon:before {
top: .825rem;
}
.navicon-button:hover .navicon:after {
top: -.825rem;
}
/*.navicon-button {*/
/* display: none;*/
/* position: relative;*/
/* padding: 2.0625rem 1.5rem;*/
/* transition: 0.25s;*/
/* cursor: pointer;*/
/* -webkit-user-select: none;*/
/* -moz-user-select: none;*/
/* -ms-user-select: none;*/
/* user-select: none;*/
/* opacity: .8;*/
/*}*/
/*.navicon-button .navicon:before, .navicon-button .navicon:after {*/
/* transition: 0.25s;*/
/*}*/
/*.navicon-button:hover {*/
/* transition: 0.5s;*/
/* opacity: 1;*/
/*}*/
/*.navicon-button:hover .navicon:before, .navicon-button:hover .navicon:after {*/
/* transition: 0.25s;*/
/*}*/
/*.navicon-button:hover .navicon:before {*/
/* top: .825rem;*/
/*}*/
/*.navicon-button:hover .navicon:after {*/
/* top: -.825rem;*/
/*}*/

/* navicon */
.navicon {
Expand Down Expand Up @@ -657,10 +665,7 @@ html[data-search-mode] .level-hide {
}


@media only screen and (min-width: 320px) and (max-width: 680px) {
body {
overflow-x: hidden;
}
@media (max-width: 1087px) {

nav {
background: #FFF;
Expand All @@ -676,17 +681,59 @@ html[data-search-mode] .level-hide {
transition: left 0.2s;
}

.navicon-button {
display: inline-block;
/*.navicon-button {*/
/* line-height: 56px;*/
/* font-size: 1.6rem;*/
/* width: inherit;*/
/* display: inline-block;*/
/* text-align: center;*/
/*}*/

.ion-ios-book {
font-size: 27px;
text-align: center;
color: white;
line-height: 27px;
vertical-align: middle;
}

.fixed-action-btn {
position: fixed;
top: 1.5em;
right: 0;
z-index: 2;
bottom: 45px;
right: 24px;
padding-top: 15px;
margin-bottom: 0;
z-index: 997;
}

.button-floating {
display: inline-block;
position: relative;
overflow: hidden;
z-index: 1;
width: 56px;
height: 56px;
padding: 0;
line-height: 54px;
font-size: 15px;
background-color: #FF7518;
border-radius: 50%;
-webkit-transition: background-color .3s;
transition: background-color .3s;
cursor: pointer;
vertical-align: middle;
text-decoration: none;
text-align: center;
letter-spacing: .5px;
outline: 0;
-webkit-tap-highlight-color: transparent;
border: none;
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2);
}

#main {
width: 100%;
min-width: 360px;
padding: 3.25rem 1.5rem;
}

#main h1.page-title {
Expand All @@ -702,6 +749,18 @@ html[data-search-mode] .level-hide {
}
}

@media (max-width: 330px) {
.mobile-break {
word-break: break-word;
overflow-wrap: break-word;
}

#main {
width: 100%;
padding: 3.25rem 1vw 0 1vw;
}
}

/** Add a '#' to static members */
[data-type="member"] a::before {
content: '#';
Expand Down
47 changes: 41 additions & 6 deletions theme/tmpl/layout.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
<label for="nav-trigger">
<div class="fixed-action-btn">
<div class="button-floating">
<!--
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
-->
<i class="ion-ios-book" aria-hidden="true"></i>
</div>
</div>
</label>

<label for="nav-trigger" class="overlay"></label>

<div class="navbar is-fixed-top" role="navigation" aria-label="main navigation">
Expand Down Expand Up @@ -90,8 +98,8 @@

<div id="main">
<div class="columns">
<div class="column"></div>
<div class="column is-9-desktop is-7-widescreen">
<div class="column is-hidden-touch"></div>
<div class="column is-11-desktop is-10-widescreen">

<?js if (title != 'Home') { ?>
<h1 class="page-title"><?js= title ?></h1>
Expand All @@ -113,7 +121,7 @@
<?js } ?>

</div>
<div class="column"></div>
<div class="column is-hidden-touch"></div>
</div>
</div>

Expand Down Expand Up @@ -151,5 +159,32 @@
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("1195922815");
</script>
<script>
document.addEventListener('DOMContentLoaded', () => {

// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);

// Check if there are any navbar burgers
if ($navbarBurgers.length > 0) {

// Add a click event on each of them
$navbarBurgers.forEach( el => {
el.addEventListener('click', () => {

// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);

// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');

});
});
}

});
</script>
</body>
</html>

0 comments on commit 371790b

Please sign in to comment.