{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Introduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Regular C# # "
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello World\r\n"
]
}
],
"source": [
"Console.WriteLine(\"Hello World\");"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### New functions"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Hello World"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(\"Hello World\");"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Read-Eval-Print Loop"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Hello World"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"Hello World\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Nuget Packages and Namespaces"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Installing package XPlot.Plotly.........done!"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Failed to add reference to package XPlot.Plotly"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"
index | value |
---|
0 | error: Unable to load the service index for source https://api.nuget.org/v3/index.json. |
1 | error: No such host is known. |
"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#r \"nuget:XPlot.Plotly\"\n",
"using XPlot.Plotly;"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var openSeries = new Graph.Scatter\n",
"{\n",
" name = \"Open\",\n",
" x = new[] {1, 2, 3, 4}, \n",
" y = new[] {10, 15, 13, 17}\n",
"};\n",
"\n",
"var closeSeries = new Graph.Scatter\n",
"{\n",
" name = \"Close\",\n",
" x = new[] { 2,3,4,5 },\n",
" y = new[] { 16, 5, 11, 9 }\n",
"};\n",
"\n",
"var chart = Chart.Plot(new[] {openSeries, closeSeries});\n",
"chart.WithTitle(\"Open vs Close\");\n",
"display(chart);"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var chart = Chart.Plot(new List \n",
"{ \n",
" new Graph.Box() { y = new int [] { -40, 24, 36, 52, 67, 99, 26, 28, 20 }, name = \"Age\" }, \n",
" new Graph.Box() { y = new int [] { 12, 42, 70, 100, 46, 20, 24, 24, 20 }, name = \"Annual Income\" }, \n",
" new Graph.Box() { y = new int [] { 0, 30, 100, 50, 60, 80, 75, 75, 20 }, name = \"Spending Score\" } \n",
"});\n",
"\n",
"var layout = new Layout.Layout() \n",
"{ \n",
" title=\"Shopping Mall Customers Data Distribution\", \n",
" showlegend = false \n",
"};\n",
"chart.WithLayout(layout);\n",
"\n",
"display(chart);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### PocketView API"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"index | value |
---|
0 | _ |
1 | a |
2 | area |
3 | aside |
4 | b |
5 | body |
6 | br |
7 | button |
8 | caption |
9 | center |
10 | code |
11 | colgroup |
12 | dd |
13 | details |
14 | div |
15 | dl |
16 | dt |
17 | em |
18 | figure |
19 | font |
20 | form |
21 | h1 |
22 | h2 |
23 | h3 |
24 | h4 |
25 | h5 |
26 | h6 |
27 | head |
28 | header |
29 | hgroup |
30 | hr |
31 | html |
32 | i |
33 | iframe |
34 | img |
35 | input |
36 | label |
37 | li |
38 | link |
39 | main |
40 | menu |
41 | menuitem |
42 | meta |
43 | meter |
44 | nav |
45 | ol |
46 | optgroup |
47 | option |
48 | p |
49 | pre |
50 | progress |
51 | q |
52 | script |
53 | section |
54 | select |
55 | small |
56 | source |
57 | span |
58 | strike |
59 | style |
60 | strong |
61 | sub |
62 | sup |
63 | svg |
64 | table |
65 | tbody |
66 | td |
67 | textarea |
68 | tfoot |
69 | th |
70 | thead |
71 | title |
72 | tr |
73 | u |
74 | ul |
75 | video |
"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var pocketViewTagMethods = typeof(PocketViewTags)\n",
" .GetProperties()\n",
" .Select(m => m.Name);\n",
"\n",
"display(pocketViewTagMethods);"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var pocketView = table[style: \"width: 100%\"](tr(td[style:\"border: 1px solid black\"](\"Hello!\")));\n",
"\n",
"display(pocketView);"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".NET (C#)",
"language": "C#",
"name": ".net-csharp"
},
"language_info": {
"file_extension": ".cs",
"mimetype": "text/x-csharp",
"name": "C#",
"pygments_lexer": "csharp",
"version": "8.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}