graphery / graphane

Data Visualization Microframework
MIT License
4 stars 0 forks source link

gComponent.data error with single data #5

Open petergreendr opened 3 weeks ago

petergreendr commented 3 weeks ago

This code has an error:

<g-composer data="10"></g-composer>
<script>
  console.log(document.querySelector('g-composer').data);
</script>

In console is displayed:

composer.js:1  Uncaught TypeError: Cannot create proxy with a non-object as target or handler

The error is related to trying to create a JavaScript Proxy for something that is not an object. This typically happens when you're trying to use a Proxy on a primitive type, like a number or a string. In this case, the element might be trying to apply a Proxy to the value stored in the data attribute, which is a number, not an object. This issue is related with https://github.com/graphery/graphane/issues/4.

pabloalmunia commented 2 weeks ago

It is fixed in version 1.0.0-beta.4. Please confirm and close the issue.