Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance updates: render nodes in view only #7

Merged
merged 8 commits into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 11 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@

# Changelog

## [Unreleased]
## [Unreleased]

## Added
## Added

- Upgrade Typescript and Storybook.
- Prevent re-rendering for nodes and links that are not in use. [alexcuz PR7](https://github.com/MrBlenny/react-flow-chart/pull/7)
- Render only nodes currently visible for user. [alexcuz PR7](https://github.com/MrBlenny/react-flow-chart/pull/7)
- Fix calculating link position when canvas is not positioned in top left corner. [alexcuz PR7](https://github.com/MrBlenny/react-flow-chart/pull/7)
- Prevent re-rendering for nodes and links that are not in use. [alexkuz PR7](https://github.com/MrBlenny/react-flow-chart/pull/7)
- Render only nodes currently visible for user. [alexkuz PR7](https://github.com/MrBlenny/react-flow-chart/pull/7)
- Fix calculating link position when canvas is not positioned in top left corner. [alexkuz PR7](https://github.com/MrBlenny/react-flow-chart/pull/7)

## Breaking
## Breaking

- Added a new [onNodeSizeChange](https://github.com/MrBlenny/react-flow-chart/pull/7/files#diff-5a121158d13f502e78c5c29411f54269R141) action that is required for calculating which nodes are visible. If you are using external state, this will need to be implemented.
- Added a new [onNodeSizeChange](https://github.com/MrBlenny/react-flow-chart/pull/7/files#diff-5a121158d13f502e78c5c29411f54269R141) action that is required for calculating which nodes are visible. If you are using external state, this will need to be implemented.

## [0.0.5] - 2019-04-02
## [0.0.5] - 2019-04-02

### Added
### Added

- Fixed a bug where links would not work on firefox [tantayou999](https://github.com/MrBlenny/react-flow-chart/issues/12)

## [0.0.4] - 2019-03-24
## [0.0.4] - 2019-03-24

### Added
### Added

- Start keeping a changelog
- Remove storybook and lodash from from dist [alexcuz PR5](https://github.com/MrBlenny/react-flow-chart/pull/5)
File renamed without changes.
7 changes: 0 additions & 7 deletions config/storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { setOptions } from "@storybook/addon-options"
import { configure } from "@storybook/react"
// import { configureViewport, INITIAL_VIEWPORTS } from "@storybook/addon-viewport"

setOptions({
hierarchySeparator: /\/|\./,
hierarchyRootSeparator: /\|/,
})

// configureViewport({
// viewports: {
// ...INITIAL_VIEWPORTS
// }
// })

function requireAll(requireContext) {
return requireContext.keys().map(requireContext);
}
Expand Down
12 changes: 12 additions & 0 deletions config/storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = ({ config }) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('ts-loader'),
},
],
});
config.resolve.extensions.push('.ts', '.tsx');
return config;
};
13 changes: 0 additions & 13 deletions config/storybook/webpack.config.ts

This file was deleted.

18 changes: 0 additions & 18 deletions config/tsconfig.json

This file was deleted.

30 changes: 0 additions & 30 deletions config/webpack.config.base.ts

This file was deleted.

9 changes: 0 additions & 9 deletions config/webpack.config.dev.ts

This file was deleted.

88 changes: 6 additions & 82 deletions docs/iframe.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<title>Storybook</title>
<link rel="shortcut icon" href="favicon.ico?v=1" />


<base target="_parent">

<style>
:not(.sb-show-main) > .sb-main,
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><meta name="viewport" content="width=device-width,initial-scale=1"><base target="_parent"><style>:not(.sb-show-main) > .sb-main,
:not(.sb-show-nopreview) > .sb-nopreview,
:not(.sb-show-errordisplay) > .sb-errordisplay {
display: none;
display: none;
}

.sb-wrapper {
Expand Down Expand Up @@ -61,77 +48,14 @@
font-size: 14px;
width: 100vw;
overflow: auto;
}
</style>

<script>
}</style><script>/* globals window */
/* eslint-disable no-underscore-dangle */
try {
if (window.parent !== window) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
} catch (e) {
// eslint-disable-next-line no-console
console.warn('unable to connect to parent frame for connecting dev tools');
}
</script>













</head>
<body>




<div class="sb-nopreview sb-wrapper">
<div class="sb-nopreview_main">
<h1 class="sb-nopreview_heading sb-heading">No Preview</h1>
<p>Sorry, but you either have no stories or none are selected somehow.</p>
<ul>
<li>Please check the storybook config.</li>
<li>Try reloading the page.</li>
</ul>
</div>
</div>

<div class="sb-errordisplay sb-wrapper">
<div id="error-message" class="sb-heading"></div>
<pre class="sb-errordisplay_code">
<code id="error-stack"></code>
</pre>
</div>



<div id="root"></div>







<script src="static/runtime~iframe.2a2464bbcb8b4545b333.bundle.js" defer></script>



<script src="static/vendors~iframe.f7fb44f13b0d6dcae5b7.bundle.js" defer></script>



<script src="static/iframe.0fd77ada0df4b2602476.bundle.js" defer></script>



</body>
</html>
}</script></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><div id="error-message" class="sb-heading"></div><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><script src="runtime~main.9a1da2a6dda232a31dca.bundle.js"></script><script src="vendors~main.9a1da2a6dda232a31dca.bundle.js"></script><script src="main.9a1da2a6dda232a31dca.bundle.js"></script></body></html>
59 changes: 5 additions & 54 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,66 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<title>Storybook</title>
<link rel="shortcut icon" href="favicon.ico?v=1" />


<style>
html, body {
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>html, body {
overflow: hidden;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
</style>

<script>
}</style><script>/* globals window */
/* eslint-disable no-underscore-dangle */
try {
if (window.parent !== window) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
} catch (e) {
// eslint-disable-next-line no-console
console.warn('unable to connect to parent frame for connecting dev tools');
}
</script>











</head>
<body>





<div id="root"></div>







<script src="static/runtime~manager.16a639f5253b2fc5c06a.bundle.js" defer></script>



<script src="static/manager.61fca02e0af4da97369d.bundle.js" defer></script>



</body>
</html>
}</script></head><body><div id="root"></div><script src="runtime~main.6ac4c33d73ae9704bbb9.bundle.js"></script><script src="vendors~main.44149a9b5f715c7cdaff.bundle.js"></script><script src="main.7c432d9b87c5c8d896f0.bundle.js"></script></body></html>
1 change: 1 addition & 0 deletions docs/main.7c432d9b87c5c8d896f0.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/main.9a1da2a6dda232a31dca.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/main.9a1da2a6dda232a31dca.bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/runtime~main.6ac4c33d73ae9704bbb9.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/runtime~main.9a1da2a6dda232a31dca.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.