Skip to content

Commit ccf42a8

Browse files
Merge pull request #9 from plotly/add_ai_ml
add ai/ml section
2 parents 19653b2 + 2890459 commit ccf42a8

9 files changed

+98
-5
lines changed

_data/display_as.yml

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ basic:
1919
statistical:
2020
reference: '#statistical-charts'
2121
text: Statistical
22+
ai_ml:
23+
reference: '#ai-ml'
24+
text: Artificial Intelligence and Machine Learning
2225
scientific:
2326
reference: '#scientific-charts'
2427
text: Scientific

_data/display_as_py_r_js.yml

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ basic:
1919
statistical:
2020
reference: 'statistical-charts'
2121
text: Statistical Charts
22+
ai_ml:
23+
reference: '#ai-ml'
24+
text: Artificial Intelligence and Machine Learning
2225
scientific:
2326
reference: 'scientific-charts'
2427
text: Scientific Charts

_includes/layouts/side-bar.html

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
{% assign financial = true %}
4040
{% elsif page.display_as == "3d_charts" %}
4141
{% assign 3d_charts = true %}
42+
{% elsif page.display_as == "ai_ml" %}
43+
{% assign ai_ml = true %}
4244
{% elsif page.display_as == "advanced_charts"%}
4345
{% assign advanced_charts = true %}
4446
{% elsif page.display_as == "multiple_axes" %}
@@ -259,6 +261,12 @@
259261
</li>
260262
{% endif %}
261263

264+
{% if ai_ml == true %}
265+
<li class="--sidebar-item">
266+
<a href="/{{langue}}/ai-ml/" class="js-splash--navigation-item">Artificial Intelligence and Machine Learning</a>
267+
</li>
268+
{% endif %}
269+
262270
{% if scientific == true %}
263271
<li class="--sidebar-item">
264272
<a href="/{{langue}}/scientific-charts/" class="js-splash--navigation-item">Scientific Charts</a>

_includes/posts/documentation_eg.html

+30-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
{% assign chart_studio = true %}
3939
{% elsif page.display_as == "advanced_opt" %}
4040
{% assign advanced_opt = true %}
41+
{% elsif page.display_as == "ai_ml" %}
42+
{% assign ai_ml = true %}
4143

4244
<!-- START OF GGPLOT CUSTOM LAYOUT -->
4345
{% elsif page.display_as == "aesthetics" %}
@@ -96,15 +98,40 @@
9698
{% if show_header %}
9799
<a href="#fundamentals" name="fundamentals" id="fundamentals">Fundamentals</a>
98100
{% endif %}
99-
101+
100102
</header>
101103
<section class="--grid">
102104
<ul class="--grid-list">
103105
{%- for page in languagelist -%}
104106
{% if page.display_as == "file_settings" %}
105107

106108
{% include layouts/grid-item.html %}
107-
109+
110+
111+
{% endif %}
112+
{%- endfor -%}
113+
</ul>
114+
</section>
115+
</section>
116+
{% endif %}
117+
118+
{% if ai_ml %}
119+
<section class="--tutorial-section" id="ai_ml">
120+
<header class="--section-header">
121+
{% if show_header %}
122+
123+
<a href="#ai_ml">Artificial Intelligence and Machine Learning</a>
124+
125+
{% endif %}
126+
127+
</header>
128+
<section class="--grid">
129+
<ul class="--grid-list">
130+
{%- for page in languagelist -%}
131+
{% if page.display_as == "ai_ml" %}
132+
133+
{% include layouts/grid-item.html %}
134+
108135

109136
{% endif %}
110137
{%- endfor -%}
@@ -876,4 +903,4 @@ <h4 class="example-section-title" id="layout-options">
876903

877904
{% if page.language == "matlab" %}
878905
<p><em>MATLAB is a registered trademark of The MathWorks, Inc.</em></p>
879-
{% endif %}
906+
{% endif %}

