« Test » : différence entre les versions
De 21Wiki
Aucun résumé des modifications Balise : Éditeur de wikicode 2017 |
Aucun résumé des modifications Balise : Éditeur de wikicode 2017 |
||
Ligne 3 : | Ligne 3 : | ||
<graph>{ | <graph>{ | ||
"width": 400, | |||
"height": 100, | |||
"width": | |||
"height": | |||
"data": [ | "data": [ | ||
{ | { | ||
"name": "people", | "name": "people", | ||
"values": [ | "values": [ | ||
{ | {"label":"Washington", "born":-7506057600000, "died":-5366196000000, | ||
"enter":-5701424400000, "leave":-5453884800000}, | |||
{"label":"Adams", "born":-7389766800000, "died":-4528285200000, | |||
"enter":-5453884800000, "leave":-5327740800000}, | |||
{"label":"Jefferson", "born":-7154586000000, "died":-4528285200000, | |||
"enter":-5327740800000, "leave":-5075280000000}, | |||
{"label":"Madison", "born":-6904544400000, "died":-4213184400000, | |||
{ | "enter":-5075280000000, "leave":-4822819200000}, | ||
{"label":"Monroe", "born":-6679904400000, "died":-4370518800000, | |||
"enter":-4822819200000, "leave":-4570358400000} | |||
{ | |||
{ | |||
{ | |||
] | ] | ||
}, | }, | ||
Ligne 54 : | Ligne 25 : | ||
"format": {"type":"json", "parse":{"when":"date"}}, | "format": {"type":"json", "parse":{"when":"date"}}, | ||
"values": [ | "values": [ | ||
{ "name":"Decl. of Independence", "when":"July 4, 1776" }, | {"name":"Decl. of Independence", "when":"July 4, 1776"}, | ||
{ "name":"U.S. Constitution", "when":"3/4/1789" }, | {"name":"U.S. Constitution", "when":"3/4/1789"}, | ||
{ "name":"Louisiana Purchase", "when":"April 30, 1803" }, | {"name":"Louisiana Purchase", "when":"April 30, 1803"}, | ||
{ "name":"Monroe Doctrine", "when":"Dec 2, 1823" } | {"name":"Monroe Doctrine", "when":"Dec 2, 1823"} | ||
] | ] | ||
} | } | ||
], | ], | ||
"scales": [ | "scales": [ | ||
{ | { | ||
"name": " | "name": "y", | ||
"type": " | "type": "ordinal", | ||
"range | "range": "height", | ||
"domain": {"data": "people", "field": "label"} | "domain": {"data": "people", "field": "label"} | ||
}, | }, | ||
{ | { | ||
"name": " | "name": "x", | ||
"type": "time", | "type": "time", | ||
"range": "width", | "range": "width", | ||
"round": true, | "round": true, | ||
"domain": {"data": "people", " | "nice": "year", | ||
"domain": {"data": "people", "field": ["born", "died"]} | |||
} | } | ||
], | ], | ||
"axes": [ | "axes": [ | ||
{" | {"type": "x", "scale": "x"} | ||
], | ], | ||
"marks": [ | "marks": [ | ||
{ | { | ||
"type": "text", | "type": "text", | ||
"from": {"data": "events"}, | "from": {"data": "events"}, | ||
" | "properties": { | ||
"enter": { | "enter": { | ||
"x": {"scale": " | "x": {"scale": "x", "field": "when"}, | ||
"y": {"value": -10}, | "y": {"value": -10}, | ||
"angle": {"value": -25}, | "angle": {"value": -25}, | ||
"fill": {"value": "#000"}, | "fill": {"value": "#000"}, | ||
"text": {"field": "name"}, | "text": {"field": "name"}, | ||
"font": {"value": "Helvetica Neue"}, | |||
"fontSize": {"value": 10} | "fontSize": {"value": 10} | ||
} | } | ||
Ligne 100 : | Ligne 71 : | ||
"type": "rect", | "type": "rect", | ||
"from": {"data": "events"}, | "from": {"data": "events"}, | ||
" | "properties": { | ||
"enter": { | "enter": { | ||
"x": {"scale": " | "x": {"scale": "x", "field": "when"}, | ||
"y": {"value": -8}, | "y": {"value": -8}, | ||
"width": {"value": 1}, | "width": {"value": 1}, | ||
Ligne 113 : | Ligne 84 : | ||
"type": "text", | "type": "text", | ||
"from": {"data": "people"}, | "from": {"data": "people"}, | ||
" | "properties": { | ||
"enter": { | "enter": { | ||
"x": {"scale": " | "x": {"scale": "x", "field": "born"}, | ||
"y": {"scale": " | "y": {"scale": "y", "field": "label", "offset": -3}, | ||
"fill": {"value": "#000"}, | "fill": {"value": "#000"}, | ||
"text": {"field": "label"}, | "text": {"field": "label"}, | ||
"font": {"value": "Helvetica Neue"}, | |||
"fontSize": {"value": 10} | "fontSize": {"value": 10} | ||
} | } | ||
Ligne 126 : | Ligne 98 : | ||
"type": "rect", | "type": "rect", | ||
"from": {"data": "people"}, | "from": {"data": "people"}, | ||
" | "properties": { | ||
"enter": { | "enter": { | ||
"x": {"scale": " | "x": {"scale": "x", "field": "born"}, | ||
"x2": {"scale": " | "x2": {"scale": "x", "field": "died"}, | ||
"y": {"scale": " | "y": {"scale": "y", "field": "label"}, | ||
"height": {"value": 2}, | "height": {"value": 2}, | ||
"fill": {"value": "#557"} | "fill": {"value": "#557"} | ||
Ligne 139 : | Ligne 111 : | ||
"type": "rect", | "type": "rect", | ||
"from": {"data": "people"}, | "from": {"data": "people"}, | ||
" | "properties": { | ||
"enter": { | "enter": { | ||
"x": {"scale": " | "x": {"scale": "x", "field": "enter"}, | ||
"x2": {"scale": " | "x2": {"scale": "x", "field": "leave"}, | ||
"y": {"scale": " | "y": {"scale": "y", "field": "label", "offset":-1}, | ||
"height": {"value": 4}, | "height": {"value": 4}, | ||
"fill": {"value": "#e44"} | "fill": {"value": "#e44"} | ||
Ligne 151 : | Ligne 123 : | ||
] | ] | ||
} | } | ||
</graph> | </graph> |