Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c84e4b

Browse files
committed
update to new pio API and use unreleased Plotly and Kaleido
1 parent afafaf2 commit 8c84e4b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.circleci/env_image.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ sudo python3 .circleci/download_google_fonts.py
66
sudo cp -r .circleci/fonts/ /usr/share/
77
sudo fc-cache -f
88
# install kaleido & plotly
9-
sudo python3 -m pip install "plotly[kaleido]==6.1.2" --progress-bar off
9+
# sudo python3 -m pip install "plotly[kaleido]==6.1.2" --progress-bar off
10+
# Once new Kaleido and Plotly versions are released, uncomment the line above, update the Plotly version,
11+
# and delete the two lines below.
12+
sudo python3 -m pip install "git+https://github.com/plotly/plotly.py.git@6837831" --progress-bar off
13+
sudo python3 -m pip install "'git+https://github.com/plotly/Kaleido.git@2a4bfa2#subdirectory=src/py'" --progress-bar off
1014
# install numpy i.e. to convert arrays to typed arrays
1115
sudo python3 -m pip install numpy==1.24.2

test/image/make_baseline.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
dirIn = os.path.join(root, 'test', 'image', 'mocks')
2020
dirOut = os.path.join(root, 'build', 'test_images')
2121

22-
# N.B. equal is the falg to write to baselines not test_images
22+
# N.B. equal is the flag to write to baselines not test_images
2323

2424
if '=' in args :
2525
args = args[args.index('=') + 1:]
@@ -35,7 +35,7 @@
3535
# until https://github.com/plotly/Kaleido/issues/124 is addressed
3636
# we are uanble to use local mathjax v3 installed in node_modules
3737
# for now let's download it from the internet:
38-
pio.kaleido.scope.mathjax = 'https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-svg.js'
38+
pio.defaults.mathjax = 'https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-svg.js'
3939
mathjax_version = 3
4040
print('Kaleido using MathJax v3')
4141

@@ -52,7 +52,8 @@
5252

5353
plotlyjs = plotlyjs_with_virtual_webgl
5454

55-
pio.kaleido.scope.plotlyjs = plotlyjs
55+
pio.defaults.plotlyjs = plotlyjs
56+
5657
pio.templates.default = 'none'
5758

5859
ALL_MOCKS = [os.path.splitext(a)[0] for a in os.listdir(dirIn) if a.endswith('.json')]

0 commit comments

Comments
 (0)