g2 icon indicating copy to clipboard operation
g2 copied to clipboard

chart-element samples missing

Open goessner opened this issue 5 years ago • 2 comments

Make examples to demonstrate usability

goessner avatar Jun 01 '20 09:06 goessner

First example provided in 5f15bf0cd3e6596a1f90ab8bd711d7416cbdb442. g2.chart is accepting functions (e.g. Math.sin), which is not supported by JSON.

We could add some kind of parsing here, for example the ability for g2.chart to accept strings like "sin", "cos", "PI" etc. to be handled accordingly.

klawr avatar Jun 01 '20 10:06 klawr

The most simple way here would be to use eval ... but it's evil.

I also would like to have normal strings in JSON data and interprete them like template strings.

I once read a discussions about that:

https://stackoverflow.com/questions/29182244/convert-a-string-to-a-template-string https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Never_use_eval!

The Function related solution sounds promising ... try it.

goessner avatar Jun 01 '20 13:06 goessner