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

is it possible to embed javascript in Config() #9

Closed
asbisen opened this issue Oct 24, 2024 · 1 comment
Closed

is it possible to embed javascript in Config() #9

asbisen opened this issue Oct 24, 2024 · 1 comment

Comments

@asbisen
Copy link

asbisen commented Oct 24, 2024

I have been playing around with Apache ECharts and the JSON object it uses for plotting can take Javascript functions as callbacks. For example

{
type: "scatter",
symbol: "circle",
symbolSize: function (val) {return val[2] * 2; }
}

Config() object can take in string, but how do I render the callback functions in JSON without the quotes for string. Performing JSON3.write() gets me "symbolSize: function (val) {return val[2] * 2; }" but I would like to render symbolSize: function (val) {return val[2] * 2; }

@joshday
Copy link
Member

joshday commented Oct 24, 2024

I think you'd need to find/create a type that JSON3 will write as you want.

@joshday joshday closed this as completed Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants