On this page

## Members

### Client

Class wrapping @graphistry/js-upload-api::Client for client->server File and Dataset uploads using username and password authentication.

Source
  - index.js, line 41

### ClientPKey

Class wrapping @graphistry/js-upload-api::ClientPKey for client->server File and Dataset uploads using personal key authentication.

Source
  - index.js, line 80

### Dataset

Class from @graphistry/js-upload-api::Dataset for combining files into a single visualizable graph.

Source
  - index.js, line 13

### EdgeFile

Helper class from @graphistry/js-upload-api::EdgeFile for tracking intent when creating a File object for uploading.

Source
  - index.js, line 27

### File

Class from @graphistry/js-upload-api::File for uploading data and then reusing as part of Dataset graph visualizations.

Source
  - index.js, line 20

### NodeFile

Helper class from @graphistry/js-upload-api::NodeFile for tracking intent when creating a File object for uploading.

Source
  - index.js, line 34

## Methods

### addExclusion(expr)

Add an exclusion to the visualization with the given expression

Parameters:

Name | Type | Description
--- | --- | ---
`expr` | string | An expression using the same language as our in-tool exclusion and filter panel

Source
  - index.js, line 1234

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(addExclusion('point:degree > 0'))
        .subscribe();

### addExclusions(expr)

Add an exclusion to the visualization with the given expression

Parameters:

Name | Type | Description
--- | --- | ---
`expr` | array | Expressions using the same language as our in-tool exclusion and filter panel

Source
  - index.js, line 1250

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(addExclusions(['point:degree > 0'], ['edge:value > 0']))
        .subscribe();

### addFilter(expr)

Add a filter to the visualization with the given expression

Parameters:

Name | Type | Description
--- | --- | ---
`expr` | string | An expression using the same language as our in-tool exclusion and filter panel

Source
  - index.js, line 1167

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(
             addFilter('point:degree > 0'),
             addFilter('edge:value > 0'))
        .subscribe();

### addFilter(expr)

Add filters to the visualization with the given expression

Parameters:

Name | Type | Description
--- | --- | ---
`expr` | array | An array of expressions using the same language as our in-tool exclusion and filter panel

Source
  - index.js, line 1185

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(addFilters(['point:degree > 0', 'edge:value > 0'])));
        .subscribe();

### (static) autocenter(percentile, cbopt)

Center the view of the graph

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`percentile` | number |  | Controls sensitivity to outliers
`cb` | function | <optional> | Callback function of type callback(error, result)

Source
  - index.js, line 1100
To Do
  - Implement this function

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(autocenter(.90))
        .subscribe();

### encodeAxis()

Add an axis to the graph

Parameters:

Type | Description
--- | ---
Object |

Source
  - index.js, line 530

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

### encodeColor(graphTypeopt, attributeopt, variationopt, colorsOrMappingopt)

Change colors based on an attribute. Pass null for attribute, mapping to clear.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`graphType` | GraphType | <optional> | 'point' or 'edge'
`attribute` | Attribute | <optional> | name of data column, e.g., 'degree'
`variation` | Variant | <optional> | If there are more bins than colors, use 'categorical' to repeat colors and 'continuous' to interpolate
`colorsOrMapping` | any | <optional> | array of color name or hex codes, or object mapping

Source
  - index.js, line 393

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeColor('point', 'degree', 'categorical', ['black', 'white']))
        .subscribe();

### encodeDefaultEdgeIcons(array:)

Single-argument edge default icons (user-unset) based on an attribute for React props

Parameters:

Name | Type | Description
--- | --- | ---
`array:` | Array | undefined to reset; str to use directly; [str attr, mapping]

Source
  - index.js, line 1159

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Examples

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeDefaultEdgeIcons())
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeDefaultEdgeIcons('some_attr'))
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeDefaultEdgeIcons(['some_attr', some_mapping]))
        .subscribe();

### encodeDefaultIcons(graphTypeopt, attributeopt, objectopt)

Change default (user-unset) icons based on an attribute. Pass undefined for attribute, mapping to clear.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`graphType` | GraphType | <optional> | 'point' or 'edge'
`attribute` | Attribute | <optional> | name of data column, e.g., 'icon'
`object` | Mapping | <optional> | optional value mapping, e.g., {categorical: {fixed: {ip: 'laptop', alert: 'alaram'}, other: 'question'}}

Source
  - index.js, line 1102

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeDefaultIcons('point', 'icon', 'some_attr'))
        .subscribe();

### encodeDefaultPointIcons(array:)

Single-argument point default icons (user-unset) based on an attribute for React props

Parameters:

