Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chart-element samples missing #37

Open
goessner opened this issue Jun 1, 2020 · 2 comments
Open

chart-element samples missing #37

goessner opened this issue Jun 1, 2020 · 2 comments
Assignees

Comments

@goessner
Copy link
Owner

goessner commented Jun 1, 2020

Make examples to demonstrate usability

@klawr
Copy link
Collaborator

klawr commented Jun 1, 2020

First example provided in 5f15bf0.
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 klawr self-assigned this Jun 1, 2020
@goessner
Copy link
Owner Author

goessner commented Jun 1, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants