Skip to content

Commit eaa5144

Browse files
author
danielcaldas
committed
Prepare release. Generate dist. Update docs. Bump to v0.1.0
1 parent 191b664 commit eaa5144

File tree

5 files changed

+229
-20
lines changed

5 files changed

+229
-20
lines changed

docs/index.html

Lines changed: 223 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset='utf-8' />
55
<title>react-d3-graph | Documentation</title>
6-
<meta name='viewport' content='wiodth=device-width,initial-scale=1'>
6+
<meta name='viewport' content='width=device-width,initial-scale=1'>
77
<link href='assets/bass.css' type='text/css' rel='stylesheet' />
88
<link href='assets/style.css' type='text/css' rel='stylesheet' />
99
<link href='assets/github.css' type='text/css' rel='stylesheet' />
@@ -15,7 +15,7 @@
1515
<div class='py1 px2'>
1616
<h2>react-d3-graph</h2>
1717
<i class="icon-github"></i>
18-
<h3 class='mb0 no-anchor'>v0.0.2</h3>
18+
<h3 class='mb0 no-anchor'>v0.1.0</h3>
1919
<h3>Quick Links</h3>
2020
<h4><a href="https://github.com/danielcaldas/react-d3-graph" target="_blank">GitHub Repo</a></h4>
2121
<h4><a href="https://danielcaldas.github.io/react-d3-graph/sandbox/index.html" target="_blank">Live Demo</a></h4>
@@ -187,6 +187,24 @@ <h4><a href="https://danielcaldas.github.io/react-d3-graph/sandbox/index.html" t
187187
#restartSimulation
188188
</a></li>
189189

190+
<li><a
191+
href='#Graph#_validateGraphData'
192+
class='regular pre-open'>
193+
#_validateGraphData
194+
</a></li>
195+
196+
<li><a
197+
href='#Graph#_initializeGraphState'
198+
class='regular pre-open'>
199+
#_initializeGraphState
200+
</a></li>
201+
202+
<li><a
203+
href='#Graph#_graphForcesConfig'
204+
class='regular pre-open'>
205+
#_graphForcesConfig
206+
</a></li>
207+
190208
</ul>
191209

192210

@@ -313,9 +331,9 @@ <h4><a href="https://danielcaldas.github.io/react-d3-graph/sandbox/index.html" t
313331
</a></li>
314332

315333
<li><a
316-
href='#utilsisEqual'
334+
href='#utilsisDeepEqual'
317335
class='regular pre-open'>
318-
.isEqual
336+
.isDeepEqual
319337
</a></li>
320338

321339
<li><a
@@ -2282,8 +2300,200 @@ <h3 class='fl m0' id='graph'>
22822300

22832301

22842302

