{ "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": [ "
indexvalue
0error: Unable to load the service index for source https://api.nuget.org/v3/index.json.
1error: 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": [ "
indexvalue
0_
1a
2area
3aside
4b
5body
6br
7button
8caption
9center
10code
11colgroup
12dd
13details
14div
15dl
16dt
17em
18figure
19font
20form
21h1
22h2
23h3
24h4
25h5
26h6
27head
28header
29hgroup
30hr
31html
32i
33iframe
34img
35input
36label
37li
38link
39main
40menu
41menuitem
42meta
43meter
44nav
45ol
46optgroup
47option
48p
49pre
50progress
51q
52script
53section
54select
55small
56source
57span
58strike
59style
60strong
61sub
62sup
63svg
64table
65tbody
66td
67textarea
68tfoot
69th
70thead
71title
72tr
73u
74ul
75video
" ] }, "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": [ "
Hello!
" ] }, "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 }