run R package msbuild

This commit is contained in:
この中二病に爆焔を! 2024-01-25 09:47:17 +08:00
parent eed9f73473
commit 4d9d0b8c0a
22 changed files with 1345 additions and 0 deletions

1
.gitignore vendored
View File

@ -240,3 +240,4 @@ _Pvt_Extensions
/build
*.map
.pkg/ggplot.zip
.pkg/Darwinism.zip

13
@export/Environment.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// export R# package module type define for javascript/typescript language
//
// imports "Environment" from "Darwinism";
//
// ref=Darwinism.Env@Darwinism, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
/**
*/
declare namespace Environment {
/**
*/
function set_threads(n_threads: object): any;
}

14
@export/Math.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
// export R# package module type define for javascript/typescript language
//
// imports "Math" from "Darwinism";
//
// ref=Darwinism.Math@Darwinism, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
/**
*/
declare namespace Math {
/**
* @param env default value Is ``null``.
*/
function average_distance(x: any, env?: object): number;
}

11
@export/index.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
// export R# source type define for javascript/typescript language
//
// package_source=Darwinism
declare namespace Darwinism {
module _ {
/**
*/
function onLoad(): object;
}
}

11
man/.onLoad.1 Normal file
View File

@ -0,0 +1,11 @@
.TH .ONLOAD 1 2024-Jan "" ".onLoad"
.SH NAME
.onLoad \- .onLoad()
.SH SYNOPSIS
\fI.onLoad()\fR
.SH FILES
.PP
SMRUCC/R#.declare_function..onLoad at zzz.R:line 1
.PP
.SH COPYRIGHT
Copyright © xieguigang, MIT Licensed 2024

View File

@ -0,0 +1,5 @@
# Environment
+ [set_threads](Environment/set_threads.1)

View File

@ -0,0 +1,12 @@
.\" man page create by R# package system.
.TH ENVIRONMENT 1 2000-Jan "set_threads" "set_threads"
.SH NAME
set_threads \-
.SH SYNOPSIS
\fIset_threads(\fBn_threads\fR as integer);\fR
.SH SEE ALSO
Environment
.SH FILES
.PP
Darwinism.dll
.PP

View File

@ -0,0 +1,5 @@
# Math
+ [average_distance](Math/average_distance.1)

View File

@ -0,0 +1,13 @@
.\" man page create by R# package system.
.TH MATH 1 2000-Jan "average_distance" "average_distance"
.SH NAME
average_distance \-
.SH SYNOPSIS
\fIaverage_distance(\fBx\fR as any,
[\fB<Environment>\fR]);\fR
.SH SEE ALSO
Math
.SH FILES
.PP
Darwinism.dll
.PP

View File

