User:Jason.nlw: Difference between revisions

From Semantic Name Authority Repository Cymru
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
{{#babel:en|cy}}
{{#babel:en|cy}}


{{engine}}
<graph>


{{Graph:Chart|width=600|height=100|xAxisTitle=X|yAxisTitle=Y
|type=rect|x=1,2,3,4,5,6,7,8|y=10,12,6,14,2,10,7,9}}
{{Special:Search}}
== Example == <!--T:11-->
</translate>
<mapframe text="Map of [[wikipedia:London|London]]" latitude="51.505" longitude="-0.126" zoom="8" width="300" height="300" align="left">
{
{
   "type": "FeatureCollection",
   "version": 2,
   "features": [
  "width": 600,
  "height": 600,
  "padding": 5,
  "signals": [
    { "name": "rotation", "init": 0,
      "streams": [{
        "type": "click",
        "expr": "rotation + 6.14/180"
      }]
    }
  ],
   "data": [
    {
      "name": "tree",
      "url": "wikiraw:///Extension:Graph/data/flare-json",
      "format": {"type": "treejson"},
      "transform": [
        { "type": "hierarchy", "sort": "name", "size": [6.28, 300], "orient": "radial", "output": {"x": "angle1", "y": "radius"} },
        { "type": "formula", "field": "angle",  "expr": "(datum.angle1 + rotation) % (2*PI)" },
        { "type": "formula", "field": "sign",    "expr": "datum.angle > 3.14 ? 1 : -1" },
        { "type": "formula", "field": "degrees", "expr": "!datum.radius ? 0 : (datum.angle + datum.sign*1.57) * 180/PI" },
        { "type": "formula", "field": "yy",      "expr": "300 + datum.radius * cos(datum.angle)" },
        { "type": "formula", "field": "xx",      "expr": "300 + datum.radius * -sin(datum.angle)" },
        { "type": "formula", "field": "align",  "expr": "!datum.radius ? 'center' : datum.sign < 0 ? 'left' : 'right'" }
      ]
    }
  ],
  "marks": [
    {
      "type": "path",
      "from": {
        "data": "tree",
        "transform": [
          {"type": "filter", "test": "datum.parent"},
          {
            "type": "linkpath",
            "sourceX": "parent.xx", "sourceY": "parent.yy",
            "targetX": "xx", "targetY": "yy",
            "shape": "line"
          }
        ]
      },
      "properties": {
        "update": {
          "path": {"field": "layout_path"},
          "stroke": {"value": "#ddd"}
        }
      }
    },
     {
     {
       "type": "Feature",
       "type": "text",
      "from": {"data": "tree"},
       "properties": {
       "properties": {
           "title": "[[wikipedia:London|London]] is the capital of [[wikipedia:United Kingdom|United Kingdom]]",
        "update": {
           "description": "[[File:Houses_of_Parliament.jpg|Houses of Parliament|280px]]",
           "x": {"field": "xx"},
           "marker-symbol": "town-hall",
           "y": {"field": "yy"},
           "marker-size": "large",
           "font": {"value": "Helvetica Neue"},
           "marker-color": "f00"
           "fontSize": {"value": 10},
      },
           "align": {"field": "align"},
      "geometry": {
          "baseline": {"value": "middle"},
        "type": "Point",
          "fill": {"value": "#000"},
        "coordinates": [
           "text": {"field": "name"},
           -0.1226806780323386,
           "angle": {"field": "degrees"}
           51.515268213580114
         }
         ]
       }
       }
     }
     }
   ]
   ]
}</mapframe>
}
<br style="clear: both;" clear="all" />
</graph>
 
<translate>

Revision as of 15:42, 10 July 2024

{{#babel:en|cy}}