@sigmacomputing/plugin 0.7.57 → 1.0.0-rc.1

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.
Files changed (63) hide show
  1. package/.gitignore +30 -0
  2. package/.lintstagedrc +3 -0
  3. package/.nvmrc +1 -0
  4. package/.prettierrc +5 -0
  5. package/CHANGELOG.md +25 -0
  6. package/CONTRIBUTING.md +60 -0
  7. package/{LICENSE.md → LICENSE} +0 -0
  8. package/README.md +782 -8
  9. package/assets/sigma-logo-dark.svg +54 -0
  10. package/assets/sigma-logo-light.svg +50 -0
  11. package/dist/client/index.d.ts +4 -0
  12. package/dist/client/index.d.ts.map +1 -0
  13. package/dist/{client.js → client/index.js} +2 -1
  14. package/dist/client/initialize.d.ts +3 -0
  15. package/dist/client/initialize.d.ts.map +1 -0
  16. package/dist/{initialize.js → client/initialize.js} +1 -1
  17. package/dist/client/react/Context.d.ts +4 -0
  18. package/dist/client/react/Context.d.ts.map +1 -0
  19. package/dist/client/react/Context.js +6 -0
  20. package/dist/client/react/Provider.d.ts +8 -0
  21. package/dist/client/react/Provider.d.ts.map +1 -0
  22. package/dist/client/react/Provider.js +9 -0
  23. package/dist/client/react/hooks.d.ts +48 -0
  24. package/dist/client/react/hooks.d.ts.map +1 -0
  25. package/dist/{react/index.js → client/react/hooks.js} +23 -60
  26. package/dist/client/react/index.d.ts +4 -0
  27. package/dist/client/react/index.d.ts.map +1 -0
  28. package/dist/client/react/index.js +21 -0
  29. package/dist/index.d.ts +2 -3
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +3 -9
  32. package/dist/types.d.ts +262 -0
  33. package/dist/types.d.ts.map +1 -0
  34. package/dist/types.js +2 -0
  35. package/dist/{deepEqual.d.ts → utils/deepEqual.d.ts} +0 -0
  36. package/dist/utils/deepEqual.d.ts.map +1 -0
  37. package/dist/utils/deepEqual.js +29 -0
  38. package/jest.config.ts +22 -0
  39. package/package.json +50 -17
  40. package/src/client/__tests__/initialize.test.ts +30 -0
  41. package/src/client/index.ts +5 -0
  42. package/src/client/initialize.ts +199 -0
  43. package/src/client/react/Context.ts +6 -0
  44. package/src/client/react/Provider.tsx +19 -0
  45. package/src/client/react/hooks.ts +178 -0
  46. package/src/client/react/index.tsx +6 -0
  47. package/src/index.ts +3 -0
  48. package/src/types.ts +322 -0
  49. package/src/utils/deepEqual.ts +24 -0
  50. package/tsconfig.build.json +9 -0
  51. package/tsconfig.json +35 -0
  52. package/yarn.lock +3226 -0
  53. package/dist/client.d.ts +0 -2
  54. package/dist/client.d.ts.map +0 -1
  55. package/dist/deepEqual.d.ts.map +0 -1
  56. package/dist/deepEqual.js +0 -46
  57. package/dist/initialize.d.ts +0 -3
  58. package/dist/initialize.d.ts.map +0 -1
  59. package/dist/initialize.test.d.ts +0 -2
  60. package/dist/initialize.test.d.ts.map +0 -1
  61. package/dist/initialize.test.js +0 -26
  62. package/dist/react/index.d.ts +0 -58
  63. package/dist/react/index.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,14 +1,788 @@
1
- # Install the dependencies
1
+ <p align="center">
2
+ <a href="https://github.com/sigmacomputing/plugin">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/sigmacomputing/plugin/blob/main/assets/sigma-logo-dark.svg">
5
+ <img alt="Sigma Logo" src="https://github.com/sigmacomputing/plugin/blob/main/assets/sigma-logo-light.svg" width="400px">
6
+ </picture>
7
+ </a>
8
+ </p>
2
9
 
