graphery / graphane

Data Visualization Microframework
MIT License
4 stars 0 forks source link

Bug in the data script #3

Open mcodispoto2019crn opened 1 month ago

mcodispoto2019crn commented 1 month ago

When writing an object o an array outside the curly braces, the Playground's browser freezes. Here's an example of the incorrect code:

<script type="data">
{
  text: "Social networks",
  hours: 2.5,
  color: "#007EA7",
}

[
  {
    text: "Social networks",
    hours: 2.5,
    color: "#007EA7",
  },
]
</script>
pabloalmunia commented 1 month ago

Firstly, the data format is incorrect and cannot be displayed correctly.

Secondly, an incorrect data format should not crash Playground or the g-composer component.

Let us analyze the problem to identify what is going on.

pabloalmunia commented 1 month ago

It is definitely a bug in g-composer, specifically in the function that checks if the data format is CSV, an object or an array. We are using a regular expression that has a catastrophic backtracking. Will be corrected in the next version.

pabloalmunia commented 1 month ago

This bug has been fixed in version 1.0.0-beta.3.

Please, confirm that this bug has been fixed.