sandbox/utils.js
function formMap(k, v) {
    // customized props
    switch (k) {
        case "link.type": {
            return {
                type: "array",
                title: "link.type",
                items: {
                    enum: Object.keys(LINE_TYPES),
                },
                uniqueItems: true,
            };
        }
    }

    return {
        title: k,
        type: typeof v,
        default: v,
    };
}
function formMap(k, v) {
    // customized props
    switch (k) {
        case "link.type": {
            return {
                type: "array",
                title: "link.type",
                items: {
                    enum: Object.keys(LINE_TYPES),
                },
                uniqueItems: true,
            };
        }
    }

    return {
        title: k,
        type: typeof v,
        default: v,
    };
}
function formMap ( k , v ) { // customized props switch ( k ) { case "link.type" : { return { type : "array" , title : "link.type" , items : { enum : Object . keys ( LINE_TYPES ) , } , uniqueItems : true , } ; } } return { title : k , type : typeof v , default : v , } ; }
This two functions generate the react-jsonschema-form
schema from some passed graph configuration.
This two functions generate the react - jsonschema - form schema from some passed graph configuration .