mattijn
4/7/2018 - 10:15 PM

bb_continu.json

{
  "$schema": "https://vega.github.io/schema/vega/v3.json",
  "width": 400,
  "height": 200,
  "padding": 10,
  "layout": {
    "padding": {
      "row": 10,
      "column": 50
    },
    "offset": 10,
    "columns": 2,
    "bounds": "full"
  },
  "signals": [
    {
      "name": "heightfragility",
      "value": 200
    },
    {
      "name": "widthfragility",
      "value": 500
    },
    {
      "name": "heightradial",
      "update": "heightfragility"
    },
    {
      "name": "widthradial",
      "update": "heightradial"
    },
    {
      "name": "Dijkvak",
      "value": "Dijkvak 7 (P18)",
      "bind": {
        "input": "select",
        "options": [
          "Dijkvak 7 (P18)",
          "Dijkvak 8 (P18)",
          "Dijkvak 9 (P18)",
          "Dijkvak 10 (P18)",
          "Dijkvak 11 (P18)",
          "Dijkvak 12 (P18)",
          "Dijkvak 13 (P19)",
          "Dijkvak 42 (P27)"
        ]
      }
    },
    {
      "name": "Gecombineerd",
      "value": true,
      "bind": {
        "input": "checkbox"
      }
    },
    {
      "name": "GEKB",
      "value": false,
      "bind": {
        "input": "checkbox"
      }
    },
    {
      "name": "STPH",
      "value": false,
      "bind": {
        "input": "checkbox"
      }
    },
    {
      "name": "STBI",
      "value": false,
      "bind": {
        "input": "checkbox"
      }
    },
    {
      "name": "Maatregel",
      "value": "Geen",
      "bind": {
        "input": "radio",
        "options": [
          "Geen",
          "GEKB",
          "STPH",
          "STBI"
        ]
      }
    },
    {
      "name": "Faalkans_WS",
      "value": "Actueel",
      "bind": {
        "input": "select",
        "options": [
          "Actueel",
          "Verwachting over 24u",
          "Verwachting over 48u"
        ]
      }
    },
    {
      "name": "slider_waterlevel",
      "value": 3.5,
      "bind": {
        "input": "range",
        "min": 0.00,
        "max": 6.00,
        "step": 0.1
      }
    },
    {
      "name": "waterlevel_plus24u",
      "update": "slider_waterlevel + 1"
    },
    {
      "name": "waterlevel_plus48u",
      "update": "slider_waterlevel + 1.6"
    }
  ],
  "data": [
    {
      "name": "failureprobabilities",
      "url": "https://data.hkvservices.nl/dataservices/data.asmx/read?database=csvdata&key=fragdb",
      "format": {
        "type": "csv"
      }
    }
  ],
  "scales": [
    {
      "name": "layout",
      "type": "band",
      "domain": [
        "fragcurve",
        "radiaal"
      ],
      "range": "height"
    }
  ],
  "marks": [
    {
      "description": "Fragility curve",
      "name": "fragcurve",
      "type": "group",
      "encode": {
        "enter": {
          "y": {
            "scale": "layout",
            "value": "fragcurve",
            "offset": 20
          },
          "width": {
            "signal": "widthfragility"
          },
          "height": {
            "signal": "heightfragility"
          },
          "fill": {
            "value": "transparent"
          }
        }
      },
      "data": [
        {
          "name": "failureprobabilitiesfragcurve",
          "source": "failureprobabilities"
        }
      ],
      "scales": [
        {
          "name": "Waterstand",
          "type": "linear",
          "range": "width",
          "zero": false,
          "domain": {
            "data": "failureprobabilitiesfragcurve",
            "field": "Waterstand"
          },
          "clamp": true
        },
        {
          "name": "Gecombineerde faalkans",
          "type": "linear",
          "range": "height",
          "zero": true,
          "domain": {
            "data": "failureprobabilitiesfragcurve",
            "field": {
              "signal": "Maatregel === 'Geen' ? 'COMB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_COMB_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_COMB_' + Dijkvak : 'MAATR_STBI_COMB_' + Dijkvak"
            }
          }
        },
        {
          "name": "Waterstandcolor",
          "type": "ordinal",
          "domain": [
            "Actueel",
            "Verwachting over 24u",
            "Verwachting over 48u"
          ],
          "range": [
            "#99ccff",
            "#77aaff",
            "#3366ff"
          ]
        },
        {
          "name": "Failuremechanisme",
          "type": "ordinal",
          "domain": [
            "Gecombineerd",
            "GEKB",
            "STPH",
            "STBI"
          ],
          "range": [
            "#a200ff",
            "#f47835",
            "#d41243",
            "#8ec127"
          ]
        }
      ],
      "axes": [
        {
          "orient": "left",
          "scale": "Gecombineerde faalkans",
          "title": "Faalkans [per jaar]",
          "titlePadding": 10,
          "grid": true,
          "encode": {
            "ticks": {
              "update": {
                "stroke": {
                  "value": "#000"
                },
                "strokeWidth": {
                  "value": 0.5
                }
              }
            },
            "title": {
              "update": {
                "font": {
                  "value": "Verdana"
                },
                "fontSize": {
                  "value": 14
                },
                "fontWeight": {
                  "value": "normal"
                },
                "fill": {
                  "value": "#000"
                }
              }
            },
            "labels": {
              "update": {
                "font": {
                  "value": "Verdana"
                },
                "fontSize": {
                  "value": 14
                },
                "fontWeight": {
                  "value": "normal"
                },
                "fill": {
                  "value": "#000"
                }
              }
            }
          }
        },
        {
          "orient": "bottom",
          "scale": "Waterstand",
          "grid": true,
          "format": ".2f",
          "title": "Waterstand [m+NAP]",
          "tickCount": 6,
          "encode": {
            "ticks": {
              "update": {
                "stroke": {
                  "value": "#000"
                },
                "strokeWidth": {
                  "value": 0.5
                }
              }
            },
            "title": {
              "update": {
                "font": {
                  "value": "Verdana"
                },
                "fontSize": {
                  "value": 14
                },
                "fontWeight": {
                  "value": "normal"
                },
                "fill": {
                  "value": "#000"
                }
              }
            },
            "labels": {
              "update": {
                "font": {
                  "value": "Verdana"
                },
                "fontSize": {
                  "value": 14
                },
                "fontWeight": {
                  "value": "normal"
                },
                "fill": {
                  "value": "#000"
                }
              }
            }
          }
        }
      ],
      "marks": [
        {
          "name": "Actuele waterstand",
          "type": "rule",
          "encode": {
            "update": {
              "x": {
                "scale": "Waterstand",
                "signal": "slider_waterlevel"
              },
              "x2": {
                "scale": "Waterstand",
                "signal": "slider_waterlevel"
              },
              "y": {
                "value": 0
              },
              "y2": {
                "signal": "heightfragility"
              },
              "stroke": {
                "value": "#99ccff"
              },
              "strokeWidth": {
                "value": 3
              }
            }
          }
        },
        {
          "name": "Verwachte waterstand over 24 uur",
          "type": "rule",
          "encode": {
            "update": {
              "x": {
                "scale": "Waterstand",
                "signal": "waterlevel_plus24u"
              },
              "x2": {
                "scale": "Waterstand",
                "signal": "waterlevel_plus24u"
              },
              "y": {
                "value": 0
              },
              "y2": {
                "signal": "heightfragility"
              },
              "stroke": {
                "value": "#77aaff"
              },
              "strokeWidth": {
                "value": 3
              }
            }
          }
        },
        {
          "name": "Verwachte waterstand over 48 uur",
          "type": "rule",
          "encode": {
            "update": {
              "x": {
                "scale": "Waterstand",
                "signal": "waterlevel_plus48u"
              },
              "x2": {
                "scale": "Waterstand",
                "signal": "waterlevel_plus48u"
              },
              "y": {
                "value": 0
              },
              "y2": {
                "signal": "heightfragility"
              },
              "stroke": {
                "value": "#3366ff"
              },
              "strokeWidth": {
                "value": 3
              },
              "opacity": {
                "value": 1
              }
            }
          }
        },
        {
          "name": "Fragility curve: gecombineerde faalkans",
          "type": "line",
          "from": {
            "data": "failureprobabilitiesfragcurve"
          },
          "encode": {
            "update": {
              "interpolate": {
                "value": "monotone"
              },
              "x": {
                "scale": "Waterstand",
                "field": "Waterstand"
              },
              "y": {
                "scale": "Gecombineerde faalkans",
                "field": {
                  "signal": "Maatregel === 'Geen' ? 'COMB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_COMB_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_COMB_' + Dijkvak : 'MAATR_STBI_COMB_' + Dijkvak"
                }
              },
              "opacity": {
                "signal": "Gecombineerd ? 1 : 0"
              },
              "stroke": {
                "value": "#a200ff"
              },
              "strokeWidth": {
                "value": 3
              }
            }
          }
        },
        {
          "name": "Fragility curve: faalkans STBI",
          "type": "line",
          "from": {
            "data": "failureprobabilitiesfragcurve"
          },
          "encode": {
            "update": {
              "interpolate": {
                "value": "monotone"
              },
              "x": {
                "scale": "Waterstand",
                "field": "Waterstand"
              },
              "y": {
                "scale": "Gecombineerde faalkans",
                "field": {
                  "signal": "Maatregel === 'Geen' ? 'STBI_' + Dijkvak : Maatregel === 'GEKB' ? 'STBI_' + Dijkvak : Maatregel === 'STPH' ? 'STBI_' + Dijkvak : 'MAATR_STBI_' + Dijkvak"
                }
              },
              "opacity": {
                "signal": "STBI ? 1 : 0"
              },
              "stroke": {
                "value": "#f47835"
              },
              "strokeWidth": {
                "value": 3
              }
            }
          }
        },
        {
          "name": "Fragility curve: faalkans STPH",
          "type": "line",
          "from": {
            "data": "failureprobabilitiesfragcurve"
          },
          "encode": {
            "update": {
              "interpolate": {
                "value": "monotone"
              },
              "x": {
                "scale": "Waterstand",
                "field": "Waterstand"
              },
              "y": {
                "scale": "Gecombineerde faalkans",
                "field": {
                  "signal": "Maatregel === 'Geen' ? 'STPH_' + Dijkvak : Maatregel === 'GEKB' ? 'STPH_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_' + Dijkvak : 'STPH_' + Dijkvak"
                }
              },
              "opacity": {
                "signal": "STPH ? 1 : 0"
              },
              "stroke": {
                "value": "#d41243"
              },
              "strokeWidth": {
                "value": 3
              }
            }
          }
        },
        {
          "name": "Fragility curve: faalkans GEKB",
          "type": "line",
          "from": {
            "data": "failureprobabilitiesfragcurve"
          },
          "encode": {
            "update": {
              "interpolate": {
                "value": "monotone"
              },
              "x": {
                "scale": "Waterstand",
                "field": "Waterstand"
              },
              "y": {
                "scale": "Gecombineerde faalkans",
                "field": {
                  "signal": "Maatregel === 'Geen' ? 'GEKB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_' + Dijkvak : Maatregel === 'STPH' ? 'GEKB_' + Dijkvak : 'GEKB_' + Dijkvak"
                }
              },
              "opacity": {
                "signal": "GEKB ? 1 : 0"
              },
              "stroke": {
                "value": "#8ec127"
              },
              "strokeWidth": {
                "value": 3
              }
            }
          }
        }
      ],
      "legends": [
        {
          "fill": "Waterstandcolor",
          "title": "Waterstand",
          "orient": "top",
          "encode": {
            "symbols": {
              "update": {
                "strokeWidth": {
                  "value": 2
                },
                "shape": {
                  "value": "M-2,-0.2L2,-0.2 2,0.2 -2,0.2Z"
                },
                "opacity": {
                  "value": 1
                }
              }
            },
            "title": {
              "update": {
                "font": {
                  "value": "Arial"
                },
                "fontSize": {
                  "value": 15
                },
                "fontWeight": {
                  "value": "normal"
                },
                "fill": {
                  "value": "#666666"
                }
              }
            },
            "labels": {
              "update": {
                "fontSize": {
                  "value": 14
                }
              }
            }
          }
        },
        {
          "fill": "Failuremechanisme",
          "title": "Faalmechanisme",
          "orient": "top",
          "encode": {
            "symbols": {
              "update": {
                "strokeWidth": {
                  "value": 2
                },
                "shape": {
                  "value": "M-2,-0.2L2,-0.2 2,0.2 -2,0.2Z"
                },
                "opacity": {
                  "value": 1
                }
              }
            },
            "title": {
              "update": {
                "font": {
                  "value": "Arial"
                },
                "fontSize": {
                  "value": 15
                },
                "fontWeight": {
                  "value": "normal"
                },
                "fill": {
                  "value": "#666666"
                }
              }
            },
            "labels": {
              "update": {
                "fontSize": {
                  "value": 14
                }
              }
            }
          }
        }
      ]
    },
    {
      "description": "Conditionele kans",
      "name": "radial",
      "type": "group",
      "encode": {
        "enter": {
          "y": {
            "scale": "layout",
            "value": "radiaal",
            "offset": 20
          },
          "width": {
            "signal": "widthradial"
          },
          "height": {
            "signal": "heightradial"
          },
          "fill": {
            "value": "transparent"
          }
        }
      },
      "signals": [
        {
          "name": "pi",
          "update": "2 * PI"
        },
        {
          "name": "innerRadius",
          "update": "width / 3"
        },
        {
          "name": "outerRadius",
          "update": "width / 2"
        }
      ],
      "data": [
        {
          "name": "failureprobabilitiesradial",
          "source": "failureprobabilities",
          "transform": [
            {
              "type": "filter",
              "expr": "Faalkans_WS === 'Actueel' ? datum.Waterstand == slider_waterlevel : Faalkans_WS === 'Verwachting over 24u' ? datum.Waterstand == waterlevel_plus24u : datum.Waterstand == waterlevel_plus48u"
            }
          ]
        }
      ],
      "scales": [
        {
          "name": "color",
          "type": "linear",
          "domain": [
            0,
            1,
            10,
            100
          ],
          "range": [
            "green",
            "yellow",
            "orange",
            "red"
          ]
        },
        {
          "name": "Failuremechanisme",
          "type": "ordinal",
          "domain": [
            "Gecombineerd",
            "GEKB",
            "STPH",
            "STBI"
          ],
          "range": [
            "#a200ff",
            "#f47835",
            "#d41243",
            "#8ec127"
          ]
        }
      ],
      "marks": [
        {
          "name": "grijze lijn",
          "type": "arc",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "fill": {
                "value": "#CCCCCC"
              },
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 2"
              },
              "startAngle": {
                "value": 0
              },
              "endAngle": {
                "signal": "pi"
              },
              "innerRadius": {
                "signal": "width/2+5"
              },
              "outerRadius": {
                "signal": "width/2+10"
              },
              "cornerRadius": {
                "value": 2
              }
            }
          }
        },
        {
          "name": "lichte achtergrond",
          "type": "arc",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "fill": {
                "value": "#F2F2F2"
              },
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 2"
              },
              "startAngle": {
                "value": 0
              },
              "endAngle": {
                "signal": "pi"
              },
              "innerRadius": {
                "signal": "innerRadius"
              },
              "outerRadius": {
                "signal": "outerRadius"
              },
              "cornerRadius": {
                "value": 2
              }
            }
          }
        },
        {
          "name": "Faalkans gecombineerd",
          "type": "arc",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "fill": {
                "scale": "color",
                "signal": "datum[Maatregel === 'Geen' ? 'COMB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_COMB_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_COMB_' + Dijkvak : 'MAATR_STBI_COMB_' + Dijkvak]*100"
              },
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 2"
              },
              "startAngle": {
                "value": 0
              },
              "endAngle": {
                "signal": "((PI / 2) * (log(datum[Maatregel === 'Geen' ? 'COMB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_COMB_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_COMB_' + Dijkvak : 'MAATR_STBI_COMB_' + Dijkvak]*100)/LN10) + PI) < 0.01 ? 0 : ((PI / 2) * (log(datum[Maatregel === 'Geen' ? 'COMB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_COMB_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_COMB_' + Dijkvak : 'MAATR_STBI_COMB_' + Dijkvak]*100)/LN10) + PI)"
              },
              "innerRadius": {
                "signal": "innerRadius"
              },
              "outerRadius": {
                "signal": "outerRadius"
              },
              "cornerRadius": {
                "value": 2
              },
              "opacity": {
                "signal": "Gecombineerd > 0 ? 1 : 0"
              }
            }
          }
        },
        {
          "name": "Percentage text COMB",
          "type": "text",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 4"
              },
              "text": {
                "signal": "'COMB: ' + round(datum[Maatregel === 'Geen' ? 'COMB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_COMB_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_COMB_' + Dijkvak : 'MAATR_STBI_COMB_' + Dijkvak]*10000)/100 + '%'"
              },
              "fillOpacity": {
                "value": 0.8
              },
              "fontSize": {
                "value": 24
              },
              "fill": {
                "value": "#666666"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              },
              "opacity": {
                "signal": "Gecombineerd > 0 ? 1 : 0"
              }
            }
          }
        },
        {
          "name": "Percentage text GEKB",
          "type": "text",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial/ 2.5"
              },
              "text": {
                "signal": "'GEKB: ' + round(datum[Maatregel === 'Geen' ? 'GEKB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_' + Dijkvak : Maatregel === 'STPH' ? 'GEKB_' + Dijkvak : 'GEKB_' + Dijkvak]*10000)/100 + '%'"
              },
              "fillOpacity": {
                "value": 0.8
              },
              "fontSize": {
                "value": 24
              },
              "fill": {
                "value": "#f47835"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              },
              "opacity": {
                "signal": "GEKB > 0 ? 1 : 0"
              }
            }
          }
        },
        {
          "name": "Percentage text STPH",
          "type": "text",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 1.85"
              },
              "text": {
                "signal": "'STPH: ' + round(datum[Maatregel === 'Geen' ? 'STPH_' + Dijkvak : Maatregel === 'GEKB' ? 'STPH_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_' + Dijkvak : 'STPH_' + Dijkvak]*10000)/100 + '%'"
              },
              "fillOpacity": {
                "value": 0.8
              },
              "fontSize": {
                "value": 24
              },
              "fill": {
                "value": "#d41243"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              },
              "opacity": {
                "signal": "STPH > 0 ? 1 : 0"
              }
            }
          }
        },
        {
          "name": "Percentage text STBI",
          "type": "text",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 1.45"
              },
              "text": {
                "signal": "'STBI: ' + round(datum[Maatregel === 'Geen' ? 'STBI_' + Dijkvak : Maatregel === 'GEKB' ? 'STBI_' + Dijkvak : Maatregel === 'STPH' ? 'STBI_' + Dijkvak : 'MAATR_STBI_' + Dijkvak]*10000)/100 + '%'"
              },
              "fillOpacity": {
                "value": 0.8
              },
              "fontSize": {
                "value": 24
              },
              "fill": {
                "value": "#8ec127"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              },
              "opacity": {
                "signal": "STBI > 0 ? 1 : 0"
              }
            }
          }
        },
        {
          "name": "Faalkans GEKB",
          "type": "arc",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "fill": {
                "value": "#f47835"
              },
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 2"
              },
              "startAngle": {
                "value": 0
              },
              "endAngle": {
                "signal": "((PI / 2) * (log(datum[Maatregel === 'Geen' ? 'GEKB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_' + Dijkvak : Maatregel === 'STPH' ? 'GEKB_' + Dijkvak : 'GEKB_' + Dijkvak]*100)/LN10) + PI) < 0.01 ? 0 : ((PI / 2) * (log(datum[Maatregel === 'Geen' ? 'GEKB_' + Dijkvak : Maatregel === 'GEKB' ? 'MAATR_GEKB_' + Dijkvak : Maatregel === 'STPH' ? 'GEKB_' + Dijkvak : 'GEKB_' + Dijkvak]*100)/LN10) + PI)"
              },
              "innerRadius": {
                "signal": "widthradial/1.1"
              },
              "outerRadius": {
                "signal": "widthradial/1"
              },
              "cornerRadius": {
                "value": 2
              },
              "opacity": {
                "signal": "GEKB > 0 ? 1 : 0"
              }
            }
          }
        },
        {
          "name": "Faalkans STPH",
          "type": "arc",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "fill": {
                "value": "#d41243"
              },
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 2"
              },
              "startAngle": {
                "value": 0
              },
              "endAngle": {
                "signal": "((PI / 2) * (log(datum[Maatregel === 'Geen' ? 'STPH_' + Dijkvak : Maatregel === 'GEKB' ? 'STPH_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_' + Dijkvak : 'STPH_' + Dijkvak]*100)/LN10) + PI) < 0.01 ? 0 : ((PI / 2) * (log(datum[Maatregel === 'Geen' ? 'STPH_' + Dijkvak : Maatregel === 'GEKB' ? 'STPH_' + Dijkvak : Maatregel === 'STPH' ? 'MAATR_STPH_' + Dijkvak : 'STPH_' + Dijkvak]*100)/LN10) + PI)"
              },
              "innerRadius": {
                "signal": "widthradial/1.27"
              },
              "outerRadius": {
                "signal": "widthradial/1.12"
              },
              "cornerRadius": {
                "value": 2
              },
              "opacity": {
                "signal": "STPH > 0 ? 1 : 0"
              }
            }
          }
        },
        {
          "name": "Faalkans STBI",
          "type": "arc",
          "from": {
            "data": "failureprobabilitiesradial"
          },
          "encode": {
            "update": {
              "fill": {
                "value": "#8ec127"
              },
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial / 2"
              },
              "startAngle": {
                "value": 0
              },
              "endAngle": {
                "signal": "((PI / 2) * (log(datum[Maatregel === 'Geen' ? 'STBI_' + Dijkvak : Maatregel === 'GEKB' ? 'STBI_' + Dijkvak : Maatregel === 'STPH' ? 'STBI_' + Dijkvak : 'MAATR_STBI_' + Dijkvak]*100)/LN10) + PI) < 0.01 ? 0 : ((PI / 2) * (log(datum[Maatregel === 'Geen' ? 'STBI_' + Dijkvak : Maatregel === 'GEKB' ? 'STBI_' + Dijkvak : Maatregel === 'STPH' ? 'STBI_' + Dijkvak : 'MAATR_STBI_' + Dijkvak]*100)/LN10) + PI)"
              },
              "innerRadius": {
                "signal": "widthradial/1.5"
              },
              "outerRadius": {
                "signal": "widthradial/1.3"
              },
              "cornerRadius": {
                "value": 2
              },
              "opacity": {
                "signal": "STBI > 0 ? 1 : 0"
              }
            }
          }
        },
        {
          "name": "Faalkans 0.1% label",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial + 135"
              },
              "y": {
                "signal": "heightradial /2"
              },
              "text": {
                "value": "Faalkans = 0.1%"
              },
              "angle": {
                "value": 90
              },
              "fontSize": {
                "value": 20
              },
              "fill": {
                "value": "black"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        },
        {
          "name": "Faalkans 0.1% marker",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial + 115 "
              },
              "y": {
                "signal": "heightradial/2"
              },
              "text": {
                "value": "▲"
              },
              "angle": {
                "value": 270
              },
              "fontSize": {
                "value": 20
              },
              "fill": {
                "value": "green"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        },
        {
          "name": "Faalkans 1%",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "heightradial + 135"
              },
              "text": {
                "value": "Faalkans = 1%"
              },
              "angle": {
                "value": 0
              },
              "fontSize": {
                "value": 20
              },
              "fill": {
                "value": "black"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        },
        {
          "name": "Faalkans 1% marker",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2 "
              },
              "y": {
                "signal": "heightradial + 115"
              },
              "text": {
                "value": "▲"
              },
              "angle": {
                "value": 0
              },
              "fontSize": {
                "value": 20
              },
              "fill": {
                "value": "yellow"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        },
        {
          "name": "Faalkans 10%",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "-135"
              },
              "y": {
                "signal": "heightradial /2"
              },
              "text": {
                "value": "Faalkans = 10%"
              },
              "angle": {
                "value": -90
              },
              "fontSize": {
                "value": 20
              },
              "fill": {
                "value": "black"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        },
        {
          "name": "Faalkans 10% marker",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "-115 "
              },
              "y": {
                "signal": "heightradial / 2"
              },
              "text": {
                "value": "▲"
              },
              "angle": {
                "value": 90
              },
              "fontSize": {
                "value": 20
              },
              "fill": {
                "value": "orange"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        },
        {
          "name": "Faalkans 100%",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2"
              },
              "y": {
                "signal": "-135"
              },
              "text": {
                "value": "Faalkans = 100%"
              },
              "angle": {
                "value": 0
              },
              "fontSize": {
                "value": 20
              },
              "fill": {
                "value": "black"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        },
        {
          "name": "Faalkans 100% marker",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2 "
              },
              "y": {
                "signal": "-115"
              },
              "text": {
                "value": "▲"
              },
              "fillOpacity": {
                "value": 0.8
              },
              "angle": {
                "value": 180
              },
              "fontSize": {
                "value": 20
              },
              "fill": {
                "value": "red"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        },
        {
          "name": "Faalkans 0% marker",
          "type": "text",
          "encode": {
            "update": {
              "x": {
                "signal": "widthradial / 2 "
              },
              "y": {
                "signal": "-innerRadius + height/2 + 5"
              },
              "text": {
                "value": "▲"
              },
              "fillOpacity": {
                "value": 0.8
              },
              "angle": {
                "value": 0
              },
              "fontSize": {
                "value": 16
              },
              "fill": {
                "value": "green"
              },
              "align": {
                "value": "center"
              },
              "baseline": {
                "value": "middle"
              }
            }
          }
        }
      ]
    }
  ]
}