flasked-altair
flasked-altair copied to clipboard
Only grid (coordinate system), no data
Hello,
just tried it and got this error on the console. Any idea?
Regards
$ ./app.py
- Serving Flask app "app" (lazy loading)
- Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead.
- Debug mode: on
- Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
- Restarting with stat
- Debugger is active!
- Debugger PIN: 337-962-991 127.0.0.1 - - [24/Oct/2018 13:17:28] "GET / HTTP/1.1" 200 - 127.0.0.1 - - [24/Oct/2018 13:17:29] "GET /data/bar HTTP/1.1" 200 - 127.0.0.1 - - [24/Oct/2018 13:17:29] "GET /data/line HTTP/1.1" 200 - 127.0.0.1 - - [24/Oct/2018 13:17:29] "GET /data/waterfall HTTP/1.1" 200 - 127.0.0.1 - - [24/Oct/2018 13:17:29] code 400, message Bad request version ('ëaA¤\x90') 127.0.0.1 - - [24/Oct/2018 13:17:29] "GET /data/multiline HTTP/1.1" 200 - 127.0.0.1 - - [24/Oct/2018 13:17:29] "GET /data/stocks HTTP/1.1" 200 - 127.0.0.1 - - [24/Oct/2018 13:17:29] "GET /data/scatter HTTP/1.1" 200 - 127.0.0.1 - - [24/Oct/2018 13:17:29] "üvàâìzG_©+¦RÂR 0Å]Îà¥"ÖÕ ëaA¤" HTTPStatus.BAD_REQUEST -
Some strange observations:
- While Pandas is imported I saw no reference to Pandas in the code.
- I removed the Pandas import statement and got the same output (no data) and no error messages.
You need to update CDN links
<!--
######## ###REMOVE THIS
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega/3.0.0-beta.30/vega.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-lite/2.0.0-beta.2/vega-lite.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-embed/3.0.0-beta.14/vega-embed.js"></script>-->
############ ADD THIS
<script src="https://cdn.jsdelivr.net/npm/vega@4"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@3"></script>
<script src="https://vega.github.io/datalib/datalib.min.js"></script>
<!-- Vega Tooltip
######## REMOVE THIS
<script src="https://vega.github.io/vega-tooltip/vega-tooltip.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://vega.github.io/vega-tooltip/vega-tooltip.css">-->
############ ADD THIS
<!-- Import Vega 3 & Vega-Lite 2 (does not have to be from CDN) -->
<link rel="stlesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/vega-tooltip.scss">
and rename veg.embed to vegaEmbed
######### REMOVE THIS
vega.embed("#"+div, url, opt, function(error, result) {
// result.view is the Vega View, url is the original Vega-Lite specification
vegaTooltip.vegaLite(result.view, url);
});
######## Add THIS
vegaEmbed("#"+div, url, opt, function(error, result) {
// result.view is the Vega View, url is the original Vega-Lite specification
vegaTooltip.vegaLite(result.view, url);
});