Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viz fails on Mac OS 10.13 #90

Open
JerryLingjieMei opened this issue Nov 29, 2018 · 4 comments
Open

viz fails on Mac OS 10.13 #90

JerryLingjieMei opened this issue Nov 29, 2018 · 4 comments

Comments

@JerryLingjieMei
Copy link

When I was trying to run the following code on webppl:

var viz = webpplViz;

//viz.bar(['a','b','c'], [1,2,3])
viz.bar(['a','b','c'], [1,2,3], {fileName: 'bar.svg'})
viz.hist(repeat(4,flip), {fileName: 'hist.svg'})
viz.scatter([1,2,3],[4,5,6], {fileName: 'scatter.svg'})

with command line

webppl src/prior.wppl --require webppl-viz

The webppl interpreter tells me that

/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega-scenegraph/src/util/bound.js:18
  return g2D || (g2D = canvas.instance(1,1).getContext('2d'));

The backtraces are as follows:

TypeError: Cannot read property 'getContext' of null
    at context (/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega-scenegraph/src/util/bound.js:18:44)
    at textMark (/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega-scenegraph/src/util/bound.js:169:11)
    at Object.itemBounds [as item] (/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega-scenegraph/src/util/bound.js:259:3)
    at /Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega/src/scene/Bounder.js:36:13
    at Array.forEach (<anonymous>)
    at Bounder.proto.evaluate (/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega/src/scene/Bounder.js:35:15)
    at Model.prototype.evaluate (/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega-dataflow/src/Graph.js:329:16)
    at Builder.proto.evaluate (/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega/src/scene/Builder.js:227:26)
    at Model.prototype.evaluate (/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega-dataflow/src/Graph.js:329:16)
    at Model.prototype.propagate (/Users/jerrymei/.webppl/node_modules/webppl-viz/node_modules/vega-dataflow/src/Graph.js:161:22)

Can you help me with this issue

@JerryLingjieMei JerryLingjieMei changed the title viz falls on Mac OS 10.13 viz fails on Mac OS 10.13 Nov 30, 2018
@longouyang
Copy link
Member

Can you tell me what version of Vega your npm is using?

@smilli
Copy link

smilli commented Dec 3, 2018

I'm having the same issue; my installation is vega 2.6.5 (with vega-scenegraph 1.1.0).

@longouyang
Copy link
Member

What version of the canvas library do you guys have installed? IIRC, there are issues with using anything above 1.6.4.

@smilli
Copy link

smilli commented Dec 5, 2018

Ah, yea I was on the latest version of canvas, just switched to 1.6.4 and it started working. Thanks, Long!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants