Test

De 21Wiki

{

 "$schema": "https://vega.github.io/schema/vega/v5.json",
 "width": 800,
 "height": 300,
 "data": [
   {
     "name": "membres",
     "values": [
       {"label": "jakub", "nom": "Jakub Larsen-Li", "membre_start": "2021-08-05", "membre_end": "2021-09-02", "status": "❌"},
       {"label": "josé", "nom": "José Fripougnon", "membre_start": "2021-08-05", "membre_end": "2021-08-24", "status": "❌"},
       {"label": "josé", "nom": "José Fripougnon", "membre_start": "2021-08-31", "membre_end": "2021-09-02", "status": "❌"},
       {"label": "taylor", "nom": "Taylor Newton", "membre_start": "2021-08-05", "membre_end": "2021-08-31", "status": "🚪"},
       {"label": "benito", "nom": "Benito Folliero", "membre_start": "2021-08-07", "membre_end": "2021-09-02", "status": "❌"},
       {"label": "charlie", "nom": "Charlie Lucheco", "membre_start": "2021-08-07", "membre_end": "2021-08-22", "status": "💢"},
       {"label": "jon", "nom": "Jon  « Kira » Kino", "membre_start": "2021-08-26", "membre_end": "2021-08-30", "status": "💢"}
     ],
     "format": {
       "type": "json",
       "parse": {
         "membre_start": "date",
         "membre_end": "date"
       }
     },
     "transform": [
       {
         "type": "formula",
         "expr": "datum.membre_end ? datum.membre_end : now()",
         "as": "membre_end"
       }
     ]
   },
   {
     "name": "seconds",
     "values": [
       {"label": "josé", "second_start": "2021-08-05", "second_end": "2021-08-24"},
       {"label": "taylor", "second_start": "2021-08-24", "second_end": "2021-08-31"}
     ],
     "format": {
       "type": "json",
       "parse": {
         "second_start": "date",
         "second_end": "date"
       }
     },
     "transform": [
       {
         "type": "formula",
         "expr": "datum.second_end ? datum.second_end : now()",
         "as": "second_end"
       }
     ]
   },
   {
     "name": "chefs",
     "values": [
       {"label": "jakub", "chef_start": "2021-08-05", "chef_end": "2021-09-02"}
     ],
     "format": {
       "type": "json",
       "parse": {
         "chef_start": "date",
         "chef_end": "date"
       }
     },
     "transform": [
       {
         "type": "formula",
         "expr": "datum.chef_end ? datum.chef_end : now()",
         "as": "chef_end"
       }
     ]
   },
   {
     "name": "events",
     "values": [
       {"name": "05/08 - Création du groupe", "date": "2021-08-05", "y": -20},
       {"name": "02/09 - Dissolution du groupe", "date": "2021-09-02", "y": -20}
     ],
     "format": {
       "type": "json",
       "parse": {
         "date": "date"
       }
     }
   }
 ],
 "scales": [
   {
     "name": "y",
     "type": "band",
     "range": "height",
     "domain": {"data": "membres", "field": "label"}
   },
   {
     "name": "x",
     "type": "time",
     "range": "width",
     "nice": "week",
     "domain": {
       "fields": [
         {"data": "membres", "field": "membre_start"},
         {"data": "membres", "field": "membre_end"}
       ]
     }
   }
 ],
 "axes": [
   {
     "orient": "bottom",
     "scale": "x",
     "grid": true,
     "format": "%m/%y"
   }
 ],
 "marks": [
   {
     "type": "text",
     "from": {"data": "events"},
     "encode": {
       "enter": {
         "x": {"scale": "x", "field": "date"},
         "y": {"value": -20},
         "angle": {"value": -30},
         "fill": {"value": "#000"},
         "text": {"field": "name"},
         "fontSize": {"value": 14}
       }
     }
   },
   {
     "type": "rect",
     "from": {"data": "events"},
     "encode": {
      
contentReference[oaicite:13]{index=13}