From 5155b4a361ecea239bcbf5c5d05c4c75d40c0f93 Mon Sep 17 00:00:00 2001 From: dennischan <48424802+dennischancs@users.noreply.github.com> Date: Mon, 7 Mar 2022 22:08:13 +0800 Subject: [PATCH] fix CJK garbled character & shrink size 1. fix CJK garbled character in Windows system 2. shrink picture size & ipynb file size --- plotly/plotly_offline_aux/plotlyoffline.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plotly/plotly_offline_aux/plotlyoffline.m b/plotly/plotly_offline_aux/plotlyoffline.m index 21444a10..b0b8a64c 100644 --- a/plotly/plotly_offline_aux/plotlyoffline.m +++ b/plotly/plotly_offline_aux/plotlyoffline.m @@ -14,10 +14,15 @@ % check that the bundle exists try - bundle = fileread(bundleFile); + % ----- js CDN url ----- + jsChina = 'https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/plotly.js/1.58.5/plotly.min.js'; + jsGlobal = 'https://cdn.jsdelivr.net/npm/plotly.js@1.58.5/dist/plotly.min.js'; % template dependencies - depScript = sprintf('\n', ... - bundle); + depScript = sprintf(['\n\n', ... + '\n\n', ... + '\n\n', ... + '\n\n'], ... + bundleFile, jsChina, jsGlobal); catch error(['Error reading: %s.\nPlease download the required ', ... 'dependencies using: >>getplotlyoffline \n', ...