2303+
2304+
2305+
2306+
2307+
2308+
2309+
2310+
2311+
2312+
</section>
2313+
2314+
</div>
2315+
</div>
2316+
2317+
<div class='border-bottom' id='Graph#restartSimulation'>
2318+
<div class="clearfix small pointer toggle-sibling">
2319+
<div class="py1 contain">
2320+
<a class='icon pin-right py1 dark-link caret-right'></a>
2321+
<span class='code strong strong truncate'>restartSimulation</span>
2322+
</div>
2323+
</div>
2324+
<div class="clearfix display-none toggle-target">
2325+
<section class='p2 mb2 clearfix bg-white minishadow'>
2326+
2327+
2328+
2329+
<p>Calls d3 simulation.restart().<br/>
2330+
<a href="https://github.com/d3/d3-force#simulation_restart">https://github.com/d3/d3-force#simulation_restart</a></p>
2331+
2332+
2333+
<div class='pre p1 fill-light mt0'>restartSimulation</div>
2334+
2335+
2336+
2337+
2338+
2339+
2340+
2341+
2342+
2343+
2344+
2345+
2346+
2347+
2348+
2349+
2350+
2351+
2352+
2353+
2354+
2355+
2356+
2357+
2358+
</section>
2359+
2360+
</div>
2361+
</div>
2362+
2363+
<div class='border-bottom' id='Graph#_validateGraphData'>
2364+
<div class="clearfix small pointer toggle-sibling">
2365+
<div class="py1 contain">
2366+
<a class='icon pin-right py1 dark-link caret-right'></a>
2367+
<span class='code strong strong truncate'>_validateGraphData(data)</span>
2368+
</div>
2369+
</div>
2370+
<div class="clearfix display-none toggle-target">
2371+
<section class='p2 mb2 clearfix bg-white minishadow'>
2372+
2373+
2374+
2375+
<p>Some integraty validations on links and nodes structure.</p>
2376+
2377+
2378+
<div class='pre p1 fill-light mt0'>_validateGraphData(data: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</div>
2379+
2380+
2381+
2382+
2383+
2384+
2385+
2386+
2387+
2388+
2389+
<div class='py1 quiet mt1 prose-big'>Parameters</div>
2390+
<div class='prose'>
2391+
2392+
<div class='space-bottom0'>
2393+
<div>
2394+
<span class='code bold'>data</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</code>
2395+
2396+
</div>
2397+
2398+
</div>
2399+
2400+
</div>
2401+
2402+
2403+
2404+
2405+
2406+
2407+
2408+
2409+
2410+
2411+
2412+
2413+
2414+
2415+
2416+
</section>
2417+
2418+
</div>
2419+
</div>
2420+
2421+
<div class='border-bottom' id='Graph#_initializeGraphState'>
2422+
<div class="clearfix small pointer toggle-sibling">
2423+
<div class="py1 contain">
2424+
<a class='icon pin-right py1 dark-link caret-right'></a>
2425+
<span class='code strong strong truncate'>_initializeGraphState(data)</span>
2426+
</div>
2427+
</div>
2428+
<div class="clearfix display-none toggle-target">
2429+
<section class='p2 mb2 clearfix bg-white minishadow'>
2430+
2431+
2432+
2433+
<p>Incapsulates common procedures to initialize graph.</p>
2434+
2435+
2436+
<div class='pre p1 fill-light mt0'>_initializeGraphState(data: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></div>
2437+
2438+
2439+
2440+
2441+
2442+
2443+
2444+
2445+
2446+
2447+
<div class='py1 quiet mt1 prose-big'>Parameters</div>
2448+
<div class='prose'>
2449+
2450+
<div class='space-bottom0'>
2451+
<div>
2452+
<span class='code bold'>data</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>)</code>
2453+
2454+
</div>
2455+
2456+
<table class='mt1 mb2 fixed-table h5 col-12'>
2457+
<colgroup>
2458+
<col width='30%' />
2459+
<col width='70%' />
2460+
</colgroup>
2461+
<thead>
2462+
<tr class='bold fill-light'>
2463+
<th>Name</th>
2464+
<th>Description</th>
2465+
</tr>
2466+
</thead>
2467+
<tbody class='mt1'>
2468+
2469+
<tr>
2470+
<td class='break-word'><span class='code bold'>data.nodes</span> <code class='quiet'><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>></code>
2471+
</td>
2472+
<td class='break-word'><span>nodes of the graph to be created.
2473+
</span></td>
2474+
</tr>
2475+
2476+
<tr>
2477+
<td class='break-word'><span class='code bold'>data.links</span> <code class='quiet'><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a>&#x3C;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>></code>
2478+
</td>
2479+
<td class='break-word'><span>links that connect data.nodes.
2480+
</span></td>
2481+
</tr>
2482+
2483+
</tbody>
2484+
</table>
2485+
2486+
</div>
2487+
2488+
</div>
2489+
2490+
2491+
2492+
2493+
2494+
22852495
<div class='py1 quiet mt1 prose-big'>Returns</div>
2286-
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a></code>:
2496+
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code>:
22872497

22882498

22892499

@@ -2304,23 +2514,22 @@ <h3 class='fl m0' id='graph'>
23042514
</div>
23052515
</div>
23062516

2307-
<div class='border-bottom' id='Graph#restartSimulation'>
2517+
<div class='border-bottom' id='Graph#_graphForcesConfig'>
23082518
<div class="clearfix small pointer toggle-sibling">
23092519
<div class="py1 contain">
23102520
<a class='icon pin-right py1 dark-link caret-right'></a>
2311-
<span class='code strong strong truncate'>restartSimulation</span>
2521+
<span class='code strong strong truncate'>_graphForcesConfig()</span>
23122522
</div>
23132523
</div>
23142524
<div class="clearfix display-none toggle-target">
23152525
<section class='p2 mb2 clearfix bg-white minishadow'>
23162526

23172527

23182528

2319-
<p>Calls d3 simulation.restart().<br/>
2320-
<a href="https://github.com/d3/d3-force#simulation_restart">https://github.com/d3/d3-force#simulation_restart</a></p>
2529+
<p>Sets d3 tick function and configures other d3 stuff such as forces and drag events.</p>
23212530

23222531

2323-
<div class='pre p1 fill-light mt0'>restartSimulation</div>
2532+
<div class='pre p1 fill-light mt0'>_graphForcesConfig()</div>
23242533

23252534

23262535

@@ -2584,7 +2793,7 @@ <h3 class='fl m0' id='nodehelper'>
25842793

25852794
<div class='py1 quiet mt1 prose-big'>Returns</div>
25862795
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code>:
2587-
concrete instance of d3 symbol.
2796+
concrete instance of d3 symbol (defaults to circle).
25882797

25892798

25902799

@@ -3071,11 +3280,11 @@ <h3 class='fl m0' id='utils'>
30713280
</div>
30723281
</div>
30733282

3074-
<div class='border-bottom' id='utilsisEqual'>
3283+
<div class='border-bottom' id='utilsisDeepEqual'>
30753284
<div class="clearfix small pointer toggle-sibling">
30763285
<div class="py1 contain">
30773286
<a class='icon pin-right py1 dark-link caret-right'></a>
3078-
<span class='code strong strong truncate'>isEqual(o1, o2, _depth = 0)</span>
3287+
<span class='code strong strong truncate'>isDeepEqual(o1, o2, _depth = 0)</span>
30793288
</div>
30803289
</div>
30813290
<div class="clearfix display-none toggle-target">
@@ -3086,7 +3295,7 @@ <h3 class='fl m0' id='utils'>
30863295
<p>Generic deep comparison between javascript simple or complex objects.</p>
30873296

30883297

3089-
<div class='pre p1 fill-light mt0'>isEqual(o1: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>, o2: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>, _depth: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></div>
3298+
<div class='pre p1 fill-light mt0'>isDeepEqual(o1: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>, o2: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>, _depth: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>?): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></div>
30903299

30913300

30923301

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-d3-graph",
3-
"version": "0.0.2",
3+
"version": "0.1.0",
44
"description": "React component to build interactive and configurable graphs with d3 effortlessly",
55
"author": "Daniel Caldas",
66
"license": "MIT",

sandbox/rd3g.gif

-1.02 MB
Loading

sandbox/rd3g.sandbox.bundle.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ function isObjectEmpty(o) {
7070
}
7171

7272
/**
73-
* @TODO: Support for arrays?
7473
* This function merges two objects o1 and o2, where o2 properties override existent o1 properties, and
7574
* if o2 doesn't posses some o1 property the function will fallback to the o1 property.
7675
* @param {Object} o1 - object.
@@ -81,6 +80,7 @@ function isObjectEmpty(o) {
8180
* existent o1 properties.
8281
*/
8382
function merge(o1={}, o2={}, _depth=0) {
83+
// @TODO: Support for arrays
8484
let o = {};
8585

8686
for (let k of Object.keys(o1)) {

0 commit comments

Comments
 (0)