Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cosmograph/cosmos

Package Overview
Dependencies
Maintainers
0
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmograph/cosmos - npm Package Compare versions

Comparing version 2.0.0-beta.1 to 2.0.0-beta.2

12

dist/config.d.ts
import { D3ZoomEvent } from 'd3-zoom';
import { D3DragEvent } from 'd3-drag';
import { type Hovered } from "./modules/Store";
import { type Hovered } from '@/graph/modules/Store';
export interface GraphEvents {

@@ -219,3 +219,3 @@ /**

* Turns ring rendering around a point on hover on / off
* Default value: `true`
* Default value: `false`
*/

@@ -239,3 +239,3 @@ renderHoveredPointRing?: boolean;

/**
* Link color accessor function or hex value.
* The default color hex value to use for links when no link colors are provided or if the color value in the array is `undefined` or `null`.
* Default value: '#666666'

@@ -250,3 +250,3 @@ */

/**
* Link width value in pixels.
* The default width value to use for links when no link widths are provided or if the width value in the array is `undefined` or `null`.
* Default value: `1`

@@ -283,3 +283,3 @@ */

/**
* Link arrow value that controls whether or not to display link arrows.
* The default link arrow value that controls whether or not to display link arrows.
* Default value: `false`

@@ -349,3 +349,3 @@ */

* Disables dragging points.
* Default: `false`
* Default: `true`
*/

@@ -352,0 +352,0 @@ disableDrag?: boolean;

import regl from 'regl';
export declare const isFunction: <T>(a: T) => boolean;
export declare const isArray: <T>(a: unknown) => a is T[];
export declare const isArray: <T>(a: unknown | T[]) => a is T[];
export declare const isObject: <T>(a: T) => boolean;

@@ -5,0 +5,0 @@ export declare const isAClassInstance: <T>(a: T) => boolean;

import 'd3-transition';
import { GraphConfig, GraphConfigInterface } from "./config";
import { GraphData } from "./modules/GraphData";
import { GraphConfig, GraphConfigInterface } from '@/graph/config';
import { GraphData } from '@/graph/modules/GraphData';
export declare class Graph {

@@ -5,0 +5,0 @@ config: GraphConfig;

import regl from 'regl';
import { GraphConfigInterface } from "../config";
import { GraphData } from "./GraphData";
import { Points } from "./Points";
import { Store } from "./Store";
import { GraphConfigInterface } from '@/graph/config';
import { GraphData } from '@/graph/modules/GraphData';
import { Points } from '@/graph/modules/Points';
import { Store } from '@/graph/modules/Store';
export declare class CoreModule {

@@ -7,0 +7,0 @@ readonly reglInstance: regl.Regl;

@@ -1,3 +0,3 @@

import { Store } from "../Store";
import { GraphConfigInterface } from "../../config";
import { Store } from '@/graph/modules/Store';
import { GraphConfigInterface } from '@/graph/config';
export declare class Drag {

@@ -4,0 +4,0 @@ readonly store: Store;

@@ -1,2 +0,2 @@

import { CoreModule } from "../core-module";
import { CoreModule } from '@/graph/modules/core-module';
export declare class ForceCenter extends CoreModule {

@@ -3,0 +3,0 @@ private centermassFbo;

@@ -1,2 +0,2 @@

import { CoreModule } from "../core-module";
import { CoreModule } from '@/graph/modules/core-module';
export declare class ForceGravity extends CoreModule {

@@ -3,0 +3,0 @@ private runCommand;

export declare function forceFrag(maxLinks: number): string;
import regl from 'regl';
import { CoreModule } from "../core-module";
import { CoreModule } from '@/graph/modules/core-module';
export declare enum LinkDirection {

@@ -4,0 +4,0 @@ OUTGOING = "outgoing",

@@ -1,2 +0,2 @@

import { CoreModule } from "../core-module";
import { CoreModule } from '@/graph/modules/core-module';
export declare class ForceManyBody extends CoreModule {

@@ -3,0 +3,0 @@ private randomValuesFbo;

export declare function forceFrag(startLevel: number, maxLevels: number): string;

@@ -1,2 +0,2 @@

import { CoreModule } from "../core-module";
import { CoreModule } from '@/graph/modules/core-module';
export declare class ForceManyBodyQuadtree extends CoreModule {

@@ -3,0 +3,0 @@ private randomValuesFbo;

export declare function forceFrag(startLevel: number, maxLevels: number): string;

@@ -1,2 +0,2 @@

import { CoreModule } from "../core-module";
import { CoreModule } from '@/graph/modules/core-module';
export declare class ForceMouse extends CoreModule {

@@ -3,0 +3,0 @@ private runCommand;

export declare const benchCSS = "\n #gl-bench {\n position:absolute;\n right:0;\n top:0;\n z-index:1000;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n #gl-bench div {\n position: relative;\n display: block;\n margin: 4px;\n padding: 0 7px 0 10px;\n background: #5f69de;\n border-radius: 15px;\n cursor: pointer;\n opacity: 0.9;\n }\n #gl-bench svg {\n height: 60px;\n margin: 0 -1px;\n }\n #gl-bench text {\n font-size: 12px;\n font-family: Helvetica,Arial,sans-serif;\n font-weight: 700;\n dominant-baseline: middle;\n text-anchor: middle;\n }\n #gl-bench .gl-mem {\n font-size: 9px;\n }\n #gl-bench line {\n stroke-width: 5;\n stroke: #112211;\n stroke-linecap: round;\n }\n #gl-bench polyline {\n fill: none;\n stroke: #112211;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 3.5;\n }\n #gl-bench rect {\n fill: #8288e4;\n }\n #gl-bench .opacity {\n stroke: #8288e4;\n }\n";

@@ -0,0 +0,0 @@ export declare class FPSMonitor {

@@ -1,2 +0,2 @@

import { GraphConfig } from "../../config";
import { GraphConfig } from '@/graph/config';
export declare class GraphData {

@@ -19,3 +19,3 @@ inputPointColors: number[] | undefined;

* Each inner array of `sourceIndexToTargetIndices` and `targetIndexToSourceIndices` contains pairs where:
* - The first value is the target/source index in the node array.
* - The first value is the target/source index in the point array.
* - The second value is the link index in the array of links.

@@ -22,0 +22,0 @@ */

export declare const getCurveLineGeometry: (segments: number) => number[][];

@@ -1,2 +0,2 @@

import { CoreModule } from "../core-module";
import { CoreModule } from '@/graph/modules/core-module';
export declare class Lines extends CoreModule {

@@ -3,0 +3,0 @@ private drawCurveCommand;

import regl from 'regl';
export declare function createGreyoutStatusBuffer(selectedIndices: Float32Array | null, reglInstance: regl.Regl, textureSize: number): regl.Framebuffer2D | undefined;
import regl from 'regl';
import { CoreModule } from "../core-module";
import { CoreModule } from '@/graph/modules/core-module';
export declare class Points extends CoreModule {

@@ -4,0 +4,0 @@ currentPositionFbo: regl.Framebuffer2D | undefined;

import regl from 'regl';
export declare function createTrackedPositionsBuffer(indices: number[], reglInstance: regl.Regl): regl.Framebuffer2D;
export declare function createTrackedIndicesBuffer(indices: number[], pointsTextureSize: number, reglInstance: regl.Regl): regl.Framebuffer2D | undefined;

@@ -0,0 +0,0 @@ import regl from 'regl';

import { mat3 } from 'gl-matrix';
export declare const ALPHA_MIN = 0.001;
export declare const MAX_POINT_SIZE = 64;
export declare type Hovered = {
export type Hovered = {
index: number;
position: [number, number];
};
declare type Focused = {
type Focused = {
index: number;

@@ -10,0 +10,0 @@ };

import { ZoomTransform } from 'd3-zoom';
import { Store } from "../Store";
import { GraphConfigInterface } from "../../config";
import { Store } from '@/graph/modules/Store';
import { GraphConfigInterface } from '@/graph/config';
export declare class Zoom {

@@ -5,0 +5,0 @@ readonly store: Store;

@@ -22,2 +22,3 @@ export declare const defaultPointColor = "#b3b3b3";

linkVisibilityMinTransparency: number;
renderHoveredPointRing: boolean;
hoveredPointRingColor: string;

@@ -24,0 +25,0 @@ focusedPointRingColor: string;

{
"name": "@cosmograph/cosmos",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"description": "GPU-based force graph layout and rendering",

@@ -35,2 +35,3 @@ "jsdelivr": "dist/index.min.js",

"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/d3-array": "^3.0.3",

@@ -57,5 +58,3 @@ "@types/d3-color": "^3.1.0",

"rollup-plugin-glslify": "^1.3.0",
"rollup-plugin-typescript2": "^0.32.1",
"ttypescript": "^1.5.15",
"typescript": "^4.7.4"
"typescript": "^5.5.2"
},

@@ -62,0 +61,0 @@ "dependencies": {

@@ -7,4 +7,3 @@ import path from 'path'

import glslify from 'rollup-plugin-glslify'
import typescript from 'rollup-plugin-typescript2'
import ttypescript from 'ttypescript'
import typescript from '@rollup/plugin-typescript'
import pkg from './package.json'

@@ -41,5 +40,3 @@

}),
typescript({
typescript: ttypescript,
}),
typescript(),
alias({

@@ -46,0 +43,0 @@ resolve: ['', '/index.ts', '.ts'],

@@ -243,3 +243,3 @@ import { D3ZoomEvent } from 'd3-zoom'

* Turns ring rendering around a point on hover on / off
* Default value: `true`
* Default value: `false`
*/

@@ -266,3 +266,3 @@ renderHoveredPointRing?: boolean;

/**
* Link color accessor function or hex value.
* The default color hex value to use for links when no link colors are provided or if the color value in the array is `undefined` or `null`.
* Default value: '#666666'

@@ -277,3 +277,3 @@ */

/**
* Link width value in pixels.
* The default width value to use for links when no link widths are provided or if the width value in the array is `undefined` or `null`.
* Default value: `1`

@@ -310,3 +310,3 @@ */

/**
* Link arrow value that controls whether or not to display link arrows.
* The default link arrow value that controls whether or not to display link arrows.
* Default value: `false`

@@ -377,3 +377,3 @@ */

* Disables dragging points.
* Default: `false`
* Default: `true`
*/

@@ -423,3 +423,3 @@ disableDrag?: boolean;

public pointSizeScale = defaultConfigValues.pointSizeScale
public renderHoveredPointRing = true
public renderHoveredPointRing = defaultConfigValues.renderHoveredPointRing
public hoveredPointRingColor = defaultConfigValues.hoveredPointRingColor

@@ -426,0 +426,0 @@ public focusedPointRingColor = defaultConfigValues.focusedPointRingColor

@@ -340,3 +340,5 @@ import { select, Selection } from 'd3-selection'

if (!this.graph.pointsNumber && !this.graph.linksNumber) {
this.stopFrames()
this.destroyParticleSystem()
select(this.canvas).style('cursor', null)
this.reglInstance.clear({

@@ -528,3 +530,3 @@ color: this.store.backgroundColor,

} else {
this.store.selectedIndices = new Float32Array(indices.filter((d): d is number => d !== undefined))
this.store.selectedIndices = new Float32Array(indices.filter(d => d !== undefined))
}

@@ -684,2 +686,3 @@

this.destroyParticleSystem()
select(this.canvas).style('cursor', null)
this.fpsMonitor?.destroy()

@@ -686,0 +689,0 @@ document.getElementById('gl-bench-style')?.remove()

@@ -23,3 +23,3 @@ import { getRgbaColor, isNumber } from '@/graph/helper'

* Each inner array of `sourceIndexToTargetIndices` and `targetIndexToSourceIndices` contains pairs where:
* - The first value is the target/source index in the node array.
* - The first value is the target/source index in the point array.
* - The second value is the link index in the array of links.

@@ -26,0 +26,0 @@ */

@@ -23,2 +23,3 @@ export const defaultPointColor = '#b3b3b3'

linkVisibilityMinTransparency: 0.25,
renderHoveredPointRing: false,
hoveredPointRingColor: 'white',

@@ -25,0 +26,0 @@ focusedPointRingColor: 'white',

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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