Name | Type | Description
--- | --- | ---
`array:` | Array | undefined to reset; str to use directly; [str attr, mapping]

Source
  - index.js, line 1127

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Examples

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeDefaultPointIcons())
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeDefaultPointIcons('some_attr'))
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeDefaultPointIcons(['some_attr', some_mapping]))
        .subscribe();

### encodeEdgeColor(array:)

Single-argument version of encodeColor used for React props

Parameters:

Name | Type | Description
--- | --- | ---
`array:` | Array | undefined to reset; str to use directly; [str attr, 'categorical' or 'continuous', [ str ] or mapping]

Source
  - index.js, line 751

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Examples

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeEdgeColor())
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeEdgeColor('prebaked_colors_col'))
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeEdgeColor(['degree', 'categorical', ['black', 'white']]))
        .subscribe();

### encodeEdgeIcons(array:)

Single-argument edge change icons based on an attribute for React props

Parameters:

Name | Type | Description
--- | --- | ---
`array:` | Array | undefined to reset; str to use directly; [str attr, mapping]

Source
  - index.js, line 922

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Examples

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeEdgeIcons())
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeEdgeIcons('some_attr'))
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeEdgeIcons(['some_attr', some_mapping]))
        .subscribe();

### encodeIcons(graphTypeopt, attributeopt, objectopt)

Change icons based on an attribute. Pass undefined for attribute, mapping to clear.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`graphType` | GraphType | <optional> | 'point' or 'edge'
`attribute` | Attribute | <optional> | name of data column, e.g., 'icon'
`object` | Mapping | <optional> | optional value mapping, e.g., {categorical: {fixed: {ip: 'laptop', alert: 'alaram'}, other: 'question'}}

Source
  - index.js, line 827

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeIcons('point', 'icon', 'some_attr'))
        .subscribe();

### encodePointColor(array:)

Single-argument version of encodeColor used for React props

Parameters:

Name | Type | Description
--- | --- | ---
`array:` | Array | undefined to reset; str to use directly; [str attr, 'categorical' or 'continuous', [ str ] or mapping]

Source
  - index.js, line 695

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Examples

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointColor())
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointColor('prebaked_colors_col'))
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointColor(['degree', 'categorical', ['black', 'white']]))
        .subscribe();

### encodePointIcons(array:)

Single-argument point change icons based on an attribute for React props

Parameters:

Name | Type | Description
--- | --- | ---
`array:` | Array | undefined to reset; str to use directly; [str attr, mapping]

Source
  - index.js, line 867

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Examples

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointIcons())
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointIcons('some_attr'))
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointIcons(['some_attr', some_mapping]))
        .subscribe();

### encodePointSize(array:)

Single-argument point change size based on an attribute for React props

Parameters:

Name | Type | Description
--- | --- | ---
`array:` | Array | undefined to reset; str to use directly; [str attr, mapping]

Source
  - index.js, line 1018

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Examples

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointSize())
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointSize('some_attr'))
        .subscribe();

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodePointSize(['some_attr', some_mapping]))
        .subscribe();

### encodeSize(graphTypeopt, attributeopt)

Change size based on an attribute. Pass null for attribute, mapping to clear.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`graphType` | GraphType | <optional> | 'point'
`attribute` | Attribute | <optional> | name of data column, e.g., 'degree'

Source
  - index.js, line 681

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(encodeSize('point', 'community_infomap'))
        .subscribe();

### getCurrentWorkbook(cbopt)

Read the workbook ID

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`cb` | function | <optional> | Callback function of type callback(error, result)

Source
  - index.js, line 1118

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(getCurrentWorkbook())
        .subscribe(function (workbook) {
            alert('id: ' + workbook.id)
        });

### labelUpdates({@link) → {Observable.<Observable.<LabelEvent>>}

Get or create an Observable stream of all label updates from the visualization.

The Observable returned by this method emits inner Observables, where each inner Observable is tied to the lifetime of the label for which it was created.

For each label rendered in the visualization, the Observable returned by this method will create and emit a new inner Observable. The inner Observable will emit events when the label changes. For example, if the user clicks on the label, or the label changes position because of a pan/zoom, the inner Observable will emit an event.

The inner Observable for a label will complete if the label is removed from the screen.

Parameters:

Name | Type | Description
--- | --- | ---
`{@link` |  | GraphistryState} [g] A GraphistryState Observable or deprecated, cache an object.

Source
  - index.js, line 1543

Returns:

An Observable of inner {Observables}, where each inner Observable represents the lifetime of a label in the visualization.

Type:
  Observable.<Observable.<LabelEvent>>

