Ogma 4.0: new events API, easier styling, best practices tutorial

September 10, 2021

Ogma 4.0.0 focuses on maintenance and API, delivering new features that will make your life easier, such as improving our events API and simplifying the application of a global styling to your visualization. This version also contains a breaking change of the package name.

Package renaming

For security and integrity reasons, and in order to avoid confusion with another public package on npm that goes by the same name, we’ve decided to change the Ogma name to @linkurious/ogma. It will affect your code, but it only means that you have to change your import statements to use it.

New events API

We are proud to announce that Ogma’s events API has been completely reworked for a more intuitive and easy-to-use events system. Ogma now provides on/off/once methods for every event and allows you to register them by name rather than through a specific method. We also provide a better typescript integration for this new API, with strong event types.

New setTheme API

Ogma 4.0.0 comes with a new way of styling your visualization: ogma.styles.setTheme. It allows you to specify default styles for nodes and edges and to customize selected/hovered styles in a single API call. We also built example themes that you can download from here, and a new example showing you how to use themes.

Apply a beautiful color style to your visualization with just one line of code, thanks to our example themes.

New getAdjacentElements method

From now on, elements and elementLists provide a new method: getAdjacentElements. It returns the lists of neighboring nodes and edges and is available for nodes, edges, nodeLists and edgeLists.

Best practices tutorial

We’re always looking for ways to help you get the most out of Ogma. Now, the documentation has been enriched with a tutorial on the best practices. Check it out to learn more on how to keep your visualizations up to speed and easy to maintain.

Ogma 4.0.0 aims to be more secure and easier to use, with new methods enabling faster development. As always, please get in touch with us for any questions or if you’d like to learn more about these latest updates.

Subscribe to our newsletter

A spotlight on graph technology directly in your inbox.