@datagrok/api-samples 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +47 -0
- package/CHANGELOG.md +9 -0
- package/README.md +8 -8
- package/dist/package-test.js +2 -2
- package/files.js +39 -0
- package/package.json +18 -9
- package/scripts/dapi/groups.js +3 -0
- package/scripts/dapi/users.js +1 -1
- package/scripts/data-access/db-master-details-manual.js +3 -3
- package/scripts/data-access/parameterized-query.js +3 -3
- package/scripts/data-frame/bitset/similarity-metrics.js +3 -3
- package/scripts/data-frame/construction/create-from-csv-format.js +3 -3
- package/scripts/data-frame/filtering/update-filter-state.js +13 -0
- package/scripts/data-frame/modification/remove-where.js +8 -0
- package/scripts/data-frame/row-matching/patterns.js +1 -3
- package/scripts/domains/chem/chem-benchmark.js +26 -26
- package/scripts/domains/chem/descriptors.js +1 -2
- package/scripts/domains/chem/diversity-search.js +3 -5
- package/scripts/domains/chem/inspect-molecule.js +1 -1
- package/scripts/domains/chem/mcs.js +2 -3
- package/scripts/domains/chem/mol-atoms-bonds.js +1 -2
- package/scripts/domains/chem/mol-panel.js +0 -1
- package/scripts/domains/chem/mol-rendering-canvas.js +4 -6
- package/scripts/domains/chem/mol-rendering.js +0 -1
- package/scripts/domains/chem/r-group.js +3 -5
- package/scripts/domains/chem/similarity-scoring-scores.js +0 -3
- package/scripts/domains/chem/similarity-scoring-sorted.js +0 -3
- package/scripts/domains/chem/substructure-search-benchmark.js +5 -8
- package/scripts/domains/chem/substructure-search-smarts-molfile-als.js +6 -9
- package/scripts/domains/chem/substructure-search-smarts.js +4 -7
- package/scripts/domains/chem/substructure-search.js +1 -4
- package/scripts/domains/data-science/predictive-model.js +2 -3
- package/scripts/functions/caching-results.js +36 -0
- package/scripts/functions/calling.js +2 -2
- package/scripts/functions/discover-functions.js +1 -1
- package/scripts/functions/func-call.js +18 -0
- package/scripts/functions/progress.js +2 -7
- package/scripts/grid/advanced/charts-in-cells.js +16 -14
- package/scripts/grid/advanced/link-click.js +19 -0
- package/scripts/grid/advanced/pinned-columns.js +7 -0
- package/scripts/grid/advanced/pinned-rows.js +8 -0
- package/scripts/grid/advanced/visible-cells.js +3 -4
- package/scripts/grid/scroll-to-pixels.js +9 -4
- package/scripts/misc/audit/activity-today.js +3 -3
- package/scripts/misc/audit/errors-summary.js +2 -4
- package/scripts/misc/audit/test-tracking.js +2 -4
- package/scripts/misc/audit/users-today.js +6 -7
- package/scripts/misc/package-credentials.js +2 -4
- package/scripts/misc/sdtm.js +8 -10
- package/scripts/misc/utils/hide-empty-columns.js +17 -4
- package/scripts/performance/all-chembl-structures.js +1 -1
- package/scripts/scripting/grok-scripting.js +1 -1
- package/scripts/scripting/scripting.js +2 -2
- package/scripts/shell/last-error.js +0 -4
- package/scripts/shell/windows/shell-windows.js +6 -0
- package/scripts/ui/components/balloons.js +4 -1
- package/scripts/ui/{elements → components}/color-palettes.js +4 -4
- package/scripts/ui/components/html-tables.js +27 -0
- package/scripts/ui/components/loading-indicators.js +4 -6
- package/scripts/ui/components/menu-customization.js +18 -0
- package/scripts/ui/components/property-grid.js +10 -10
- package/scripts/ui/{layouts → containers}/splitters.js +3 -3
- package/scripts/ui/css.js +20 -0
- package/scripts/ui/inputs/advanced/all-input-types.js +47 -0
- package/scripts/ui/inputs/{for-properties.js → advanced/for-properties.js} +17 -2
- package/scripts/ui/inputs/advanced/input-form.js +10 -0
- package/scripts/ui/inputs/forms.js +35 -0
- package/scripts/ui/inputs/grid-input.js +14 -0
- package/scripts/ui/inputs/inputs.js +24 -0
- package/scripts/ui/{elements/inputs → inputs}/table-input.js +1 -2
- package/scripts/ui/inputs/typeahead-input.js +19 -0
- package/scripts/ui/viewers/custom-scatterplot-rendering.js +1 -1
- package/scripts/ui/viewers/custom-viewer-properties.js +5 -5
- package/scripts/ui/viewers/js viewers/chord-viewer.js +3 -0
- package/scripts/ui/viewers/js viewers/globe-viewer.js +13 -0
- package/scripts/ui/viewers/js viewers/radar-viewer.js +9 -0
- package/scripts/ui/viewers/js viewers/sankey-viewer.js +4 -0
- package/scripts/ui/viewers/js viewers/sunburst-viewer.js +3 -0
- package/scripts/ui/viewers/js viewers/surface-plot.js +2 -0
- package/scripts/ui/viewers/js viewers/timelines-viewer.js +3 -0
- package/scripts/ui/viewers/js viewers/tree-viewer.js +3 -0
- package/scripts/ui/viewers/js viewers/word-cloud.js +5 -0
- package/scripts/ui/viewers/trellis-plot-with-summary-viewer.js +14 -0
- package/scripts/ui/views/currently-open-views.js +5 -5
- package/src/package-test.ts +40 -1
- package/scripts/dapi/files.js +0 -39
- package/scripts/misc/audit/errors.js +0 -4
- package/scripts/misc/audit/event-types-summary.js +0 -4
- package/scripts/misc/audit/rolling-events.js +0 -11
- package/scripts/ui/apps/color-checker.js +0 -328
- package/scripts/ui/components/panels.js +0 -19
- package/scripts/ui/docking/README.md +0 -16
- package/scripts/ui/elements/html-tables.js +0 -24
- package/scripts/ui/elements/inputs/inputs.js +0 -46
- package/scripts/ui/elements/inputs/typeahead-input.js +0 -8
- package/scripts/ui/layouts/templates/2 Column.js +0 -14
- package/scripts/ui/layouts/templates/3 Column.js +0 -15
- package/scripts/ui/layouts/templates/Flex box.js +0 -16
- package/scripts/ui/layouts/templates/Fluid layout.js +0 -19
- package/scripts/ui/layouts/templates/Gallery grid.js +0 -18
- package/scripts/ui/layouts/templates/Splitter (1 Column 2 Row).js +0 -19
- package/scripts/ui/layouts/templates/Splitter (2 Column).js +0 -16
- package/scripts/ui/layouts/templates/Splitter (2 Row).js +0 -18
- package/scripts/ui/layouts/templates/Splitter (2-3 Column).js +0 -23
- package/scripts/ui/layouts/templates/Tabs 2 column.js +0 -19
- package/scripts/ui/layouts/templates/Tabs navbar.js +0 -16
- package/scripts/ui/viewers/types/google-map.js +0 -5
- package/scripts/ux/Dialogs/add-new-column-dlg.js +0 -58
- package/scripts/ux/Dialogs/link-table-dlg.js +0 -23
- package/scripts/ux/Filters/data-filtering.js +0 -99
- package/scripts/ux/Input forms/form-types.js +0 -133
- package/scripts/ux/Input forms/misc.js +0 -52
- package/scripts/ux/Layouts/example-1.js +0 -50
- package/scripts/ux/Layouts/example-2.js +0 -63
- package/scripts/ux/Layouts/example-3.js +0 -192
- package/scripts/ux/Layouts/example-4.js +0 -51
- package/scripts/ux/Managing Collections/datasource-view.js +0 -47
- package/scripts/ux/Views/property-panel.js +0 -120
- package/scripts/ux/Views/toolbar.js +0 -131
- package/scripts/ux/Views/toolbox.js +0 -124
- /package/scripts/ui/{elements → components}/buttons.js +0 -0
- /package/scripts/ui/{elements → components}/icons.js +0 -0
- /package/scripts/ui/{elements → components}/image.js +0 -0
- /package/scripts/ui/{elements → components}/list.js +0 -0
- /package/scripts/ui/{elements → components}/range-slider.js +0 -0
- /package/scripts/ui/{cards → components}/summary-card.js +0 -0
- /package/scripts/ui/{elements → components}/typography.js +0 -0
- /package/scripts/ui/{layouts → containers}/blocks.js +0 -0
- /package/scripts/ui/{layouts → containers}/box.js +0 -0
- /package/scripts/ui/{layouts → containers}/containers.js +0 -0
- /package/scripts/ui/{layouts → containers}/flexbox.js +0 -0
- /package/scripts/ui/{layouts → containers}/panels.js +0 -0
- /package/scripts/ui/inputs/{custom-inputs.js → advanced/custom-inputs.js} +0 -0
- /package/scripts/ui/inputs/{for-columns.js → advanced/for-columns.js} +0 -0
- /package/scripts/ui/inputs/{input-events.js → advanced/input-events.js} +0 -0
- /package/scripts/ui/inputs/{master-details.js → advanced/master-details.js} +0 -0
- /package/scripts/ui/{elements/inputs → inputs}/choice-input.js +0 -0
- /package/scripts/ui/{elements/inputs → inputs}/column-combo-box.js +0 -0
- /package/scripts/ui/{elements/inputs → inputs}/column-inputs.js +0 -0
- /package/scripts/ui/{elements/inputs → inputs}/inputs-events.js +0 -0
- /package/scripts/ui/{elements/inputs → inputs}/inputs-extended.js +0 -0
- /package/scripts/ui/{elements/inputs → inputs}/molecule-input.js +0 -0
- /package/scripts/ui/{elements/inputs → inputs}/tags-input.js +0 -0
- /package/scripts/{ux/Interactivity → ui/interactivity}/drag-and-drop.js +0 -0
- /package/scripts/{ux/Interactivity → ui/interactivity}/hints.js +0 -0
- /package/scripts/{ux/Interactivity → ui/interactivity}/wizard-hints.js +0 -0
- /package/scripts/{ux/Rendering → ui/rendering}/render-items.js +0 -0
- /package/scripts/ui/{components/tooltips → tooltips}/row-group-tooltips.js +0 -0
- /package/scripts/ui/{components/tooltips → tooltips}/tooltip-events.js +0 -0
- /package/scripts/ui/{components/tooltips → tooltips}/tooltips.js +0 -0
- /package/scripts/{ux/Navigations → ui/views}/navigation.js +0 -0
- /package/scripts/{ux/Managing Collections → ui/views}/virtual-view.js +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//Layout: 2 Column
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('2 Column', [
|
|
8
|
-
ui.block25(['Column 1 (25%)']),
|
|
9
|
-
ui.block75(['Column 2 (75%)']),
|
|
10
|
-
],'layout');
|
|
11
|
-
|
|
12
|
-
view.box = true;
|
|
13
|
-
|
|
14
|
-
$('.layout div').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//Layout: 3 Column
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('3 Column', [
|
|
8
|
-
ui.block50(['Column 1']),
|
|
9
|
-
ui.block(['Column 2']),
|
|
10
|
-
ui.block(['Column 3'])
|
|
11
|
-
],'layout');
|
|
12
|
-
|
|
13
|
-
view.box = true;
|
|
14
|
-
|
|
15
|
-
$('.layout div').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//Layout: Flex box
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('Flex box', [
|
|
8
|
-
ui.divV([
|
|
9
|
-
ui.divH([ui.divText('item 1'), ui.divText('item 2')]),
|
|
10
|
-
ui.divH([ui.divText('item 3'), ui.divText('item 4'),ui.divText('item 5')]),
|
|
11
|
-
ui.divH([ui.divText('item 6'), ui.divText('item 7'),ui.divText('item 8'), ui.divText('item 9')]),
|
|
12
|
-
]),
|
|
13
|
-
],'layout');
|
|
14
|
-
|
|
15
|
-
$('.layout div:not(.d4-flex-col)').css('border','1px dashed var(--grey-2)');
|
|
16
|
-
$('.layout div:not(.d4-flex-col)').css('padding','10px');
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//Layout: Fluid layout
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('Fluid layout', [
|
|
8
|
-
ui.block25(['block 1']),
|
|
9
|
-
ui.block75(['block 2']),
|
|
10
|
-
ui.block50(['block 3']),
|
|
11
|
-
ui.block50(['block 4']),
|
|
12
|
-
ui.block25(['block 5']),
|
|
13
|
-
ui.block25(['block 6']),
|
|
14
|
-
ui.block25(['block 7']),
|
|
15
|
-
ui.block25(['block 8']),
|
|
16
|
-
],'layout');
|
|
17
|
-
|
|
18
|
-
$('.layout div').css('border','1px dashed var(--grey-2)');
|
|
19
|
-
$('.layout div').css('padding','10px');
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//Layout: Gallery grid
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let gallery = ui.divH([],'grok-gallery-grid');
|
|
8
|
-
for (let i =0; i<40; i++){
|
|
9
|
-
gallery.append(ui.card(ui.p('item-'+i.toString())))
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let view = grok.shell.newView('Gallery grid', [
|
|
13
|
-
gallery
|
|
14
|
-
],'layout');
|
|
15
|
-
|
|
16
|
-
view.box = true;
|
|
17
|
-
|
|
18
|
-
$('.layout div').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//Layout: Splitter 1 Column 2 Row
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('1 Column - 2 Rows', [
|
|
8
|
-
ui.splitH([
|
|
9
|
-
ui.panel('Column 2'),
|
|
10
|
-
ui.splitV([
|
|
11
|
-
ui.panel('Row 1'),
|
|
12
|
-
ui.panel('Row 2')
|
|
13
|
-
])
|
|
14
|
-
])
|
|
15
|
-
],'layout');
|
|
16
|
-
|
|
17
|
-
view.box = true;
|
|
18
|
-
|
|
19
|
-
$('.layout .ui-div').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//Layout: Splitter 2 Column
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('2 Column', [
|
|
8
|
-
ui.splitH([
|
|
9
|
-
ui.panel('Column 1'),
|
|
10
|
-
ui.panel('Column 2')
|
|
11
|
-
])
|
|
12
|
-
],'layout');
|
|
13
|
-
|
|
14
|
-
view.box = true;
|
|
15
|
-
|
|
16
|
-
$('.layout .ui-div').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//Layout: Splitter 2 Rows
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('2 Rows', [
|
|
8
|
-
ui.splitH([
|
|
9
|
-
ui.splitV([
|
|
10
|
-
ui.panel('Row 1'),
|
|
11
|
-
ui.panel('Row 2')
|
|
12
|
-
])
|
|
13
|
-
])
|
|
14
|
-
],'layout');
|
|
15
|
-
|
|
16
|
-
view.box = true;
|
|
17
|
-
|
|
18
|
-
$('.layout .ui-div').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//Layout: Splitter 2 - 3 Column
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('Splitter 2 - 3 Column', [
|
|
8
|
-
ui.splitV([
|
|
9
|
-
ui.splitH([
|
|
10
|
-
ui.panel('Row 1 Column 1'),
|
|
11
|
-
ui.panel('Row 1 Column 2'),
|
|
12
|
-
]),
|
|
13
|
-
ui.splitH([
|
|
14
|
-
ui.panel('Row 2 Column 1'),
|
|
15
|
-
ui.panel('Row 2 Column 2'),
|
|
16
|
-
ui.panel('Row 2 Column 3'),
|
|
17
|
-
])
|
|
18
|
-
])
|
|
19
|
-
],'layout');
|
|
20
|
-
|
|
21
|
-
view.box = true;
|
|
22
|
-
|
|
23
|
-
$('.layout .ui-div').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//Layout: Tabs 2 column
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('Tabs 2 Column', [
|
|
8
|
-
ui.splitH([
|
|
9
|
-
ui.tabControl({
|
|
10
|
-
'First': ui.panel('Tab 1, column 1'),
|
|
11
|
-
'Second': ui.panel('Tab 2, column 1'),
|
|
12
|
-
}).root,
|
|
13
|
-
ui.panel('Column 2')
|
|
14
|
-
])
|
|
15
|
-
],'layout');
|
|
16
|
-
|
|
17
|
-
view.box = true;
|
|
18
|
-
|
|
19
|
-
$('.layout .ui-box').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//Layout: Tabs navbar
|
|
2
|
-
|
|
3
|
-
let windows = grok.shell.windows;
|
|
4
|
-
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.showContextPanel = false; //*hide context panel
|
|
6
|
-
|
|
7
|
-
let view = grok.shell.newView('Tabs Navbar', [
|
|
8
|
-
ui.tabControl({
|
|
9
|
-
'First': ui.panel('First tab'),
|
|
10
|
-
'Second': ui.panel('Second tab')
|
|
11
|
-
})
|
|
12
|
-
],'layout');
|
|
13
|
-
|
|
14
|
-
view.box = true;
|
|
15
|
-
|
|
16
|
-
$('.layout .ui-div').css('border','1px dashed var(--grey-2)');
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
//Example "Add new column" dialog layout
|
|
2
|
-
|
|
3
|
-
let table = grok.data.testData('demog', 10000);
|
|
4
|
-
let grid = DG.Viewer.grid(table);
|
|
5
|
-
grid.root.style.height = '205px';
|
|
6
|
-
grid.columns.setVisible(['site']);
|
|
7
|
-
|
|
8
|
-
let addNewColumnDlg = ui.dialog('Add New Column');
|
|
9
|
-
let inputName = ui.stringInput('','');
|
|
10
|
-
inputName.input.placeholder = 'Name';
|
|
11
|
-
inputName.input.style.width = '100%';
|
|
12
|
-
inputName.input.style.maxWidth = '100%';
|
|
13
|
-
|
|
14
|
-
let inputType = ui.choiceInput('', 'Auto', ['Auto', 'Double', 'Int', 'String', 'Datetime', 'Bool']);
|
|
15
|
-
inputType.input.style.width = '100%';
|
|
16
|
-
|
|
17
|
-
let inputExpression = ui.textInput('','');
|
|
18
|
-
inputExpression.input.placeholder = 'Expression';
|
|
19
|
-
inputExpression.input.style.minHeight = '140px';
|
|
20
|
-
inputExpression.input.style.width = '100%';
|
|
21
|
-
|
|
22
|
-
let widgetColumnsFunc = null;
|
|
23
|
-
let widgetColumns = ui.div();
|
|
24
|
-
(async()=>{
|
|
25
|
-
widgetColumnsFunc = await DG.Func.byName('ColumnGridWidget').apply({df: table});
|
|
26
|
-
widgetColumnsFunc.root.lastChild.style.height = '350px';
|
|
27
|
-
widgetColumns.append(widgetColumnsFunc.root)
|
|
28
|
-
})();
|
|
29
|
-
|
|
30
|
-
let widgetFunctionsFunc = null;
|
|
31
|
-
let widgetFunctions = ui.div();
|
|
32
|
-
(async()=>{
|
|
33
|
-
widgetFunctionsFunc = await DG.Func.byName('FunctionsWidget').apply();
|
|
34
|
-
widgetFunctionsFunc.props.visibleTags = 'math,text,date,timespan,binning,logic,stats';
|
|
35
|
-
widgetFunctionsFunc.props.showSignature = true;
|
|
36
|
-
widgetFunctionsFunc.root.lastChild.style.height = '240px';
|
|
37
|
-
widgetFunctions.append(widgetFunctionsFunc.root)
|
|
38
|
-
})();
|
|
39
|
-
|
|
40
|
-
let addNewColumnLayout =
|
|
41
|
-
ui.div([
|
|
42
|
-
ui.block50([
|
|
43
|
-
ui.block([inputName], { style: { width: '65%' } }),
|
|
44
|
-
ui.block([inputType], { style: { width: '35%' } }),
|
|
45
|
-
ui.block([inputExpression]),
|
|
46
|
-
ui.block([grid])
|
|
47
|
-
], { style: { paddingRight: '20px' } }),
|
|
48
|
-
|
|
49
|
-
ui.block25([
|
|
50
|
-
ui.block([widgetColumns])
|
|
51
|
-
], { style: { paddingRight: '20px' } }),
|
|
52
|
-
|
|
53
|
-
ui.block25([
|
|
54
|
-
ui.block([widgetFunctions])
|
|
55
|
-
])
|
|
56
|
-
], {style:{width:'700px', height:'400px'}});
|
|
57
|
-
|
|
58
|
-
addNewColumnDlg.add(addNewColumnLayout).show({x:550, y:100});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//Example "Link table" dialog layout
|
|
2
|
-
|
|
3
|
-
let table = grok.data.testData('demog', 10000);
|
|
4
|
-
grok.shell.addTableView(table);
|
|
5
|
-
let tables = grok.shell.tables;
|
|
6
|
-
|
|
7
|
-
let linkTablesDlg = ui.dialog('Link Tables');
|
|
8
|
-
let linkType = ui.choiceInput('Link Type', 'row to filter', ['row to filter', 'row to row', 'filter to filter']);
|
|
9
|
-
let inputs = ui.inputs([
|
|
10
|
-
ui.divH([ui.tableInput('Tables', tables[0], tables), ui.tableInput('', tables[0], tables)]),
|
|
11
|
-
ui.divH([ui.columnInput('Key Columns', tables[0]), ui.columnInput('', tables[0]), ui.button(ui.iconFA('plus', ()=>{
|
|
12
|
-
let newInputRow = ui.divH([ui.columnInput(' ', tables[0]), ui.columnInput('', tables[0]), ui.button(ui.iconFA('trash-alt'),()=>{
|
|
13
|
-
$(newInputRow).detach();
|
|
14
|
-
})])
|
|
15
|
-
inputs.insertBefore(newInputRow, linkType.root);
|
|
16
|
-
$(inputs).find('input, select, .d4-column-selector').css('min-width','120px');
|
|
17
|
-
}))]),
|
|
18
|
-
linkType
|
|
19
|
-
])
|
|
20
|
-
|
|
21
|
-
linkTablesDlg.add(inputs);
|
|
22
|
-
linkTablesDlg.show({x:50, y:100});
|
|
23
|
-
$(inputs).find('input, select, .d4-column-selector').css('min-width','120px');
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
//Example of filtering dataFrame using the Filter Viewer and custom input fields
|
|
2
|
-
|
|
3
|
-
let view = grok.shell.newView('Filtering');
|
|
4
|
-
let table = grok.data.testData('demog');
|
|
5
|
-
view.box=true;
|
|
6
|
-
let windows = grok.shell.windows;
|
|
7
|
-
windows.showToolbox = false;
|
|
8
|
-
windows.showHelp = false;
|
|
9
|
-
windows.showProperties = false;
|
|
10
|
-
|
|
11
|
-
let filters = DG.Viewer.fromType('Filters', table, {
|
|
12
|
-
'columnNames':['SEX','AGE','RACE'],
|
|
13
|
-
'showContextMenu':false,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
let lineChart = DG.Viewer.fromType('Line chart', table, {
|
|
17
|
-
"xColumnName": "AGE",
|
|
18
|
-
"yColumnNames": [
|
|
19
|
-
"WEIGHT"
|
|
20
|
-
],
|
|
21
|
-
"yAggrTypes": [
|
|
22
|
-
"avg"
|
|
23
|
-
],
|
|
24
|
-
"splitColumnName": "",
|
|
25
|
-
"segmentColumnName": "SEX",
|
|
26
|
-
"interpolation": "Spline",
|
|
27
|
-
"chartTypes": [
|
|
28
|
-
"Line Chart",
|
|
29
|
-
"Line Chart",
|
|
30
|
-
"Line Chart"
|
|
31
|
-
],
|
|
32
|
-
"innerChartMarginTop": 0,
|
|
33
|
-
"outerChartMarginRight": 0,
|
|
34
|
-
"outerChartMarginBottom": 0,
|
|
35
|
-
"showXSelector": false,
|
|
36
|
-
"showYSelectors": false,
|
|
37
|
-
"showAggrSelectors": false,
|
|
38
|
-
"showCloseLink": false,
|
|
39
|
-
"showSplitSelector": false,
|
|
40
|
-
"showYAxis": false,
|
|
41
|
-
"legendVisibility": "Never",
|
|
42
|
-
"showMarkers": "Never",
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
let barChart = DG.Viewer.fromType('Bar chart', table, {
|
|
46
|
-
"splitColumnName": "Site",
|
|
47
|
-
"stackColumnName": "Sex",
|
|
48
|
-
"valueColumnName": "AGE",
|
|
49
|
-
"valueAggrType": "count",
|
|
50
|
-
"legendVisibility": "Never",
|
|
51
|
-
"barSortType": "by value",
|
|
52
|
-
"barSortOrder": "desc",
|
|
53
|
-
"showValueAxis": false,
|
|
54
|
-
"showValueSelector": false,
|
|
55
|
-
"showCategorySelector": false,
|
|
56
|
-
"showStackSelector": false,
|
|
57
|
-
"showSelectedRows": false,
|
|
58
|
-
'Title':'Bar chart'
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
barChart.root.style.height = '150px';
|
|
62
|
-
lineChart.root.style.height = '150px';
|
|
63
|
-
filters.root.style.overflow = 'scroll';
|
|
64
|
-
|
|
65
|
-
view.append(ui.splitH([
|
|
66
|
-
ui.splitV([
|
|
67
|
-
// Add custom filter
|
|
68
|
-
ui.panel([
|
|
69
|
-
ui.h1('Custom filters'),
|
|
70
|
-
ui.inputs([
|
|
71
|
-
ui.choiceInput('Sex', '',['M', 'F'], (v)=>{
|
|
72
|
-
table.rows.match('Sex ='+v).filter();
|
|
73
|
-
}),
|
|
74
|
-
ui.choiceInput('Race', '',['Caucasian', 'Asian', 'Black', 'Other'], (v)=>{
|
|
75
|
-
table.rows.match('Race = '+v).filter();
|
|
76
|
-
}),
|
|
77
|
-
ui.intInput('Age', '', (v)=>{
|
|
78
|
-
table.rows.match('Age ='+v).filter();
|
|
79
|
-
}),
|
|
80
|
-
ui.stringInput('Weight', '', (v)=>{
|
|
81
|
-
table.rows.match('Weight >'+v).filter();
|
|
82
|
-
}),
|
|
83
|
-
])
|
|
84
|
-
]),
|
|
85
|
-
// Add filter viewer
|
|
86
|
-
ui.box(ui.panel([ui.h1('Default filters')]), {style:{maxHeight:'55px'}}),
|
|
87
|
-
filters.root
|
|
88
|
-
], {style:{maxWidth:'270px'}}),
|
|
89
|
-
ui.splitV([
|
|
90
|
-
ui.box(
|
|
91
|
-
ui.panel([
|
|
92
|
-
ui.block(ui.h1('Demography insights')),
|
|
93
|
-
ui.block50(barChart.root),
|
|
94
|
-
ui.block50(lineChart.root),
|
|
95
|
-
]), {style:{maxHeight:'220px'}}),
|
|
96
|
-
ui.box(ui.panel(ui.h1('Demography data')), {style:{maxHeight:'55px'}}),
|
|
97
|
-
DG.Viewer.fromType('Grid',table).root
|
|
98
|
-
])
|
|
99
|
-
]));
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
//Example of various input-forms
|
|
2
|
-
|
|
3
|
-
let view = grok.shell.newView('Form types');
|
|
4
|
-
|
|
5
|
-
let basicLayout = ui.panel([
|
|
6
|
-
ui.h1('Basic form'),
|
|
7
|
-
ui.inputs([
|
|
8
|
-
ui.stringInput('Name',''),
|
|
9
|
-
ui.textInput('Description',''),
|
|
10
|
-
ui.choiceInput('Type', 'Text', ['Text','Number','Bool']),
|
|
11
|
-
ui.choiceInput('Suggested values', 'Query', ['Query']),
|
|
12
|
-
ui.choiceInput('Query', 'List of countries', ['List of countries']),
|
|
13
|
-
ui.intInput('Minimun',0),
|
|
14
|
-
ui.intInput('Maximum',100),
|
|
15
|
-
ui.boolInput('Add slicer', true),
|
|
16
|
-
ui.buttonsInput([
|
|
17
|
-
ui.bigButton('Apply'),
|
|
18
|
-
ui.button('Reset')
|
|
19
|
-
])
|
|
20
|
-
]),
|
|
21
|
-
]);
|
|
22
|
-
|
|
23
|
-
let inlineLayout = ui.panel([
|
|
24
|
-
ui.h1('Inline form'),
|
|
25
|
-
ui.inputs([
|
|
26
|
-
ui.divH([
|
|
27
|
-
ui.choiceInput('Tables', 'Demog',['Demog']),
|
|
28
|
-
ui.choiceInput('', 'Crime',['Crime']),
|
|
29
|
-
ui.button(ui.iconFA('folder-open'))
|
|
30
|
-
]),
|
|
31
|
-
ui.divH([
|
|
32
|
-
ui.stringInput('Key Columns', 'Age'),
|
|
33
|
-
ui.stringInput('', 'Age'),
|
|
34
|
-
ui.button(ui.iconFA('plus'))
|
|
35
|
-
]),
|
|
36
|
-
ui.divH([ui.choiceInput('Link Type', 'row to filter', ['row to filter', 'row to row', 'filter to filter'])]),
|
|
37
|
-
ui.divH([
|
|
38
|
-
ui.buttonsInput([
|
|
39
|
-
ui.bigButton('Apply'),
|
|
40
|
-
ui.button('Reset')
|
|
41
|
-
])
|
|
42
|
-
])
|
|
43
|
-
])
|
|
44
|
-
]);
|
|
45
|
-
//Setting the same input width for all fields
|
|
46
|
-
$(inlineLayout)
|
|
47
|
-
.find('input, select')
|
|
48
|
-
.css('min-width','130px');
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let columnLayout = ui.panel([
|
|
52
|
-
ui.h1('Two column form'),
|
|
53
|
-
ui.divH([
|
|
54
|
-
ui.div([
|
|
55
|
-
ui.inputs([
|
|
56
|
-
ui.stringInput('Name',''),
|
|
57
|
-
ui.textInput('Description',''),
|
|
58
|
-
ui.choiceInput('Type', 'Text', ['Text','Number','Bool']),
|
|
59
|
-
ui.choiceInput('Suggested values', 'Query', ['Query']),
|
|
60
|
-
ui.choiceInput('Query', 'List of countries', ['List of countries']),
|
|
61
|
-
ui.boolInput('Show assistance', false),
|
|
62
|
-
ui.buttonsInput([
|
|
63
|
-
ui.bigButton('Apply'),
|
|
64
|
-
ui.button('Reset')
|
|
65
|
-
])
|
|
66
|
-
])
|
|
67
|
-
]),
|
|
68
|
-
ui.div([
|
|
69
|
-
ui.inputs([
|
|
70
|
-
ui.choiceInput('Calculation type', 'Percent of total',['Percent of total']),
|
|
71
|
-
ui.boolInput('Compute total', true),
|
|
72
|
-
ui.choiceInput('Compute usign', 'Pane (down)',['Pane (down)']),
|
|
73
|
-
ui.choiceInput('Compute type', 'Month of order',['Month of order']),
|
|
74
|
-
ui.intInput('Minimun',0),
|
|
75
|
-
ui.intInput('Maximum',100),
|
|
76
|
-
]),
|
|
77
|
-
]),
|
|
78
|
-
])
|
|
79
|
-
]);
|
|
80
|
-
|
|
81
|
-
let advancedFormAcc = ui.accordion();
|
|
82
|
-
let slider = ui.element('input');
|
|
83
|
-
slider.type = 'range';
|
|
84
|
-
slider.min = '0';
|
|
85
|
-
slider.max = '100';
|
|
86
|
-
let sliderLabel = ui.label('Value range');
|
|
87
|
-
sliderLabel.classList = 'ui-label ui-input-label';
|
|
88
|
-
|
|
89
|
-
let min = ui.intInput('Minimun',0);
|
|
90
|
-
let max = ui.intInput('Maximum',100);
|
|
91
|
-
min.type = 'number';
|
|
92
|
-
max.type = 'number';
|
|
93
|
-
|
|
94
|
-
advancedFormAcc.addPane('Advanced',()=>
|
|
95
|
-
ui.inputs([
|
|
96
|
-
ui.choiceInput('Suggested values', 'Query', ['Query']),
|
|
97
|
-
ui.choiceInput('Query', 'List of countries', ['List of countries']),
|
|
98
|
-
|
|
99
|
-
ui.boolInput('Add slicer', true),
|
|
100
|
-
ui.div([
|
|
101
|
-
sliderLabel,
|
|
102
|
-
slider
|
|
103
|
-
], 'ui-input-root')
|
|
104
|
-
])
|
|
105
|
-
, true);
|
|
106
|
-
|
|
107
|
-
let advancedForm = ui.panel([
|
|
108
|
-
ui.h1('Advanced form'),
|
|
109
|
-
ui.inputs([
|
|
110
|
-
ui.stringInput('Name',''),
|
|
111
|
-
ui.textInput('Description',''),
|
|
112
|
-
ui.choiceInput('Type', 'Text', ['Text','Number','Bool']),
|
|
113
|
-
]),
|
|
114
|
-
advancedFormAcc.root,
|
|
115
|
-
ui.inputs([
|
|
116
|
-
ui.buttonsInput([
|
|
117
|
-
ui.bigButton('Apply'),
|
|
118
|
-
ui.button('Reset')
|
|
119
|
-
])
|
|
120
|
-
])
|
|
121
|
-
]);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
view.append(ui.div([
|
|
125
|
-
basicLayout,
|
|
126
|
-
ui.div([],{style:{borderBottom:'1px solid var(--grey-2)'}}),
|
|
127
|
-
inlineLayout,
|
|
128
|
-
ui.div([],{style:{borderBottom:'1px solid var(--grey-2)'}}),
|
|
129
|
-
columnLayout,
|
|
130
|
-
ui.div([],{style:{borderBottom:'1px solid var(--grey-2)'}}),
|
|
131
|
-
advancedForm
|
|
132
|
-
])
|
|
133
|
-
);
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//Example app layout with input-form
|
|
2
|
-
|
|
3
|
-
let view = grok.shell.newView('Input form');
|
|
4
|
-
view.box = true;
|
|
5
|
-
let windows = grok.shell.windows;
|
|
6
|
-
windows.showToolbox = false;
|
|
7
|
-
windows.showHelp = false;
|
|
8
|
-
windows.showProperties = false;
|
|
9
|
-
|
|
10
|
-
let query = ui.choiceInput('Query', 'Log Sessions', ['Log Sessions', 'Log Actions', 'Errors Summary On Date', 'Events Summary On Date', 'Unique Users By Date']);
|
|
11
|
-
let viewType = ui.choiceInput('Render', 'Scatter plot', ['Scatter plot', 'Bar chart']);
|
|
12
|
-
let date = ui.stringInput('Date', 'today');
|
|
13
|
-
date.addPatternMenu('datetime');
|
|
14
|
-
|
|
15
|
-
let filterCol = ui.inputs([
|
|
16
|
-
date,
|
|
17
|
-
query,
|
|
18
|
-
viewType,
|
|
19
|
-
ui.buttonsInput([
|
|
20
|
-
ui.bigButton('Run query', ()=>{
|
|
21
|
-
viewerView.innerHTML = '';
|
|
22
|
-
gridView.innerHTML = '';
|
|
23
|
-
grok.shell.info(date.value);
|
|
24
|
-
grok.shell.info('UsageAnalysis:'+query.stringValue.replace(/\s/g, ''));
|
|
25
|
-
grok.data.query('UsageAnalysis:'+query.stringValue.replace(/\s/g, ''), {'date': date.value}).then(t => {
|
|
26
|
-
viewerView.append(DG.Viewer.fromType(viewType.stringValue,t,{'color': 'login'}).root);
|
|
27
|
-
gridView.append(DG.Viewer.grid(t).root);
|
|
28
|
-
});
|
|
29
|
-
}),
|
|
30
|
-
ui.button('Clear', ()=>{
|
|
31
|
-
viewerView.innerHTML = '';
|
|
32
|
-
gridView.innerHTML = '';
|
|
33
|
-
}),
|
|
34
|
-
])
|
|
35
|
-
]);
|
|
36
|
-
|
|
37
|
-
let filtersPane = ui.panel([
|
|
38
|
-
ui.h2('Filters'),
|
|
39
|
-
filterCol
|
|
40
|
-
]);
|
|
41
|
-
|
|
42
|
-
let viewerView = ui.box();
|
|
43
|
-
let gridView = ui.box();
|
|
44
|
-
$(filtersPane).find('input, select').css('min-width','150px');
|
|
45
|
-
|
|
46
|
-
view.append(ui.splitH([
|
|
47
|
-
ui.box(filtersPane, {style:{maxWidth:'350px'}}),
|
|
48
|
-
ui.splitV([
|
|
49
|
-
viewerView,
|
|
50
|
-
gridView
|
|
51
|
-
])
|
|
52
|
-
]));
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//Splitter layout
|
|
2
|
-
|
|
3
|
-
let data = grok.data.demo.demog();
|
|
4
|
-
let view = grok.shell.newView('Layout 1');
|
|
5
|
-
view.box = true;
|
|
6
|
-
|
|
7
|
-
let windows = grok.shell.windows;
|
|
8
|
-
windows.showToolbox = false; //*hide tool box
|
|
9
|
-
windows.showContextPanel = false; //*hide context panel
|
|
10
|
-
windows.showHelp = false; //*hide context help
|
|
11
|
-
|
|
12
|
-
//inputs
|
|
13
|
-
let colInput = ui.columnInput('Column', data, data.col('age'), ()=>{
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
let searchInput = ui.searchInput('', '', ()=>{
|
|
17
|
-
if (searchInput.value != '')
|
|
18
|
-
data.rows.match(colInput.stringValue+'='+searchInput.value).filter();
|
|
19
|
-
});
|
|
20
|
-
let filters = ui.button(ui.iconFA('filter'),()=>{
|
|
21
|
-
grok.shell.dockManager.dock(filterDock.root, 'left',null,'Filters',0.2);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
//viewers
|
|
25
|
-
let barChart = DG.Viewer.barChart(data);
|
|
26
|
-
barChart.setOptions({
|
|
27
|
-
split:'race',
|
|
28
|
-
});
|
|
29
|
-
let boxPlot = DG.Viewer.boxPlot(data);
|
|
30
|
-
boxPlot.setOptions({
|
|
31
|
-
split:'weight'
|
|
32
|
-
});
|
|
33
|
-
let grid = DG.Viewer.grid(data);
|
|
34
|
-
let statistics = DG.Viewer.fromType('Statistics', data);
|
|
35
|
-
let filterDock = DG.Viewer.fromType('Filters', data);
|
|
36
|
-
|
|
37
|
-
//layout
|
|
38
|
-
view.append(ui.splitV([
|
|
39
|
-
ui.box(ui.panel([
|
|
40
|
-
ui.divH([colInput,searchInput,filters])
|
|
41
|
-
]), {style:{maxHeight:'80px'}}),
|
|
42
|
-
ui.splitH([
|
|
43
|
-
barChart.root,
|
|
44
|
-
boxPlot.root,
|
|
45
|
-
]),
|
|
46
|
-
ui.tabControl({
|
|
47
|
-
'DATA': ()=> grid.root,
|
|
48
|
-
'STATISTICS': ()=> statistics.root
|
|
49
|
-
}).root
|
|
50
|
-
]));
|