wpu.nu

Skillnad mellan versioner av "Mall:Isotopgraf"

Från wpu.nu

(Skapade sidan med '<includeonly>{{#tag:graph|</includeonly><noinclude>{{:{{FULLPAGENAME}} }}<br>'''<graph>'''{{#tag:syntaxhighlight|</noinclude>{ "version": 2, "width": 100, "height": 1...')
 
Rad 1: Rad 1:
 
<includeonly>{{#tag:graph|</includeonly><noinclude>{{:{{FULLPAGENAME}} }}<br>'''&lt;graph>'''{{#tag:syntaxhighlight|</noinclude>{
 
<includeonly>{{#tag:graph|</includeonly><noinclude>{{:{{FULLPAGENAME}} }}<br>'''&lt;graph>'''{{#tag:syntaxhighlight|</noinclude>{
   "version": 2,
+
   "width": 800,
   "width": 100,
+
   "height": 800,
   "height": 100,
+
   "padding": {"top": 30, "left": 60, "bottom": 60, "right": 30},
 +
 
 
   "data": [
 
   "data": [
 
     {
 
     {
 
       "name": "table",
 
       "name": "table",
       "values": [12,23,47,6,52,19],
+
       "url": "https://wpu.nu/wiki/Special:Fr%C3%A5ga/format%3Dcsv/limit%3D100000/link%3Dall/headers%3Dshow/searchlabel%3DCSV/class%3Dsortable-20wikitable-20smwtable/sep%3D,-20/sort%3D/order%3Dasc/offset%3D0/-5B-5BKategori:Kulor-5D-5D-20-5B-5BHar-20Pb208-20Pb206::%2B-5D-5D/-3F%3Dnamn/-3FUr-20Ask%3Dask/-3FHar-20Pb204-20Pb206%3D204-5F206/-3FHar-20Pb207-20Pb206%3D207-5F206/-3FHar-20Pb208-20Pb206%3D208-5F206/-3FHar-20Felmarginal-20Pb204-20Pb206%3Derr4/-3FHar-20Felmarginal-20Pb207-20Pb206%3Derr7/-3FHar-20Felmarginal-20Pb208-20Pb206%3Derr8/mainlabel%3D/prettyprint%3Dtrue/unescape%3Dtrue",
       "transform": [{"type": "pie","field": "data"}]
+
      "format": {"type": "csv"},
 +
      "transform": [
 +
    {"type": "formula", "field": "kortnamn", "expr": "replace(datum.namn, 'Kula ', '')"}
 +
      ]
 +
    }
 +
  ],
 +
  "signals": [
 +
    {
 +
      "name": "tooltip",
 +
      "init": {},
 +
      "streams": [
 +
        {"type": "rect:mouseover", "expr": "datum"},
 +
        {"type": "rect:mouseout", "expr": "{}"}
 +
      ]
 +
    }
 +
  ],
 +
 
 +
  "predicates": [
 +
    {
 +
      "name": "ifTooltip", "type": "==",  
 +
       "operands": [{"signal": "tooltip._id"}, {"arg": "id"}]
 
     }
 
     }
 
   ],
 
   ],
 
   "scales": [
 
   "scales": [
     {
+
     {  
       "name": "r",
+
       "name": "scale_46",  
       "type": "sqrt",
+
       "range": "width",
       "domain": {"data": "table","field": "data"},
+
      "zero": false,
       "range": [20,100]
+
        "domain": [0.050, 0.055]
 +
    },
 +
    {
 +
      "name": "scale_86",
 +
      "range": "height",
 +
      "zero": false,
 +
        "domain": [2.0, 2.03]
 +
    },
 +
    {
 +
      "name": "scale_76",
 +
      "range": "width",
 +
       "zero": false,
 +
        "domain": [0.8125, 0.8235]
 +
    },
 +
    {  
 +
      "name": "err4",
 +
      "range": [0, 36000],
 +
      "zero": true,
 +
        "domain":
 +
        {
 +
            "data": "table",  
 +
            "field": "err4"
 +
        }
 +
    },
 +
    {
 +
      "name": "err7",
 +
      "range": [0, 2000],
 +
      "zero": true,
 +
        "domain":
 +
        {
 +
            "data": "table",
 +
            "field": "err7"
 +
        }
 +
    },
 +
    {
 +
      "name": "err8",  
 +
       "range": [0, 36000],
 +
      "zero": true,
 +
        "domain":
 +
        {
 +
            "data": "table",
 +
            "field": "err8"
 +
        }
 +
    },
 +
    {
 +
    "name": "box",
 +
    "type": "ordinal",
 +
    "range": "category20b",
 +
        "domain":
 +
        {
 +
            "data": "table",
 +
            "field": "ask"
 +
        }
 
     }
 
     }
 
   ],
 
   ],
 +
  "axes": [
 +
    { "type": "x", "scale": "scale_76", "title": "Pb207/Pb206" },
 +
    { "type": "y", "scale": "scale_86", "title": "Pb208/Pb206" }
 +
  ],
 +
 
   "marks": [
 
   "marks": [
 
     {
 
     {
       "type": "arc",
+
      "name": "points",
       "from": {"data": "table"},
+
       "type": "symbol",
 +
       "from": {"data":"table"},
 
       "properties": {
 
       "properties": {
 
         "enter": {
 
         "enter": {
           "x": {"field": {"group": "width"},"mult": 0.5},
+
           "xc": {"scale": "scale_76", "field": "207_206"},
           "y": {"field": {"group": "height"},"mult": 0.5},
+
           "yc": {"scale": "scale_86", "field": "208_206"},
           "startAngle": {"field": "layout_start"},
+
           "size": {"scale": "err7", "field": "err7"},
           "endAngle": {"field": "layout_end"},
+
           "fill": {"scale": "box", "field": "ask"},
           "innerRadius": {"value": 20},
+
           "fillOpacity": {"value": 0.5},
           "outerRadius": {"scale": "r","field": "data"},
+
           "stroke": {"scale": "box", "field": "ask"},
           "stroke": {"value": "#fff"}
+
           "strokeOpacity": {"value": 1},
 +
          "strokeWidth": {"value": 3}
 +
        },
 +
        "hover" : {
 +
          "fillOpacity": {"value": 1}
 
         },
 
         },
         "update": {"fill": {"value": "{{{1|#ccc}}}"} },
+
         "update" : {
         "hover": {"fill": {"value": "pink"} }
+
          "fillOpacity": {"value": 0.5}
 +
         }
 
       }
 
       }
 
     },
 
     },
Rad 41: Rad 125:
 
       "properties": {
 
       "properties": {
 
         "enter": {
 
         "enter": {
           "x": {"field": {"group": "width"},"mult": 0.5},
+
           "xc": {"scale": "scale_76", "field": "207_206"},
           "y": {"field": {"group": "height"},"mult": 0.5},
+
           "yc": {"scale": "scale_86", "field": "208_206"},
           "radius": {"scale": "r","field": "data","offset": 8},
+
           "text": {"field": "kortnamn"},
           "theta": {"field": "layout_mid"},
+
           "fontSize": {"value": 14},
 
           "fill": {"value": "#000"},
 
           "fill": {"value": "#000"},
 +
          "fontWeight":{"value": "bold"},
 
           "align": {"value": "center"},
 
           "align": {"value": "center"},
           "baseline": {"value": "middle"},
+
           "baseline": {"value": "middle"}
          "text": {"field": "data"}
 
 
         }
 
         }
 
       }
 
       }
 
     }
 
     }
 +
  ],
 +
  "legends": [
 +
  {
 +
  "title": "Ask",
 +
  "fill": "box",
 +
  "orient": "left",
 +
  "offset": -300,
 +
  "size": {"value": 30000}
 +
  }
 
   ]
 
   ]
 
}<includeonly>}}</includeonly><noinclude>|lang=javascript}}'''&lt;/graph>'''</noinclude>
 
}<includeonly>}}</includeonly><noinclude>|lang=javascript}}'''&lt;/graph>'''</noinclude>

Versionen från 24 september 2021 kl. 18.52


<graph><syntaxhighlight lang="javascript">{

 "width": 800,
 "height": 800,
 "padding": {"top": 30, "left": 60, "bottom": 60, "right": 30},
 "data": [
   {
     "name": "table",
     "url": "https://wpu.nu/wiki/Special:Fr%C3%A5ga/format%3Dcsv/limit%3D100000/link%3Dall/headers%3Dshow/searchlabel%3DCSV/class%3Dsortable-20wikitable-20smwtable/sep%3D,-20/sort%3D/order%3Dasc/offset%3D0/-5B-5BKategori:Kulor-5D-5D-20-5B-5BHar-20Pb208-20Pb206::%2B-5D-5D/-3F%3Dnamn/-3FUr-20Ask%3Dask/-3FHar-20Pb204-20Pb206%3D204-5F206/-3FHar-20Pb207-20Pb206%3D207-5F206/-3FHar-20Pb208-20Pb206%3D208-5F206/-3FHar-20Felmarginal-20Pb204-20Pb206%3Derr4/-3FHar-20Felmarginal-20Pb207-20Pb206%3Derr7/-3FHar-20Felmarginal-20Pb208-20Pb206%3Derr8/mainlabel%3D/prettyprint%3Dtrue/unescape%3Dtrue",
     "format": {"type": "csv"},
     "transform": [
   	{"type": "formula", "field": "kortnamn", "expr": "replace(datum.namn, 'Kula ', )"}
     ]
   }
 ],
 "signals": [
   {
     "name": "tooltip",
     "init": {},
     "streams": [
       {"type": "rect:mouseover", "expr": "datum"},
       {"type": "rect:mouseout", "expr": "{}"}
     ]
   }
 ],
 "predicates": [
   {
     "name": "ifTooltip", "type": "==", 
     "operands": [{"signal": "tooltip._id"}, {"arg": "id"}]
   }
 ],
 "scales": [
   { 
     "name": "scale_46", 
     "range": "width",
     "zero": false,
       "domain": [0.050, 0.055]
   },
   { 
     "name": "scale_86", 
     "range": "height",
     "zero": false,
       "domain": [2.0, 2.03]
   },
   { 
     "name": "scale_76", 
     "range": "width",
     "zero": false,
       "domain": [0.8125, 0.8235]
   },
   { 
     "name": "err4", 
     "range": [0, 36000],
     "zero": true,
       "domain": 
       { 
           "data": "table", 
           "field": "err4"
       } 
   },
   { 
     "name": "err7", 
     "range": [0, 2000],
     "zero": true,
       "domain": 
       { 
           "data": "table", 
           "field": "err7"
       } 
   },
   { 
     "name": "err8", 
     "range": [0, 36000],
     "zero": true,
       "domain": 
       { 
           "data": "table", 
           "field": "err8"
       } 
   },
   { 
   "name": "box", 
   "type": "ordinal",
   "range": "category20b",
       "domain": 
       { 
           "data": "table", 
           "field": "ask"
       } 
   }
 ],
 "axes": [
   { "type": "x", "scale": "scale_76", "title": "Pb207/Pb206" },
   { "type": "y", "scale": "scale_86", "title": "Pb208/Pb206" }
 ],
 "marks": [
   {
     "name": "points",
     "type": "symbol",
     "from": {"data":"table"},
     "properties": {
       "enter": {
         "xc": {"scale": "scale_76", "field": "207_206"},
         "yc": {"scale": "scale_86", "field": "208_206"},
         "size": {"scale": "err7", "field": "err7"},
         "fill": {"scale": "box", "field": "ask"},
         "fillOpacity": {"value": 0.5},
         "stroke": {"scale": "box", "field": "ask"},
         "strokeOpacity": {"value": 1},
         "strokeWidth": {"value": 3}
       },
       "hover" : {
         "fillOpacity": {"value": 1}
       },
       "update" : {
         "fillOpacity": {"value": 0.5}
       }
     }
   },
   {
     "type": "text",
     "from": {"data": "table"},
     "properties": {
       "enter": {
         "xc": {"scale": "scale_76", "field": "207_206"},
         "yc": {"scale": "scale_86", "field": "208_206"},  
         "text": {"field": "kortnamn"},
         "fontSize": {"value": 14},
         "fill": {"value": "#000"},
         "fontWeight":{"value": "bold"},
         "align": {"value": "center"},
         "baseline": {"value": "middle"}
       }
     }
   }
 ],
 "legends": [
 	{
 		"title": "Ask",
 		"fill": "box",
 		"orient": "left",
 		"offset": -300,
 		"size": {"value": 30000}
 	}
 ]

}</syntaxhighlight></graph>