New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cosmograph/cosmograph

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmograph/cosmograph - npm Package Compare versions

Comparing version 0.0.6-beta.2 to 0.0.6

32

modules/cosmograph/config.d.ts

@@ -67,3 +67,11 @@ import { CosmosInputLink, CosmosInputNode, GraphConfigInterface, GraphSimulationSettings, GraphEvents } from '@cosmograph/cosmos';

onSetData?: (nodes: N[], links: L[]) => void;
/**
* Callback function that will be called when the nodes was filtered by Node Crossfilter.
* Default: `undefined`
*/
onNodesFiltered?: (filteredNodes: N[] | undefined) => void;
/**
* Callback function that will be called when the links was filtered by Link Crossfilter.
* Default: `undefined`
*/
onLinksFiltered?: (filteredLinks: L[] | undefined) => void;

@@ -129,6 +137,30 @@ } & GraphEvents<N> & {

simulationFriction?: GraphSimulationSettings<N>['friction'];
/**
* Callback function that will be called when the simulation starts.
* Default value: `undefined`
*/
onSimulationStart?: GraphSimulationSettings<N>['onStart'];
/**
* Callback function that will be called on every tick of the simulation.
* The value of the first argument `alpha` will decrease over time as the simulation
* "cools down". If there's a node under the cursor, its datum will be passed as the second argument,
* index as the third argument and position as the fourth argument:
* (alpha: number, node: Node | undefined, index: number | undefined, nodePosition: [number, number] | undefined) => void. Default value: undefined
* Default value: `undefined`
*/
onSimulationTick?: GraphSimulationSettings<N>['onTick'];
/**
* Callback function that will be called when the simulation stops.
* Default value: `undefined`
*/
onSimulationEnd?: GraphSimulationSettings<N>['onEnd'];
/**
* Callback function that will be called when the simulation is paused.
* Default value: `undefined`
*/
onSimulationPause?: GraphSimulationSettings<N>['onPause'];
/**
* Callback function that will be called when the simulation is restarted.
* Default value: `undefined`
*/
onSimulationRestart?: GraphSimulationSettings<N>['onRestart'];

@@ -135,0 +167,0 @@ };

@@ -31,15 +31,71 @@ import { Graph, CosmosInputNode, CosmosInputLink } from '@cosmograph/cosmos';

get data(): CosmographData<N, L>;
/**
* Sets the data for the graph.
* @param nodes - Nodes to be added to the graph.
* @param links - Links to be added to the graph.
*/
setData(nodes: N[], links: L[]): void;
/**
* Sets the config for the graph.
* @param config - Config to be applied to the graph.
*/
setConfig(config?: CosmographInputConfig<N, L>): void;
/**
* Creates a filter for the nodes, adds the filter to the nodes crossfilter and returns this filter.
*/
addNodesFilter(): Filter<N>;
/**
* Creates a filter for the links, adds the filter to the links crossfilter and returns this filter.
*/
addLinksFilter(): Filter<L>;
/**
* Selects nodes inside a rectangular area.
* @param selection Array of two corners of the rectangle `[[left, top], [right, bottom]]`.
* The `left` and `right` coordinates should be relative to the width of the canvas. The
* `top` and `bottom` coordinates should be relative to the height of the canvas.
*/
selectNodesInRange(selection: [[number, number], [number, number]] | null): void;
/**
* Selects nodes.
* @param nodes Array of nodes to be selected.
*/
selectNodes(nodes: N[]): void;
/**
* Selects a node and, optionally, select its connected nodes.
* @param node Selected node.
* @param selectAdjacentNodes Optional parameter determining whether to also select the connected nodes.
*/
selectNode(node: N, selectAdjacentNodes?: boolean): void;
/**
* Unselects all nodes.
*/
unselectNodes(): void;
/**
* Center the view and zoom in to a node.
* @param node Node to be zoomed in.
*/
zoomToNode(node: N): void;
/**
* Set focus on a node. A ring will be drawn around the focused node.
* If no node is focused, the ring will be cleared.
* @param node Node to be focused.
*/
focusNode(node?: N): void;
/**
* Starts the simulation.
* @param alpha Value between 0 and 1. The higher the value,
* the more initial energy the simulation will get.
*/
start(alpha?: number): void;
/**
* Pause the simulation.
*/
pause(): void;
/**
* Restarts the simulation.
*/
restart(): void;
/**
* Destroy the graph and clean up the context.
*/
remove(): void;

@@ -46,0 +102,0 @@ private _createCosmosConfig;

@@ -10,2 +10,6 @@ import { CosmosInputLink, CosmosInputNode } from '@cosmograph/cosmos';

constructor(cosmograph: Cosmograph<CosmosInputNode, CosmosInputLink>, targetElement: HTMLElement, config?: CosmographHistogramInputConfig<OutDatum, InDatum>);
/**
* Sets the config for the histogram.
* @param config Configuration to be applied to the histogram.
*/
setConfig(config?: CosmographHistogramInputConfig<OutDatum, InDatum>): void;

@@ -20,3 +24,9 @@ /** `getCurrentSelection`: Returns current brush selection. */

setSelection(selection?: [number, number]): void;
/**
* Returns current histogram configuration.
*/
getConfig(): CosmographHistogramConfigInterface<OutDatum, InDatum>;
/**
* Destroy the histogram instance.
*/
remove(): void;

@@ -23,0 +33,0 @@ private _createHistogramConfig;

4

modules/search/config.d.ts
import { CosmosInputNode } from '@cosmograph/cosmos';
import type { SearchConfigInterface, SearchEvents } from '@cosmograph/ui';
export type CosmographSearchConfigInterface<N extends CosmosInputNode> = {
/**
* Callback function that will be called when the user selects an item from the suggestions list.
* Provides selected node as argument.
*/
onSelectResult?: (node?: N) => void;

@@ -5,0 +9,0 @@ } & Omit<SearchEvents<N>, 'onSelect'>;

@@ -11,2 +11,6 @@ import { CosmosInputNode, CosmosInputLink } from '@cosmograph/cosmos';

constructor(cosmograph: Cosmograph<CosmosInputNode, CosmosInputLink>, targetElement: HTMLElement, config?: CosmographTimelineInputConfig<Datum>);
/**
* Sets the configuration for the timeline.
* @param config Configuration to be applied to the timeline.
*/
setConfig(config?: CosmographTimelineInputConfig<Datum>): void;

@@ -13,0 +17,0 @@ /** `getCurrentSelection`: Returns current brush selection in data units (`Date` or `number`). */

4

package.json
{
"name": "@cosmograph/cosmograph",
"version": "0.0.6-beta.2",
"version": "0.0.6",
"description": "Cosmograph: The fastest web-based graph visualization library",

@@ -12,3 +12,3 @@ "author": "cosmograph-org",

"@cosmograph/cosmos": "1.5.0-beta.0",
"@cosmograph/ui": "0.0.6-beta.2",
"@cosmograph/ui": "0.0.6",
"@interacta/css-labels": "^0.0.11",

@@ -15,0 +15,0 @@ "crossfilter2": "^1.5.4",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc