standalone bl.ock for vega not working

78 views
Skip to first unread message

Enrico Spinielli

unread,
Aug 10, 2015, 1:11:07 PM8/10/15
to d3...@googlegroups.com
Hi all,
I have few bl.ocks containing Vega (2.0) examples.
These all display correctly in the <iframe>'d mode but do not work when I click the 'Open in a new window.' link.

For example for this example when opened in its own window, the javascript console shows the following:

 (vega.min.js:3) Uncaught SyntaxError: Invalid regular expression: /[ªµºÀ-ÖØ-öø-Ë Ë†-Ë <and on on on ...>
(bl.ocks.org/:13)Uncaught ReferenceError: vg is not defined

Anybody experienced the same issue?

Bye and thanks for any feedbacks
Enrico

Enrico Spinielli

unread,
Aug 10, 2015, 1:18:29 PM8/10/15
to d3...@googlegroups.com
I forgot to say that Vega version is 2.0.0 and d3 is 3.5.6

The problem is that in that standalone version Vega fails to load: vg is not available so I had to search for 'version' in the ega.min.js to find the version out while I could execute d3.version to print d3's version.

Enrico Spinielli

unread,
Aug 12, 2015, 5:45:47 AM8/12/15
to d3...@googlegroups.com
I discovered that locally serving with
http-server -p 8000
results in no problems, while using 
python -m SimpleHTTPServer 8000

will result in the error as reported in my initial email.

For the sake of having a working standalone bl.ock I reverted to use d3 and vega libraries as served from
the vega site:

This is weird ...

Robert Feldt

unread,
May 30, 2016, 7:22:48 AM5/30/16
to d3-js
Did anyone else run into this and maybe have found a solution? I have the same problem with latest vega and d3 and running both a ruby-based or a python-based web server. When I revert to linking directly to the vega and d3 files on the vega web site everything works but with local copies I get the same uncaught exception. Maybe it has to do with serving the files and encoding (UTF or not)?

Any help appreciated,

Robert Feldt

Blake Haugen

unread,
Feb 14, 2017, 9:30:30 AM2/14/17
to d3-js
I ran into this problem when using the python http.server. I am not certain but I believe the problem has to do with the encoding of the javascript files. I changed my html to explicitly load the script as UTF-8 and it seems to be working for me. 

    <script src="js/d3.min.js" charset="UTF-8"></script>

Hopefully this helps the next person with this problem.

-Blake
Reply all
Reply to author
Forward
0 new messages