Aktionen

Benutzer

Felix Englisch: Unterschied zwischen den Versionen

Aus Lünepedia

Zeile 382: Zeile 382:
}</graph>
}</graph>


== Tortendiagramm ==
<graph>{
<graph>
"version": 1, "width": 250,
 
"height": 450,
{
"padding": {
  //
"top": 20,
  // ATTENTION: This code is maintained at https://www.mediawiki.org/wiki/Template:Graph:Pie_from_row
"left": 30,
  //            Please do not modify it anywhere else, as it may get copied and override your changes.
"bottom": 30,
  //            Suggestions can be made at https://www.mediawiki.org/wiki/Template_talk:Graph:Pie_from_row
"right": 10
  //
},
  // Template translation is in https://commons.wikimedia.org/wiki/Data:Original/Template:Graphs.tab
"data": [
  //
{
 
"name": "table",
  "version": 2,
"values": [
  "width": 100, "height": 100, "padding": "auto",
{
"legends": [{"title": "Legend","fill": "color"}],
"x": 0,
  "data": [{
"y": 30,
      "name": "table",
"c": 0
      "url": "tabular:///Bea.gov/GDP by state.tab",
},
      "format": {"type": "json", "property": "data"},
{
      "transform": [
"x": 0,
 
"y": 55,
        {"type": "fold", "fields": []},
"c": 1
        {"type": "pie", "field": "value"}
},
      ]
{
  },
"x": 1,
  {
"y": 43,
    "name": "labels",
"c": 0
    "url": "tabular:///Bea.gov/GDP by state.tab",
},
    "format": {"type": "json", "property": "fields"}
{
  }],
"x": 1,
  "scales": [{
"y": 91,
      "name": "color",
"c": 1
      "type": "ordinal",
},
      "range": "category10",
{
      "domain": {"data": "table", "field": "key"},
"x": 2,
  }],
"y": 81,
  "marks": [
"c": 0
    {
},
      "type": "arc",
{
      "from": { "data": "table" },
"x": 2,
      "properties": {
"y": 53,
        "enter": {
"c": 1
          "fill": {"field": "key", "scale": "color"},
},
          "stroke": {"value": "white"},
{
          "startAngle": {"field": "layout_start"},
"x": 3,
          "endAngle": {"field": "layout_end"},
"y": 19,
          "outerRadius": {"value": 100 },
"c": 0
        }
},
      }
{
    },
"x": 3,
 
"y": 87,
    {
"c": 1
      // This mark draws labels around the pie chart after the pie chart has been drawn
},
      "type": "text",
{
      // Before drawing, we need to perform a number of calculations to figure out the exact location and orientation of the text
"x": 4,
      "from": {
"y": 52,
        "data": "table",
"c": 0
        "transform": [
},
          // For each data point (datum), each of these transformations will be ran in order.
{
          // Formula transformation evaluates the expression and assigns result to the datapoint
"x": 4,
          // Size of the pie slice, in degrees:  sliceSize = (end - start) * 180 / Pi
"y": 48,
          { "type": "formula", "field": "sliceSize", "expr": "(datum.layout_end - datum.layout_start)*180/PI" },
"c": 1
          // Draw text only if the slice of the arc is more than 2 degrees to avoid overcrowding
},
          { "type": "filter", "test": "datum.sliceSize > 9" },
{
          // Format percentage as a string
"x": 5,
          { "type": "formula", "field": "prcStr", "expr": "format('.0%',datum.sliceSize/360)" },
"y": 24,
          { "type": "formula", "field": "title", "expr": "datum.key+' '+datum.prcStr" },
"c": 0
          // Determine the side of the pie chart we are on - left or right.
},
          { "type": "formula", "field": "invert", "expr": "datum.layout_mid*180/PI < 180 ? 1 : -1" },
{
          // If on the left, the text should be right-aligned (go from the rim inward)
"x": 5,
          { "type": "formula", "field": "align", "expr": "datum.invert < 0 ? 'left' : 'right'" },
"y": 49,
          // At what angle should the text be drawn relative to the point on the circle
"c": 1
          { "type": "formula", "field": "angle", "expr": "(datum.layout_mid*180/PI)-90*datum.invert" },
},
          // Make font smaller for smaller pie slices
{
          { "type": "formula", "field": "fontSize", "expr": "datum.sliceSize > 20 ? 15 : (datum.sliceSize > 13 ? 12 : 9)" },
"x": 6,
          // Make font bold for largest pie slices
"y": 87,
          { "type": "formula", "field": "fontWeight", "expr": "datum.sliceSize > 15 ? 'bold' : 'normal'" }
"c": 0
        ]
},
      },
{
      "properties": {
"x": 6,
        "enter": {
"y": 66,
          // Use the fields calculated in the transformation to draw category names
"c": 1
          "align": {"value": "center"},
},
          "angle": {"field": "angle"},
{
          "baseline": {"value": "middle"},
"x": 7,
          "fill": {"value": "black"},
"y": 17,
          "fontSize": {"field": "fontSize"},
"c": 0
          "fontWeight": {"field": "fontWeight"},
},
          "radius": {"value": 100, "offset": -30},
{
          "text": {"field": "title"},
"x": 7,
          "theta": {"field": "layout_mid"}
"y": 27,
        }
"c": 1
      }
},
    }
{
 
"x": 8,
 
"y": 68,
  ]
"c": 0
}
},
 
{
</graph>
"x": 8,
"y": 16,
"c": 1
},
{
"x": 9,
"y": 49,
"c": 0
},
{
"x": 9,
"y": 15,
"c": 1
}
]
},
{
"name": "stats",
"source": "table",
"transform": [
{
"type": "facet",
"keys": [
"data.x"
]
},
{
"type": "stats",
"value": "data.y"
}
]
}
],
"scales": [
{
"name": "x",
"type": "linear",
"range": "width",
"zero": false,
"domain": {
"data": "table",
"field": "data.x"
}
},
{
"name": "y",
"type": "linear",
"range": "height",
"nice": true,
"domain": {
"data": "stats",
"field": "sum"
}
},
{
"name": "color",
"type": "ordinal",
"range": "category10"
}
],
"axes": [
{
"type": "x",
"scale": "x"
},
{
"type": "y",
"scale": "y"
}
],
"marks": [
{
"type": "group",
"from": {
"data": "table",
"transform": [
{
"type": "facet",
"keys": [
"data.c"
]
},
{
"type": "stack",
"point": "data.x",
"height": "data.y"
}
]
},
"marks": [
{
"type": "area",
"properties": {
"enter": {
"interpolate": {
"value": "monotone"
},
"x": {
"scale": "x",
"field": "data.x"
},
"y": {
"scale": "y",
"field": "y"
},
"y2": {
"scale": "y",
"field": "y2"
},
"fill": {
"scale": "color",
"field": "data.c"
}
},
"update": {
"fillOpacity": {
"value": 1
}
},
"hover": {
"fillOpacity": {
"value": 0.5
}
}
}
}
]
}
]
}</graph>

Version vom 29. November 2021, 22:42 Uhr

Willkommen auf meiner Benutzer*innenseite. Ich bin Felix, der dieses Stadtwiki von technischer Seite her konfiguriert hat. Gemeinsam mit Benutzer:Klarambolage und Benutzer:Mira haben wir Lünepedia initiiert und sind sehr gespannt, wie es sich entwickelt.

Kurz über mich: Ich studiere an der Leuphana einen Mix aus Nachhaltigkeitswissenschaften, Ökonomik und Politikwissenschaften im Rahmen des Studium Individuale. Inzwischen bin ich bereits im 6. Semester meines Bachelor-Studiums, aber habe nicht vor, Lüneburg danach einfach zu verlassen. Den Großteil meiner Zeit stecke ich in die Initiative Lebendiges Lüneburg und bin auch anderweitig politisch und klimaaktivistisch aktiv.

Spielplatz

Überschrift

Wahl zum Stadtrat der Hansestadt Lüneburg 2021 (Wahlbeteiligung 56,2 %)

Zweites Diagramm

Weiteres Diagramm

Testgelände

Cookies helfen uns bei der Bereitstellung von Lünepedia. Durch die Nutzung von Lünepedia erklärst du dich damit einverstanden, dass wir Cookies speichern.