Markdown Snippets

Markdown Snippets

Markdown Snippets

  Vega & Vega-Lite Data Source Repo  

Step

Step

icons

  Level2

 Level3

 Level4

 Brain

 SkullCrossbones

 digging

 chart-look

 hands

 bog-roll

 chart-look

 Pepper

 Smoking

 Level5

 Level6

1
2
3
4
5
6
7
8
SELECT 
t.column1
-, t.column2
, t.column3
FROM table1 as t
no removal
+ newline
- removed line

lists

bullets

  • item 1
  • item 2
  • item 3
  • item 4
  • item 5
  • item 6

Click on the @icn-camera icon to take a screen shot.

Click on the @icon-camera icon to take a screen shot.

Visit Blog ##

Configuration

Configuration can be launched from the Tools -> Settings menu option.

Used on a button:

1
2
3
4
5
6
7
{
  "data": {"name": "dataset"}
  // comments
  /* json comments */
  ...
}

link to check box

architecture-beta
    group api(cloud)[API]

    service db(database)[Database] in api
    service disk1(disk)[Storage] in api
    service disk2(disk)[Storage] in api
    service server(server)[Server] in api

    db:L -- R:server
    disk1:T -- B:server
    disk2:T -- B:db
flowchart TD
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me think}
    C -->|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[fa:fa-car Car]
