Skip to content

Commit

Permalink
Add Performance
Browse files Browse the repository at this point in the history
  • Loading branch information
warioddly committed May 14, 2024
1 parent ed0b4f4 commit b140873
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion parser/bin/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void _formatter(String path) {
final bundler = Bundler();
final formatter = Formatter();

final data = jsonDecode(File(path).readAsStringSync());
final data = List<Map<String, dynamic>>.from(jsonDecode(File(path).readAsStringSync()));

final normalData = formatter.fromCytoscapeToNormal(data);
final cytoscapeData = formatter.fromNormalToCytoscape(normalData);
Expand Down
1 change: 1 addition & 0 deletions parser/output/Ак уул/data.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions parser/output/Ак уул/data_cytoscape.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions parser/output/Ак уул/data_normal.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions parser/output/Ак уул/dynamic_all_data.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/data/data.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/components/tree/TreeInteractiveViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function TreeInteractiveViewer() {

fetch('/api/get-nodes', {
method: 'POST',
body: JSON.stringify({ limit: -1 }),
body: JSON.stringify({ limit: 14000 }),
}).then((res) => res.json()).then((data: TreeNodeDefinition[]) => {
setGraph(data);
setLoading(false);
Expand Down Expand Up @@ -84,6 +84,7 @@ export function TreeInteractiveViewer() {
motionBlur={true}
headless={false}
wheelSensitivity={1.0}
pixelRatio={1}
style={{ width: '100vw', height: '100vh' }}
cy={(cy: cytoscape.Core) => {
treeStore.cy = cy;
Expand Down
10 changes: 2 additions & 8 deletions src/core/styles/cytoscape-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ export const cytoscapeThemes: CytoscapeTheme[] = [
width: 30,
height: 30,
label: 'data(name)',
'z-index': '10',
color: 'white',
fontSize: 12,
fontSize: 10,
},
},
{
selector: 'node:selected',
style: {
'border-width': '2px',
'border-color': '#AAD8FF',
'border-opacity': '0.5',
'background-color': '#77828C',
width: 30,
height: 30,
'text-outline-color': '#77828C',
Expand All @@ -43,15 +38,14 @@ export const cytoscapeThemes: CytoscapeTheme[] = [
"line-color": "#2a3e79",
'target-arrow-color': '#2a3e79',
'target-arrow-shape': 'triangle',
'curve-style': 'bezier',
'curve-style': 'haystack',
},
},
{
selector: 'edge.highlighted',
style: {
'line-color': '#d30000',
'target-arrow-color': '#d30000',
'opacity': 0.7,
}
}
];

0 comments on commit b140873

Please sign in to comment.