diff --git a/build/ui-bundle.zip b/build/ui-bundle.zip index 4675dea..aee3204 100644 Binary files a/build/ui-bundle.zip and b/build/ui-bundle.zip differ diff --git a/preview-src/index.adoc b/preview-src/index.adoc index 300b40f..7d09ccb 100644 --- a/preview-src/index.adoc +++ b/preview-src/index.adoc @@ -256,6 +256,35 @@ image::multirepo-ssg.svg[Multirepo SSG,250] Make the switch today! +== GSQL highlighting +[source,gsql] +---- +CREATE QUERY pageRankDyn (FLOAT maxChange=0.00, INT maxIter=25, + FLOAT damping=0.85, + STRING vType, STRING eType, STRING attr) //parameterized schema +//no graph name +{ + MaxAccum @@maxDiff = 9999; + SumAccum @rcvd_score = 0; + SumAccum @score = 1; + + Start = {vType}; + WHILE @@maxDiff > maxChange LIMIT maxIter DO + @@maxDiff = 0; + V = SELECT s + FROM Start:s -(eType:e)- vType:t //parameterized + ACCUM t.@rcvd_score += s.@score/(s.outdegree(eType)) //param + POST-ACCUM s.@score = (1.0-damping) + damping * s.@rcvd_score, + s.@rcvd_score = 0, + @@maxDiff += abs(s.@score - s.@score); + END; + + V = SELECT s FROM Start:s + POST-ACCUM s.setAttr(attr, s.@score); //parameterized +} +RUN QUERY pageRankDyn(_,_,_,"Page", "Link", "Score") +---- + [#english+中文] == English + 中文 diff --git a/preview-src/ui-model.yml b/preview-src/ui-model.yml index 085dfe9..a68b2df 100644 --- a/preview-src/ui-model.yml +++ b/preview-src/ui-model.yml @@ -18,7 +18,7 @@ site: latestVersion: *latest_version_abc - &component name: xyz - title: &component_title Project XYZ + title: &component_title TigerGraph Graph Data Science Library url: /xyz/6.0/index.html versions: - &latest_version_xyz diff --git a/src/css/nav.css b/src/css/nav.css index 52742e3..c36eb5b 100644 --- a/src/css/nav.css +++ b/src/css/nav.css @@ -185,6 +185,10 @@ html.is-clipped--nav { height: var(--drawer-height); } +.nav-panel-explore .context .title { + width: 11rem; +} + .nav-panel-explore .context .version { display: flex; align-items: inherit; diff --git a/src/highlight-gsql/gsql.js b/src/highlight-gsql/gsql.js new file mode 100644 index 0000000..b59d880 --- /dev/null +++ b/src/highlight-gsql/gsql.js @@ -0,0 +1,40 @@ +/* +Language: GSQL +Contributors: Dan Barkus +Description: GSQL language for TigerGraph +Website: https://www.tigergraph.com/ +*/ + +export default function(hljs) { + return { + name: "GSQL", + keywords: + { + keyword: 'accum and any api as asc avg bag batch between bool both break by case catch coalesce compress continue count create datetime datetime_add datetime_sub delete desc distributed do double edge else end escape exception false file filter float foreach for from graph group gsql_int_max gsql_int_min gsql_uint_max having if in insert int interpret intersect interval into is isempty jsonarray jsonobject lasthop leading like limit list load_accum log map match max min minus not now null offset or order path per pinned post_accum post-accum primary_id print query raise range replace reset_collection_accum return returns run sample select select_vertex set src static string sum syntax target tagstgt then to to_csv to_datetime trailing trim true try tuple typedef uint union update values vertex when where while with', + literal: 'true false null' + }, + contains: [ + // hljs.QUOTE_STRING_MODE, + // hljs.APOS_STRING_MODE, + hljs.C_NUMBER_MODE, + hljs.C_BLOCK_COMMENT_MODE, + hljs.HASH_COMMENT_MODE, + { + className: 'clause', + keywords: { + built_in: 'accum having limit order postAccum sample where' + } + }, + { + className: 'accum', + keywords: { + built_in: 'andaccum arrayaccum avgaccum bagaccum bitwiseandaccum bitwiseoraccum groupbyaccum heapaccum listaccum MapAccum maxaccum minaccum oraccum setaccum sumaccum' + } + }, + { + className: 'relation', + begin: /(-\s?)(\(.*\:\w?\))(\s?-)/, + } + ] + } + } \ No newline at end of file diff --git a/src/js/vendor/highlight.bundle.js b/src/js/vendor/highlight.bundle.js index eb96369..df83dfb 100644 --- a/src/js/vendor/highlight.bundle.js +++ b/src/js/vendor/highlight.bundle.js @@ -1,3 +1,7 @@ +// var path = require('path'); +// var filePath = path.join('..', '..', 'highlight-gsql', 'gsql.js'); +// console.log(filePath); + ;(function () { 'use strict'