{ "name": "Calculator", "display": { "scale": 0.6, "arrowHeight": 15, "arrowWidth": 6, "layout": "vertical" }, "edgeData": { "Order": { "desc": "First or second operand? (1 or 2)", "type": "number", "validator": "NumberIsOneOrTwo", "value": 1, "start": ["Terminals.*", "Operations.*"], "end": ["Operations.*"] } }, "types": [{ "type": "Terminals", "width": 100, "height": 100, "padding": 0, "subtypes": [{ "type": "Number", "desc": "Number", "view": "<?xml version=\"1.0\" encoding=\"utf-8\"?> <svg version=\"1.1\" id=\"Addition\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\"> <g> <rect x=\"3\" y=\"3\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"5\" stroke-miterlimit=\"10\" width=\"94\" height=\"94\"/> <rect x=\"3\" y=\"3\" fill=\"none\" stroke=\"#000000\" stroke-width=\"5\" stroke-miterlimit=\"10\" width=\"94\" height=\"94\"/> <text transform=\"matrix(1 0 0 1 6.8389 57.1431)\" font-family=\"'MyriadPro-Regular'\" font-size=\"25\">Number</text> </g> </svg> ", "nodeData": { "Value": { "desc": "Value", "type": "number", "value": 0 } }, "constraints": { "incoming": { "range": [0,0] }, "outgoing": { "range": [1,1], "types": { "Operations.*": [1,1] } } } }] }, { "type": "Operations", "width": 100, "height": 100, "padding": 40, "constraints": { "incoming": { "range": [2,2], "types": { "Terminals.Number": [0,2], "Operations.*": [0,2] } }, "outgoing": { "range": [1,1], "types": { "Operations.*": [0,1], "Output": [0,1] } } }, "subtypes": [{ "type": "Addition", "desc": "Addition", "view": "<?xml version=\"1.0\" encoding=\"utf-8\"?><svg version=\"1.1\" id=\"Addition\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\"><g><circle fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/><circle fill=\"none\" stroke=\"#000000\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/><rect x=\"45.5\" y=\"17.5\" width=\"8.9\" height=\"65\"/><rect x=\"17.5\" y=\"45.5\" width=\"65\" height=\"9\"/></g></svg> " },{ "type": "Subtraction", "desc": "Subtraction", "view": "<?xml version=\"1.0\" encoding=\"utf-8\"?><svg version=\"1.1\" id=\"Subtraction\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\"><g><circle fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/><circle fill=\"none\" stroke=\"#000000\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/><rect x=\"17.5\" y=\"45.5\" width=\"65\" height=\"9\"/></g></svg> " },{ "type": "Multiplication", "desc": "Multiplication", "view": "<?xml version=\"1.0\" encoding=\"utf-8\"?> <svg version=\"1.1\" id=\"Addition\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\"> <g> <circle fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/> <circle fill=\"none\" stroke=\"#000000\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/> <rect x=\"17.5\" y=\"45.5\" transform=\"matrix(0.7071 -0.7071 0.7071 0.7071 -20.7107 50)\" width=\"65\" height=\"9\"/> <rect x=\"17.5\" y=\"45.5\" transform=\"matrix(-0.7071 -0.7071 0.7071 -0.7071 50 120.7107)\" width=\"65\" height=\"9\"/> </g> </svg>" },{ "type": "Division", "desc": "Division", "view": "<?xml version=\"1.0\" encoding=\"utf-8\"?> <svg version=\"1.1\" id=\"Addition\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\"> <g> <circle fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/> <circle fill=\"none\" stroke=\"#000000\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/> <rect x=\"17.5\" y=\"45.5\" width=\"65\" height=\"9\"/> <circle cx=\"50.5\" cy=\"30.5\" r=\"7.5\"/> <circle cx=\"50.5\" cy=\"69.5\" r=\"7.5\"/> </g> </svg>" }] }, { "type": "Output", "desc": "Output", "width": 100, "height": 100, "padding": 40, "view": "<?xml version=\"1.0\" encoding=\"utf-8\"?> <svg version=\"1.1\" id=\"Addition\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\"> <g> <circle fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/> <circle fill=\"none\" stroke=\"#000000\" stroke-width=\"5\" stroke-miterlimit=\"10\" cx=\"50\" cy=\"50\" r=\"47\"/> <rect x=\"17.5\" y=\"56.1\" width=\"65\" height=\"9\"/> <rect x=\"17.5\" y=\"34.9\" width=\"65\" height=\"9\"/> </g> </svg>", "constraints": { "incoming": { "range": [1,1], "types": { "Operations.*": [1,1] } }, "outgoing": { "range": [0,0] } } } ] }