erDiagram
    CUSTOMER }|..|{ DELIVERY-ADDRESS : has
    CUSTOMER ||--o{ ORDER : places
    CUSTOMER ||--o{ INVOICE : "liable for"
    DELIVERY-ADDRESS ||--o{ ORDER : receives
    INVOICE ||--|{ ORDER : covers
    ORDER ||--|{ ORDER-ITEM : includes
    PRODUCT-CATEGORY ||--|{ PRODUCT : contains
    PRODUCT ||--o{ ORDER-ITEM : "ordered in"
graph LR
    A[Start] --> B[Process AI Data]
    B --> C[Train Model]
    C --> D[Deploy Model]
    D --> E[Monitor Results]
    E --> F[Refine Model]
    F --> C
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "Reproducing http://robslink.com/SAS/democd91/pyramid_pie.htm",
  "data": {
    "values": [
      {"category": "Sky", "value": 75, "order": 3},
      {"category": "Shady side of a pyramid", "value": 10, "order": 1},
      {"category": "Sunny side of a pyramid", "value": 15, "order": 2}
    ]
  },
  "mark": {"type": "arc", "outerRadius": 80},
  "encoding": {
    "theta": {
      "field": "value", "type": "quantitative",
      "scale": {"range": [2.35619449, 8.639379797]},
      "stack": true
    },
    "color": {
      "field": "category", "type": "nominal",
      "scale": {
        "domain": ["Sky", "Shady side of a pyramid", "Sunny side of a pyramid"],
        "range": ["#416D9D", "#674028", "#DEAC58"]
      },
      "legend": {
        "orient": "none",
        "title": null,
        "columns": 1,
        "legendX": 200,
        "legendY": 80
      }
    },
    "order": {
      "field": "order"
    }
  }
}

Column 1Column 2
Example JSON 1{ "name": "Alice", "age": 25 }
Example JSON 2{ "city": "New York", "country": "USA" }
Column 1Column 2
Example JSON 1json {"name": "Alice", "age": 25}
Example JSON 2json {"city": "New York", "country": "USA"}
Code Block 1Code Block 2

      { "data": {"name": "dataset"} } 
      
 
      { "data": 
      + {"name": "dataset"} 
      } 
    
1
2
3
4
5
SELECT 
t.column1
, t.column2
, t.column3
FROM table1 as t
1
2
3
4
5
SELECT 
t.column1
, t.column2
, t.column3
FROM table1 as t

ℹ️ Note: Here’s a small note for reference.

💀 Note: Here’s a small note for reference.

⚠️ Note: Here’s a small note for reference.

⛔ Note: Here’s a small note for reference.

This is an example of a Tip.

This is an example of an Info block.

This is an example of a Warning block.

This is an example of a Danger block.

dax highlighter

1
2
3
4
5
Distinct Vertices Label Prop = 
CALCULATE( 
  COUNTROWS( DISTINCT( 'Vertices Label Prop'[id] ) )
  , 'Vertices Label Prop'[Type] in {"User", "Group"} 
)

check boxes

check boxes

  • check1
  • check2

terms

Define a Term
definition
 Dropdown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

{
    $schema: "https://vega.github.io/schema/vega-lite/v5.json",
    description: "A simple bar chart with embedded data.",
    data: {
      values: [
        {a: "A", b: 28}, /* comments */
        {a: "B", b: 55}, // comments2
        {a: "C", b: 43},
        {a: "D", b: 91},
        {a: "E2", b: 81},
        {a: "F", b: 53},
        {a: "G", b: 19},
        {a: "H", b: 87},
        {a: "I", b: 52}
      ]
    },
    mark: "bar",
    encoding: {
      x: {field: "a", type: "ordinal"},
      y: {field: "b", type: "quantitative"}
    }
  }


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

{
    $schema: "https://vega.github.io/schema/vega-lite/v5.json",
    description: "A simple bar chart with embedded data.",
    data: {
      values: [
        {a: "A", b: 28}, /* comments */
        {a: "B", b: 55}, // comments2
        {a: "C", b: 43},
        {a: "D", b: 91},
        {a: "E2", b: 81},
        {a: "F", b: 53},
        {a: "G", b: 19},
        {a: "H", b: 87},
        {a: "I", b: 52}
      ]
    },
    mark: "bar",
    encoding: {
      x: {field: "a", type: "ordinal"},
      y: {field: "b", type: "quantitative"}
    }
  }


 Reveal Code: HTML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<div id="vis0"></div>
  <script type="text/javascript">
    var spec = {
      $schema: 'https://vega.github.io/schema/vega-lite/v5.json',
      description: 'A simple bar chart with embedded data.',
      width: 400,
      height: 200,
      data: {
        values: [
          {a: 'A', b: 28},
          {a: 'B', b: 55},
          {a: 'C', b: 43},
          {a: 'D', b: 91},
          {a: 'E', b: 81},
          {a: 'F', b: 53},
          {a: 'G', b: 19},
          {a: 'H', b: 87},
          {a: 'I', b: 52}
        ]
      },
      mark: 'bar',
      encoding: {
        x: {field: 'a', type: 'ordinal'},
        y: {field: 'b', type: 'quantitative'}
      }
    };
    vegaEmbed('#vis0', spec);
  </script>
</html>


 Reveal Code: VEGALITE

 Reveal Code: VEGALITE







Prompt Blocks

text new text here

subsection

text2

subsection3

text3

  Dataset

Add Markdown syntax content to file _tabs/about.md and it will show up on this page.

Add another markdown bit here

1
2
3
4
5
SELECT 
t.column1
, t.column2
, t.column3
FROM table1 as t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
{
/*comments*/
  "data": {
    "name": "dataset"
  },
  "title": {
    "text": "BULLET CHART",
    "anchor": "start"
  },
  "params": [
    {
      "name": "actual",
      "value": 43000,
      "bind": {
        "input": "range",
        "min": 10000,
        "max": 60000,
        "step": 1
      }
    },
    {
      "name": "budget",
      "value": 100000,
      "bind": {
        "input": "range",
        "min": 10000,
        "max": 100000,
        "step": 1
      }
    },
    {
      "name": "target",
      "value": 40000,
      "bind": {
        "input": "range",
        "min": 20000,
        "max": 75000,
        "step": 1
      }
    }
  ],
  "transform": [
    {
      "calculate": "max(actual,target,budget)",
      "as": "max_label"
    },
    {
      "calculate": "min(actual,target,budget)",
      "as": "min_actual_label"
    },
    {
      "calculate": "((actual - target) / target)",
      "as": "label_var"
    }
  ],
  "width": 450,
  "height": 35,
  "layer": [
    {
      "mark": {
        "type": "bar",
        "fill": "transparent",
        "stroke": "transparent"
      },
      "encoding": {
        "x": {
          "datum": 100000,
          "type": "quantitative"
        },
        "y": {
          "datum": "",
          "axis": {
            "title": "",
            "titlePadding": 10,
            "titleBaseline": "middle",
            "titleAngle": 0,
            "titleAlign": "right"
          }
        }
      }
    },
    {
      "mark": {
        "type": "bar",
        "fill": "whitesmoke"
      },
      "encoding": {
        "x": {
          "datum": {
            "expr": "budget"
          },
          "type": "quantitative"
        }
      }
    },
    {
      "mark": {
        "type": "bar",
        "height": 20,
        "fill": "lightblue",
        "fillOpacity": 0.5
      },
      "encoding": {
        "x": {
          "datum": {
            "expr": "actual"
          },
          "type": "quantitative"
        }
      }
    },
    {
      "mark": {
        "type": "bar",
        "height": 10,
        "yOffset": 5,
        "fill": {
          "expr": "actual > target ? 'limegreen' : 'crimson'"
        }
      },
      "encoding": {
        "x": {
          "datum": {
            "expr": "target"
          },
          "type": "quantitative"
        },
        "x2": {
          "datum": {
            "expr": "actual"
          },
          "type": "quantitative"
        }
      }
    },
    {
      "mark": {
        "type": "tick",
        "size": 35,
        "thickness": 5,
        "fill": "black"
      },
      "encoding": {
        "x": {
          "datum": {
            "expr": "target"
          },
          "type": "quantitative"
        }
      }
    },
    {
      "mark": {
        "type": "text",
        "size": 16,
        "thickness": 5,
        "strokeWidth": 0.1,
        "stroke": "black",
        "fill": {
          "expr": "actual > target ? 'darkgreen' : 'crimson'"
        },
        "align": "left",
        "dx": 10,
        "dy": 0.5
      },
      "encoding": {
        "x": {
          "datum": {
            "expr": "max(actual,target)"
          },
          "type": "quantitative"
        },
        "text": {
          "value": {
            "expr": "format(((actual - target) / target), '+0.0%')"
          },
          "type": "quantitative",
          "format": "+0.0%"
        }
      }
    },
    {
      "mark": {
        "type": "text",
        "fontWeight": "bold",
        "size": 15,
        "thickness": 5,
        "fill": "black",
        "align": "right",
        "baseline": "middle",
        "dx": -10,
        "dy": 0.5
      },
      "encoding": {
        "x": {
          "datum": {
            "expr": "min(actual,target)"
          },
          "format": ",.3~s",
          "type": "quantitative"
        },
        "text": {
          "value": {
            "expr": "format(actual, ',.3~s')"
          },
          "type": "quantitative",
          "format": ",.3~s"
        }
      }
    }
  ],
  "encoding": {
    "x": {
      "datum": 80000,
      "type": "quantitative"
    },
    "y": {
      "datum": "",
      "axis": {
        "title": "",
        "titlePadding": 10,
        "titleBaseline": "middle",
        "titleAngle": 0,
        "titleAlign": "right"
      }
    }
  }
}
”What's the secret?” It's a dirty mess!




Click to expand **This text is bold!** You can use other Markdown features here too, like: - **Bold list item** - *Italic list item* - [Links](https://example.com)


[!NOTE]
Highlights information that users should take into account, even when skimming.

[!IMPORTANT]
Crucial information necessary for users to succeed.

[!WARNING]
Critical content demanding immediate user attention due to potential risks.

Note This is a note

Warning This is a warning


Simple alerts

[!NOTE] This is a note.

[!TIP] This is a tip. (Supported since 14 Nov 2023)

[!IMPORTANT] Crutial information comes here.

[!CAUTION] Negative potential consequences of an action. (Supported since 14 Nov 2023)

[!WARNING] Critical content comes here.


⚠️ Warning

You shouldn’t. This is irreversible!

❌ Error

Don’t do that. This is irreversible!

ℹ️ Information

You can do that without problem.

✅ Success

Don’t hesitate to do that.

🦄 New line support

It supports new lines:

.. simply use an empty > line


This post is licensed under CC BY 4.0 by the author.