From 34af4dd794c682d1f672b1b3fb97671a9ddb3bd6 Mon Sep 17 00:00:00 2001 From: James Nash Date: Sat, 8 Jan 2022 00:41:50 +0000 Subject: [PATCH] wip: started data-model section --- technical-reports/format/data-model.md | 19 +++++++++++++++++++ technical-reports/format/data-model.svg | 3 +++ technical-reports/format/index.html | 5 +++++ technical-reports/format/parse-serialize.svg | 3 +++ 4 files changed, 30 insertions(+) create mode 100644 technical-reports/format/data-model.md create mode 100644 technical-reports/format/data-model.svg create mode 100644 technical-reports/format/parse-serialize.svg diff --git a/technical-reports/format/data-model.md b/technical-reports/format/data-model.md new file mode 100644 index 0000000..6fdeb84 --- /dev/null +++ b/technical-reports/format/data-model.md @@ -0,0 +1,19 @@ +# Data model + +There are 2 kinds of entities that this spec defines: Groups and design tokens. Together, they form a tree data structure. The root node is always a group. Group nodes can contain child nodes which are either other groups or design tokens. Design tokens nodes cannot have children and are therefore always leaf nodes. + +
+ +![Diagram depicting an example tree structure made of group and design token nodes](./data-model.svg) + +
Visual representation of an example tree structure consisting of group and design token nodes
+
+ +The file format defined by this specification is a serialisation of that data structure. + +
+ +![Diagram of a file on one side and a group and desing token tree on the other. An arrow pointing from the file to the data structure is labelled "parse". Another arrow pointing in the opposite direction is labelled "serialize".](./parse-serialize.svg) + +
Illustration of the relationship between a design token file and the corresponding data model
+
diff --git a/technical-reports/format/data-model.svg b/technical-reports/format/data-model.svg new file mode 100644 index 0000000..e2f5a31 --- /dev/null +++ b/technical-reports/format/data-model.svg @@ -0,0 +1,3 @@ + + +
Group
Group
Group
Group
Token
Token
Token
Token
Token
Token
Token
Token
Token
Token
Text is not SVG - cannot display
\ No newline at end of file diff --git a/technical-reports/format/index.html b/technical-reports/format/index.html index f07f502..e537c6c 100644 --- a/technical-reports/format/index.html +++ b/technical-reports/format/index.html @@ -145,6 +145,11 @@

Introduction

data-include-format="markdown" > +
+
+ +
{
  "group-1": {
    "token-1": {
      "value": 123
    },
    "token-2": {
      "value": 321
   }
   ...
}

{...

Parse
Parse
Serialize
Serialize
File
File
Data model
Data model
Text is not SVG - cannot display
\ No newline at end of file