10
+ Sigma Computing Plugins provides an API for third-party applications add
11
+ additional functionality into an existing Sigma workbook.
12
+
13
+ Plugins are built using Sigma’s Plugin API. This API communicates data and
14
+ interaction events between a Sigma workbook and the plugin. Plugins are hosted
15
+ by their developer and rendered in an iframe in Sigma.
16
+
17
+ ## Requirements
18
+
19
+ To test your plugin in Sigma Plugin Dev Playground, you must:
20
+
21
+ - Have an Admin, Creator or Explorer account type
22
+ - Have Can Edit permission on the work
23
+ - Be in the workbook’s Edit mode
24
+
25
+ To test a development version of a registered plugin, you must:
26
+
27
+ - Have either:
28
+
29
+ - An Admin account type
30
+ - A custom account type that supports plugin developer feature permissions
31
+
32
+ - Have "can edit" permission on the workbook
33
+ - Be in the workbook’s Edit mode
34
+
35
+ Your plugin must be a Javascript-based project and run in the browser.
36
+
37
+ ## Getting Started
38
+
39
+ ### Installation
40
+
41
+ Provided you have already followed the steps to create a plugin and a plugin
42
+ development environment, you can install `@sigmacomputing/plugin` using one of
43
+ the following commands
44
+
45
+ ```sh
46
+ yarn add @sigmacomputing/plugin
47
+ # or
48
+ npm install @sigmacomputing/plugin
49
+ ```
50
+
51
+ If you have yet to set up your development environment, follow one of the setup
52
+ guides below
53
+
54
+ ### Create a Development Project
55
+
56
+ At Sigma, we use React for all of our frontend development. This was taken into
57
+ consideration when building Sigma’s Plugin feature.
58
+
59
+ While you are not required to use React for your plugin, it must be written in
60
+ Javascript and React is recommended. We support both a standard Javascript API
61
+ and a React Hooks API.
62
+
63
+ #### Create a Project with React
64
+
65
+ 1. Open your terminal and navigate to the directory you want to create your
66
+ project in.
67
+ 2. Create your new project. We recommend using Facebook’s
68
+ [`create-react-app`](https://create-react-app.dev/).
69
+
70
+ ```sh
71
+ npx create-react-app <my-cool-plugin>
72
+ ```
73
+
74
+ 3. Navigate to the project's main directory.
75
+
76
+ ```sh
77
+ cd <my-cool-plugin>
78
+ ```
79
+
80
+ 4. Use your package manager to install Sigma’s plugin library. We recommend
81
+ using `yarn`.
82
+
83
+ ```sh
84
+ yarn add @sigmacomputing/plugin
85
+ ```
86
+
87
+ 5. Spin up your local development server.
88
+
89
+ ```sh
90
+ yarn && yarn start
91
+ ```
92
+
93
+ 6. Start developing:
94
+
95
+ - Get started with Sigma’s Plugin APIs.
96
+ - Test your plugin directly in a Sigma workbook using the Sigma Plugin Dev
97
+ Playground.
98
+ - By default, Create React App dev servers run on http://localhost:3000.
99
+
100
+ ## Testing your Plugin
101
+
102
+ Plugin developers should have access to a special plugin called Sigma Plugin Dev
103
+ Playground. This plugin is available from any workbook and points to
104
+ http://localhost:3000, by default.
105
+
106
+ If you cannot find this plugin, or would like a development playground with an
107
+ alternative default host, please contact your Organization Admin with a request
108
+ to Register a Plugin with its production URL set to your preferred development
109
+ URL.
110
+
111
+ ### Using the Development Playground
112
+
113
+ Before you start:
114
+
115
+ - Set your plugin’s development URL to http://localhost:3000.
116
+ - Start your plugin locally
117
+
118
+ > Note: If you followed our recommendations under
119
+ > [#create-a-development-project](#create-a-development-project), enter the
120
+ > following command in your terminal:
121
+ >
122
+ > ```sh
123
+ > yarn && yarn start
124
+ > ```
125
+
126
+ 1. Create/open a workbook.
127
+ 2. In the workbook header, click Edit.
128
+ 3. Click the + button in the sidebar, to open the workbook’s ADD NEW panel.
129
+ 4. Select the PLUGINS element type, located under UI ELEMENTS.
130
+ 5. The editor panel will show you a list of available plugins. Select Sigma
131
+ Plugin Dev Playground.
132
+ 6. Your new plugin element will appear on the page.
133
+
134
+ > **Note:**
135
+ > The editor panel will only display content if you have configured your plugin
136
+ > using Sigma’s plugin [Configuration API](#documentation).
137
+ > Likewise, the element will only display content if your plugin is configured to display content.
138
+ > If you change a plugin's configuration options, input values will need to be
139
+ > re-added in the editor panel.
140
+
141
+ **Now what?**
142
+
143
+ - You can refresh your plugin as you make changes to its code. This option is
144
+ available from the element’s menu.
145
+ - You are responsible for hosting your plugin. [Learn more](#host-your-plugin).
146
+ - When you’re ready to register your plugin, [Add your custom your
147
+ Plugin](https://help.sigmacomputing.com/hc/en-us/articles/4410105794963) with
148
+ Sigma.
149
+
150
+ ## Documentation
151
+
152
+ #### CustomPluginConfigOptions
153
+
154
+ A plugin can be configured with any number of configuration fields. Each field
155
+ type has its own configuration options. Each field type is also garunteed to
156
+ have a the following options:
157
+
158
+ - `name : string` - the name of the field
159
+ - `type : string` - the field type
160
+ - `label : string (optional)` - a display name for the field
161
+
162
+ <details>
163
+ <summary>Full CustomPluginConfigOptions Type</summary>
164
+
165
+ ```ts
166
+ type CustomPluginConfigOptions =
167
+ | {
168
+ type: 'group';
169
+ name: string;
170
+ label?: string;
171
+ }
172
+ | {
173
+ type: 'element';
174
+ name: string;
175
+ label?: string;
176
+ }
177
+ | {
178
+ type: 'column';
179
+ name: string;
180
+ label?: string;
181
+ allowedTypes?: ValueType[];
182
+ source: string;
183
+ allowMultiple: boolean;
184
+ }
185
+ | {
186
+ type: 'text';
187
+ name: string;
188
+ label?: string;
189
+ source?: string; // can point to a group or element config
190
+ secure?: boolean; // if true will omit from prehydrated configs
191
+ multiline?: boolean;
192
+ placeholder?: string;
193
+ defaultValue?: string;
194
+ }
195
+ | {
196
+ type: 'toggle';
197
+ name: string;
198
+ label?: string;
199
+ source?: string;
200
+ defaultValue?: boolean;
201
+ }
202
+ | {
203
+ type: 'checkbox';
204
+ name: string;
205
+ label?: string;
206
+ source?: string;
207
+ defaultValue?: boolean;
208
+ }
209
+ | {
210
+ type: 'radio';
211
+ name: string;
212
+ label?: string;
213
+ source?: string;
214
+ values: string[];
215
+ singleLine?: boolean;
216
+ defaultValue?: string;
217
+ }
218
+ | {
219
+ type: 'dropdown';
220
+ name: string;
221
+ label?: string;
222
+ source?: string;
223
+ width?: string;
224
+ values: string[];
225
+ defaultValue?: string;
226
+ }
227
+ | {
228
+ type: 'color';
229
+ name: string;
230
+ label?: string;
231
+ source?: string;
232
+ }
233
+ | {
234
+ type: 'variable';
235
+ name: string;
236
+ label?: string;
237
+ allowedTypes?: ControlType[];
238
+ }
239
+ | {
240
+ type: 'interaction';
241
+ name: string;
242
+ label?: string;
243
+ };
244
+ ```
245
+
246
+ </details>
247
+
248
+ **Group**
249
+
250
+ Can be used to identify a group of related fields
251
+
252
+ **Element**
253
+
254
+ A custom element that is added by your plugin
255
+
256
+ **Column**
257
+
258
+ A custom column configuration that your plugin uses
259
+
260
+ Additional Fields
261
+
262
+ - `allowedTypes : ValueType[] (optional)` - the allowed data types that this
263
+ column can contain where `ValueType` has the following type:
264
+
265
+ ```ts
266
+ type ValueType =
267
+ | 'boolean'
268
+ | 'datetime'
269
+ | 'number'
270
+ | 'integer'
271
+ | 'text'
272
+ | 'variant'
273
+ | 'link'
274
+ | 'error';
275
+ ```
276
+
277
+ - `source : string` - the data source that should be used to supply this field
278
+ - `allowMultiple : boolean` - whether multiple columns should be allowed as
279
+ input for this field
280
+
281
+ **Text**
282
+
283
+ A configurable text input for your plugin
284
+
285
+ Additional Fields
286
+
287
+ - `source : string (optional)` - the data source that should be used to supply this field
288
+ - `secure : boolean (optional)` - whether to omit input from pre-hydrated configs
289
+ - `multiline : boolean (optional)` - whether this text input should allow
290
+ multiple lines
291
+ - `placeholder : string (optional)` - the placeholder for this input field
292
+ - `defaultValue : string (optional)` - the default value for this input field
293
+
294
+ **Toggle**
295
+
296
+ A configurable toggle for your plugin
297
+
298
+ Additional Fields
299
+
300
+ - `source : string (optional)` - the data source that should be used to supply this field
301
+ - `defaultValue : boolean (optional)` - the default value for this input field
302
+
303
+ **Checkbox**
304
+
305
+ A configurable checkbox for your plugin
306
+
307
+ Additional Fields
308
+
309
+ - `source : string (optional)` - the data source that should be used to supply this field
310
+ - `defaultValue : boolean (optional)` - the default value for this input field
311
+
312
+ **Radio**
313
+
314
+ A configurable radio button for your plugin
315
+
316
+ Additional Fields
317
+
318
+ - `source : string (optional)` - the data source that should be used to supply
319
+ this field
320
+ - `values : string[]` - the options to show for this input field
321
+ - `singleLine : boolean (optional)` - whether to display options on a single
322
+ line. Good for (2-3) options
323
+ - `defaultValue : boolean (optional)` - the default value for this input field
324
+
325
+ **Dropdown**
326
+
327
+ A configurable dropdown for your plugin
328
+
329
+ Additional Fields
330
+
331
+ - `source : string (optional)` - the data source that should be used to supply
332
+ this field
333
+ - `values : string[]` - the options to show for this input field
334
+ - `width : string (optional)` - how wide the dropdown should be in pixels
335
+ - `defaultValue : boolean (optional)` - the default value for this input field
336
+
337
+ **Color**
338
+
339
+ A configurable color picker for your plugin
340
+
341
+ Additional Fields
342
+
343
+ - `source : string (optional)` - the data source that should be used to supply
344
+ this field
345
+
346
+ **Variable**
347
+
348
+ A configurable workbook variable to control other elements within your workbook
349
+
350
+ Additional Fields
351
+
352
+ - `allowedTypes : ControlType[] (optional)` - the allowed control types that this
353
+ variable can use where `ControlType` has the following type:
354
+
355
+ ```ts
356
+ type ControlType =
357
+ | 'boolean'
358
+ | 'date'
359
+ | 'number'
360
+ | 'text'
361
+ | 'text-list'
362
+ | 'number-list'
363
+ | 'date-list'
364
+ | 'number-range'
365
+ | 'date-range';
366
+ ```
367
+
368
+ **Interaction**
369
+
370
+ A configurable workbook interaction to interact with other charts within your workbook
371
+
372
+ #### PluginInstance
373
+
374
+ ```ts
375
+ interface PluginInstance<T> {
376
+ sigmaEnv: 'author' | 'viewer' | 'explorer';
377
+
378
+ config: {
379
+ /**
380
+ * Getter for entire Plugin Config
381
+ */
382
+ get(): Partial<T> | undefined;
383
+
384
+ /**
385
+ * Performs a shallow merge between current config and passed in config
386
+ */
387
+ set(config: Partial<T>): void;
388
+
389
+ /**
390
+ * Getter for key within plugin config
391
+ */
392
+ getKey<K extends keyof T>(key: K): Pick<T, K>;
393
+
394
+ /**
395
+ * Assigns key value pair within plugin
396
+ */
397
+ setKey<K extends keyof T>(key: K, value: Pick<T, K>): void;
398
+
399
+ /**
400
+ * Subscriber for Plugin Config
401
+ */
402
+ subscribe(listener: (arg0: T) => void): Unsubscriber;
403
+
404
+ /**
405
+ * Set possible options for plugin config
406
+ */
407
+ configureEditorPanel(options: CustomPluginConfigOptions[]): void;
408
+
409
+ /**
410
+ * Gets a static image of a workbook variable
411
+ */
412
+ getVariable(id: string): WorkbookVariable;
413
+
414
+ /**
415
+ * Setter for workbook variable passed in
416
+ */
417
+ setVariable(id: string, ...values: unknown[]): void;
418
+
419
+ /**
420
+ * Getter for interaction selection state
421
+ */
422
+ getInteraction(id: string): WorkbookSelection[];
423
+
424
+ /**
425
+ * Setter for interaction selection state
426
+ */
427
+ setInteraction(
428
+ id: string,
429
+ elementId: string,
430
+ selection: WorkbookSelection[],
431
+ ): void;
432
+
433
+ /**
434
+ * Overrider function for Config Ready state
435
+ */
436
+ setLoadingState(ready: boolean): void;
437
+
438
+ /**
439
+ * Allows users to subscribe to changes in the passed in variable
440
+ */
441
+ subscribeToWorkbookVariable(
442
+ id: string,
443
+ callback: (input: WorkbookVariable) => void,
444
+ ): Unsubscriber;
445
+
446
+ /**
447
+ * Allows users to subscribe to changes in the passed in interaction ID
448
+ */
449
+ subscribeToWorkbookInteraction(
450
+ id: string,
451
+ callback: (input: WorkbookSelection[]) => void,
452
+ ): Unsubscriber;
453
+ };
454
+
455
+ elements: {
456
+ /**
457
+ * Getter for Column Data by parent sheet ID
458
+ */
459
+ getElementColumns(id: string): Promise<WbElementColumns>;
460
+
461
+ /**
462
+ * Subscriber to changes in column data by ID
463
+ */
464
+ subscribeToElementColumns(
465
+ id: string,
466
+ callback: (cols: WbElementColumns) => void,
467
+ ): Unsubscriber;
468
+
469
+ /**
470
+ * Subscriber for the data within a given sheet
471
+ */
472
+ subscribeToElementData(
473
+ id: string,
474
+ callback: (data: WbElementData) => void,
475
+ ): Unsubscriber;
476
+ };
477
+
478
+ /**
479
+ * Destroys plugin instance and removes all subscribers
480
+ */
481
+ destroy(): void;
482
+ }
483
+ ```
484
+
485
+ ### Framework Agnostic API
486
+
487
+ #### client
488
+
489
+ The client is a pre-initialized plugin instance. You can use this instance
490
+ directly or create your own instance using `initialize`
491
+
492
+ ```ts
493
+ const client: PluginInstance = initialize();
3
494
  ```
4
- yarn install
495
+
496
+ Usage
497
+
498
+ ```ts
499
+ import { client } from '@sigmacomputing/plugin';
500
+
501
+ client.config.configureEditorPanel([
502
+ { name: 'source', type: 'element' },
503
+ { name: 'dimension', type: 'column', source: 'source', allowMultiple: true },
504
+ ]);
505
+ ```
506
+
507
+ #### initialize()
508
+
509
+ Instead of using the pre-initialized plugin instance, you can create your own
510
+ plugin instance.
511
+
512
+ ```ts
513
+ function initialize<T = {}>(): PluginInstance<T>;
5
514
  ```
6
515
 
7
- # Build a New Release
516
+ Usage
517
+
518
+ ```ts
519
+ import { initialize } from '@sigmacomputing/plugin';
520
+
521
+ const myClient: PluginInstance = initialize();
522
+
523
+ myClient.config.configureEditorPanel([
524
+ { name: 'source', type: 'element' },
525
+ { name: 'dimension', type: 'column', source: 'source', allowMultiple: true },
526
+ ]);
527
+ ```
528
+
529
+ ### React API
530
+
531
+ #### <SigmaClientProvider />
532
+
533
+ A context provider your plugin that enables all of the other React API hooks.
534
+ You should wrap your plugin with this provider if your want to use the plugin
535
+ hook API.
536
+
537
+ ```ts
538
+ interface SigmaClientProviderProps {
539
+ client: PluginInstance;
540
+ children?: ReactNode;
541
+ }
542
+
543
+ function SigmaClientProvider(props: SigmaClientProviderProps): ReactNode;
544
+ ```
545
+
546
+ #### usePlugin()
547
+
548
+ Gets the entire plugin instance
549
+
550
+ ```ts
551
+ function usePlugin(): PluginInstance;
552
+ ```
553
+
554
+ #### useEditorPanelConfig()
555
+
556
+ Provides a setter for the plugin's configuration options
557
+
558
+ ```ts
559
+ function useEditorPanelConfig(nextOptions: CustomPluginConfigOptions[]): void;
560
+ ```
561
+
562
+ Provides a setter for the Plugin's Config Options
563
+
564
+ Arguments
565
+
566
+ - `nextOptions : CustomPluginConfigOptions[]` - Updated possible Config Options
567
+
568
+ #### useLoadingState()
569
+
570
+ Gets the current plugin's loading stat. Returns a value and a setter allowing
571
+ you to update the plugin's loading state
572
+
573
+ ```ts
574
+ function useLoadingState(
575
+ initialState: boolean,
576
+ ): [boolean, (nextState: boolean) => void];
577
+ ```
578
+
579
+ Arguments
580
+
581
+ - `initialState : boolean` - Initial value to set loading state to
582
+
583
+ #### useElementColumns()
584
+
585
+ Provides the latest column values from corresponding sheet
586
+
587
+ ```ts
588
+ function useElementColumns(elementId: string): WorkbookElementColumns;
589
+ ```
590
+
591
+ Arguments
592
+
593
+ - `elementId : string` - A workbook element’s unique identifier.
594
+
595
+ Returns the column information from the specified element.
596
+
597
+ ```ts
598
+ interface WorkbookElementColumn {
599
+ id: string;
600
+ name: string;
601
+ columnType: ValueType;
602
+ }
603
+
604
+ interface WorkbookElementColumns {
605
+ [colId: string]: WbElementColumn;
606
+ }
607
+ ```
608
+
609
+ #### useElementData()
610
+
611
+ Provides the latest data values from corresponding sheet
612
+
613
+ ```ts
614
+ function useElementData(elementId: string): WorkbookElementData;
615
+ ```
616
+
617
+ Arguments
618
+
619
+ - `elementId : string` - A workbook element’s unique identifier.
620
+
621
+ Returns the row data from the specified element.
622
+
623
+ ```ts
624
+ interface WorkbookElementData {
625
+ [colId: string]: any[];
626
+ }
627
+ ```
628
+
629
+ #### useVariable()
630
+
631
+ Returns a given variable's value and a setter to update that variable
632
+
633
+ ```ts
634
+ function useVariable(
635
+ variableId: string,
636
+ ): [WorkbookVariable | undefined, (...values: unknown[]) => void];
637
+ ```
638
+
639
+ Arguments
640
+
641
+ - `variableId : string` - The ID of the variable
642
+
643
+ The returned setter function accepts 1 or more variable values expressed as an
644
+ array or multiple parameters
645
+
646
+ ```ts
647
+ function setVariableCallback(...values: unknown[]): void;
648
+ ```
649
+
650
+ #### useInteraction()
651
+
652
+ Returns a given interaction's selection state and a setter to update that interation
653
+
654
+ ```ts
655
+ function useInteraction(
656
+ interactionId: string,
657
+ elementId: string,
658
+ ): [WorkbookSelection | undefined, (value: WorkbookSelection[]) => void];
659
+ ```
660
+
661
+ Arguments
662
+
663
+ - `interactionId : string` - The ID of the interaction
664
+ - `elementId : string` - The ID of the element that this interaction is
665
+ associated with
666
+
667
+ The returned setter function accepts an array of workbook selection elements
668
+
669
+ ```ts
670
+ function setVariableCallback(value: WorkbookSelection[]): void;
671
+ ```
672
+
673
+ #### useConfig()
674
+
675
+ Returns the workbook element’s current configuration. If a key is provided, only
676
+ the associated configuration is returned.
677
+
678
+ ```ts
679
+ function useConfig(key?: string): any;
680
+ ```
681
+
682
+ Arguments
683
+
684
+ - `key : string (optional)` - The name of a key within the associated
685
+ `PluginConfigOptions` object
686
+
687
+ ## Examples
688
+
689
+ Sigma’s development team has created a set of example plugins, listed below.
690
+
691
+ All of our example plugins are hosted and can be added to your organization. To
692
+ view / add an example plugin to your organization, follow the steps to register
693
+ a plugin using its Production URL, listed below.
694
+
695
+ You can also visit Sigma’s [Sample Plugin
696
+ repository](https://github.com/sigmacomputing/sigma-sample-plugins) directly on
697
+ Github.
698
+
699
+ ### Available Plugins
700
+
701
+ - **Recharts Bar Chart** - A basic bar chart built with the Recharts library.
702
+
703
+ - [Source Code](https://github.com/sigmacomputing/sigma-sample-plugins/tree/main/sample-plugin-bar-chart)
704
+ - Production URL: https://sigma-sample-bar-chart-54049.netlify.app/
705
+
706
+ - **D3 Candlestick** - A candlestick visualization built with D3.
707
+
708
+ - [Source Code](https://github.com/sigmacomputing/sigma-sample-plugins/tree/main/sample-plugin-bar-chart)
709
+ - Production URL: https://sigma-sample-candlestick-chart-1664e5.netlify.app/
710
+
711
+ - **Narrative Science Quill** - Demonstrates secure text entry.
712
+
713
+ - [Source Code]()
714
+ - Production URL: https://narrativescience-quill-3ee312.netlify.app/
715
+
716
+ - **D3 Graph** - Demonstrates usage of multiple data sources and in-memory
717
+ joins.
718
+
719
+ - [Source Code](https://github.com/sigmacomputing/sigma-sample-plugins/tree/main/d3-graph)
720
+ - Production URL: https://d3-graph-3a0d0f.netlify.app/
721
+
722
+ - **D3 Sunburst** - A sunburst visualization built with D3.
723
+
724
+ - [Source Code](https://github.com/sigmacomputing/sigma-sample-plugins/tree/main/d3-sunburst)
725
+ - Production URL: https://d3-sunburst-b97c7c.netlify.app/
726
+
727
+ - **Frappe Heatmap** - A basic Frappe visualization example.
728
+
729
+ - [Source Code](https://github.com/sigmacomputing/sigma-sample-plugins/tree/main/frappe-heatmap)
730
+ - Production URL: https://frappe-heatmap-9a4163.netlify.app/
731
+
732
+ ### Use an Example in Your Organization
733
+
734
+ To add an example plugin to your organization, follow the steps to [register a
735
+ plugin](https://help.sigmacomputing.com/hc/en-us/articles/4410105794963) using
736
+ its Production URL, listed in the [examples](#available-plugins) above.
737
+
738
+ ### Run an Example Locally
739
+
740
+ 1. Open your terminal, and navigate to the directory you want to save the example’s in.
741
+ 2. Clone Sigma’s [Sample Plugin
742
+ repository](https://github.com/sigmacomputing/sigma-sample-plugins).
743
+
744
+ ```sh
745
+ git clone https://github.com/sigmacomputing/sigma-sample-plugins.git
746
+ ```
747
+
748
+ 3. Navigate to the plugin you would like to try.
749
+
750
+ ```sh
751
+ cd sigma-sample-plugins/<plugin-name>
752
+ ```
753
+
754
+ 4. Run the plugin.
755
+
756
+ ```sh
757
+ yarn && yarn start
758
+ ```
759
+
760
+ > **Note**: For additional instructions, visit the README file located in the main directory of any given example plugin.
761
+
762
+ ## Host Your Plugin
763
+
764
+ As a plugin developer, you are responsible for hosting your plugin(s). If you’re
765
+ new to hosting your own projects, here are a few popular hosting platforms you
766
+ can get started with:
767
+
768
+ - [Heroku](https://devcenter.heroku.com/)
769
+ - [Netlify](https://www.netlify.com/)
770
+
771
+ ## Contributing
772
+
773
+ We welcome contributions to `@sigmacomputing/plugin`!
774
+
775
+ 🐛 Issues, 📥 Pull requests and 🌟 Stars are always welcome.
776
+ Read our [contributing
777
+ guide](https://github.com/sigmacomputing/plugin/blob/main/CONTRIBUTING.md) to
778
+ get started.
779
+
780
+ **yarn format**
781
+
782
+ Format your code to match the sigmacomputing style guide
783
+
784
+ **yarn test**
8
785
 
9
- - Pull down changes from master
10
- - Create a new branch
11
- - Bump the version in package.json `npm version patch`
12
- - Submit for review
786
+ Check if the unit tests all pass
13
787
 
14
- After that is checked in, switch to master, and run `npm publish`
788
+ > You can also run the tests in `--watch` mode with **yarn test:watch**