title: How to get the object properties onclick of the element in d3.js Treemap layout
body: <p>In the d3 <strong>treemap</strong> layout onClick of any segment, how to log the clicked element object properties in the console .  </p>
  
  <p>Find my react and d3.js code in this link . <a href="https://codesandbox.io/s/affectionate-thunder-l024x" rel="nofollow noreferrer">https://codesandbox.io/s/affectionate-thunder-l024x</a></p>
  
  <pre><code>const dataObj = {
    name: "Home",
    children: [
      {
        name: "A",
        metricsValue: "ma",
        value: "15"
      },
      {
        name: "BCD",
        value: "35",
        metricsValue: "m1"
      }
    ]
  };
  </code></pre>
  
  <p>Example : Onclick of the element <strong>"BCD"</strong> , log the properties of BCD in the console .</p>
  
  <pre><code>Result : 
  {
        name: "BCD",
        value: "35",
        metricsValue: "m1"
      }
  </code></pre>