This is a repositiory of style presets for Ogma graph visualisation library. You can use them in your prototypes and applications.
- How to use
- Themes:
- Color Schemes
- Copyright
npm install -S @linkurious/ogma-styles
# or
yarn add @linkurious/ogma-styles
Alternatively, you can use the CDN-hosted version
<script src="https://cdn.jsdelivr.net/npm/@linkurious/ogma-styles@0.0.4/dist/index.min.js"></script>
...
<script>
// themes are globally exposed as `ogmaStyles`
const themes = ogmaStyles;
</script>import { Ogma } from '@linkurious/ogma';
import { midsummerNight as theme } from '@linkurious/ogma-styles'
const ogma = new Ogma({ ... });
ogma.styles.setTheme(theme);import { Ogma } from '@linkurious/ogma';
import { midsummerNight as theme } from '@linkurious/ogma-styles'
const ogma = new Ogma({
...
});
ogma.styles.setTheme(theme);
// you can also use the theme's colors for your UI
console.log(theme.colors.red); // '#df162e'midsummer-night exports several constants for you to apply when you need conditional styling.
edgeOutlineWidth: 2,
edgeHaloWidth: 8,
nodeHaloWidth: 20,
// you can also use different colors for the nodes and edges
colors: {}You can follow the examples in src to create your own theme.
The repositiory uses TypeScript for checking the types of attributes, so you will not get lost. You can always try out your theme in Ogma playground
If you want to share it, send us a pull request and we will check and publish it.
import { Ogma } from '@linkurious/ogma';
import { afternoonNap as theme } from '@linkurious/ogma-styles'
const ogma = new Ogma({
...
});
ogma.styles.setTheme(theme);
// you can also use the theme's constants for your UI
console.log(theme.colors.nodeHaloWidth); // 40import { Ogma } from '@linkurious/ogma';
import { morningBreeze as theme } from '@linkurious/ogma-styles'
const ogma = new Ogma({
...
});
ogma.styles.setTheme(theme);
// you can also use the theme's constants for your UI
console.log(theme.colors.nodeHaloWidth); // 40The package includes a collection of carefully selected color palettes for data visualization, including Paul Tol's scientifically designed color schemes and custom categorical palettes.
#44AA99 #FFCB2F #FF7523 #FF9AAC #80E5CA #0099FF #1450DD #9386CE
#617083
#44AA99 #FFCB2F #FF7523 #FF9AAC #80E5CA #0099FF #1450DD #9386CE
#617083 #E74C3C #2ECC71 #F39C12 #8E44AD #34495E #16A085 #D35400
#44AA99 #FFCB2F #FF7523 #FF9AAC #80E5CA #0099FF #1450DD #9386CE
#617083 #E74C3C #2ECC71 #F39C12 #8E44AD #34495E #16A085 #D35400
#27AE60 #E67E22 #9B59B6 #3498DB #F1C40F #E91E63 #00BCD4 #795548
#4477AA #66CCEE #228833 #CCBB44 #EE6677 #AA3377 #BBBBBB
#DDAA33 #BB5566 #004488 #000000
#0077BB #33BBEE #009988 #EE7733 #CC3311 #EE3377 #BBBBBB
#332288 #88CCEE #44AA99 #117733 #999933 #DDCC77 #CC6677 #882255
#AA4499
#EECC66 #EE99AA #6699CC #997700 #994455 #004488 #000000
#BBCCEE #CCEEFF #CCDDAA #EEEEBB #FFCCCC #DDDDDD
#000000 #E69F00 #56B4E9 #009E73 #F0E442 #0072B2 #D55E00 #CC79A7
import {
categorical,
categorical16,
categorical24,
contrastLight,
vibrant,
muted
} from '@linkurious/ogma-styles/colors';
// Use with Ogma node styling
ogma.styles.addNodeStyle({
color: (node, index) => categorical[index % categorical.length]
});
// Use for custom color mapping
const nodeColors = categorical16.slice(0, myCategories.length);
ogma.styles.addNodeStyle({
color: node => nodeColors[node.getData('category') % nodeColors.length]
});
// Access individual colors
console.log(vibrant[0]); // '#0077BB'
console.log(categorical24.length); // 24- Categorical schemes are optimized for maximum visual distinction
- Paul Tol schemes are scientifically designed for accessibility and perceptual uniformity
- Wong scheme is colorblind-friendly
- All colors are provided as hex strings (e.g., '#44AA99')
Linkurious SAS © 2025





