Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

## Dev

### Added

* **client-api**: Add `resetFilters` and `resetExclusions` calls, requires minimum Graphistry version 2.42.18
* **client-api**: Add `playUpdates` observer which creates event when graph simulation completes
* **client-api-react**: Add `onPlayComplete` callback property

## 5.1.4 - 2025-05-29

### Added

* **client-api-react**: Add `pointStrokeWidth` and `showCollections` bindings
* **client-api**: Add `playUpdates` observer which creates event when graph simulation completes
* **client-api-react**: Add `onPlayComplete` callback property

### Security

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.1.4",
"version": "5.1.5",
"packages": [
"projects/client-api",
"projects/client-api-react",
Expand Down
6 changes: 3 additions & 3 deletions projects/client-api-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions projects/client-api-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphistry/client-api-react",
"version": "5.1.4",
"version": "5.1.5",
"repository": {
"type": "git",
"url": "git+https://github.com/graphistry/graphistry-js.git"
Expand Down Expand Up @@ -69,7 +69,7 @@
"author": "Graphistry, Inc <https://graphistry.com>",
"license": "ISC",
"dependencies": {
"@graphistry/client-api": "^5.1.4",
"@graphistry/client-api": "^5.1.5",
"crypto-browserify": "3.12.0",
"prop-types": ">=15.6.0",
"shallowequal": "1.1.0",
Expand Down
4 changes: 3 additions & 1 deletion projects/client-api-react/src/bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ const bindings =
// TODO: infer this from chainList in client-api
const calls = bindings.map(b => b.jsCommand).filter(Boolean).concat([
'setSelectionExternal',
'setHighlightExternal'
'setHighlightExternal',
'resetFilters',
'resetExclusions'
])

export { bindings, panelNames, calls };
42 changes: 42 additions & 0 deletions projects/client-api-react/src/stories/GraphistryJS.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
updateSetting,
addFilters,
addExclusions,
resetFilters,
resetExclusions,
togglePanel,
toggleToolbar,
toggleHistograms,
Expand Down Expand Up @@ -294,6 +296,46 @@ export const setFilters = {
},
};

export const ResetFilters = {
render: (args) => {
const iframe = useRef(null);
const [messages, setMessages] = useState(['loading...']);

useEffect(() => {
//////// Instantiate GraphistryJS for an iframe
const sub =
(graphistryJS(iframe.current)
.pipe(
tap(() =>
setMessages((arr) => arr.concat([`graphistryJS instantiated; pausing 3s...`]))
),
delay(3000),
tap(() => setMessages((arr) => arr.concat([`adding filters`]))),
addFilters(
args.filters || ['point:community_infomap in (4, 5, 6)', 'point:degree > 1']
),
addExclusions(args.exclusions || ['edge:id = 1']),
togglePanel('filters', false),
tap(() => setMessages((arr) => arr.concat([`pausing before removing filters`]))),
delay(3000),
tap(() => setMessages((arr) => arr.concat([`removing filters`]))),
resetFilters(),
resetExclusions()
)
.subscribe(() => null),
(err) => setMessages((arr) => arr.concat([`Error: ${err}`])),
() => setMessages((arr) => arr.concat(['Completed'])));
////////
return () => (sub.unsubscribe ? sub.unsubscribe() : null);
}, [iframe]);

return <>
<iframe {...defaultIframeProps} ref={iframe} src={lesMisNoPlayNoSplash} {...args} />
<pre>{messages.join('\n')}</pre>
</>
},
};

export const togglePanelFilters = {
render: (args) => {
const iframe = useRef(null);
Expand Down
6 changes: 3 additions & 3 deletions projects/client-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions projects/client-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphistry/client-api",
"version": "5.1.4",
"version": "5.1.5",
"description": "Client-side API for interacting with a Graphistry embedded visualization.",
"jsnext:main": "dist/index.js",
"config": {
Expand Down Expand Up @@ -85,7 +85,7 @@
"@graphistry/falcor-json-graph": "^2.9.10",
"@graphistry/falcor-model-rxjs": "2.11.0",
"@graphistry/falcor-socket-datasource": "2.11.3",
"@graphistry/js-upload-api": "^5.1.4",
"@graphistry/js-upload-api": "^5.1.5",
"shallowequal": "1.1.0"
},
"peerDependencies": {
Expand Down
28 changes: 28 additions & 0 deletions projects/client-api/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,20 @@ export function addFilters(expr) {
}
chainList.addFilters = addFilters;

/**
* Reset all filters in a visualization
* @function resetFilters
* @return {@link GraphistryState} A {@link GraphistryState} {@link Observable} that emits the result of the operation
* @example
* GraphistryJS(document.getElementById('viz'))
* .pipe(resetFilters())
* .subscribe();
*/
export function resetFilters() {
return makeCaller('view', 'filters.reset', []);
}
chainList.resetFilters = resetFilters;

/**
* Add an exclusion to the visualization with the given expression
* @function addExclusion
Expand Down Expand Up @@ -1254,6 +1268,20 @@ export function addExclusions(expr) {
}
chainList.addExclusions = addExclusions;

/**
* Reset all exclusions in a visualization
* @function resetExclusions
* @return {@link GraphistryState} A {@link GraphistryState} {@link Observable} that emits the result of the operation
* @example
* GraphistryJS(document.getElementById('viz'))
* .pipe(resetExclusions())
* .subscribe();
*/
export function resetExclusions() {
return makeCaller('view', 'exclusions.reset', []);
}
chainList.resetExclusions = resetExclusions;

/**
* UNSTABLE: Set the selection.
* Currently, this uses internal ids and will be updated to use external ids.
Expand Down
4 changes: 2 additions & 2 deletions projects/cra-template/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/cra-template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphistry/cra-template",
"version": "5.1.4",
"version": "5.1.5",
"private": true,
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down
4 changes: 2 additions & 2 deletions projects/cra-test-18/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions projects/cra-test-18/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "test18",
"version": "5.1.4",
"version": "5.1.5",
"private": true,
"dependencies": {
"@graphistry/client-api-react": "^5.1.4",
"@graphistry/client-api-react": "^5.1.5",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
6 changes: 3 additions & 3 deletions projects/cra-test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions projects/cra-test/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@graphistry/client-react-app-cra-test",
"version": "5.1.4",
"version": "5.1.5",
"private": true,
"dependencies": {
"@craco/craco": "^6.4.2",
"@graphistry/client-api-react": "^5.1.4",
"@graphistry/client-api-react": "^5.1.5",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^14.2.0",
Expand Down
2 changes: 1 addition & 1 deletion projects/js-upload-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion projects/js-upload-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphistry/js-upload-api",
"version": "5.1.4",
"version": "5.1.5",
"repository": {
"type": "git",
"url": "git+https://github.com/graphistry/graphistry-js.git"
Expand Down
2 changes: 1 addition & 1 deletion projects/node-api-test-cjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions projects/node-api-test-cjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphistry/node-api-test-cjs",
"version": "5.1.4",
"version": "5.1.5",
"description": "",
"main": "src/index.js",
"type": "commonjs",
Expand All @@ -16,7 +16,7 @@
"author": "Graphistry, Inc.",
"license": "Apache-2.0",
"dependencies": {
"@graphistry/node-api": "^5.1.4",
"@graphistry/node-api": "^5.1.5",
"apache-arrow": "^11.0.0"
}
}
2 changes: 1 addition & 1 deletion projects/node-api-test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions projects/node-api-test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphistry/node-api-test",
"version": "5.1.4",
"version": "5.1.5",
"description": "",
"main": "src/index.js",
"type": "module",
Expand All @@ -16,7 +16,7 @@
"author": "Graphistry, Inc.",
"license": "Apache-2.0",
"dependencies": {
"@graphistry/node-api": "^5.1.4",
"@graphistry/node-api": "^5.1.5",
"apache-arrow": "^11.0.0"
}
}
2 changes: 1 addition & 1 deletion projects/node-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions projects/node-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphistry/node-api",
"version": "5.1.4",
"version": "5.1.5",
"repository": {
"type": "git",
"url": "git+https://github.com/graphistry/graphistry-js.git"
Expand Down Expand Up @@ -74,7 +74,7 @@
"typescript": "^4.6.4"
},
"dependencies": {
"@graphistry/js-upload-api": "^5.1.4",
"@graphistry/js-upload-api": "^5.1.5",
"node-fetch-commonjs": "^3.2.4"
}
}