title: Extracting info from a JSON: P5.js
body: <p>my php script json_encodes this:</p>
  
  <pre><code>[{"x":"20","y":"24","name":"NewNov"},{"x":"20","y":"70","name":"Tito"}]
  </code></pre>
  
  <p>But I can't see how I can extract this information in my p5.js program? </p>
  
  <p>Say, I need to use those 'x', 'y', 'name' to draw a circle in the appropriate place with the right name.</p>
  
  <p>I used loadJSON in the script, and now I have a variable -</p>
  
  <pre><code>data = loadJSON()
  </code></pre>
  
  <p>But how do I get, say, the 'x' component from the JSON?</p>
  
  <pre><code>var radius;
  
  function preload() {
      var url = 'http://localhost/planetTrequest.php';
      radius = loadJSON(url);
  }
  
  function setup() {
      createCanvas(300, 300);
      background(153);
      noLoop();
  }
  
  function draw() {
      background(200);
      textSize(15);
      text(radius.x, 10, 30);
      fill(0, 102, 153);
  }
  </code></pre>