Cosmograph

Latest version: v0.0.47

Safety actively analyzes 723217 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

2.0.0

🪐 Cosmos 2.0 Public Beta

https://github.com/user-attachments/assets/bb02ca08-af3e-4d34-8a36-4d420ee5481f

Cosmos 2.0 goes low level to give you even better performance! Check out the [migration guide](https://github.com/cosmograph-org/cosmos/blob/main/cosmos-2-0-migration-notes.md) and our [Storybook app](https://cosmograph-org.github.io/cosmos/?path=/docs/welcome-to-cosmos--docs) for more details.

New features:
- Point Dragging
- Clustering Force
- Configurable Link Strength

Current release is a public beta but it should be stable enough to try it out!

Also we're announcing Cosmograph for 🐍 Python! More about it — [on our website](https://cosmograph.app/docs/cosmograph/Cosmograph%20Python/get-started-widget/).

1.6.0

What's new

* **Support for accessor function in `linkArrows`:** Added support for using accessor function in `linkArrows` to customize the appearance of the arrows. This feature was contributed by [WanQiyang](https://github.com/WanQiyang).
* **Support for linking to minified library:** Added support for linking to the minified version of the library through jsDelivr CDN links.
* **Initial zoom behavior updates:** The `initialZoomLevel` configuration parameter is now `undefined` by default. If `initialZoomLevel` is set, the view will not be fit to the initial zoom level.
* **Zoom the view without d3 transition:** Zoom the view without d3 transition if the duration parameter is 0.
* **Support color with transparency in `backgroundColor` configuration property:** For example, `rgba(0, 0, 0, 0)` would set the background color to black with no opacity. Thanks [miklevin](https://github.com/miklevin) for raising issue in the cosmograph-issues repository (https://github.com/cosmograph-org/cosmograph-issues/issues/14).
* **Improved point detection accuracy on mouse hover**
* **Paddings when Fitting the View:** When fitting the view, the paddings are now taken into account as a percentage of the view size.




Fixes

* **Canvas Resizing:** Previously, centering of the view was lost when resizing the canvas. Now, the centering is saved during resizing.

Optimization

* **Prevent Maximum call stack size exceeded:** Calculating the minimum and maximum values using `Math.min` and `Math.max` with spread operators can lead to Maximum call stack size exceeded error, especially when dealing with large arrays. To address this issue, the d3-array `extend` method is used instead, which is more memory-efficient and provides the same functionality.

Bumps

* `ttypescript` from 1.5.13 to 1.5.15

1.5.1

Cosmograph 1.5 brings a few exciting new features, along with bug fixes and optimizations.

What's new

* **Node Sampling**: A new method `getSampledNodePositionsMap` has been introduced to enable you to sample a number of evenly distributed nodes visible on the screen. It comes in handy when you want to implement feature like dynamic node labels. You can control the number of nodes in the sample by specifying the `nodeSamplingDistance` configuration parameter. Thanks to this feature, we were able to introduce dynamic node labels in the latest [Cosmograph.app](https://cosmograph.app/) update:

![](https://github.com/cosmograph-org/cosmos/assets/755708/edd8e969-c661-4888-9c6d-09b6c98fb919)

* **Fitting Nodes in the Scene on Initialization**: Cosmos will now center and zoom the view to include all nodes in the scene upon initialization. You can use the following configuration options to control this behavior: `fitViewOnInit`, `fitViewDelay`, and `fitViewByNodesInRect`.

![](https://github.com/cosmograph-org/cosmos/assets/755708/c931ede6-075b-4c01-8b12-ee4849b4ad2e)

* **Rescaling Initial Position of Nodes**: To avoid issues related to nodes having coordinates outside the simulation space boundaries, Cosmos will now rescale the initial coordinates of the nodes to fit within the simulation space if the simulation is active. This is useful when you load a graph with pre-calculated initial coordinates and want Cosmos to calculate the force layout for it.

Fixes
* We have resolved the issue of switching between curve/straight line rendering after Cosmos initialization.

Optimization
* Node sizes are now stored in an array for faster access.

1.4.0

In version `1.4` Cosmos introduces features like curved links, enhanced node focus/hover distinctions with new configurations, options for initial zoom level and disabling zoom/simulation, and more.

![cosmos-curved-links](https://github.com/cosmograph-org/cosmos/assets/755708/102a39db-c068-4ac5-a4fc-8276db0a66e3)

What's new:

* **Curved Links**: The `curvedLinks` config parameter turns line curvature on/off.

* **New `onTick` callback arguments:** The hovered `node`, `index`, and `nodePosition` are now available as second, third, and fourth callback arguments.

* **Hovered and focused nodes introduced:** We've separated the highlighted nodes into two categories: hovered and focused nodes. We also added new methods to control the focused node such as `setFocusedNodeById` and `setFocusedNodeByIndex`. Additionally, we have introduced new configuration parameters that allow for more customization, such as `renderHoveredNodeRing`, `hoveredNodeRingColor`, and `focusedNodeRingColor`. These new changes will be available alongside the old configurations to ensure compatibility until version 2.0. For more detailed information, please see our wiki page.

* Adjusted transparency of the hovered and focused node's ring:** The transparency of the hovered and focused node's ring is now inherited from the parent node.
* **Assigning the initial zoom level to the graph when it is first created:** The `initialZoomLevel' configuration parameter can be set once during graph initialization.
* **Disable Zooming**. If the `disableZoom` configuration parameter is set to `true`, zooming in and out using the mouse wheel is disabled.
* Cosmos can be run without the simulation, e.g. if you just want to visualize your data set with provided node coordinates. Use the `disableSimulation` config parameter to turn on that behavior (please note that it can be set on graph initialization only).

Fixes:

* Smart destruction of WebGL buffers and frame buffers and preventing a zero-sized texture from attaching to a WebGL frame buffer.

* Cosmos will not crash if there are no nodes or links.

* Fixed the `fitView` method execution, when calling before the animation starts.

* Adjusting `spaceSize` if it exceeds the WebGL limit (https://github.com/cosmograph-org/cosmos/issues/49#issuecomment-1484667398).
* Cosmos can now run the simulation even if the graph contains only nodes and no links.
* We made the `graph` property public in the main `Graph` class (where the data processing takes place).
* Added a second argument - `index` to the config accessor functions `nodeSize` and `nodeColor`.

Optimization
* We have improved the method for finding the hovered node to minimize the chance of slowdowns or lags.

Other
* We've also added a citation file that you can use if you use Cosmos or Cosmograph.

1.3.0

Release 1.3 of Cosmos implements a bunch of new features making your work with graphs way more comfortable. Our personal highlight is the `trackNodePositionsBy` methods allowing you to continuously get coordinates for chosen nodes and render labels for them.

We deliberately decided not to add labels rendering functionality to Cosmos itself to keep the library tiny. Instead we've created a separate package [`interacta/css-labels`](https://www.npmjs.com/package/interacta/css-labels) that you can use along with Cosmos to add labels to your graph. Check out [this CodeSanbox example](https://codesandbox.io/s/cosmos-node-labels-hkfplk) for copy-pastable sample code.


![](https://user-images.githubusercontent.com/755708/227098266-b189ff5b-6a77-4e45-8a7b-f065feef07ce.mp4)

What's new:
* 🤖 **New API methods** `getNodeRadiusByIndex`, `getNodeRadiusById`, `spaceToScreenPosition`, `spaceToScreenRadius`, `trackNodePositionsByIds`, `trackNodePositionsByIndices` and `getTrackedNodePositionsMap`;
* 🌱 **Random seed**. You can now provide `randomSeed` in the [config](https://github.com/cosmograph-org/cosmos/wiki/Cosmos-configuration). It allows you to control the randomness of the layout across different simulation runs. This feature was implemented thanks to jorrit-hdrn's feedback in issue #19;
* 🖱️ **Mouse events**. You can now add callbacks to `onMouseMove`, `onNodeMouseOver` and `onNodeMouseOut` events in the [config](https://github.com/cosmograph-org/cosmos/wiki/Cosmos-configuration);
* ⚪ **Highlight nodes with a ring** when hovered or clicked. Config properties `renderHighlightedNodeRing` allow you to turn on/off highlighting and `highlightedNodeRingColor` allow you to set the color of the ring 24;
* 🔍 **Define scale when zooming to a node programmatically**. New arguments `scale` and `canZoomOut` are available in the `zoomToNodeById` and `zoomToNodeByIndex` methods;
* 👨‍💻 **Renamed Types**: `InputNode` to `CosmosInputNode` and `InputLink` to `CosmosInputLink` (old naming will also be available till version 2.0 to preserve compatibility).

1.2.0

What's new:
* **Zoom events**. You can now add callbacks to `onZoomStart`, `onZoom` and `onZoomEnd` events in the [config](https://github.com/cosmograph-org/cosmos#cosmos_configuration);
* **New API method** `fitViewByNodeIds`. This feature was implemented thanks to GoodNovember's feedback in issue 13.

Fixed:
* More precise point search on mouse click.

Page 1 of 2

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.