Examples

    GraphistryJS(document.getElementById('viz'))
        .pipe(
             map(g => labelUpdates(g)),
             tap(({ id, tag, pageX, pageY }) => {
                    // prints messages like
                    // > 'Label 13 added at (200, 340)'
                    // > 'Label 74 updated at (750, 100)'
                    console.log(`Label ${id} ${tag} at (${pageX}, ${pageY})`);
             }),
             takeLast(1),
             tap(function ({ id, pageX, pageY }) {
                    console.log(`Label ${id} removed at (${pageX}, ${pageY})`);
             });
        })
        .subscribe();

    //first use
    GraphistryJS(document.getElementById('viz'))
       .pipe(map((g) => labelUpdates(g)))
       .subscribe();
    //second time reuse the cache to avoid excess event queue slowdowns
    GraphistryJS(document.getElementById('viz'))
         .pipe(map((g) => labelUpdates(g)))
        .subscribe()

### (private) makeCaller(modelName, args)

Serialization and coordination for formatting postMessage API calls, used with GraphistryState Observables

Parameters:

Name | Type | Description
--- | --- | ---
`modelName` | string | 'view' or 'workbook'
`args` | any | anything to pass as falcor .call(...args)

Source
  - index.js, line 376

Returns:

GraphistryState Observable

Example

    GraphistryJS(document.getElementById('viz'))
       .pipe(
             makeCaller('view', 'tick', []),
             delay(2000),
             makeCaller('view', 'tick', []))
       .subscribe();

### (private) makeCallerJSON(modelName, args)

Serialization and coordination for formatting postMessage API calls, used with GraphistryState Observables. Adds json desrialization to makeCaller.

Parameters:

Name | Type | Description
--- | --- | ---
`modelName` | string | 'view' or 'workbook'
`args` | any | anything to pass as falcor .call(...args)

Source
  - index.js, line 440

Returns:

GraphistryState Observable

Example

    GraphistryJS(document.getElementById('viz'))
       .pipe(
             makeCaller('view', 'tick', []),
             delay(2000),
             makeCaller('view', 'tick', []))
       .subscribe();

### makeGetter(modelName, …args)

Serialization and coordination for formatting postMessage API calls, used with GraphistryState Observable

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`modelName` | string |  |
`args` | any | <repeatable> | anything to pass as falcor .get(...args)

Source
  - index.js, line 467

Returns:

GraphistryState Observable

### makeGetterJSON(modelName, …args)

Serialization and coordination for formatting postMessage API calls, used with GraphistryState Observable. Adds json desrialization to makeGetter.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`modelName` | string |  |
`args` | any | <repeatable> |

Source
  - index.js, line 267

Returns:

GraphistryState Observable

### (private) makeSetter(modelName, value)

Serialization and coordination for formatting postMessage API calls, used with GraphistryState Observables

Parameters:

Name | Type | Description
--- | --- | ---
`modelName` | string | 'view' or 'workbook'
`value` | string | $value path/value pair

Source
  - index.js, line 578

Returns:

GraphistryState Observable

Example

    GraphistryJS(document.getElementById('viz'))
       .pipe(makeSetter('view', $value('viz.width', 500)))
       .subscribe();

### (private) makeSetterWithModel(modelName, value)

Serialization and coordination for formatting postMessage API calls, used with GraphistryState Observables

Parameters:

Name | Type | Description
--- | --- | ---
`modelName` | string | 'view' or 'workbook'
`value` | string | $value path/value pair

Source
  - index.js, line 528

Returns:

GraphistryState Observable

Example

    GraphistryJS(document.getElementById('viz'))
       .pipe(makeSetterWithModel('view', model => myValuesFromModel(model)))
       .subscribe();

### playUpdates({@link) → {Subscription}

Subscribe to graph simulation completion event

Parameters:

Name | Type | Description
--- | --- | ---
`{@link` |  | GraphistryState} [g] A GraphistryState Observable

Source
  - index.js, line 1720

Returns:

A Subscription that can be used to react to the play updates

Type:
  Subscription

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(
             map(playUpdates),
             tap(() => console.log('Play completed')),
        })
        .subscribe();

### resetColor(graphTypeopt)

Reset color encoding

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`graphType` | GraphType | <optional> | 'point' or 'edge'

Source
  - index.js, line 420

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
       .pipe(resetColor('point'))
       .subscribe();

### resetEdgeColor() → {GraphistryState}

Reset the edge color encoding

Source
  - index.js, line 793

Returns:

A GraphistryState Observable that emits the result of the operation

Type:
  GraphistryState

Example

    GraphistryJS(document.getElementById('viz'))
      .pipe(resetEdgeColor())
      .subscribe();

