Skip to content

Commit

Permalink
feat: update assets
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Oct 20, 2023
1 parent 4c540cc commit c21201b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const CanvasClick = () => {

React.useEffect(() => {
const handleCenter = () => {
graph.fitView();
graph.fitView(
{ padding: 10, rules: {} },
{
duration: 500,
},
);
};
graph.on('canvas:dblclick', handleCenter);
return () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface TimeChartProps {

const TimeChart: React.FunctionComponent<TimeChartProps> = props => {
const { chartType, height, dataType, title, brushMode } = props;
console.log(' props', props);

return (
<div>
Expand Down
24 changes: 12 additions & 12 deletions packages/gi-assets-basic/src/components/FilterPanel/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,22 +173,22 @@ const FilterPanel: React.FunctionComponent<FilterPanelProps> = props => {
if (highlightMode) {
const { isEmpty, isFull } = highlightSubGraph(graph, data);

updateContext(draft => {
//@ts-ignore
draft.persistentHighlight = !isEmpty && !isFull;
});
// updateContext(draft => {
// //@ts-ignore
// draft.persistentHighlight = !isEmpty && !isFull;
// });

return;
}

updateContext(draft => {
if (isStyles(source.nodes)) {
draft.data = data;
} else {
draft.data = transform(data);
}
draft.layoutCache = true;
});
// updateContext(draft => {
// if (isStyles(source.nodes)) {
// draft.data = data;
// } else {
// draft.data = transform(data);
// }
// draft.layoutCache = true;
// });
};

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const FitCenter: React.FunctionComponent<IProps> = props => {
<GIAComponent
GIAC={GIAC}
onClick={() => {
graph.fitCenter();
graph.fitCenter({
'duration':100,
});
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const FitView: React.FunctionComponent<IProps> = props => {

const callback = () => {
// graph.fitCenter();
graph.fitView();
graph.fitView({
padding:10,
rules:{}
},{
'duration':200,
});
};

return <GIAComponent GIAC={GIAC} onClick={callback} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const transform = data => {
};
});

console.log('TransformGraphinData edges ', edges, nodes);
// console.log('TransformGraphinData edges ', edges, nodes);

return {
nodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const PropertyGraphInitializer: React.FunctionComponent<IProps> = props => {
const context = useContext();
const { data, schemaData, updateContext } = context;

React.useEffect(() => {
const propertyGraphData = utils.graphData2PropertyGraph(data, schemaData);
updateContext(draft => {
draft.propertyGraphData = propertyGraphData;
});
}, [data]);
// React.useEffect(() => {
// const propertyGraphData = utils.graphData2PropertyGraph(data, schemaData);
// updateContext(draft => {
// draft.propertyGraphData = propertyGraphData;
// });
// }, [data]);

return null;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const SegmentedLayout: React.FunctionComponent<UadLayoutProps> = props => {
const [SideContent] = Containers;
const { width = 360, padding = 12 } = SideContent;
const items = useMemo(() => {
console.log('SegmentContainer >>>> calc');
return SideContent.components.map(item => {
return {
icon: <Icon type={item.icon} />,
Expand Down

0 comments on commit c21201b

Please sign in to comment.