Thanks to visit codestin.com
Credit goes to github.com

Skip to content

console logging p5.Vector #469

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

Closed
shiffman opened this issue Nov 4, 2017 · 4 comments
Closed

console logging p5.Vector #469

shiffman opened this issue Nov 4, 2017 · 4 comments

Comments

@shiffman
Copy link
Member

shiffman commented Nov 4, 2017

Related to #468, but I think a different problem so filing a separate issue. Trying to print() or console.log() a p5.Vector object results in the following message: Converting circular structure to JSON. We should see: {x: 100, y: 100, z: 0}.

function setup() {
  let v = createVector(100, 100);
  print(v);
}
@himanshuc3
Copy link
Contributor

screen shot 2018-02-20 at 10 28 34 am
Console in Firefox shows a JSHINT warning, the expected console message and Cycle object value error message.
Does this error has something to do with createVector. If it does, is this an issue for p5.js library instead of editor.

@catarak
Copy link
Member

catarak commented Feb 20, 2018

this is an error with the console component i think—it doesn't know how to handle class structures which hold references to themselves and thus are cyclical. this is handled in chrome developer tools by having open and close arrows.

@catarak
Copy link
Member

catarak commented Sep 7, 2018

this is now fixed thanks to #656

@catarak catarak closed this as completed Sep 7, 2018
@shiffman
Copy link
Member Author

shiffman commented Sep 8, 2018

Woohoo! I am constantly demonstrating the beauty of console logging p5.Vector now! ❤️

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