### resetEdgeIcons() → {GraphistryState}

Reset the edge icon encoding

Source
  - index.js, line 964

Returns:

A GraphistryState Observable that emits the result of the operation

Type:
  GraphistryState

Example

    GraphistryJS(document.getElementById('viz'))
    .pipe(resetEdgeIcons())
    .subscribe();

### resetExclusions()

Reset all exclusions in a visualization

Source
  - index.js, line 1285

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(resetExclusions())
        .subscribe();

### resetFilters()

Reset all filters in a visualization

Source
  - index.js, line 1220

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(resetFilters())
        .subscribe();

### resetIcons(graphTypeopt) → {GraphistryState}

Reset the icon encoding

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`graphType` | GraphType | <optional> | 'point' or 'edge'

Source
  - index.js, line 852

Returns:

A GraphistryState Observable that emits the result of the operation

Type:
  GraphistryState

Example

    GraphistryJS(document.getElementById('viz'))
     .pipe(resetIcons())
     .subscribe();

### resetPointColor() → {GraphistryState}

Reset the point color encoding

Source
  - index.js, line 737

Returns:

A GraphistryState Observable that emits the result of the operation

Type:
  GraphistryState

Example

    GraphistryJS(document.getElementById('viz'))
       .pipe(resetPointColor())
       .subscribe();

### resetPointIcons() → {GraphistryState}

Reset the point icon encoding

Source
  - index.js, line 909

Returns:

A GraphistryState Observable that emits the result of the operation

Type:
  GraphistryState

Example

    GraphistryJS(document.getElementById('viz'))
     .pipe(resetPointIcons())
     .subscribe();

### resetPointSize() → {GraphistryState}

Reset the point size encoding

Source
  - index.js, line 1050

Returns:

A GraphistryState Observable that emits the result of the operation

Type:
  GraphistryState

Example

    GraphistryJS(document.getElementById('viz'))
    .pipe(resetPointSize())
    .subscribe();

### resetSize(graphTypeopt) → {GraphistryState}

Reset the size encoding

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`graphType` | GraphType | <optional> | 'point'

Source
  - index.js, line 702

Returns:

A GraphistryState Observable that emits the result of the operation

Type:
  GraphistryState

Example

    GraphistryJS(document.getElementById('viz'))
      .pipe(resetSize())
      .subscribe();

### saveWorkbook()

Save the current workbook. A saved workbook will persist the analytics state of the visualization, including active filters and exclusions

Source
  - index.js, line 1135

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(saveWorkbook())
        .subscribe();

### selectionUpdates({@link) → {Subscription}

Get or create an Observable stream of all selection updates from the visualization. UNSTABLE: This API is subject to change in future versions. The security model for this is being developed, in the mean time it is disabled by default. Contact us for help to prototype this feature.

Parameters:

Name | Type | Description
--- | --- | ---
`{@link` |  | GraphistryState} [g] A GraphistryState Observable

Source
  - index.js, line 1452

Returns:

A Subscription that can be used to react to the selection updates

Type:
  Subscription

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(
             map(selectionUpdates),
             tap(({ edge, point}) => console.log('Edge array:', edge, 'Point array:', point)),
        })
        .subscribe();

### setHighlightExternal(selection)

UNSTABLE: Set the highlight. Currently, this uses internal ids and will be updated to use external ids.

Parameters:

Name | Type | Description
--- | --- | ---
`selection` | Object | point array, edge array and darken boolean

Source
  - index.js, line 1315

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(setHighlightExternal({point: [1, 2, 3], edge: []}))
        .subscribe();

### setSelectionExternal(selection)

UNSTABLE: Set the selection. Currently, this uses internal ids and will be updated to use external ids.

Parameters:

Name | Type | Description
--- | --- | ---
`selection` | Object | point array and edge array

Source
  - index.js, line 1299

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(setSelectionExternal({point: [1, 2, 3], edge: []}))
        .subscribe();

### subscribeLabels() → {Subscription}

Subscribe to label change and exit events

Parameters:

Type | Description
--- | ---
Object | An Object with `onChange` and `onExit` callbacks

Source
  - index.js, line 1686

Returns:

A Subscription that can be used to stop reacting to label updates

Type:
  Subscription

Example

    var sub = graphistryJS(document.getElementById('viz'))
       .pipe((g) => subscribeLabels({
          g,
          onChange: (label) => {
            console.log(`Label ${label.id} changed at (${label.pageX}, ${label.pageY})`);
         },
         onExit: (label) => {
           console.log(`Label ${label.id} removed at (${label.pageX}, ${label.pageY})`);
         },
         onError: (e) => {
           console.error('Error in label subscription', e);
         }
    }));
    setTimeout(() => { sub.unsubscribe(); }, 5000);

