Skip to content

Commit 3655be9

Browse files
authored
Merge pull request #455 from plotly/cam/add-v4-migration-guide
docs: Add plotly.js v4 migration guide
2 parents f2d82f9 + 9c6a4a9 commit 3655be9

142 files changed

Lines changed: 24620 additions & 35538 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ jobs:
3333
- name: Fetch upstream docs
3434
run: make fetch_upstream_files
3535

36-
- name: Set up Mapbox token
37-
run: |
38-
echo "token: ${{ secrets.MAPBOX_TOKEN }}" > _data/mapbox_token.yml
39-
4036
- name: Build site
4137
run: |
4238
python front-matter-ci.py _posts
@@ -49,7 +45,6 @@ jobs:
4945
md5sum all_static/css/main.css | cut -d ' ' -f 1 > _data/cache_bust_css.yml
5046
bundle exec jekyll build
5147
cp python/sitemap.xml _site/python/sitemap.xml
52-
rm _data/mapbox_token.yml
5348
5449
- name: Create Percy snapshots
5550
run: |

_data/display_as.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ signal-analysis:
1313
file_settings:
1414
reference: '#fundamentals'
1515
text: Fundamentals
16+
guide:
17+
reference: '#guides'
18+
text: Guides
1619
basic:
1720
reference: '#basic-charts'
1821
text: Basic

_data/display_as_py_r_js.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ signal-analysis:
1313
file_settings:
1414
reference: 'plotly-fundamentals'
1515
text: Fundamentals
16+
guide:
17+
reference: 'guides'
18+
text: Guides
1619
basic:
1720
reference: 'basic-charts'
1821
text: Basic Charts

_data/jsversion.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "3.6.0"
2+
"version": "4.0.0"
33
}

_data/make_ref_pages.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
schema = json.load(open("plotschema.json"))
44

55

6-
for upperlang in ["Python", "JavaScript", "MATLAB", "R", "Julia", "F#"]:
6+
# Only Python and JavaScript are regenerated. The MATLAB, R, Julia, and F# reference
7+
# pages are frozen at whatever schema they were last built from: those languages are no
8+
# longer maintained, and their pages load pinned older plotly.js bundles (R/ggplot2 on
9+
# 1.58.4, Julia/MATLAB on 2.35.3 — see _includes/layouts/head.html), so regenerating them
10+
# from a current schema would document attributes their bundles don't have and drop ones
11+
# they do. Their existing files under _posts/reference_pages/<lang>/ are left untouched.
12+
for upperlang in ["Python", "JavaScript"]:
713
lang = upperlang.lower()
814
lang = "fsharp" if lang == "f#" else lang
915
lang = "csharp" if lang == "c#" else lang
1016
langcode = "plotly_js" if lang == "javascript" else lang
1117
for attr in [
12-
"xaxis", "yaxis", "coloraxis", "scene", "polar", "ternary", "smith", "geo", "mapbox",
18+
"xaxis", "yaxis", "coloraxis", "scene", "polar", "ternary", "smith", "geo", "map",
1319
"sliders", "updatemenus", "annotations", "shapes", "images","selections", "global"
1420
]:
1521
fullattr = "layout" + ("." + attr if attr != "global" else "")

_data/orderings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"scene",
5151
"geo",
5252
"map",
53-
"mapbox",
5453
"polar",
5554
"smith",
5655

@@ -63,8 +62,6 @@
6362
"sliders",
6463
"selections",
6564

