0.0.37 • Published 8 months ago
@senx/discovery-code v0.0.37
Discovery Code
This web components embed a WarpScript editor dedicated to Warp 10.
Usage
In a Web Environment
With NPM/Yarn
$ npm install @senx/discovery-code
With CDN
<script nomodule src="https://cdn.jsdelivr.net/npm/@senx/discovery-code/dist/discovery-code/discovery-code.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@senx/discovery-code/dist/discovery-code/discovery-code.esm.js"></script>
Usage
<html lang="en">
<head>
<title>Test</title>
</head>
<body>
<div style="width: 100%; min-height: calc(100vh - 280px);overflow: hidden;">
<discovery-code-editor url="https://sandbox.senx.io/api/v0/exec"
debug="true" show-dataviz="false"
id="editor"
show-execute="true" debug
show-result="true" config='{}'
display-messages="true" initial-size="400">
NEWGTS 'v' STORE
0 10 <%
'ts' STORE
$v NOW $ts STU * - NaN NaN NaN RAND ADDVALUE DROP
%> FOR
$v
</discovery-code-editor>
</div>
<script nomodule src="https://cdn.jsdelivr.net/npm/@senx/discovery-code/dist/discovery-code/discovery-code.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@senx/discovery-code/dist/discovery-code/discovery-code.esm.js"></script>
</body>
</html>
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
code | code | string | '' | |
config | config | Config \| string | new Config() | |
debug | debug | boolean | false | |
displayMessages | display-messages | boolean | false | |
existingComments | existing-comments | ReviewCommentEvent[] \| string | [] | |
heightLine | height-line | number | undefined | |
heightPx | height-px | number | undefined | |
imageTab | image-tab | boolean | false | |
initialSize | -- | { w?: number; h?: number; name?: string; p?: number; } | undefined | |
language | language | "flows" \| "warpscript" | 'warpscript' | |
showDataviz | show-dataviz | boolean | false | |
showExecute | show-execute | boolean | false | |
showResult | show-result | boolean | false | |
theme | theme | "dark" \| "light" | 'light' | |
url | url | string | undefined | |
widthPx | width-px | number | undefined |
Events
Event | Description | Type |
---|---|---|
discoveryCodeBreakPoint | CustomEvent<any> | |
discoveryCodeChanged | CustomEvent<any> | |
discoveryCodeDataviz | CustomEvent<any> | |
discoveryCodeError | CustomEvent<any> | |
discoveryCodeLoaded | CustomEvent<any> | |
discoveryCodeRef | CustomEvent<any> | |
discoveryCodeResult | CustomEvent<any> | |
discoveryCodeReview | CustomEvent<any> | |
discoveryCodeSize | CustomEvent<any> | |
discoveryCodeStatus | CustomEvent<any> |
Methods
abort(session?: string) => Promise<void>
Returns
Type: Promise<void>
execute(session?: string) => Promise<void>
Returns
Type: Promise<void>
highlight(line: number) => Promise<void>
Returns
Type: Promise<void>
resize(initial: boolean) => Promise<void>
Returns
Type: Promise<void>
Data format
Default config
{
"buttons" : {
"class": ""
},
"execButton" : {
"class": "",
"label": "Execute"
},
"datavizButton" : {
"class": "",
"label": "Visualize"
},
"hover" : true,
"readOnly" : false,
"messageClass" : "",
"errorClass" : "",
"editor": {
"quickSuggestionsDelay": 10,
"quickSuggestions": true,
"tabSize": 2,
"minLineNumber": 10,
"enableDebug": false
}
}
CSS vars
Inherited from Discovery
Name | Default value |
---|---|
--warp-view-button-font-size | 1rem |
--warp-view-button-border-color | #004eff |
--warp-view-button-padding | .375rem .75rem |
--warp-view-button-label-color | #ffffff |
--warp-view-button-bg-color | #004eff |
--warp-view-button-bg-color | #004eff |
--warp-view-button-width | auto |
--warp-view-button-border-radius | 0.25rem |
--warp-view-spinner-color | #004eff |
Specific
Name | Default value |
---|---|
--discovery-code-status-bar-font-color | #404040 |
--discovery-code-status-bar-background | #c0c0c0 |
--discovery-code-breakpoint-color | #dc3545 |
--discovery-code-selected-line-color | #00abc066 |
0.0.37
8 months ago
0.0.35
11 months ago
0.0.36
10 months ago
0.0.34
1 year ago
0.0.33
1 year ago
0.0.31
1 year ago
0.0.32
1 year ago
0.0.30
1 year ago
0.0.29
1 year ago
0.0.26
1 year ago
0.0.27
1 year ago
0.0.28
1 year ago
0.0.23
1 year ago
0.0.24
1 year ago
0.0.25
1 year ago
0.0.21
1 year ago
0.0.22
1 year ago
0.0.20
1 year ago
0.0.19
1 year ago
0.0.17
1 year ago
0.0.18
1 year ago
0.0.15
2 years ago
0.0.16
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago