fix(core): set default edge opts before setting elements
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -661,8 +661,14 @@ export function useActions(
|
||||
'translateExtent',
|
||||
'nodeExtent',
|
||||
'hooks',
|
||||
'defaultEdgeOptions',
|
||||
]
|
||||
|
||||
// we need to set the default opts before setting any elements so the options are applied to the elements on first render
|
||||
if (isDef(opts.defaultEdgeOptions)) {
|
||||
state.defaultEdgeOptions = opts.defaultEdgeOptions
|
||||
}
|
||||
|
||||
const elements = opts.modelValue || opts.nodes || opts.edges ? ([] as Elements) : undefined
|
||||
|
||||
if (elements) {
|
||||
@@ -682,16 +688,16 @@ export function useActions(
|
||||
}
|
||||
|
||||
const setSkippedOptions = () => {
|
||||
if (typeof opts.maxZoom !== 'undefined') {
|
||||
if (isDef(opts.maxZoom)) {
|
||||
setMaxZoom(opts.maxZoom)
|
||||
}
|
||||
if (typeof opts.minZoom !== 'undefined') {
|
||||
if (isDef(opts.minZoom)) {
|
||||
setMinZoom(opts.minZoom)
|
||||
}
|
||||
if (typeof opts.translateExtent !== 'undefined') {
|
||||
if (isDef(opts.translateExtent)) {
|
||||
setTranslateExtent(opts.translateExtent)
|
||||
}
|
||||
if (typeof opts.nodeExtent !== 'undefined') {
|
||||
if (isDef(opts.nodeExtent)) {
|
||||
setNodeExtent(opts.nodeExtent)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user