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>'''<graph>'''{{#tag:syntaxhighlight|</noinclude>{ | <includeonly>{{#tag:graph|</includeonly><noinclude>{{:{{FULLPAGENAME}} }}<br>'''<graph>'''{{#tag:syntaxhighlight|</noinclude>{ | ||
− | " | + | "width": 800, |
− | " | + | "height": 800, |
− | " | + | "padding": {"top": 30, "left": 60, "bottom": 60, "right": 30}, |
+ | |||
"data": [ | "data": [ | ||
{ | { | ||
"name": "table", | "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": [ | "scales": [ | ||
− | { | + | { |
− | "name": " | + | "name": "scale_46", |
− | " | + | "range": "width", |
− | "domain": {"data": "table","field": "data"}, | + | "zero": false, |
− | "range": [ | + | "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": " | + | "name": "points", |
− | "from": {"data": "table"}, | + | "type": "symbol", |
+ | "from": {"data":"table"}, | ||
"properties": { | "properties": { | ||
"enter": { | "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": {" | + | "update" : { |
− | + | "fillOpacity": {"value": 0.5} | |
+ | } | ||
} | } | ||
}, | }, | ||
Rad 41: | Rad 125: | ||
"properties": { | "properties": { | ||
"enter": { | "enter": { | ||
− | " | + | "xc": {"scale": "scale_76", "field": "207_206"}, |
− | " | + | "yc": {"scale": "scale_86", "field": "208_206"}, |
− | " | + | "text": {"field": "kortnamn"}, |
− | " | + | "fontSize": {"value": 14}, |
"fill": {"value": "#000"}, | "fill": {"value": "#000"}, | ||
+ | "fontWeight":{"value": "bold"}, | ||
"align": {"value": "center"}, | "align": {"value": "center"}, | ||
− | "baseline": {"value": "middle | + | "baseline": {"value": "middle"} |
− | |||
} | } | ||
} | } | ||
} | } | ||
+ | ], | ||
+ | "legends": [ | ||
+ | { | ||
+ | "title": "Ask", | ||
+ | "fill": "box", | ||
+ | "orient": "left", | ||
+ | "offset": -300, | ||
+ | "size": {"value": 30000} | ||
+ | } | ||
] | ] | ||
}<includeonly>}}</includeonly><noinclude>|lang=javascript}}'''</graph>'''</noinclude> | }<includeonly>}}</includeonly><noinclude>|lang=javascript}}'''</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>