EdgeGrouping
Creates a transformation that groups edges.
Props
enabled
type:
boolean
default:
True
Whether the transformation is enabled or not.
duration
type:
number
default:
0
Animation duration.
events
type:
string | string[]
default:
'all'
values:
'all' | 'enabled' | 'disabled' | 'refreshed' | 'indexChanged' | 'destroyed'
Which events to register on.
options
type:
() => options:
EdgeGroupingOptionsdefault:
() => ({ })
Options for the transformation. See EdgeGroupingOptions.
Events
enabled
- payload:
transformation: EdgeGrouping
Emitted when the transformation is enabled.
disabled
- payload:
transformation: EdgeGrouping
Emitted when the transformation is disabled.
refreshed
- payload:
transformation: EdgeGrouping
Emitted when the transformation is refreshed.
indexChanged
- payload:
transformation: EdgeGrouping
Emitted when the transformation index is changed. See transformation pipeline.
Example
vue
<template>
...
<EdgeGrouping
:options="grouping.options"
:enabled="grouping.enabled"
:duration="grouping.duration"
@enabled="onEnabled"
/>
...
</template>
<script setup lang="ts">
import { EdgeGrouping, EdgeGroupingProps } from "@linkurious/ogma-vue";
const grouping = ref<EdgeGroupingProps>({
enabled: true,
duration: 1000,
options: {
selector: () => true,
groupIdFunction: (edge) => edge.getId() % 2,
},
});
function onEnabled(transformation) {
console.log("Enabled: ", transformation);
}
</script>