Skip to content

JavaScript functions as values #170

Description

@randyzwitch

I know it's not part of the JSON data format specification, but is there a way to pass JavaScript functions within JSON created by Julia?

So much of what I do in Julia involves generating JSON, and in some JavaScript libraries, the parser will evaluate functions (and seems that it is the JS library dev preference).

So is there a way to create something like:

{
    symbolSize: function (data) {
        return Math.sqrt(data[2]) / 5e2;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions