@datagrok/api-samples 1.0.4 → 1.0.5
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/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Style-related context commands: https://datagrok.ai/help/visualize/viewers/#common-actions
|
|
2
|
+
|
|
3
|
+
const df = grok.data.demo.demog();
|
|
4
|
+
const view = grok.shell.addTableView(df);
|
|
5
|
+
|
|
6
|
+
const sp = view.scatterPlot({
|
|
7
|
+
colorColumnName: 'sex',
|
|
8
|
+
backColor: DG.Color.lightBlue,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// Sets the current state of viewer properties as the default configuration
|
|
12
|
+
// used to create new viewer instances of this type (works both for native and custom viewers).
|
|
13
|
+
// Corresponds to the "Pick Up / Apply | Set as Default"
|
|
14
|
+
// Takes optional arguments to specify whether [data] and [style] settings should be copied.
|
|
15
|
+
// By default, copies only style settings: setDefault() is the same as setDefault(false, true)
|
|
16
|
+
sp.props.setDefault(true, true);
|
|
17
|
+
|
|
18
|
+
// Clears the previously remembered default settings.
|
|
19
|
+
// Note that the reset method can be invoked on any instance of this viewer type.
|
|
20
|
+
// Corresponds to "Pick Up / Apply | Reset Default"
|
|
21
|
+
const sp1 = view.scatterPlot();
|
|
22
|
+
sp1.props.resetDefault();
|