### subscribeSelections() → {Subscription}

Subscribe to selection change events

Parameters:

Type | Description
--- | ---
Object | An Object with `onChange` and `onExit` callbacks

Source
  - index.js, line 1525

Returns:

A Subscription that can be used to stop reacting to label updates

Type:
  Subscription

Example

    var sub = graphistryJS(document.getElementById('viz'))
       .pipe((g) => subscribeSelections({
          g,
          onChange: ({ edge, point}) => console.log('Edge array:', edge, 'Point array:', point)
       }
    }));
    setTimeout(() => { sub.unsubscribe(); }, 5000);

### toggleHistograms(turnOnopt)

Toggle histogram panel

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`turnOn` | boolean | <optional> | Whether to make panel visible

Source
  - index.js, line 1046

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(toggleHistograms(true))
        .subscribe();

### toggleInspector(turnOnopt)

Toggle inspector panel

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`turnOn` | boolean | <optional> | Whether to make panel visible

Source
  - index.js, line 1271

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(toggleInspector(true))
        .subscribe();

### togglePanel(panelopt, turnOnopt)

Toggle a top menu panel on/off. If panel is an array, interpret as [panel, turnOn]. Only one panel is turned on; the rest are turned off.

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`panel` | string | <optional> | Name of panel: filters, exclusions, scene, labels, layout
`turnOn` | boolean | <optional> | Whether to make panel visible, or turn all off

Source
  - index.js, line 764

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(togglePanel('filters', true));
        .subscribe();

### toggleTimebars(turnOnopt)

Toggle timebars panel

Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`turnOn` | boolean | <optional> | Whether to make panel visible

Source
  - index.js, line 1017

Returns:

Graphistry A Graphistry Observable that emits the result of the operation

Example

    GraphistryJS(document.getElementById('viz'))
        .pipe(toggleTimebars(true));
        .subscribe();

### toogleToolbar(show)

Hide or Show Toolbar UI

Parameters:

Name | Type | Description
--- | --- | ---
`show` | boolean | Set to true to show toolbar, and false to hide toolbar.

Source
  - index.js, line 1151

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    <button onclick="g.pipe(toggleToolbar(false)).subcribe()">Hide toolbar</button>
    <button onclick="g.pipe(toggleToolbar(true)).subscribe()">Show toolbar</button>

### updateSetting(name, val)

Modify a settings value in the visualization

Available Settings | Value Type
--- | ---
`showToolbar` | `boolean`
`pruneOrphans` | `boolean`
`showArrows` | `boolean`
`background` | color as hex or rgba `string`
`edgeOpacity` | `number` (0 to 1)
`edgeSize` | `number` (0.1 to 10)
`edgeCurvature` | `number` (0.1 to 1)
`pointOpacity` | `number` (0 to 1)
`pointSize` | `number` (0.1 to 10)
`neighborhoodHighlight` | `string` ("incoming", "outgoing", "both", "none")
`neighborhoodHighlightHops` | `uint`
`zoom` | `uint`
`center` | `const 0`
`labelOpacity` | `boolean`
`labelEnabled` | `boolean`
`labelPOI` | `boolean`
`labelLabelPOI` | `boolean`
`labelHighlightEnabled` | `boolean`
`labelInspectorEnabled` | `boolean`
`labelShowActions` | `boolean`
`labelColor` | color as hex or rgba `string`
`labelBackground` | color as hex or rgba `string`
`precisionVsSpeed` | `int` (-5 to +5)
`gravity` | `number` (0 to 10)
`scalingRatio` | `number` (0 to 10)
`edgeInfluence` | `number` (0 to 10)
`strongGravity` | `boolean`
`dissuadeHubs` | `boolean`
`linLog` | `boolean`
`lockedX` | `boolean`
`lockedY` | `boolean`
`lockedR` | `boolean`

Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name of the setting to change
`val` | string | the value to set the setting to.

Source
  - index.js, line 1378

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    graphistryJS(document.getElementById('viz'))
        .pipe(updateSetting('background', 'red'))
        .subscribe();

### updateZoom(level)

Update the camera zoom level

Parameters:

Name | Type | Description
--- | --- | ---
`level` | number | Controls how far to zoom in or out.

Source
  - index.js, line 1437

Returns:

GraphistryState A GraphistryState Observable that emits the result of the operation

Example

    graphistryJS(document.getElementById('viz'))
        .pipe(updateZoom(2), delay(2000), updateZoom(0.5))
        .subscribe();

Type anything to view search result