Skip to content

Commit 3ab1866

Browse files
committed
Release 1.2.0
1 parent d46e7c5 commit 3ab1866

21 files changed

+136
-126
lines changed

docs/examples/complete.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211157,7 +211157,7 @@ const MyCustomGraph = ({ children }) => {
211157211157
}, []);
211158211158
react_1.useEffect(() => {
211159211159
setSettings({
211160-
labelRenderedSizeThreshold: 20,
211160+
renderLabels: random_1.renderLabels,
211161211161
nodeReducer: (node, data) => {
211162211162
const graph = sigma.getGraph();
211163211163
const newData = Object.assign(Object.assign({}, data), { highlighted: data.highlighted || false });
@@ -211206,7 +211206,7 @@ react_dom_1.default.render(react_1.default.createElement(react_1.default.StrictM
211206211206
"use strict";
211207211207

211208211208
Object.defineProperty(exports, "__esModule", ({ value: true }));
211209-
exports.rng = exports.faTime = void 0;
211209+
exports.renderLabels = exports.rng = exports.faTime = void 0;
211210211210
const tslib_1 = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.js");
211211211211
const faker_1 = tslib_1.__importDefault(__webpack_require__(/*! faker */ "../node_modules/faker/index.js"));
211212211212
const seedrandom_1 = tslib_1.__importDefault(__webpack_require__(/*! seedrandom */ "../node_modules/seedrandom/index.js"));
@@ -211225,6 +211225,8 @@ const faTimeParam = urlParams.get("faTime");
211225211225
if (faTimeParam && !Number.isNaN(Number.parseInt(faTimeParam))) {
211226211226
exports.faTime = faTime = Number.parseInt(faTimeParam);
211227211227
}
211228+
const renderLabels = urlParams.get("seed") ? false : true;
211229+
exports.renderLabels = renderLabels;
211228211230

211229211231

211230211232
/***/ }),

docs/examples/complete.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/examples/customBtn.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218651,7 +218651,7 @@ const MyCustomGraph = ({ children }) => {
218651218651
const setSettings = index_1.useSetSettings();
218652218652
react_1.useEffect(() => {
218653218653
setSettings({
218654-
labelRenderedSizeThreshold: 20,
218654+
renderLabels: random_1.renderLabels,
218655218655
});
218656218656
const graph = erdos_renyi_1.default(graphology_1.UndirectedGraph, { order: 100, probability: 0.1, rng: random_1.rng });
218657218657
circular_1.default.assign(graph);
@@ -218694,7 +218694,7 @@ react_dom_1.default.render(react_1.default.createElement(react_1.default.StrictM
218694218694
"use strict";
218695218695

218696218696
Object.defineProperty(exports, "__esModule", ({ value: true }));
218697-
exports.rng = exports.faTime = void 0;
218697+
exports.renderLabels = exports.rng = exports.faTime = void 0;
218698218698
const tslib_1 = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.js");
218699218699
const faker_1 = tslib_1.__importDefault(__webpack_require__(/*! faker */ "../node_modules/faker/index.js"));
218700218700
const seedrandom_1 = tslib_1.__importDefault(__webpack_require__(/*! seedrandom */ "../node_modules/seedrandom/index.js"));
@@ -218713,6 +218713,8 @@ const faTimeParam = urlParams.get("faTime");
218713218713
if (faTimeParam && !Number.isNaN(Number.parseInt(faTimeParam))) {
218714218714
exports.faTime = faTime = Number.parseInt(faTimeParam);
218715218715
}
218716+
const renderLabels = urlParams.get("seed") ? false : true;
218717+
exports.renderLabels = renderLabels;
218716218718

218717218719

218718218720
/***/ }),

docs/examples/customBtn.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/examples/events.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211187,7 +211187,7 @@ react_dom_1.default.render(react_1.default.createElement(react_1.default.StrictM
211187211187
"use strict";
211188211188

211189211189
Object.defineProperty(exports, "__esModule", ({ value: true }));
211190-
exports.rng = exports.faTime = void 0;
211190+
exports.renderLabels = exports.rng = exports.faTime = void 0;
211191211191
const tslib_1 = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.js");
211192211192
const faker_1 = tslib_1.__importDefault(__webpack_require__(/*! faker */ "../node_modules/faker/index.js"));
211193211193
const seedrandom_1 = tslib_1.__importDefault(__webpack_require__(/*! seedrandom */ "../node_modules/seedrandom/index.js"));
@@ -211206,6 +211206,8 @@ const faTimeParam = urlParams.get("faTime");
211206211206
if (faTimeParam && !Number.isNaN(Number.parseInt(faTimeParam))) {
211207211207
exports.faTime = faTime = Number.parseInt(faTimeParam);
211208211208
}
211209+
const renderLabels = urlParams.get("seed") ? false : true;
211210+
exports.renderLabels = renderLabels;
211209211211

211210211212

211211211213
/***/ }),

docs/examples/events.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/examples/multiple.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211138,7 +211138,7 @@ const MyCustomGraph = ({ children }) => {
211138211138
const setSettings = index_1.useSetSettings();
211139211139
react_1.useEffect(() => {
211140211140
setSettings({
211141-
labelRenderedSizeThreshold: 20,
211141+
renderLabels: random_1.renderLabels,
211142211142
});
211143211143
const graph = erdos_renyi_1.default(graphology_1.UndirectedGraph, { order: 100, probability: 0.1 });
211144211144
circular_1.default.assign(graph);
@@ -211192,7 +211192,7 @@ react_dom_1.default.render(react_1.default.createElement(react_1.default.StrictM
211192211192
"use strict";
211193211193

211194211194
Object.defineProperty(exports, "__esModule", ({ value: true }));
211195-
exports.rng = exports.faTime = void 0;
211195+
exports.renderLabels = exports.rng = exports.faTime = void 0;
211196211196
const tslib_1 = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.js");
211197211197
const faker_1 = tslib_1.__importDefault(__webpack_require__(/*! faker */ "../node_modules/faker/index.js"));
211198211198
const seedrandom_1 = tslib_1.__importDefault(__webpack_require__(/*! seedrandom */ "../node_modules/seedrandom/index.js"));
@@ -211211,6 +211211,8 @@ const faTimeParam = urlParams.get("faTime");
211211211211
if (faTimeParam && !Number.isNaN(Number.parseInt(faTimeParam))) {
211212211212
exports.faTime = faTime = Number.parseInt(faTimeParam);
211213211213
}
211214+
const renderLabels = urlParams.get("seed") ? false : true;
211215+
exports.renderLabels = renderLabels;
211214211216

211215211217

211216211218
/***/ }),

docs/examples/multiple.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<title>react-sigma-v2 - v1.1.1 | react-sigma-v2 - v1.1.1</title>
7-
<meta name="description" content="Documentation for react-sigma-v2 - v1.1.1">
6+
<title>react-sigma-v2 - v1.2.0 | react-sigma-v2 - v1.2.0</title>
7+
<meta name="description" content="Documentation for react-sigma-v2 - v1.2.0">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<style type="text/css">:root {
1010
--color-background: #fdfdfd;
@@ -2674,7 +2674,7 @@
26742674
<div class="container">
26752675
<div class="table-wrap">
26762676
<div class="table-cell">
2677-
<strong><a href="index.html">react-sigma-v2 - v1.1.1</a></strong>
2677+
<strong><a href="index.html">react-sigma-v2 - v1.2.0</a></strong>
26782678
</div>
26792679
<div class="table-cell" id="tsd-widgets">
26802680
<div id="tsd-filter">
@@ -2775,14 +2775,15 @@
27752775
<a href="#react-sigma-v2-" id="react-sigma-v2-" style="color: inherit; text-decoration: none;">
27762776
<h1>React Sigma v2 <a href="https://github.com/sim51/react-sigma-v2/actions/workflows/test.yml"><img src="https://github.com/sim51/react-sigma-v2/actions/workflows/test.yml/badge.svg" alt="CI"></a></h1>
27772777
</a>
2778-
<p>A set of react components to display graphs with Sigma v2.<br>This project is in beta test.</p>
2778+
<p>A set of react components to display graphs with Sigma v2.</p>
27792779
<p>You can find some online examples here : <a href="https://sim51.github.io/react-sigma-v2/examples/">https://sim51.github.io/react-sigma-v2/examples/</a></p>
2780+
<p>Or test it on cocdesanbox with this link: <a href="https://githubbox.com/sim51/react-sigma-v2/tree/main/demo">https://githubbox.com/sim51/react-sigma-v2/tree/main/demo</a></p>
27802781
<a href="#philosophy" id="philosophy" style="color: inherit; text-decoration: none;">
27812782
<h2>Philosophy</h2>
27822783
</a>
27832784
<p>This library shares the same philosophy as <a href="https://react-leaflet.js.org">react-leaflet</a>, it just provides some bindings (and helpers) between React and Sigma.</p>
27842785
<p>The main component, ie. <code>SigmaContainer</code> create a Sigma instance with an empty graph. If its option <code>initialSettings</code> or <code>graphOptions</code> is updated, the instance is killed and re-created.</p>
2785-
<p>I recommend you to NOT UPDATE those options to avoid performance issues.<br>Sigma (&amp; graphology) comes with methods that allow the user to update the settings.</p>
2786+
<p>I recommend you to NOT UPDATE those options to avoid performance issues.<br>Sigma (&amp; graphology) comes with methods that allow users to update the settings.<br>You should treat it as an immutable component.</p>
27862787
<p>Every child has access to the sigma instance (and so the graph instance) via the React context created by the <code>SigmaContainer</code>.</p>
27872788
<p>In your components, you can use the hook <code>const sigma = useSigma()</code> that gives you the sigma instance (and so the underlying graph with <code>sigma.getGraph()</code>)</p>
27882789
<p>This is an example of how to display a graph :</p>
@@ -3032,7 +3033,7 @@ <h3>Mouse<wbr>NodeEVent</h3>
30323033
<div class="tsd-signature tsd-kind-icon">Mouse<wbr>NodeEVent<span class="tsd-signature-symbol">:</span> <a href="interfaces/mouseevent.html" class="tsd-signature-type" data-tsd-kind="Interface">MouseEvent</a><span class="tsd-signature-symbol"> &amp; </span><a href="interfaces/nodeevent.html" class="tsd-signature-type" data-tsd-kind="Interface">NodeEvent</a></div>
30333034
<aside class="tsd-sources">
30343035
<ul>
3035-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/types.ts#L15">types.ts:15</a></li>
3036+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/types.ts#L15">types.ts:15</a></li>
30363037
</ul>
30373038
</aside>
30383039
</section>
@@ -3045,7 +3046,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> Controls<wbr>Container</h3>
30453046
<div class="tsd-signature tsd-kind-icon">Controls<wbr>Container<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">React.FC</span><span class="tsd-signature-symbol">&lt;</span><a href="interfaces/controlscontainerprops.html" class="tsd-signature-type" data-tsd-kind="Interface">ControlsContainerProps</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div>
30463047
<aside class="tsd-sources">
30473048
<ul>
3048-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/controls/ControlsContainer.tsx#L45">controls/ControlsContainer.tsx:45</a></li>
3049+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/controls/ControlsContainer.tsx#L45">controls/ControlsContainer.tsx:45</a></li>
30493050
</ul>
30503051
</aside>
30513052
<div class="tsd-comment tsd-typography">
@@ -3067,7 +3068,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> Force<wbr>Atlas<wbr>Control
30673068
<div class="tsd-signature tsd-kind-icon">Force<wbr>Atlas<wbr>Control<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">React.FC</span><span class="tsd-signature-symbol">&lt;</span><a href="interfaces/forceatlascontrolprops.html" class="tsd-signature-type" data-tsd-kind="Interface">ForceAtlasControlProps</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div>
30683069
<aside class="tsd-sources">
30693070
<ul>
3070-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/controls/ForceAtlasControl.tsx#L66">controls/ForceAtlasControl.tsx:66</a></li>
3071+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/controls/ForceAtlasControl.tsx#L66">controls/ForceAtlasControl.tsx:66</a></li>
30713072
</ul>
30723073
</aside>
30733074
<div class="tsd-comment tsd-typography">
@@ -3089,7 +3090,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> Full<wbr>Screen<wbr>Control
30893090
<div class="tsd-signature tsd-kind-icon">Full<wbr>Screen<wbr>Control<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">React.FC</span><span class="tsd-signature-symbol">&lt;</span><a href="interfaces/fullscreencontrolprops.html" class="tsd-signature-type" data-tsd-kind="Interface">FullScreenControlProps</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div>
30903091
<aside class="tsd-sources">
30913092
<ul>
3092-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/controls/FullScreenControl.tsx#L59">controls/FullScreenControl.tsx:59</a></li>
3093+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/controls/FullScreenControl.tsx#L59">controls/FullScreenControl.tsx:59</a></li>
30933094
</ul>
30943095
</aside>
30953096
<div class="tsd-comment tsd-typography">
@@ -3110,7 +3111,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> Search<wbr>Control</h3>
31103111
<div class="tsd-signature tsd-kind-icon">Search<wbr>Control<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">React.FC</span><span class="tsd-signature-symbol">&lt;</span><a href="interfaces/searchcontrolprops.html" class="tsd-signature-type" data-tsd-kind="Interface">SearchControlProps</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div>
31113112
<aside class="tsd-sources">
31123113
<ul>
3113-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/controls/SearchControl.tsx#L40">controls/SearchControl.tsx:40</a></li>
3114+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/controls/SearchControl.tsx#L40">controls/SearchControl.tsx:40</a></li>
31143115
</ul>
31153116
</aside>
31163117
<div class="tsd-comment tsd-typography">
@@ -3131,7 +3132,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> Sigma<wbr>Container</h3>
31313132
<div class="tsd-signature tsd-kind-icon">Sigma<wbr>Container<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">React.FC</span><span class="tsd-signature-symbol">&lt;</span><a href="interfaces/sigmacontainerprops.html" class="tsd-signature-type" data-tsd-kind="Interface">SigmaContainerProps</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div>
31323133
<aside class="tsd-sources">
31333134
<ul>
3134-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/SigmaContainer.tsx#L51">SigmaContainer.tsx:51</a></li>
3135+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/SigmaContainer.tsx#L51">SigmaContainer.tsx:51</a></li>
31353136
</ul>
31363137
</aside>
31373138
<div class="tsd-comment tsd-typography">
@@ -3151,7 +3152,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> Zoom<wbr>Control</h3>
31513152
<div class="tsd-signature tsd-kind-icon">Zoom<wbr>Control<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">React.FC</span><span class="tsd-signature-symbol">&lt;</span><a href="interfaces/zoomcontrolprops.html" class="tsd-signature-type" data-tsd-kind="Interface">ZoomControlProps</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div>
31523153
<aside class="tsd-sources">
31533154
<ul>
3154-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/controls/ZoomControl.tsx#L60">controls/ZoomControl.tsx:60</a></li>
3155+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/controls/ZoomControl.tsx#L60">controls/ZoomControl.tsx:60</a></li>
31553156
</ul>
31563157
</aside>
31573158
<div class="tsd-comment tsd-typography">
@@ -3185,7 +3186,7 @@ <h3>use<wbr>Load<wbr>Graph</h3>
31853186
<li class="tsd-description">
31863187
<aside class="tsd-sources">
31873188
<ul>
3188-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/hooks/useLoadGraph.ts#L16">hooks/useLoadGraph.ts:16</a></li>
3189+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/hooks/useLoadGraph.ts#L16">hooks/useLoadGraph.ts:16</a></li>
31893190
</ul>
31903191
</aside>
31913192
<div class="tsd-comment tsd-typography">
@@ -3231,7 +3232,7 @@ <h3>use<wbr>Register<wbr>Events</h3>
32313232
<li class="tsd-description">
32323233
<aside class="tsd-sources">
32333234
<ul>
3234-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/hooks/useRegisterEvents.ts#L35">hooks/useRegisterEvents.ts:35</a></li>
3235+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/hooks/useRegisterEvents.ts#L35">hooks/useRegisterEvents.ts:35</a></li>
32353236
</ul>
32363237
</aside>
32373238
<div class="tsd-comment tsd-typography">
@@ -3277,7 +3278,7 @@ <h3>use<wbr>Set<wbr>Settings</h3>
32773278
<li class="tsd-description">
32783279
<aside class="tsd-sources">
32793280
<ul>
3280-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/hooks/useSetSettings.ts#L17">hooks/useSetSettings.ts:17</a></li>
3281+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/hooks/useSetSettings.ts#L17">hooks/useSetSettings.ts:17</a></li>
32813282
</ul>
32823283
</aside>
32833284
<div class="tsd-comment tsd-typography">
@@ -3323,7 +3324,7 @@ <h3>use<wbr>Sigma</h3>
33233324
<li class="tsd-description">
33243325
<aside class="tsd-sources">
33253326
<ul>
3326-
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/8fbc622/src/hooks/useSigma.ts#L12">hooks/useSigma.ts:12</a></li>
3327+
<li>Defined in <a href="https://github.com/sim51/react-sigma-v2/blob/d46e7c5/src/hooks/useSigma.ts#L12">hooks/useSigma.ts:12</a></li>
33273328
</ul>
33283329
</aside>
33293330
<div class="tsd-comment tsd-typography">

0 commit comments

Comments
 (0)