Skip to content

Releases: cosmograph-org/cosmos

Release v1.6

14 Mar 15:49
Compare
Choose a tag to compare

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.
  • 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 for raising issue in the cosmograph-issues repository (cosmograph-org/cosmograph-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

Release v1.5

29 Dec 02:28
df0613e
Compare
Choose a tag to compare

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 update:

  • 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.

  • 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.

Release v1.4

18 Sep 01:26
Compare
Choose a tag to compare

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

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 (#49 (comment)).

  • 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.

Release v1.3

23 Mar 04:45
Compare
Choose a tag to compare

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 that you can use along with Cosmos to add labels to your graph. Check out this CodeSanbox example for copy-pastable sample code.

What's new:

  • πŸ€– New API methods getNodeRadiusByIndex, getNodeRadiusById, spaceToScreenPosition, spaceToScreenRadius, trackNodePositionsByIds, trackNodePositionsByIndices and getTrackedNodePositionsMap;
  • 🌱 Random seed. You can now provide randomSeed in the config. 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;
  • βšͺ 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).

Release v1.2.0

02 Dec 03:24
Compare
Choose a tag to compare

What's new:

  • Zoom events. You can now add callbacks to onZoomStart, onZoom and onZoomEnd events in the config;
  • New API method fitViewByNodeIds. This feature was implemented thanks to @GoodNovember's feedback in issue #13.

Fixed:

  • More precise point search on mouse click.

Release v1.1.3

12 Nov 15:59
Compare
Choose a tag to compare

What's new:

  • Selecting adjacent nodes. We've added a second argument to the selectNodeById and selectNodeByIndex API methods for selecting adjacent nodes. When it's true, calling those functions will also select the adjacent nodes to the specified node. The default value is false. This feature was implemented thanks to @GoodNovember's feedback in issue #13.
  • New API method getAdjacentNodes.
  • Empty selection. You can now set an empty selection by providing an empty array to the selectNodesByIds and selectNodesByIndices API methods. If you want to reset the selection, pass null.

See version 1.1.0 release notes for the latest new features announcement.

Release v1.1.2

18 Oct 04:32
Compare
Choose a tag to compare

Fixes:

  • Adding "type":"module" to package.json for correct library import

See version 1.1.0 release notes for the latest new features announcement.

Release v1.1.1

11 Oct 15:11
Compare
Choose a tag to compare

Fixes:

  • #9 getNodePositions returns incorrect positions
  • Vulnerability detected in d3-color

See version 1.1.0 release notes for the latest new features announcement.

Release v1.1.0

04 Oct 04:21
Compare
Choose a tag to compare

Cosmos 1.1.0 introduces a number of graph interactions, such as:

  • Select a node or multiple nodes by their indices or ids;
  • Select all nodes in a rectangular area;
  • Zoom to a specific node;
  • Fit the graph view to contain all the nodes.

There're three new configuration properties:

  • nodeGreyoutOpacity and linkGreyoutOpacity allow you to set the opacity of non-selected nodes and links when selection is active;
  • scaleNodesOnZoom (true by default) enables node scaling depending on the zoom level. This will allow to easier pick a node when you zoom in.

The onClick callback will now have four arguments instead of two: node, its index, position, and the corresponding event.

You can find the full list of available methods and properties in the readme file. We've also updated our CodeSandbox example to show you how to use them.

cosmos-1 1 0-codesandbox

Nikita & The Cosmograph Team

Release v1.0.0

10 Jun 16:42
Compare
Choose a tag to compare

The first public release