Selaa lähdekoodia

#580 update DEPENDENCIES and fetch_dependencies for plotly 2.20.0

Falko Schindler 2 vuotta sitten
vanhempi
säilyke
965aa86fba
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 1 1
      DEPENDENCIES.md
  2. 3 3
      fetch_dependencies.py

+ 1 - 1
DEPENDENCIES.md

@@ -5,7 +5,7 @@
 - Socket.io: 4.6.1
 - Tailwind CSS: 3.2.6
 - Tween.js: 18.6.4
-- Plotly.js: 2.18.2
+- Plotly.js: 2.20.0
 - AG Grid: 29.1.0
 - NippleJS: 0.10.1
 - Mermaid: 9.4.3

+ 3 - 3
fetch_dependencies.py

@@ -90,11 +90,11 @@ Path('nicegui/elements/lib/tween.umd.min.js').write_text(js)
 print('Tween.js:', version)
 
 # plotly.js
-url = 'https://plotly.com/javascript/'
+url = 'https://cdnjs.com/libraries/plotly.js'
 html = request_buffered_str(url)
 soup = BeautifulSoup(html, 'html.parser')
-version = soup.find('a', class_='plotly_js').text.strip().removeprefix('Javascript (v').removesuffix(')')
-url = f'https://cdn.plot.ly/plotly-{version}.min.js'
+version = soup.find('span', class_='vs__selected').text.strip()
+url = f'https://cdnjs.cloudflare.com/ajax/libs/plotly.js/{version}/plotly.min.js'
 js = request_buffered_str(url)
 Path('nicegui/elements/lib/plotly.min.js').write_text(js)
 print('Plotly.js:', version)