66-
"hidesources",
67-
6865
"_deprecated",
6966
"radialaxis",
7067
"angularaxis",
@@ -75,15 +72,15 @@
7572
"traces": [
7673
"scatter", "scattergl",
7774
"bar", "pie", "heatmap", "heatmapgl","image",
78-
"contour", "table",
75+
"contour", "quiver", "table",
7976

8077
"box", "violin", "histogram", "histogram2d", "histogram2dcontour",
8178

8279
"ohlc", "candlestick", "waterfall", "funnel", "funnelarea","indicator",
8380

8481
"scatter3d", "surface", "mesh3d", "cone", "streamtube", "volume", "isosurface",
8582

86-
"scattergeo", "choropleth", "scattermap", "scattermapbox", "choroplethmap", "choroplethmapbox", "densitymap", "densitymapbox",
83+
"scattergeo", "choropleth", "scattermap", "choroplethmap", "densitymap",
8784

8885
"scatterpolar", "scatterpolargl", "barpolar", "scatterternary", "scattersmith", "sunburst", "treemap", "icicle",
8986

@@ -398,6 +395,9 @@
398395
"sortpaths",
399396

400397
"anchor",
398+
"arrowref",
399+
"lengthmode",
400+
"lengthfactor",
401401
"autocontour",
402402
"bandwidth",
403403
"below",

_data/plotschema.json

Lines changed: 21692 additions & 34890 deletions
Large diffs are not rendered by default.

_includes/layouts/head.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
{% endif %}
3636

3737
<!-- Mathjax -->
38+
{% if page.language == "r" or page.language == "ggplot2" %}
39+
<!-- MathJax v2, kept for the hardcoded plotly.js 1.58.4 bundle loaded on R/ggplot2 pages below -->
3840
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
41+
{% else %}
42+
<!-- MathJax v3 (tex-svg). Plotly.js v4 removed MathJax v2 support; v3 works with v2.x and v3.x bundles too. -->
43+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-svg.js"></script>
44+
{% endif %}
3945

4046
{% if page.language == "plotly_js" %}
4147
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>

_includes/layouts/reference-side-nav.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
{% comment %}Python and JavaScript track the current plotly.js schema; the other
2+
languages' reference pages are frozen on older bundles, so they keep the legacy
3+
entries. See the note at the top of _data/make_ref_pages.py.{% endcomment %}
4+
{% assign v4ref = false %}
5+
{% if langue == "javascript" or langue == "python" %}{% assign v4ref = true %}{% endif %}
16
<details style="color: white; margin-top: 20px">
27
<summary>Simple Traces</summary>
38
<nav class="--sidebar-body watch" id="where">
@@ -22,9 +27,11 @@
2227
<a href="/{{ langue }}/reference/heatmap">Heatmap</a>
2328
</li>
2429

30+
{% unless v4ref %}
2531
<li class="--sidebar-item">
2632
<a href="/{{ langue }}/reference/heatmapgl">Heatmap GL</a>
2733
</li>
34+
{% endunless %}
2835

2936
<li class="--sidebar-item">
3037
<a href="/{{ langue }}/reference/image">Image</a>
@@ -34,6 +41,12 @@
3441
<a href="/{{ langue }}/reference/contour">Contour</a>
3542
</li>
3643

44+
{% if v4ref %}
45+
<li class="--sidebar-item">
46+
<a href="/{{ langue }}/reference/quiver">Quiver</a>
47+
</li>
48+
{% endif %}
49+
3750
<li class="--sidebar-item">
3851
<a href="/{{ langue }}/reference/table">Table</a>
3952
</li>
@@ -152,25 +165,32 @@
152165
<a href="/{{ langue }}/reference/scattermap">Scatter Map</a>
153166
</li>
154167

168+
{% unless v4ref %}
155169
<li class="--sidebar-item">
156170
<a href="/{{ langue }}/reference/scattermapbox">Scatter Mapbox</a>
157171
</li>
172+
{% endunless %}
158173

159174
<li class="--sidebar-item">
160175
<a href="/{{ langue }}/reference/choroplethmap">Choropleth Map</a>
161176
</li>
162177

178+
{% unless v4ref %}
163179
<li class="--sidebar-item">
164180
<a href="/{{ langue }}/reference/choroplethmapbox">Choropleth Mapbox</a>
165181
</li>
182+
{% endunless %}
166183

167184
<li class="--sidebar-item">
168185
<a href="/{{ langue }}/reference/densitymap">Density Map</a>
169186
</li>
170187

188+
{% unless v4ref %}
171189
<li class="--sidebar-item">
172190
<a href="/{{ langue }}/reference/densitymapbox">Density Mapbox</a>
173191
</li>
192+
{% endunless %}
193+
174194
</ul>
175195
</nav>
176196
</details>
@@ -295,7 +315,7 @@
295315
<a href="/{{ langue }}/reference/layout/geo/">Geo</a>
296316
</li>
297317
<li class="--sidebar-item">
298-
<a href="/{{ langue }}/reference/layout/mapbox/">Mapbox</a>
318+
{% if v4ref %}<a href="/{{ langue }}/reference/layout/map/">Map</a>{% else %}<a href="/{{ langue }}/reference/layout/mapbox/">Mapbox</a>{% endif %}
299319
</li>
300320
<li class="--sidebar-item">
301321
<a href="/{{ langue }}/reference/layout/polar/">Polar</a>

_includes/layouts/side-bar.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@
168168
<a href="/javascript/configuration-options/" class="js-splash--navigation-item">Configuration
169169
Options</a>
170170
</li>
171+
<li class="--sidebar-item">
172+
<a href="/javascript/guides/" class="js-splash--navigation-item">Guides</a>
173+
</li>
171174
{% endif %}
172175

173176
<!-- R Specific -->

0 commit comments

Comments
 (0)