Closed celine3d closed 4 years ago
In the current version of the extension, expand/collapse cues are shown when parent nodes with nested children are selected. You can see this in the demos. However, since you use autounselectify: true,
, you disable the node selection and therefore cannot activate expand/collapse cues.
If disabling node selection is necessary for your application, you can use the previous release (v3.2.1) of the extension where expand/collapse cues are shown when you mouse over a node.
You are the best- thank you so much!!!
Hi, here is my implementation. The graph works fine, cytoscape expand collapse is also working at first render(at first all nodes are collapsed, as I am doing collapseAll when ready) but then there is no icon on parent node with nested children, hence expand is not possible. Is there something wrong with my implementation. Can someone please take a look at it?
import React, { useEffect, useState, useRef } from 'react'; import cytoscape from 'cytoscape'; import expandCollapse from 'cytoscape-expand-collapse';
import styling from './styling'; import elements from './data';
expandCollapse(cytoscape);
const Test = () => { const ref = useRef(null); useEffect(() => { ref.current && renderCytoscapeElement(); }, []);
const renderCytoscapeElement = () => { console.log('* Cytoscape.js is rendering the graph..');
};
return ( <div ref={ref} style={{ height: '700px', width: '900px' }} /> ); };