_includes/posts/mainlang_documentation_eg.html

+24
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
{% assign chart_studio = true %}
4242
{% elsif page.display_as == "advanced_opt" %}
4343
{% assign advanced_opt = true %}
44+
{% elsif page.display_as == "ai_ml" %}
45+
{% assign ai_ml = true %}
4446

4547
{% endif %}
4648
{%- endfor -%}
@@ -78,6 +80,28 @@
7880
</section>
7981
{% endif %}
8082

83+
84+
85+
{% if ai_ml %}
86+
<section class="--tutorial-section">
87+
<header class="--section-header"><a href="#ai_ml" name="ai_ml" id="ai_ml">Artificial Intelligence and Machine Learning</a>
88+
<a href="/{{language}}/ai-ml/" class="langindexlink">More AI and ML &raquo;</a>
89+
</header>
90+
<section class="--grid">
91+
<ul class="--grid-list">
92+
{%- for page in languagelist -%}
93+
{% if page.display_as == "ai_ml" and page.order < num_examples %}
94+
95+
96+
{% include layouts/grid-item.html %}
97+
{% endif %}
98+
{%- endfor -%}
99+
</ul>
100+
<a href="/{{language}}/ai-ml/" class="langindexlink-mobile">More AI and ML &raquo;</a>
101+
</section>
102+
</section>
103+
{% endif %}
104+
81105
{% if chart_type %}
82106
<section class="--tutorial-section">
83107
<header class="--section-header"><a href="#basic-charts" id="basic-charts">Basic Charts</a>

_posts/plotly_js/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ order: 5
4444
{% assign examples = site.posts | where:"language","plotly_js" | where:"suite","add-chart-type-or-topic"| sort: "order" %}
4545
{% include posts/auto_examples.html examples=examples %}
4646
```
47-
- Make sure to update `_includes/posts/documentation_eg.html` with the new chart type!
47+
- Make sure to update `_includes/posts/documentation_eg.html`, `_includes/layouts/side-bar.html`, and `_data/display_as_py_r_js.yml` and the CI python scripts with the new chart type!
4848

4949
- Index pages for chart categories must have `order: 5`.
5050

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
permalink: python/ai-ml/
3+
description: Plotly's Python graphing library makes interactive, publication-quality graphs online. Examples of how to make charts related to artificial intelligence and machine learning.
4+
name: AI and ML Charts
5+
layout: langindex
6+
language: python
7+
display_as: ai_ml
8+
thumbnail: thumbnail/mixed.jpg
9+
page_type: example_index
10+
---
11+
12+
13+
<header class="--welcome">
14+
<div class="--welcome-body">
15+
<!--div.--wrap-inner-->
16+
<div class="--title">
17+
<div class="--body">
18+
<h1>Plotly Python Open Source Graphing Library Artificial Intelligence and Machine Learning Charts</h1>
19+
<p>{{page.description}}</p>
20+
</div>
21+
</div>
22+
</div>
23+
</header>
24+
25+
26+
{% assign languagelist = site.posts | where: "language","python" | where: "display_as","ai_ml" | where: "layout","base" | sort: "order" %}
27+
{% include posts/documentation_eg.html %}

check-or-enforce-order.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
if sys.argv[2] == 'enforce':
1717
enforce = True
1818

19-
categories = ["file_settings", "basic", "financial", "statistical", "scientific", "maps", "3d_charts", "multiple_axes"]
19+
categories = ["file_settings", "basic", "financial", "statistical", "scientific", "maps", "3d_charts", "multiple_axes", "ai_ml"]
2020

2121
def get_post(path):
2222
return fm.load(str(path))

front-matter-ci.py

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def check_noTrailingSlash(meta_to_check):
7575
"maps",
7676
"3d_charts",
7777
"multiple_axes",
78+
"ai_ml"
7879
]
7980
languages = ["python", "python/v3", "plotly_js", "r"]
8081

0 commit comments

Comments
 (0)