-
Notifications
You must be signed in to change notification settings - Fork 56
/
spec.json
2321 lines (2321 loc) · 65.1 KB
/
spec.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"scriptappy": "1.1.0",
"info": {
"name": "@nebula.js/stardust",
"description": "Product and framework agnostic integration API for Qlik's Associative Engine",
"version": "2.4.1",
"license": "MIT",
"stability": "stable"
},
"entries": {
"embed": {
"description": "Initiates a new `Embed` instance using the specified enigma `app`.",
"kind": "function",
"params": [
{
"name": "app",
"type": "EngineAPI.IApp"
},
{
"name": "instanceConfig",
"optional": true,
"type": "#/definitions/Configuration"
}
],
"returns": {
"type": "#/definitions/Embed"
},
"examples": [
"import { embed } from '@nebula.js/stardust'\nconst n = embed(app);\nn.render({ id: 'abc' });"
],
"entries": {
"createConfiguration": {
"description": "Creates a new `embed` scope bound to the specified `configuration`.\n\nThe configuration is merged with all previous scopes.",
"kind": "function",
"params": [
{
"name": "configuration",
"description": "The configuration object",
"type": "#/definitions/Configuration"
}
],
"returns": {
"type": "#/entries/embed"
},
"examples": [
"import { embed } from '@nebula.js/stardust';\n// create a 'master' config which registers all types\nconst m = embed.createConfiguration({\n types: [{\n name: 'mekko',\n version: '1.0.0',\n load: () => Promise.resolve(mekko)\n }],\n});\n\n// create an alternate config with dark theme\n// and inherit the config from the previous\nconst d = m.createConfiguration({\n theme: 'dark'\n});\n\nm(app).render({ type: 'mekko' }); // will render the object with default theme\nd(app).render({ type: 'mekko' }); // will render the object with 'dark' theme\nembed(app).render({ type: 'mekko' }); // will throw error since 'mekko' is not a register type on the default instance"
]
}
}
},
"useState": {
"description": "Creates a stateful value.",
"templates": [
{
"name": "S"
}
],
"kind": "function",
"params": [
{
"name": "initialState",
"description": "The initial state.",
"kind": "union",
"items": [
{
"type": "S"
},
{
"kind": "function",
"params": [],
"returns": {
"type": "S"
}
}
]
}
],
"returns": {
"description": "The value and a function to update it.",
"kind": "array",
"items": [
{
"type": "S"
},
{
"type": "#/definitions/SetStateFn",
"generics": [
{
"type": "S"
}
]
}
]
},
"examples": [
"import { useState } from '@nebula.js/stardust';\n// ...\n// initiate with simple primitive value\nconst [zoomed, setZoomed] = useState(false);\n\n// update\nsetZoomed(true);\n\n// lazy initiation\nconst [value, setValue] = useState(() => heavy());"
]
},
"useEffect": {
"description": "Triggers a callback function when a dependent value changes.",
"kind": "function",
"params": [
{
"name": "effect",
"description": "The callback.",
"type": "#/definitions/EffectCallback"
},
{
"name": "deps",
"description": "The dependencies that should trigger the callback.",
"optional": true,
"kind": "array",
"items": {
"type": "any"
}
}
],
"examples": [
"import { useEffect } from '@nebula.js/stardust';\n// ...\nuseEffect(() => {\n console.log('mounted');\n return () => {\n console.log('unmounted');\n };\n}, []);"
]
},
"useMemo": {
"description": "Creates a stateful value when a dependent changes.",
"templates": [
{
"name": "T"
}
],
"kind": "function",
"params": [
{
"name": "factory",
"description": "The factory function.",
"kind": "function",
"params": [],
"returns": {
"type": "T"
}
},
{
"name": "deps",
"description": "The dependencies.",
"kind": "array",
"items": {
"type": "any"
}
}
],
"returns": {
"description": "The value returned from the factory function.",
"type": "T"
},
"examples": [
"import { useMemo } from '@nebula.js/stardust';\n// ...\nconst v = useMemo(() => {\n return doSomeHeavyCalculation();\n}), []);"
]
},
"usePromise": {
"description": "Runs a callback function when a dependent changes.",
"templates": [
{
"name": "P"
}
],
"kind": "function",
"params": [
{
"name": "factory",
"description": "The factory function that calls the promise.",
"kind": "function",
"params": [],
"returns": {
"type": "Promise",
"generics": [
{
"type": "P"
}
]
}
},
{
"name": "deps",
"description": "The dependencies.",
"optional": true,
"kind": "array",
"items": {
"type": "any"
}
}
],
"returns": {
"description": "The resolved value.",
"kind": "array",
"items": [
{
"type": "P"
},
{
"type": "Error"
}
]
},
"examples": [
"import { usePromise } from '@nebula.js/stardust';\nimport { useModel } from '@nebula.js/stardust';\n// ...\nconst model = useModel();\nconst [resolved, rejected] = usePromise(() => model.getLayout(), []);"
]
},
"useElement": {
"description": "Gets the HTMLElement this visualization is rendered into.",
"kind": "function",
"params": [],
"returns": {
"type": "HTMLElement"
},
"examples": [
"import { useElement } from '@nebula.js/stardust';\n// ...\nconst el = useElement();\nel.innerHTML = 'Hello!';"
]
},
"useRect": {
"description": "Gets the size of the HTMLElement the visualization is rendered into.",
"kind": "function",
"params": [],
"returns": {
"description": "The size of the element.",
"type": "#/definitions/Rect"
},
"examples": [
"import { useRect } from '@nebula.js/stardust';\n// ...\nconst rect = useRect();\nuseEffect(() => {\n console.log('resize');\n}, [rect.width, rect.height])"
]
},
"useLayout": {
"description": "Gets the layout of the generic object associated with this visualization.",
"kind": "function",
"params": [],
"returns": {
"type": "EngineAPI.IGenericObjectLayout"
},
"examples": [
"import { useLayout } from '@nebula.js/stardust';\n// ...\nconst layout = useLayout();\nconsole.log(layout);"
]
},
"useStaleLayout": {
"description": "Gets the layout of the generic object associated with this visualization.\n\nUnlike the regular layout, a _stale_ layout is not changed when a generic object enters\nthe modal state. This is mostly notable in that `qSelectionInfo.qInSelections` in the layout is\nalways `false`.\nThe returned value from `useStaleLayout()` and `useLayout()` are identical when the object\nis not in a modal state.",
"kind": "function",
"params": [],
"returns": {
"type": "EngineAPI.IGenericObjectLayout"
},
"examples": [
"import { useStaleLayout } from '@nebula.js/stardust';\n// ...\nconst staleLayout = useStaleLayout();\nconsole.log(staleLayout);"
]
},
"useAppLayout": {
"description": "Gets the layout of the app associated with this visualization.",
"kind": "function",
"params": [],
"returns": {
"description": "The app layout",
"type": "EngineAPI.INxAppLayout"
},
"examples": [
"import { useAppLayout } from '@nebula.js/stardust';\n// ...\nconst appLayout = useAppLayout();\nconsole.log(appLayout.qLocaleInfo);"
]
},
"useModel": {
"description": "Gets the generic object API of the generic object connected to this visualization.",
"kind": "function",
"params": [],
"returns": {
"kind": "union",
"items": [
{
"type": "EngineAPI.IGenericObject"
},
{
"type": "undefined"
}
]
},
"examples": [
"import { useModel } from '@nebula.js/stardust';\n// ...\nconst model = useModel();\nuseEffect(() => {\n model.getInfo().then(info => {\n console.log(info);\n })\n}, []);"
]
},
"useApp": {
"description": "Gets the doc API.",
"kind": "function",
"params": [],
"returns": {
"description": "The doc API.",
"kind": "union",
"items": [
{
"type": "EngineAPI.IApp"
},
{
"type": "undefined"
}
]
},
"examples": [
"import { useApp } from '@nebula.js/stardust';\n// ...\nconst app = useApp();\nuseEffect(() => {\n app.getAllInfos().then(infos => {\n console.log(infos);\n })\n}, []);"
]
},
"useGlobal": {
"description": "Gets the global API.",
"kind": "function",
"params": [],
"returns": {
"description": "The global API.",
"kind": "union",
"items": [
{
"type": "EngineAPI.IGlobal"
},
{
"type": "undefined"
}
]
},
"examples": [
"import { useGlobal } from '@nebula.js/stardust';\n\n// ...\nconst g = useGlobal();\nuseEffect(() => {\n g.engineVersion().then(version => {\n console.log(version);\n })\n}, []);"
]
},
"useSelections": {
"description": "Gets the object selections.",
"kind": "function",
"params": [],
"returns": {
"description": "The object selections.",
"type": "#/definitions/ObjectSelections"
},
"examples": [
"import { useSelections } from '@nebula.js/stardust';\nimport { useElement } from '@nebula.js/stardust';\nimport { useEffect } from '@nebula.js/stardust';\n// ...\nconst selections = useSelections();\nconst element = useElement();\nuseEffect(() => {\n const onClick = () => {\n selections.begin('/qHyperCubeDef');\n };\n element.addEventListener('click', onClick);\n return () => {\n element.removeEventListener('click', onClick);\n };\n}, []);"
]
},
"useTheme": {
"description": "Gets the theme.",
"kind": "function",
"params": [],
"returns": {
"description": "The theme.",
"type": "#/definitions/Theme"
},
"examples": [
"import { useTheme } from '@nebula.js/stardust';\n\nconst theme = useTheme();\nconsole.log(theme.getContrastinColorTo('#ff0000'));"
]
},
"useEmbed": {
"description": "Gets the embed instance used.",
"stability": "experimental",
"availability": {
"since": "1.7.0"
},
"kind": "function",
"params": [],
"returns": {
"description": "The embed instance used.",
"type": "#/definitions/Embed"
},
"examples": [
"import { useEmbed } from '@nebula.js/stardust';\n\nconst embed = useEmbed();\nembed.render(...)"
]
},
"useTranslator": {
"description": "Gets the translator.",
"kind": "function",
"params": [],
"returns": {
"description": "The translator.",
"type": "#/definitions/Translator"
},
"examples": [
"import { useTranslator } from '@nebula.js/stardust';\n// ...\nconst translator = useTranslator();\nconsole.log(translator.get('SomeString'));"
]
},
"useDeviceType": {
"description": "Gets the device type. ('touch' or 'desktop')",
"kind": "function",
"params": [],
"returns": {
"description": "device type.",
"type": "string"
},
"examples": [
"import { useDeviceType } from '@nebula.js/stardust';\n// ...\nconst deviceType = useDeviceType();\nif (deviceType === 'touch') { ... };"
]
},
"usePlugins": {
"description": "Gets the array of plugins provided when rendering the visualization.",
"kind": "function",
"params": [],
"returns": {
"description": "array of plugins.",
"kind": "array",
"items": {
"type": "#/definitions/Plugin"
}
},
"examples": [
"// provide plugins that can be used when rendering\nembed(app).render({\n element,\n type: 'my-chart',\n plugins: [plugin]\n});",
"// It's up to the chart implementation to make use of plugins in any way\nimport { usePlugins } from '@nebula.js/stardust';\n// ...\nconst plugins = usePlugins();\nplugins.forEach((plugin) => {\n // Invoke plugin\n plugin.fn();\n});"
]
},
"useAction": {
"description": "Registers a custom action.",
"templates": [
{
"name": "A"
}
],
"kind": "function",
"params": [
{
"name": "factory",
"kind": "function",
"params": [],
"returns": {
"type": "#/definitions/ActionDefinition",
"generics": [
{
"type": "A"
}
]
}
},
{
"name": "deps",
"optional": true,
"kind": "array",
"items": {
"type": "any"
}
}
],
"returns": {
"type": "A"
},
"examples": [
"import { useAction } from '@nebula.js/stardust';\n// ...\nconst [zoomed, setZoomed] = useState(false);\nconst act = useAction(() => ({\n hidden: false,\n disabled: zoomed,\n action() {\n setZoomed(prev => !prev);\n },\n icon: {}\n}), [zoomed]);"
]
},
"useConstraints": {
"description": "Gets the desired constraints that should be applied when rendering the visualization.\n\nThe constraints are set on the embed configuration before the visualization is rendered\nand should respected by you when implementing the visualization.",
"kind": "function",
"params": [],
"returns": {
"type": "#/definitions/Constraints"
},
"examples": [
"// configure embed to disallow active interactions when rendering\nembed(app, {\n constraints: {\n active: true, // do not allow interactions\n }\n}).render({ element, id: 'sdfsdf' });",
"import { useConstraints } from '@nebula.js/stardust';\n// ...\nconst constraints = useConstraints();\nuseEffect(() => {\n if (constraints.active) {\n // do not add any event listener if active constraint is set\n return undefined;\n }\n const listener = () => {};\n element.addEventListener('click', listener);\n return () => {\n element.removeEventListener('click', listener);\n };\n}, [constraints])"
]
},
"useOptions": {
"description": "Gets the options object provided when rendering the visualization.\n\nThis is an empty object by default but enables customization of the visualization through this object.\nOptions are different from setting properties on the generic object in that options\nare only temporary settings applied to the visualization when rendered.\n\nYou have the responsibility to provide documentation of the options you support, if any.",
"kind": "function",
"params": [],
"returns": {
"type": "object"
},
"examples": [
"// when embedding the visualization, anything can be set in options\nembed(app).render({\n element,\n type: 'my-chart',\n options: {\n showNavigation: true,\n }\n});",
"// it is up to you use and implement the provided options\nimport { useOptions } from '@nebula.js/stardust';\nimport { useEffect } from '@nebula.js/stardust';\n// ...\nconst options = useOptions();\nuseEffect(() => {\n if (!options.showNavigation) {\n // hide navigation\n } else {\n // show navigation\n }\n}, [options.showNavigation]);"
]
},
"onTakeSnapshot": {
"description": "Registers a callback that is called when a snapshot is taken.",
"kind": "function",
"params": [
{
"name": "snapshotCallback",
"kind": "function",
"params": [
{
"type": "EngineAPI.IGenericObjectLayout"
}
],
"returns": {
"type": "Promise",
"generics": [
{
"type": "EngineAPI.IGenericObjectLayout"
}
]
}
}
],
"examples": [
"import { onTakeSnapshot } from '@nebula.js/stardust';\nimport { useState } from '@nebula.js/stardust';\nimport { useLayout } from '@nebula.js/stardust';\n\nconst layout = useLayout();\nconst [zoomed] = useState(layout.isZoomed || false);\n\nonTakeSnapshot((copyOfLayout) => {\n copyOfLayout.isZoomed = zoomed;\n return Promise.resolve(copyOfLayout);\n});"
]
},
"useRenderState": {
"description": "Gets render state instance.\n\nUsed to update properties and get a new layout without triggering onInitialRender.",
"stability": "experimental",
"kind": "function",
"params": [],
"returns": {
"description": "The render state.",
"type": "#/definitions/RenderState"
},
"examples": [
"import { useRenderState } from '@nebula.js/stardust';\n\nconst renderState = useRenderState();\nuseState(() => {\n if(needProperteisUpdate(...)) {\n useRenderState.pending();\n updateProperties(...);\n } else {\n useRenderState.restore();\n ...\n }\n}, [...]);"
]
},
"useKeyboard": {
"description": "Gets the desired keyboard settings and status to applied when rendering the visualization.\nA visualization should in general only have tab stops if either `keyboard.enabled` is false or if active is true.\nThis means that either Nebula isn't configured to handle keyboard input or the chart is currently focused.\nEnabling or disabling keyboardNavigation are set on the embed configuration and\nshould be respected by the visualization.",
"kind": "function",
"params": [],
"returns": {
"type": "#/definitions/Keyboard"
},
"examples": [
"// configure nebula to enable navigation between charts\nembed(app, {\n context: {\n keyboardNavigation: true, // tell Nebula to handle navigation\n }\n}).render({ element, id: 'sdfsdf' });",
"import { useKeyboard } from '@nebula.js/stardust';\n// ...\nconst keyboard = useKeyboard();\nuseEffect(() => {\n // Set a tab stop on our button if in focus or if Nebulas navigation is disabled\n button.setAttribute('tabIndex', keyboard.active || !keyboard.enabled ? 0 : -1);\n // If navigation is enabled and focus has shifted, lets focus the button\n keyboard.enabled && keyboard.active && button.focus();\n}, [keyboard])"
]
}
},
"definitions": {
"Context": {
"kind": "interface",
"entries": {
"disableCellPadding": {
"optional": true,
"type": "boolean"
},
"keyboardNavigation": {
"optional": true,
"type": "boolean"
},
"constraints": {
"optional": true,
"kind": "object",
"entries": {
"active": {
"optional": true,
"type": "boolean"
},
"passive": {
"optional": true,
"type": "boolean"
},
"select": {
"optional": true,
"type": "boolean"
}
}
},
"theme": {
"optional": true,
"defaultValue": "light",
"type": "string"
},
"language": {
"optional": true,
"defaultValue": "en-US",
"type": "string"
},
"deviceType": {
"optional": true,
"defaultValue": "auto",
"type": "string"
}
}
},
"Configuration": {
"kind": "interface",
"entries": {
"context": {
"optional": true,
"type": "#/definitions/Context"
},
"types": {
"optional": true,
"kind": "array",
"items": {
"type": "#/definitions/TypeInfo"
}
},
"themes": {
"optional": true,
"kind": "array",
"items": {
"type": "#/definitions/ThemeInfo"
}
},
"anything": {
"optional": true,
"type": "object"
}
}
},
"Galaxy": {
"kind": "interface",
"entries": {
"translator": {
"type": "#/definitions/Translator"
},
"flags": {
"type": "#/definitions/Flags"
},
"deviceType": {
"type": "string"
},
"anything": {
"type": "object"
}
}
},
"Embed": {
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"render": {
"description": "Renders a visualization into an HTMLElement.",
"kind": "function",
"params": [
{
"name": "cfg",
"description": "The render configuration.",
"kind": "union",
"items": [
{
"type": "#/definitions/CreateConfig"
},
{
"type": "#/definitions/GetConfig"
}
]
}
],
"returns": {
"description": "A controller to the rendered visualization.",
"type": "Promise",
"generics": [
{
"type": "#/definitions/Viz"
}
]
},
"examples": [
"// render from existing object\nn.render({\n element: el,\n id: 'abcdef'\n});",
"// render on the fly\nn.render({\n element: el,\n type: 'barchart',\n fields: ['Product', { qLibraryId: 'u378hn', type: 'measure' }]\n});"
]
},
"context": {
"description": "Updates the current context of this embed instance.\nUse this when you want to change some part of the current context, like theme.",
"kind": "function",
"params": [
{
"name": "ctx",
"description": "The context to update.",
"type": "#/definitions/Context"
}
],
"returns": {
"type": "Promise",
"generics": [
{
"type": "undefined"
}
]
},
"examples": [
"// change theme\nn.context({ theme: 'dark'});",
"// limit constraints\nn.context({ constraints: { active: true } });"
]
},
"selections": {
"description": "Gets the app selections of this instance.",
"kind": "function",
"params": [],
"returns": {
"type": "Promise",
"generics": [
{
"type": "#/definitions/AppSelections"
}
]
},
"examples": [
"const selections = await n.selections();\nselections.mount(element);"
]
},
"field": {
"description": "Gets the listbox instance of the specified field",
"availability": {
"since": "1.1.0"
},
"kind": "function",
"params": [
{
"name": "fieldIdentifier",
"description": "Fieldname as a string or a Library dimension",
"kind": "union",
"items": [
{
"type": "string"
},
{
"type": "#/definitions/LibraryField"
}
]
}
],
"returns": {
"type": "Promise",
"generics": [
{
"type": "#/definitions/FieldInstance"
}
]
},
"examples": [
"const fieldInstance = await n.field(\"MyField\");\nfieldInstance.mount(element, { title: \"Hello Field\"});"
]
},
"getRegisteredTypes": {
"description": "Gets a list of registered visualization types and versions",
"kind": "function",
"params": [],
"returns": {
"description": "types",
"kind": "array",
"items": {
"type": "Object"
}
},
"examples": [
"const types = n.getRegisteredTypes();\n// Contains\n//[\n// {\n// name: \"barchart\"\n// versions:[undefined, \"1.2.0\"]\n// }\n//]"
]
}
}
},
"ReceiverFunction": {
"description": "A callback function which receives another function as input.",
"kind": "alias",
"items": {
"kind": "function",
"params": [
{
"kind": "function",
"params": []
}
]
}
},
"FieldInstance": {
"availability": {
"since": "1.1.0"
},
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"mount": {
"description": "Mounts the field as a listbox into the provided HTMLElement.",
"availability": {
"since": "1.1.0"
},
"kind": "function",
"params": [
{
"name": "element",
"type": "HTMLElement"
},
{
"name": "options",
"description": "Settings for the embedded listbox",
"optional": true,
"kind": "object",
"entries": {
"title": {
"description": "Custom title, defaults to fieldname",
"optional": true,
"type": "string"
},
"direction": {
"description": "Direction setting ltr|rtl.",
"optional": true,
"defaultValue": "ltr",
"type": "string"
},
"listLayout": {
"description": "Layout direction vertical|horizontal",
"optional": true,
"defaultValue": "vertical",
"type": "string"
},
"search": {
"description": "To show the search bar",
"optional": true,
"defaultValue": true,
"type": "boolean"
},
"toolbar": {
"description": "To show the toolbar",
"optional": true,
"defaultValue": true,
"type": "boolean"
},
"stateName": {
"description": "Sets the state to make selections in",
"optional": true,
"defaultValue": false,
"type": "boolean"
},
"properties": {
"description": "Properties object to extend default properties with",
"optional": true,
"defaultValue": "{}",
"type": "object"
},
"sessionModel": {
"description": "Use a custom sessionModel.",
"optional": true,
"type": "object"
},
"selectionsApi": {
"description": "Use a custom selectionsApi to customize how values are selected.",
"optional": true,
"type": "object"
},
"update": {
"description": "A function which receives an update function which upon call will trigger a data fetch.",
"optional": true,
"type": "#/definitions/ReceiverFunction"
}
}
}
],
"examples": [
"fieldInstance.mount(element);"
]
},
"unmount": {
"description": "Unmounts the field listbox from the DOM.",
"availability": {
"since": "1.1.0"
},
"kind": "function",
"params": [],
"examples": [
"listbox.unmount();"
]
}
}
},
"ThemeJSON": {
"kind": "alias",
"items": {
"type": "any"
}
},
"ThemeInfo": {
"kind": "interface",
"entries": {
"id": {
"description": "Theme identifier",
"type": "string"
},
"load": {
"description": "A function that should return a Promise that resolves to a raw JSON theme.",
"kind": "function",
"params": [],
"returns": {
"type": "Promise",
"generics": [
{
"type": "#/definitions/ThemeJSON"
}
]
}
}
}
},
"Viz": {
"description": "A controller to further modify a visualization after it has been rendered.",
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"id": {
"description": "The id of this visualization's generic object.",
"type": "string"
},
"destroy": {
"description": "Destroys the visualization and removes it from the the DOM.",
"kind": "function",
"params": [],
"examples": [
"const viz = await embed(app).render({\n element,\n id: 'abc'\n});\nviz.destroy();"
]
},
"convertTo": {
"description": "Converts the visualization to a different registered type",
"availability": {
"since": "1.1.0"
},
"kind": "function",
"params": [
{
"name": "newType",
"description": "Which registered type to convert to.",
"type": "string"
},
{
"name": "forceUpdate",
"description": "Whether to run setProperties or not, defaults to true.",
"optional": true,
"type": "boolean"
}
],
"returns": {
"description": "Promise object that resolves to the full property tree of the converted visualization.",
"type": "Promise",
"generics": [
{
"type": "object"
}
]
},
"examples": [
"const viz = await embed(app).render({\n element,\n id: 'abc'\n});\nviz.convertTo('barChart');"
]
}
},
"examples": [
"const viz = await embed(app).render({\n element,\n type: 'barchart'\n});\nviz.destroy();"
]
},
"Flags": {
"kind": "interface",
"entries": {
"isEnabled": {
"description": "Checks whether the specified flag is enabled.",
"kind": "function",
"params": [
{
"name": "flag",
"description": "The value flag to check.",
"type": "string"
}
],
"returns": {
"description": "True if the specified flag is enabled, false otherwise.",
"type": "boolean"
}
}
}
},
"AppSelections": {
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"mount": {
"description": "Mounts the app selection UI into the provided HTMLElement.",
"kind": "function",
"params": [
{
"name": "element",
"type": "HTMLElement"
}
],
"examples": [
"selections.mount(element);"
]
},
"unmount": {
"description": "Unmounts the app selection UI from the DOM.",
"kind": "function",
"params": [],
"examples": [
"selections.unmount();"
]
}
}
},
"ObjectSelections": {
"kind": "class",
"constructor": {
"kind": "function",
"params": []
},
"entries": {
"begin": {
"kind": "function",
"params": [
{
"name": "paths",
"kind": "array",
"items": {
"type": "string"