Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@graphistry/client-api
Advanced tools
Client-side API for interacting with a Graphistry embedded visualization.
The JS package supports commonjs, esm, and iffe formats. See package.json for dist/
folder contents.
The rxjs
version is an unpinned peer dependency:
dist/index.{cjs,esm,iife}.min.js
keep rxjs
as an external packagedist/index.full.{cjs,esm,iife}.min.js
include itdist/index.full.iife.min.js
for <script src="..."/>
tagsSee also the @graphistry/client-api-react React docs
Depending on the module format, you may use import
, require
, and window.GraphistryModule
:
const G = GraphistryModule;
const g = G.graphistryJS(elt);
import { graphistryJS } from '@graphistry/client-api';
const g = graphistryJS(elt);
const G = require('@graphistry/client-api');
const g = G.graphistryJS(elt);
The library exposes two calling conventions to choose from.
const G = GraphistryModule;
document.addEventListener("DOMContentLoaded", function () {
var g = G.graphistryJS(document.getElementById('viz'));
var sub = g.pipe(
G.tap(() => console.log('GraphistryJS ready instance as window.g')),
G.delay(5000),
G.addFilter('point:degree > 1'),
G.updateSetting('background', '#FF0000')
)
.subscribe(
function () {},
function (err) { console.error('exn on setup', err); },
function () { console.log('finished setup'); });
//Optional: sub.unsubscribe() to cancel
});
const G = GraphistryModule;
document.addEventListener("DOMContentLoaded", function () {
var g = G.graphistryJS(document.getElementById('viz'));
g.pipe(
G.tap(() => {
//non-rxjs on ready g
console.log('GraphistryJS ready instance as window.g');
setTimeout(
() => {
g.addFilter();
g.updateSetting('background', '#FF0000');
},
5000);
}))
.subscribe();
});
You can also use the library to configure & upload visualization data, and get back dataset IDs to embed as a live visualization:
import { Client, Dataset, File, EdgeFile, NodeFile } from '@graphistry/client-api';
//defaults: 'https', 'hub.graphistry.com', 'https://hub.graphistry.com'
const client = new Client('my_username', 'my_password');
//columnar data is fastest; column per attribute; reuse across datasets
const edgesFile = new EdgeFile({'s': ['a1', 'b2'], 'd': ['b2', 'c3']});
const nodesFile = new NodeFile({'n': ['a1', 'b2', 'c3'], 'a1': ['x', 'y', 'z']});
const dataset = new Dataset({
node_encodings: { bindings: { node: 'n' } },
edge_encodings: { bindings: { source: 's', destination: 'd' } },
metadata: {},
name: 'testdata',
}, edgesFile, nodesFile);
await dataset.upload();
console.info(`View at ${dataset.datasetID} at ${dataset.datasetURL}`);
See additional examples in the @graphistry/node-api
docs or API references here
FAQs
Client-side API for interacting with a Graphistry embedded visualization.
The npm package @graphistry/client-api receives a total of 493 weekly downloads. As such, @graphistry/client-api popularity was classified as not popular.
We found that @graphistry/client-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.