@ -9,6 +9,7 @@ Imports SMRUCC.Rsharp.Runtime.Interop
''' math helpers
''' </summary>
<Package("Math")>
<RTypeExport("entity_vector", GetType(ClusterEntity))>
Module Math
''' <summary>

View File

@ -0,0 +1,95 @@
<!DOCTYPE html><html lang="zh-CN">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
<title>Environment</title>
<meta name="author" content="xie.guigang@gcmodeller.org" />
<meta name="copyright" content="SMRUCC genomics Copyright (c) 2022" />
<meta name="keywords" content="R#; Environment; Darwinism" />
<meta name="generator" content="https://github.com/rsharp-lang" />
<meta name="theme-color" content="#333" />
<meta name="description" content="..." />
<meta class="foundation-data-attribute-namespace" />
<meta class="foundation-mq-xxlarge" />
<meta class="foundation-mq-xlarge" />
<meta class="foundation-mq-large" />
<meta class="foundation-mq-medium" />
<meta class="foundation-mq-small" />
<meta class="foundation-mq-topbar" />
<style>
.table-three-line {
border-collapse:collapse; /* 关键属性:合并表格内外边框(其实表格边框有2px外面1px里面还有1px哦) */
border:solid #000000; /* 设置边框属性;样式(solid=实线)、颜色(#999=灰) */
border-width:2px 0 2px 0px; /* 设置边框状粗细:上 右 下 左 = 对应1px 0 0 1px */
}
.left-1{
border:solid #000000;border-width:1px 1px 2px 0px;padding:2px;
font-weight:bolder;
}
.right-1{
border:solid #000000;border-width:1px 0px 2px 1px;padding:2px;
font-weight:bolder;
}
.mid-1{
border:solid #000000;border-width:1px 1px 2px 1px;padding:2px;
font-weight:bolder;
}
.left{
border:solid #000000;border-width:1px 1px 1px 0px;padding:2px;
}
.right{
border:solid #000000;border-width:1px 0px 1px 1px;padding:2px;
}
.mid{
border:solid #000000;border-width:1px 1px 1px 1px;padding:2px;
}
table caption {font-size:14px;font-weight:bolder;}
</style>
</head>
<body>
<table width="100%" summary="page for {Environment}">
<tbody>
<tr>
<td>{Environment}</td>
<td style="text-align: right;">R# Documentation</td>
</tr>
</tbody>
</table>
<h1>Environment</h1>
<hr />
<p style=" font-size: 1.125em; line-height: .8em; margin-left: 0.5%; background-color: #fbfbfb; padding: 24px; ">
<code>
<span style="color: blue;">require</span>(<span style="color: black; font-weight: bold;">Darwinism</span>);
<br /><br /><span style="color: green;">{$desc_comments}</span><br /><span style="color: blue;">imports</span><span style="color: brown"> "Environment"</span><span style="color: blue;"> from</span><span style="color: brown"> "Darwinism"</span>;
</code>
</p>
<p></p>
<blockquote>
<p style="font-style: italic; font-size: 0.9em;">
</p>
</blockquote>
<div id="main-wrapper">
<table class="table-three-line" style="display: none">
<caption>.NET clr type export</caption>
<tbody></tbody>
</table>
<br />
<br />
<table class="table-three-line">
<caption>.NET clr function exports</caption>
<tbody><tr>
<td id="set_threads">
<a href="./Environment/set_threads.html">set_threads</a>
</td>
<td></td>
</tr></tbody>
</table>
</div>
<hr />
<div style="text-align: center;">[<a href="../index.html">Document Index</a>]</div>
</body>
</html>

View File

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<title>set_threads</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" type="text/css" href="../../_assets/page.css">
</head>
<body>
<div class="container">
<table style="width: 100%;">
<tr>
<td>set_threads {Environment}</td>
<td style="text-align: right;">R Documentation</td>
</tr>
</table>
<h2>set_threads</h2>
<h3>Description</h3>
set_threads
<h3>Usage</h3>
<div style="width: 100%; padding-left: 3%; color: black;">
<pre><code class='language-R' style="color: black; font-weight:normal;"><strong>set_threads</strong>(<i>n.threads</i>);</code></pre>
</div>
<h3>Arguments</h3>
<table>
</table>
<h3 style="display: none;">Details</h3>
<h3 style="display: block">Authors</h3>
Darwinism
<h3>Value</h3>
this function returns data object of type <i>any</i> kind.<h4>clr value class</h4><ul><li><i>any</i> kind</li></ul>
<h3 style="display: none;">Examples</h3>
<hr />
<div style="text-align: center;">[Package <em>Environment</em> version 1.0.0.0 <a
href="../Environment.html">Index</a>]
</div>
</div>
</body>
<script type="text/javascript" src="../../_assets/R_syntax.js"></script>
<script type="text/javascript" src="../../_assets/highlights.js"></script>
<script type="text/javascript">r_highlights("example_r");</script>
</html>

View File

@ -0,0 +1,100 @@
<!DOCTYPE html><html lang="zh-CN">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
<title>Math</title>
<meta name="author" content="xie.guigang@gcmodeller.org" />
<meta name="copyright" content="SMRUCC genomics Copyright (c) 2022" />
<meta name="keywords" content="R#; Math; Darwinism" />
<meta name="generator" content="https://github.com/rsharp-lang" />
<meta name="theme-color" content="#333" />
<meta name="description" content="..." />
<meta class="foundation-data-attribute-namespace" />
<meta class="foundation-mq-xxlarge" />
<meta class="foundation-mq-xlarge" />
<meta class="foundation-mq-large" />
<meta class="foundation-mq-medium" />
<meta class="foundation-mq-small" />
<meta class="foundation-mq-topbar" />
<style>
.table-three-line {
border-collapse:collapse; /* 关键属性:合并表格内外边框(其实表格边框有2px外面1px里面还有1px哦) */
border:solid #000000; /* 设置边框属性;样式(solid=实线)、颜色(#999=灰) */
border-width:2px 0 2px 0px; /* 设置边框状粗细:上 右 下 左 = 对应1px 0 0 1px */
}
.left-1{
border:solid #000000;border-width:1px 1px 2px 0px;padding:2px;
font-weight:bolder;
}
.right-1{
border:solid #000000;border-width:1px 0px 2px 1px;padding:2px;
font-weight:bolder;
}
.mid-1{
border:solid #000000;border-width:1px 1px 2px 1px;padding:2px;
font-weight:bolder;
}
.left{
border:solid #000000;border-width:1px 1px 1px 0px;padding:2px;
}
.right{
border:solid #000000;border-width:1px 0px 1px 1px;padding:2px;
}
.mid{
border:solid #000000;border-width:1px 1px 1px 1px;padding:2px;
}
table caption {font-size:14px;font-weight:bolder;}
</style>
</head>
<body>
<table width="100%" summary="page for {Math}">
<tbody>
<tr>
<td>{Math}</td>
<td style="text-align: right;">R# Documentation</td>
</tr>
</tbody>
</table>
<h1>Math</h1>
<hr />
<p style=" font-size: 1.125em; line-height: .8em; margin-left: 0.5%; background-color: #fbfbfb; padding: 24px; ">
<code>
<span style="color: blue;">require</span>(<span style="color: black; font-weight: bold;">Darwinism</span>);
<br /><br /><span style="color: green;">{$desc_comments}</span><br /><span style="color: blue;">imports</span><span style="color: brown"> "Math"</span><span style="color: blue;"> from</span><span style="color: brown"> "Darwinism"</span>;
</code>
</p>
<p></p>
<blockquote>
<p style="font-style: italic; font-size: 0.9em;">
</p>
</blockquote>
<div id="main-wrapper">
<table class="table-three-line" style="display: block">
<caption>.NET clr type export</caption>
<tbody><tr>
<td id="entity_vector">
<a href="/vignettes/clr/Microsoft/VisualBasic/DataMining/KMeans/ClusterEntity.html">entity_vector: ClusterEntity</a>
</td>
<td><p>A tagged numeric vector</p></td>
</tr></tbody>
</table>
<br />
<br />
<table class="table-three-line">
<caption>.NET clr function exports</caption>
<tbody><tr>
<td id="average_distance">
<a href="./Math/average_distance.html">average_distance</a>
</td>
<td></td>
</tr></tbody>
</table>
</div>
<hr />
<div style="text-align: center;">[<a href="../index.html">Document Index</a>]</div>
</body>
</html>

View File

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<title>average_distance</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" type="text/css" href="../../_assets/page.css">
</head>
<body>
<div class="container">
<table style="width: 100%;">
<tr>
<td>average_distance {Math}</td>
<td style="text-align: right;">R Documentation</td>
</tr>
</table>
<h2>average_distance</h2>
<h3>Description</h3>
average_distance
<h3>Usage</h3>
<div style="width: 100%; padding-left: 3%; color: black;">
<pre><code class='language-R' style="color: black; font-weight:normal;"><strong>average_distance</strong>(<i>x</i>);</code></pre>
</div>
<h3>Arguments</h3>
<table>
</table>
<h3 style="display: none;">Details</h3>
<h3 style="display: block">Authors</h3>
Darwinism
<h3>Value</h3>
this function returns data object of type double.<h4>clr value class</h4><ul><li>double</li></ul>
<h3 style="display: none;">Examples</h3>
<hr />
<div style="text-align: center;">[Package <em>Math</em> version 1.0.0.0 <a
href="../Math.html">Index</a>]
</div>
</div>
</body>
<script type="text/javascript" src="../../_assets/R_syntax.js"></script>
<script type="text/javascript" src="../../_assets/highlights.js"></script>
<script type="text/javascript">r_highlights("example_r");</script>
</html>

View File

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<title><p>.onLoad</p></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" type="text/css" href="../../_assets/page.css">
</head>
<body>
<div class="container">
<table style="width: 100%;">
<tr>
<td>.onLoad {Darwinism}</td>
<td style="text-align: right;">R Documentation</td>
</tr>
</table>
<h2><p>.onLoad</p></h2>
<h3>Description</h3>
<h3>Usage</h3>
<div style="width: 100%; padding-left: 3%; color: black;">
<pre><code class='language-R' style="color: black; font-weight:normal;"><strong>.onLoad</strong>();</code></pre>
</div>
<h3>Arguments</h3>
<table>
</table>
<h3 style="display: none;">Details</h3>
<h3 style="display: block">Authors</h3>
xieguigang
<h3>Value</h3>
This function has no value returns.
<h3 style="display: none;">Examples</h3>
<hr />
<div style="text-align: center;">[Package <em>Darwinism</em> version 1.0.0.1254 <a
href="../Darwinism.html">Index</a>]
</div>
</div>
</body>
<script type="text/javascript" src="../../_assets/R_syntax.js"></script>
<script type="text/javascript" src="../../_assets/highlights.js"></script>
<script type="text/javascript">r_highlights("example_r");</script>
</html>

View File

@ -0,0 +1,491 @@
var Token;
(function (Token) {
/**
* regexp for test html colors
*/
Token.html_color = /"[#][a-zA-Z0-9]{6}"/ig;
/**
* pattern for match the number token
*/
Token.number_regexp = /[-]?\d+(\.\d+)?([eE][-]?\d+)?/ig;
Token.symbol_name = /[a-zA-Z_\.]/ig;
function renderTextSet(chars) {
var set = {};
for (var _i = 0, chars_1 = chars; _i < chars_1.length; _i++) {
var char = chars_1[_i];
set[char] = 1;
}
return set;
}
Token.logical = renderTextSet(["true", "false", "TRUE", "FALSE", "True", "False"]);
Token.operators = renderTextSet(["+", "-", "*", "/", "\\", "!", "$", "%", "^", "&", "=", "<", ">", ":", "|", ",", "~", "?"]);
Token.stacks = renderTextSet(["[", "]", "(", ")", "{", "}"]);
Token.keywords = renderTextSet([
"imports", "from", "require",
"if", "else", "for", "break", "while", "next",
"in", "between",
"function", "return",
"let", "const", "as",
"stop", "invisible",
"export", "namespace", "class",
"extends", "implements", // typescript keywords
"string", "double", "integer", "list", "boolean",
"typeof"
]);
var hex_colors = {
aliceblue: "#F0F8FF",
antiquewhite: "#FAEBD7",
aqua: "#00FFFF",
aquamarine: "#7FFFD4",
azure: "#F0FFFF",
beige: "#F5F5DC",
bisque: "#FFE4C4",
black: "#000000",
blanchedalmond: "#FFEBCD",
blue: "#0000FF",
blueviolet: "#8A2BE2",
brown: "#A52A2A",
burlywood: "#DEB887",
cadetblue: "#5F9EA0",
chartreuse: "#7FFF00",
chocolate: "#D2691E",
coral: "#FF7F50",
cornflowerblue: "#6495ED",
cornsilk: "#FFF8DC",
crimson: "#DC143C",
cyan: "#00FFFF",
darkblue: "#00008B",
darkcyan: "#008B8B",
darkgoldenrod: "#B8860B",
darkgray: "#A9A9A9",
darkgrey: "#A9A9A9",
darkgreen: "#006400",
darkkhaki: "#BDB76B",
darkmagenta: "#8B008B",
darkolivegreen: "#556B2F",
darkorange: "#FF8C00",
darkorchid: "#9932CC",
darkred: "#8B0000",
darksalmon: "#E9967A",
darkseagreen: "#8FBC8F",
darkslateblue: "#483D8B",
darkslategray: "#2F4F4F",
darkslategrey: "#2F4F4F",
darkturquoise: "#00CED1",
darkviolet: "#9400D3",
deeppink: "#FF1493",
deepskyblue: "#00BFFF",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1E90FF",
firebrick: "#B22222",
floralwhite: "#FFFAF0",
forestgreen: "#228B22",
fuchsia: "#FF00FF",
gainsboro: "#DCDCDC",
ghostwhite: "#F8F8FF",
gold: "#FFD700",
goldenrod: "#DAA520",
gray: "#808080",
grey: "#808080",
green: "#008000",
greenyellow: "#ADFF2F",
honeydew: "#F0FFF0",
hotpink: "#FF69B4",
indianred: "#CD5C5C",
indigo: "#4B0082",
ivory: "#FFFFF0",
khaki: "#F0E68C",
lavender: "#E6E6FA",
lavenderblush: "#FFF0F5",
lawngreen: "#7CFC00",
lemonchiffon: "#FFFACD",
lightblue: "#ADD8E6",
lightcoral: "#F08080",
lightcyan: "#E0FFFF",
lightgoldenrodyellow: "#FAFAD2",
lightgray: "#D3D3D3",
lightgrey: "#D3D3D3",
lightgreen: "#90EE90",
lightpink: "#FFB6C1",
lightsalmon: "#FFA07A",
lightseagreen: "#20B2AA",
lightskyblue: "#87CEFA",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#B0C4DE",
lightyellow: "#FFFFE0",
lime: "#00FF00",
limegreen: "#32CD32",
linen: "#FAF0E6",
magenta: "#FF00FF",
maroon: "#800000",
mediumaquamarine: "#66CDAA",
mediumblue: "#0000CD",
mediumorchid: "#BA55D3",
mediumpurple: "#9370DB",
mediumseagreen: "#3CB371",
mediumslateblue: "#7B68EE",
mediumspringgreen: "#00FA9A",
mediumturquoise: "#48D1CC",
mediumvioletred: "#C71585",
midnightblue: "#191970",
mintcream: "#F5FFFA",
mistyrose: "#FFE4E1",
moccasin: "#FFE4B5",
navajowhite: "#FFDEAD",
navy: "#000080",
oldlace: "#FDF5E6",
olive: "#808000",
olivedrab: "#6B8E23",
orange: "#FFA500",
orangered: "#FF4500",
orchid: "#DA70D6",
palegoldenrod: "#EEE8AA",
palegreen: "#98FB98",
paleturquoise: "#AFEEEE",
palevioletred: "#DB7093",
papayawhip: "#FFEFD5",
peachpuff: "#FFDAB9",
peru: "#CD853F",
pink: "#FFC0CB",
plum: "#DDA0DD",
powderblue: "#B0E0E6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#FF0000",
rosybrown: "#BC8F8F",
royalblue: "#4169E1",
saddlebrown: "#8B4513",
salmon: "#FA8072",
sandybrown: "#F4A460",
seagreen: "#2E8B57",
seashell: "#FFF5EE",
sienna: "#A0522D",
silver: "#C0C0C0",
skyblue: "#87CEEB",
slateblue: "#6A5ACD",
slategray: "#708090",
slategrey: "#708090",
snow: "#FFFAFA",
springgreen: "#00FF7F",
steelblue: "#4682B4",
tan: "#D2B48C",
teal: "#008080",
thistle: "#D8BFD8",
tomato: "#FF6347",
turquoise: "#40E0D0",
violet: "#EE82EE",
wheat: "#F5DEB3",
white: "#FFFFFF",
whitesmoke: "#F5F5F5",
yellow: "#FFFF00",
yellowgreen: "#9ACD32",
};
function isColorLiteral(pull_str) {
if (!Token.html_color) {
return false;
}
if (Token.html_color.test(pull_str)) {
return true;
}
else {
pull_str = pull_str.toLowerCase();
return pull_str in hex_colors;
}
}
Token.isColorLiteral = isColorLiteral;
})(Token || (Token = {}));
///<reference path="token.ts" />
var TokenParser = /** @class */ (function () {
function TokenParser(source) {
this.source = source;
this.escaped = false;
this.escape_char = null;
this.escape_comment = false;
/**
* for get char at index
*/
this.i = 0;
this.str_len = -1;
/**
* the token text buffer
*/
this.buf = [];
if (source) {
this.str_len = source.length;
}
}
TokenParser.prototype.getTokens = function () {
var tokens = [];
var tmp = null;
while (this.i < this.str_len) {
if (tmp = this.walkChar(this.source.charAt(this.i++))) {
tokens.push(tmp);
if (this.buf.length == 1) {
var c = this.buf[0];
if (c == " " || c == "\t") {
this.buf = [];
tokens.push({
text: c, type: "whitespace"
});
}
else if (c == "\r" || c == "\n") {
this.buf = [];
tokens.push({
text: c, type: "newLine"
});
}
else if (c in Token.stacks) {
this.buf = [];
tokens.push({
text: c, type: "bracket"
});
}
else if (c == ";") {
this.buf = [];
tokens.push({
text: c, type: "terminator"
});
}
else if (c == ",") {
this.buf = [];
tokens.push({
text: c, type: "delimiter"
});
}
}
}
}
if (this.buf.length > 0) {
tokens.push(this.measureToken(null));
}
return tokens;
};
TokenParser.prototype.walkChar = function (c) {
if (this.escaped) {
this.buf.push(c);
if (c == this.escape_char) {
var pull_str = this.buf.join("");
var type = Token.isColorLiteral(pull_str) ? "color" : "character";
// end escape
this.escaped = false;
this.escape_char = null;
this.buf = [];
return {
text: pull_str,
type: type
};
}
else {
// do nothing
}
return null;
}
if (this.escape_comment) {
if (c == "\r" || c == "\n") {
var pull_comment = this.buf.join("");
// end comment line
this.escape_comment = false;
this.buf = [c];
return {
text: pull_comment,
type: "comment"
};
}
else {
this.buf.push(c);
}
return null;
}
if (c == "#") {
// start comment
this.escape_comment = true;
if (this.buf.length > 0) {
// populate previous token
return this.measureToken(c);
}
else {
this.buf.push(c);
}
}
else if (c == "'" || c == '"') {
// start string
this.escape_char = c;
this.escaped = true;
if (this.buf.length > 0) {
// populate previous token
return this.measureToken(c);
}
else {
this.buf.push(c);
}
}
else if (c == " " || c == "\t") {
if (this.buf.length > 0) {
// populate previous token
return this.measureToken(c);
}
else {
return {
type: "whitespace",
text: c
};
}
}
else if (c == "\r" || c == "\n") {
if (this.buf.length > 0) {
// populate previous token
return this.measureToken(c);
}
else {
return {
type: "newLine",
text: c
};
}
}
else if (c in Token.stacks) {
if (this.buf.length > 0) {
// populate previous token
return this.measureToken(c);
}
else {
return {
type: "bracket",
text: c
};
}
}
else if (c == ";") {
if (this.buf.length > 0) {
// populate previous token
return this.measureToken(c);
}
else {
return {
type: "terminator",
text: c
};
}
}
else if (c == ",") {
if (this.buf.length > 0) {
// populate previous token
return this.measureToken(c);
}
else {
return {
type: "delimiter",
text: c
};
}
}
else {
this.buf.push(c);
}
return null;
};
TokenParser.prototype.measureToken = function (push_next) {
var text = this.buf.join("");
var test_symbol = text.match(Token.symbol_name);
var test_number = text.match(Token.number_regexp);
this.buf = [];
if (push_next) {
this.buf.push(push_next);
}
if (text == "NULL" || text == "NA" || text == "NaN" || text == "Inf") {
return {
text: text,
type: "factor"
};
}
else if (text in Token.logical) {
return {
text: text,
type: "logical"
};
}
else if (text in Token.keywords) {
return {
text: text,
type: "keyword"
};
}
else if (test_number && (test_number.length > 0)) {
return {
text: text,
type: "number"
};
}
else if (test_symbol && (test_symbol.length > 0)) {
// symbol
return {
text: text,
type: "symbol"
};
}
else if (text in Token.operators) {
return {
text: text,
type: "operator"
};
}
else {
return {
text: text,
type: "undefined"
};
}
};
return TokenParser;
}());
///<reference path="token.ts" />
///<reference path="parser.ts" />
function parseText(str) {
var parser = new TokenParser(str);
var tokens = parser.getTokens();
return tokens;
}
/**
* parse the script text to syntax highlight html content
*/
function highlights(str, verbose) {
if (verbose === void 0) { verbose = true; }
var html = "";
var syntax = parseText(str);
if (verbose) {
console.log("view of the syntax tokens:");
console.table(syntax);
}
for (var _i = 0, syntax_1 = syntax; _i < syntax_1.length; _i++) {
var t = syntax_1[_i];
switch (t.type) {
case "newLine":
html = html + "\n";
break;
case "whitespace":
case "symbol":
html = html + escape_op(t.text);
break;
case "color":
html = html + "<span class=\"color\" style=\"font-style: italic; background-color: ".concat(t.text.replace(/'/ig, "").replace(/"/ig, ""), "; color: white; font-weight: bold;\">").concat(t.text, "</span>");
break;
default:
html = html + "<span class=\"".concat(t.type, "\">").concat(t.text, "</span>");
}
}
return html;
}
function escape_op(str) {
if (!str) {
return "";
}
else {
return str
.replace("&", "&amp;")
.replace(">", "&gt;")
.replace("<", "&lt;");
}
}
//# sourceMappingURL=R_syntax.js.map

View File

@ -0,0 +1,9 @@
function r_highlights(id) {
let example_code = document.getElementById(id);
let highlights_str = highlights(example_code.innerText);
console.log(example_code.innerText);
console.log(highlights_str);
example_code.innerHTML = highlights_str;
}

167
vignettes/_assets/page.css Normal file
View File

@ -0,0 +1,167 @@
@media screen {
.container {
padding-right: 10px;
padding-left: 10px;
margin-right: auto;
margin-left: auto;
max-width: 900px;
}
}
.rimage img {
/* from knitr - for examples and demos */
width: 96%;
margin-left: 2%;
}
.katex {
font-size: 1.1em;
}
code {
color: rgb(194, 42, 42);
background: inherit;
font-style: italic;
font-weight: bold;
}
pre code {
color: rgb(54, 54, 54);
font-style: normal;
}
body {
line-height: 1.4;
background: white;
color: black;
}
a:link {
background: white;
color: blue;
}
a:visited {
background: white;
color: rgb(50%, 0%, 50%);
}
h1 {
background: white;
color: rgb(55%, 55%, 55%);
font-family: monospace;
font-size: 1.4em;
/* x-large; */
text-align: center;
}
h2 {
background: white;
color: rgb(40%, 40%, 40%);
font-family: monospace;
font-size: 1.2em;
/* large; */
text-align: center;
}
h3 {
background: white;
color: rgb(40%, 40%, 40%);
font-family: monospace;
font-size: 1.2em;
/* large; */
}
h4 {
background: white;
color: rgb(40%, 40%, 40%);
font-family: monospace;
font-style: italic;
font-size: 1.2em;
/* large; */
}
h5 {
background: white;
color: rgb(40%, 40%, 40%);
font-family: monospace;
}
h6 {
background: white;
color: rgb(40%, 40%, 40%);
font-family: monospace;
font-style: italic;
}
img.toplogo {
width: 4em;
vertical-align: middle;
}
img.arrow {
width: 30px;
height: 30px;
border: 0;
}
span.acronym {
font-size: small;
}
span.env {
font-family: monospace;
}
span.file {
font-family: monospace;
}
span.option {
font-family: monospace;
}
span.pkg {
font-weight: bold;
}
span.samp {
font-family: monospace;
}
div.vignettes a:hover {
background: rgb(85%, 85%, 85%);
}
.character {
color: brown;
}
.comment {
color: green;
font-style: italic;
}
.number {
color: skyblue;
}
.keyword {
color: blue;
font-weight: bold;
}
.operator {
color: gray;
font-weight: bold;
}
.bracket {
color: rgb(197, 1, 197);
font-weight: bold;
}
.logical {
color: fuchsia;
font-style: italic;
}

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<title>Microsoft.VisualBasic.DataMining.KMeans.ClusterEntity</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" type="text/css" href="../../_assets/page.css">
</head>
<body>
<div class="container">
<table style="width: 100%;">
<tr>
<td>ClusterEntity {Microsoft.VisualBasic.DataMining.KMeans}</td>
<td style="text-align: right;">.NET clr documentation</td>
</tr>
</table>
<h2>ClusterEntity</h2>
<h3>Description</h3>
<p>A tagged numeric vector</p>
<p>uid -- feature_vector</p>
<p>(计算所使用的对象实例实体模型)</p>
<h3>Declare</h3>
<pre>
<code id="clr_ts">
# namespace Microsoft.VisualBasic.DataMining.KMeans
export class ClusterEntity extends <a href="/vignettes/clr/Microsoft/VisualBasic/DataMining/ComponentModel/EntityBase`1.html">EntityBase`1</a> {
# the unique reference id of current entity object
uid: string;
# the cluster class label
cluster: integer;
# the point data vector
entityVector: double;
Length: integer;
}
</code>
</pre>
<h3>.NET clr type reference tree</h3>
<ol>
<li>this class extends from <a href="/vignettes/clr/Microsoft/VisualBasic/DataMining/ComponentModel/EntityBase`1.html">EntityBase`1</a> class: <a href="/vignettes/clr/Microsoft/VisualBasic/DataMining/ComponentModel/EntityBase`1.html">EntityBase`1</a></li>
</ol>
<hr />
<div style="text-align: center;">[Package <em>{$package}</em> version {$version} <a
href="../{$package}.html">Index</a>]
</div>
</div>
</body>
<script type="text/javascript" src="../../_assets/R_syntax.js"></script>
<script type="text/javascript" src="../../_assets/highlights.js"></script>
<script type="text/javascript">r_highlights("clr_ts");</script>
</html>

View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<title>System.Double</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" type="text/css" href="../../_assets/page.css">
</head>
<body>
<div class="container">
<table style="width: 100%;">
<tr>
<td>Double {System}</td>
<td style="text-align: right;">.NET clr documentation</td>
</tr>
</table>
<h2>Double</h2>
<h3>Description</h3>
<h3>Declare</h3>
<pre>
<code id="clr_ts">
# namespace System
export class Double extends <a href="/vignettes/clr/System/ValueType.html">ValueType</a> {
}
</code>
</pre>
<h3>.NET clr type reference tree</h3>
<ol>
<li>this class extends from <a href="/vignettes/clr/System/ValueType.html">ValueType</a> class: <a href="/vignettes/clr/System/ValueType.html">ValueType</a></li>
</ol>
<hr />
<div style="text-align: center;">[Package <em>{$package}</em> version {$version} <a
href="../{$package}.html">Index</a>]
</div>
</div>
</body>
<script type="text/javascript" src="../../_assets/R_syntax.js"></script>
<script type="text/javascript" src="../../_assets/highlights.js"></script>
<script type="text/javascript">r_highlights("clr_ts");</script>
</html>

View File

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<title>System.ValueType</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="stylesheet" type="text/css" href="../../_assets/page.css">
</head>
<body>
<div class="container">
<table style="width: 100%;">
<tr>
<td>ValueType {System}</td>
<td style="text-align: right;">.NET clr documentation</td>
</tr>
</table>
<h2>ValueType</h2>
<h3>Description</h3>
<h3>Declare</h3>
<pre>
<code id="clr_ts">
# namespace System
export class ValueType {
}
</code>
</pre>
<h3>.NET clr type reference tree</h3>
this clr type has no other .net clr type reference.
<hr />
<div style="text-align: center;">[Package <em>{$package}</em> version {$version} <a
href="../{$package}.html">Index</a>]
</div>
</div>
</body>
<script type="text/javascript" src="../../_assets/R_syntax.js"></script>
<script type="text/javascript" src="../../_assets/highlights.js"></script>
<script type="text/javascript">r_highlights("clr_ts");</script>
</html>

22
vignettes/index.html Normal file
View File

@ -0,0 +1,22 @@
<pre>Package: Darwinism
Type: Package
Title: Create Elegant Data Visualisations Using the Grammar of Graphics
Version: 1.0.0.1254
Date: 2021-01-25
Author: xieguigang
Maintainer: xieguigang &lt;gg.xie@bionovogene.com>
Description: A R language ggplot2 package liked grammar of
graphics library for R# language programming.
License: MIT
RoxygenNote: 7.1.1
</pre>
<br />
<h2>R Package Symbols</h2>
<ul>
<li><a href="./R/docs/.onLoad.html">.onLoad</a></li>
</ul>
<h2>Library: Darwinism.dll</h2>
<ul>
<li><a href="./Darwinism/Environment.html">Environment</a></li>
<li><a href="./Darwinism/Math.html">Math</a></li>
</ul>