Skip to content

Commit 18a7855

Browse files
committed
Fixing Documentation Template
1 parent 66bb0ee commit 18a7855

6 files changed

Lines changed: 183 additions & 4 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
from pymoo.visualization.scatter import Scatter
14+
from pymoo.problems import get_problem
15+
16+
F = get_problem("zdt3").pareto_front()
17+
Scatter().add(F).show()
18+
19+
20+
21+
22+
23+
F = get_problem("zdt3").pareto_front(use_cache=False, flatten=False)
24+
plot = Scatter()
25+
plot.add(F, s=30, facecolors='none', edgecolors='r')
26+
plot.add(F, plot_type="line", color="black", linewidth=2)
27+
plot.show()
28+
29+
30+
31+
32+
33+
from pymoo.util.ref_dirs import get_reference_directions
34+
35+
ref_dirs = get_reference_directions("uniform", 3, n_partitions=12)
36+
37+
F = get_problem("dtlz1").pareto_front(ref_dirs)
38+
39+
plot = Scatter()
40+
plot.add(F)
41+
plot.show()
42+
43+
44+
45+
46+
47+
import numpy as np
48+
F = np.random.random((30, 4))
49+
50+
plot = Scatter(tight_layout=True)
51+
plot.add(F, s=10)
52+
plot.add(F[10], s=30, color="red")
53+
plot.show()
54+
55+
56+
57+
58+
59+

docs/source/_static/js/pymoo-sidebar.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
if (id && /[^a-zA-Z0-9_-]/.test(id)) {
99
const newId = id.replace(/[^a-zA-Z0-9_-]/g, '-');
1010
element.id = newId;
11-
11+
1212
// Update any links that reference the old ID
1313
const links = document.querySelectorAll(`a[href="#${CSS.escape(id)}"]`);
1414
links.forEach(link => {
@@ -17,11 +17,32 @@
1717
}
1818
});
1919
}
20-
20+
2121
// Run immediately if DOM is ready, otherwise wait
2222
if (document.readyState === 'loading') {
2323
document.addEventListener('DOMContentLoaded', sanitizeIds);
2424
} else {
2525
sanitizeIds();
2626
}
27-
})();
27+
})();
28+
29+
// Open newsletter modal
30+
function openNewsletter() {
31+
const modal = document.getElementById('newsletter');
32+
if (modal) {
33+
// Use Bootstrap's modal API if available
34+
if (typeof bootstrap !== 'undefined' && bootstrap.Modal) {
35+
const bsModal = new bootstrap.Modal(modal);
36+
bsModal.show();
37+
} else if (typeof $ !== 'undefined' && $.fn.modal) {
38+
// Fallback to jQuery Bootstrap modal
39+
$(modal).modal('show');
40+
} else {
41+
// Last resort: just show it with display
42+
modal.style.display = 'block';
43+
modal.classList.add('show');
44+
}
45+
} else {
46+
console.warn('Newsletter modal not found');
47+
}
48+
}

docs/source/_templates/layout.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends "!layout.html" %}
2+
3+
{% block footer %}
4+
{{ super() }}
5+
{% include "newsletter.html" %}
6+
{% endblock %}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<style>
2+
.modal-backdrop {
3+
position: fixed !important;
4+
z-index: 1040 !important;
5+
}
6+
7+
.modal {
8+
z-index: 1050 !important;
9+
}
10+
</style>
11+
12+
<div class="modal fade" id="newsletter" tabindex="-1" role="dialog" aria-labelledby="newsletterModalLabel"
13+
aria-hidden="true">
14+
<div class="modal-dialog" role="document">
15+
<div class="modal-content">
16+
<div class="modal-header">
17+
<h5 class="modal-title" id="newsletterModalLabel"><b>Newsletter</b></h5>
18+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
19+
</div>
20+
<div class="modal-body">
21+
<!-- Begin Mailchimp Signup Form -->
22+
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
23+
<style type="text/css">
24+
#mc_embed_signup {
25+
background: #fff;
26+
clear: left;
27+
font: 14px Helvetica, Arial, sans-serif;
28+
}
29+
</style>
30+
<div id="mc_embed_signup">
31+
<form action="https://pymoo.us1.list-manage.com/subscribe/post?u=4454ea68ad3065ee471d6f9aa&amp;id=6f71107645"
32+
method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form"
33+
class="validate" target="_blank" novalidate>
34+
<div id="mc_embed_signup_scroll">
35+
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
36+
<div class="mc-field-group">
37+
<label for="mce-EMAIL">Email Address <span class="asterisk">*</span></label>
38+
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" autocomplete="email">
39+
</div>
40+
<div class="mc-field-group">
41+
<label for="mce-FNAME">First Name </label>
42+
<input type="text" value="" name="FNAME" class="" id="mce-FNAME">
43+
</div>
44+
<div class="mc-field-group">
45+
<label for="mce-LNAME">Last Name </label>
46+
<input type="text" value="" name="LNAME" class="" id="mce-LNAME">
47+
</div>
48+
<div class="mc-field-group">
49+
<label for="mce-INSTITUTIO">Institution </label>
50+
<input type="text" value="" name="INSTITUTIO" class="" id="mce-INSTITUTIO">
51+
</div>
52+
<p>Powered by <a href="http://eepurl.com/hsCRrP"
53+
title="MailChimp - email marketing made easy and fun">MailChimp</a></p>
54+
<div id="mce-responses" class="clear">
55+
<div class="response" id="mce-error-response" style="display:none"></div>
56+
<div class="response" id="mce-success-response" style="display:none"></div>
57+
</div>
58+
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
59+
<div style="position: absolute; left: -5000px;" aria-hidden="true">
60+
<input type="text" name="b_4454ea68ad3065ee471d6f9aa_6f71107645" tabindex="-1" value="">
61+
</div>
62+
<div class="clear">
63+
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
64+
</div>
65+
</div>
66+
</form>
67+
</div>
68+
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
69+
<script type='text/javascript'>
70+
(function ($) {
71+
window.fnames = new Array();
72+
window.ftypes = new Array();
73+
fnames[0] = 'EMAIL';
74+
ftypes[0] = 'email';
75+
fnames[1] = 'FNAME';
76+
ftypes[1] = 'text';
77+
fnames[2] = 'LNAME';
78+
ftypes[2] = 'text';
79+
fnames[6] = 'INSTITUTIO';
80+
ftypes[6] = 'text';
81+
}(jQuery));
82+
var $mcj = jQuery.noConflict(true);
83+
</script>
84+
<!--End mc_embed_signup-->
85+
</div>
86+
</div>
87+
</div>
88+
</div>

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"navigation_depth": 1,
8686
"navbar_end": ["navbar-icon-links"],
8787
"nosidebar": True, # Disable the right sidebar
88+
"home_page_in_toc": True, # Show Home link in sidebar
8889
}
8990

9091
# Add any paths that contain custom static files (such as style sheets) here,

docs/source/visualization/scatter.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.17.1
7+
jupytext_version: 1.17.2
8+
kernelspec:
9+
name: default
10+
display_name: default
11+
language: python
812
---
913

1014
```{raw-cell}

0 commit comments

Comments
 (0)