Graph Test: Difference between revisions

From wikiluntti
No edit summary
No edit summary
Line 1: Line 1:
{{Graph:Chart|width=600|height=100|xAxisTitle=X|yAxisTitle=Y
{{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}}
  |type=rect|x=1,2,3,4,5,6,7,8|y=10,12,6,14,2,10,7,9}}

Revision as of 21:41, 13 June 2021

Template:Graph:Chart

Template:Graph:Chart

Template:Graph:Chart


<graph> {

 "version": 2,
 "width": 550,
 "height": 400,
 "data": [
   {
     "name": "tree",
     "url": "wikiraw:///Extension:Graph/data/flare-json",
     "format": {"type": "treejson"},
     "transform": [
       {"type": "hierarchy", "field": "size", "size": [400, 500]}
     ]
   }
 ],
 "marks": [
   {
     "type": "path",
     "from": {
       "data": "tree",
       "transform": [
         {
           "type": "filter", "test": "datum.parent"
         },
         {
           "type": "linkpath",
           "sourceX": "parent.layout_y",
           "sourceY": "parent.layout_x",
           "targetX": "layout_y",
           "targetY": "layout_x",
           "shape": "diagonalX"
         }
       ]
     },
     "properties": {
       "enter": {
         "path": {"field": "layout_path"},
         "stroke": {"value": "#ddd"}
       }
     }
   },
   {
     "type": "text",
     "from": {"data": "tree"},
     "properties": {
       "enter": {
         "x": {"field": "layout_y", "offset": -10},
         "y": {"field": "layout_x"},
         "font": {"value": "Helvetica Neue"},
         "fontSize": {"value": 10},
         "align": {"value": "left"},
         "baseline": {"value": "middle"},
         "fill": {"value": "#000"},
         "text": {"field": "name"}
       }
     }
   }
 ]

} </graph>