EdgeFilter
Creates a transformation that filters edges based on a criteria.
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:
() => ({ criteria: (edge:
Edge) => Boolean })
default:
() => ({ criteria: () => true })
Options for the transformation. See EdgeFilterOptions. Criteria is a function that takes an edge as parameter and returns a boolean.
Events
enabled
- payload:
transformation: EdgeFilter
Emitted when the transformation is enabled.
disabled
- payload:
transformation: EdgeFilter
Emitted when the transformation is disabled.
refreshed
- payload:
transformation: EdgeFilter
Emitted when the transformation is refreshed.
indexChanged
- payload:
transformation: EdgeFilter
Emitted when the transformation index is changed. See transformation pipeline.
Example
<template>
...
<EdgeFilter
:enabled="filter.enabled"
:duration="filter.duration"
:options="filter.options"
@enabled="onEnabled"
/>
...
</template>
<script setup lang="ts">
import { EdgeFilter, EdgeFilterProps } from "@linkurious/ogma-vue";
const filter = ref<EdgeFilterProps>({
enabled: true,
duration: 1000,
options: {
criteria: () => true,
},
});
function onEnabled(transformation) {
console.log("Enabled: ", transformation);
}
</script>