diff --git a/graph-positional-encoding.html b/graph-positional-encoding.html index 651c0e3..051a4a0 100755 --- a/graph-positional-encoding.html +++ b/graph-positional-encoding.html @@ -130,7 +130,7 @@

References

- + \ No newline at end of file diff --git a/js/laplacian_similarity.js b/js/laplacian_similarity.js index 7128a9f..628b214 100755 --- a/js/laplacian_similarity.js +++ b/js/laplacian_similarity.js @@ -1,5 +1,3 @@ - const laplacian_data = {"directed": true, "multigraph": false, "graph": {}, "nodes": [{"laplacian_similarity": [0.9999998211860657, -0.09076929837465286, -0.2217780351638794, 0.003705994924530387, 0.13741004467010498, -0.0017503983108326793, -0.0017503983108326793, -0.20746123790740967, 0.08479569107294083, -0.12110082805156708, 0.13741004467010498, 0.8360997438430786, 0.4086306691169739, -0.19233103096485138, -0.2552964985370636, -0.2552964985370636, -0.16118070483207703, 0.3367418944835663, -0.2552964985370636, 0.29269301891326904, -0.2552964985370636, 0.3367418944835663, -0.2552964985370636, -0.23186014592647552, -0.11715371161699295, -0.14771167933940887, -0.08965776115655899, -0.14203061163425446, -0.12919892370700836, -0.1609266698360443, -0.16113856434822083, -0.005818113684654236, -0.3496345281600952, -0.2948828339576721], "id": 0}, {"laplacian_similarity": [-0.09076929837465286, 1.000000238418579, -0.06565603613853455, 0.04776616767048836, -0.1282798796892166, -0.13604013621807098, -0.13604013621807098, 0.44441255927085876, -0.15444573760032654, -0.22090283036231995, -0.1282798796892166, -0.38334718346595764, -0.33202552795410156, 0.412394642829895, -0.18586097657680511, -0.18586097657680511, -0.044275764375925064, 0.8258781433105469, -0.18586097657680511, 0.5588499307632446, -0.18586097657680511, 0.8258781433105469, -0.18586097657680511, -0.12934458255767822, -0.08182311058044434, -0.0377364456653595, -0.07511203736066818, -0.13993102312088013, -0.16655424237251282, -0.10575313866138458, 0.231516033411026, -0.15641798079013824, -0.22645226120948792, -0.2361360788345337], "id": 1}, {"laplacian_similarity": [-0.2217780351638794, -0.06565603613853455, 0.9999998211860657, 0.187241330742836, -0.06436643749475479, -0.13963818550109863, -0.13963818550109863, 0.4262372553348541, 0.2747739553451538, 0.786829948425293, -0.06436643749475479, -0.128886878490448, -0.11969280242919922, 0.4935528635978699, -0.35535895824432373, -0.35535895824432373, -0.08037640154361725, -0.3764050602912903, -0.35535895824432373, -0.26468586921691895, -0.35535895824432373, -0.3764050602912903, -0.35535895824432373, -0.14987270534038544, -0.07841650396585464, -0.3121921420097351, -0.1537187695503235, 0.3681737780570984, 0.34060367941856384, -0.23917566239833832, 0.05081569403409958, -0.19491076469421387, -0.3554610013961792, 0.011004984378814697], "id": 2}, {"laplacian_similarity": [0.003705994924530387, 0.04776616767048836, 0.187241330742836, 1.0000001192092896, -0.12130340188741684, -0.1113259419798851, -0.1113259419798851, 0.8359134197235107, -0.2018638551235199, -0.22222541272640228, -0.12130340188741684, -0.1947106420993805, 0.802241861820221, 0.7025771737098694, -0.061295896768569946, -0.061295896768569946, -0.03916625306010246, -0.2568175792694092, -0.061295896768569946, -0.406384140253067, -0.061295896768569946, -0.2568175792694092, -0.061295896768569946, -0.06636694818735123, -0.12424980849027634, -0.022240400314331055, -0.05366845428943634, -0.17204637825489044, -0.11557833850383759, -0.010975828394293785, -0.21529828011989594, -0.10098554193973541, -0.013455934822559357, -0.43619105219841003], "id": 3}, {"laplacian_similarity": [0.13741004467010498, -0.1282798796892166, -0.06436643749475479, -0.12130340188741684, 1.0, 0.14191167056560516, 0.14191167056560516, -0.022030044347047806, -0.08212313801050186, -0.05545306205749512, 1.0, -0.19230110943317413, -0.14757369458675385, -0.11875100433826447, -0.06299427896738052, -0.06299427896738052, -0.3149315118789673, -0.09561536461114883, -0.06299427896738052, -0.16447953879833221, -0.06299427896738052, -0.09561536461114883, -0.06299427896738052, -0.04537120833992958, -0.07470434159040451, -0.05466137081384659, -0.042260605841875076, -0.060020968317985535, -0.05329948291182518, -0.03361925110220909, -0.08899220079183578, -0.07085757702589035, -0.06716182827949524, -0.20304150879383087], "id": 4}, {"laplacian_similarity": [-0.0017503983108326793, -0.13604013621807098, -0.13963818550109863, -0.1113259419798851, 0.14191167056560516, 0.9999999403953552, 0.9999999403953552, -0.13856583833694458, -0.08705310523509979, -0.06751459836959839, 0.14191167056560516, -0.06330801546573639, -0.07502329349517822, -0.18250207602977753, -0.11318175494670868, -0.11318175494670868, 0.8893902897834778, -0.10924994200468063, -0.11318175494670868, -0.11269807815551758, -0.11318175494670868, -0.10924994200468063, -0.11318175494670868, -0.10052964091300964, -0.07839319109916687, -0.07926946133375168, -0.05320842191576958, -0.07479750365018845, -0.07447528094053268, -0.0749245211482048, -0.07877610623836517, -0.09781976789236069, -0.15885694324970245, -0.2126893550157547], "id": 5}, {"laplacian_similarity": [-0.0017503983108326793, -0.13604013621807098, -0.13963818550109863, -0.1113259419798851, 0.14191167056560516, 0.9999999403953552, 0.9999999403953552, -0.13856583833694458, -0.08705310523509979, -0.06751459836959839, 0.14191167056560516, -0.06330801546573639, -0.07502329349517822, -0.18250207602977753, -0.11318175494670868, -0.11318175494670868, 0.8893902897834778, -0.10924994200468063, -0.11318175494670868, -0.11269807815551758, -0.11318175494670868, -0.10924994200468063, -0.11318175494670868, -0.10052964091300964, -0.07839319109916687, -0.07926946133375168, -0.05320842191576958, -0.07479750365018845, -0.07447528094053268, -0.0749245211482048, -0.07877610623836517, -0.09781976789236069, -0.15885694324970245, -0.2126893550157547], "id": 6}, {"laplacian_similarity": [-0.20746123790740967, 0.44441255927085876, 0.4262372553348541, 0.8359134197235107, -0.022030044347047806, -0.13856583833694458, -0.13856583833694458, 0.9999998807907104, -0.13205769658088684, -0.06325844675302505, -0.022030044347047806, -0.5025681853294373, 0.37118321657180786, 0.8501915335655212, -0.27023041248321533, -0.27023041248321533, -0.08077016472816467, -0.01582108810544014, -0.27023041248321533, -0.2535196840763092, -0.27023041248321533, -0.01582108810544014, -0.27023041248321533, -0.11254114657640457, -0.12245912849903107, -0.07277387380599976, -0.0957537591457367, -0.08314304053783417, -0.052718762308359146, -0.0863175243139267, -0.0074020251631736755, -0.19286806881427765, -0.20053578913211823, -0.48900145292282104], "id": 7}, {"laplacian_similarity": [0.08479569107294083, -0.15444573760032654, 0.2747739553451538, -0.2018638551235199, -0.08212313801050186, -0.08705310523509979, -0.08705310523509979, -0.13205769658088684, 1.0000001192092896, -0.004090762231498957, -0.08212313801050186, 0.20855773985385895, -0.07366495579481125, -0.450107216835022, -0.29090794920921326, -0.29090794920921326, -0.06063851714134216, -0.19595268368721008, -0.29090794920921326, -0.4443272650241852, -0.29090794920921326, -0.19595268368721008, -0.29090794920921326, -0.07693720608949661, -0.13531696796417236, -0.11312399059534073, -0.07834330201148987, -0.07269541174173355, -0.02185608074069023, -0.029539166018366814, 0.8670445680618286, -0.07515642046928406, 0.24406594038009644, -0.27341949939727783], "id": 8}, {"laplacian_similarity": [-0.12110082805156708, -0.22090283036231995, 0.786829948425293, -0.22222541272640228, -0.05545306205749512, -0.06751459836959839, -0.06751459836959839, -0.06325844675302505, -0.004090762231498957, 0.9999998807907104, -0.05545306205749512, 0.1188589334487915, -0.34795820713043213, 0.2860664427280426, -0.07836083322763443, -0.07836083322763443, -0.03552486002445221, -0.2701081335544586, -0.07836083322763443, 0.13633306324481964, -0.07836083322763443, -0.2701081335544586, -0.07836083322763443, -0.11937486380338669, -0.15360127389431, -0.4638213515281677, -0.028234779834747314, 0.4572155475616455, 0.3843216300010681, -0.16493424773216248, -0.2813875079154968, -0.21865098178386688, -0.37784239649772644, 0.5125817060470581], "id": 9}, {"laplacian_similarity": [0.13741004467010498, -0.1282798796892166, -0.06436643749475479, -0.12130340188741684, 1.0, 0.14191167056560516, 0.14191167056560516, -0.022030044347047806, -0.08212313801050186, -0.05545306205749512, 1.0, -0.19230110943317413, -0.14757369458675385, -0.11875100433826447, -0.06299427896738052, -0.06299427896738052, -0.3149315118789673, -0.09561536461114883, -0.06299427896738052, -0.16447953879833221, -0.06299427896738052, -0.09561536461114883, -0.06299427896738052, -0.04537120833992958, -0.07470434159040451, -0.05466137081384659, -0.042260605841875076, -0.060020968317985535, -0.05329948291182518, -0.03361925110220909, -0.08899220079183578, -0.07085757702589035, -0.06716182827949524, -0.20304150879383087], "id": 10}, {"laplacian_similarity": [0.8360997438430786, -0.38334718346595764, -0.128886878490448, -0.1947106420993805, -0.19230110943317413, -0.06330801546573639, -0.06330801546573639, -0.5025681853294373, 0.20855773985385895, 0.1188589334487915, -0.19230110943317413, 1.0, 0.33019015192985535, -0.38618847727775574, -0.09120530635118484, -0.09120530635118484, -0.07081318646669388, 0.10027119517326355, -0.09120530635118484, 0.2378050684928894, -0.09120530635118484, 0.10027119517326355, -0.09120530635118484, -0.024590078741312027, -0.043923668563365936, -0.15000741183757782, -0.03466234728693962, 0.1103287786245346, -0.10847994685173035, -0.06981146335601807, -0.15176858007907867, -0.03992993012070656, -0.1823732703924179, 0.046242281794548035], "id": 11}, {"laplacian_similarity": [0.4086306691169739, -0.33202552795410156, -0.11969280242919922, 0.802241861820221, -0.14757369458675385, -0.07502329349517822, -0.07502329349517822, 0.37118321657180786, -0.07366495579481125, -0.34795820713043213, -0.14757369458675385, 0.33019015192985535, 1.0, 0.24754959344863892, 0.03159331530332565, 0.03159331530332565, -0.04407761991024017, -0.31510141491889954, 0.03159331530332565, -0.3966870605945587, 0.03159331530332565, -0.31510141491889954, 0.03159331530332565, -0.026271050795912743, -0.0896562859416008, 0.0289265476167202, -0.017579499632120132, -0.21854323148727417, -0.18365195393562317, 0.03995022550225258, -0.25893765687942505, 0.010883035138249397, 0.09806270152330399, -0.3705364465713501], "id": 12}, {"laplacian_similarity": [-0.19233103096485138, 0.412394642829895, 0.4935528635978699, 0.7025771737098694, -0.11875100433826447, -0.18250207602977753, -0.18250207602977753, 0.8501915335655212, -0.450107216835022, 0.2860664427280426, -0.11875100433826447, -0.38618847727775574, 0.24754959344863892, 0.9999999403953552, -0.05962348356842995, -0.05962348356842995, -0.08536016941070557, 0.04782537370920181, -0.05962348356842995, 0.09893207252025604, -0.05962348356842995, 0.04782537370920181, -0.05962348356842995, -0.2124193012714386, -0.2369426190853119, -0.29953497648239136, -0.05825541913509369, 0.008371587842702866, 0.10416115820407867, -0.13641180098056793, -0.38295015692710876, -0.2316765934228897, -0.322849303483963, -0.05135456472635269], "id": 13}, {"laplacian_similarity": [-0.2552964985370636, -0.18586097657680511, -0.35535895824432373, -0.061295896768569946, -0.06299427896738052, -0.11318175494670868, -0.11318175494670868, -0.27023041248321533, -0.29090794920921326, -0.07836083322763443, -0.06299427896738052, -0.09120530635118484, 0.03159331530332565, -0.05962348356842995, 1.0, 1.0, -0.06255806237459183, -0.13285095989704132, 1.0, 0.127645343542099, 1.0, -0.13285095989704132, 1.0, -0.07894615083932877, -0.19931180775165558, -0.20433291792869568, -0.3045318126678467, -0.11125283688306808, -0.159977525472641, -0.2379005253314972, -0.1959364116191864, -0.07705680280923843, 0.7752416729927063, 0.5684211254119873], "id": 14}, {"laplacian_similarity": [-0.2552964985370636, -0.18586097657680511, -0.35535895824432373, -0.061295896768569946, -0.06299427896738052, -0.11318175494670868, -0.11318175494670868, -0.27023041248321533, -0.29090794920921326, -0.07836083322763443, -0.06299427896738052, -0.09120530635118484, 0.03159331530332565, -0.05962348356842995, 1.0, 1.0, -0.06255806237459183, -0.13285095989704132, 1.0, 0.127645343542099, 1.0, -0.13285095989704132, 1.0, -0.07894615083932877, -0.19931180775165558, -0.20433291792869568, -0.3045318126678467, -0.11125283688306808, -0.159977525472641, -0.2379005253314972, -0.1959364116191864, -0.07705680280923843, 0.7752416729927063, 0.5684211254119873], "id": 15}, {"laplacian_similarity": [-0.16118070483207703, -0.044275764375925064, -0.08037640154361725, -0.03916625306010246, -0.3149315118789673, 0.8893902897834778, 0.8893902897834778, -0.08077016472816467, -0.06063851714134216, -0.03552486002445221, -0.3149315118789673, -0.07081318646669388, -0.04407761991024017, -0.08536016941070557, -0.06255806237459183, -0.06255806237459183, 1.0000001192092896, -0.0833500549197197, -0.06255806237459183, -0.06047270819544792, -0.06255806237459183, -0.0833500549197197, -0.06255806237459183, -0.06134817749261856, -0.03292066231369972, -0.03712296485900879, -0.027040498331189156, -0.039197858422994614, -0.035176750272512436, -0.04594241827726364, -0.018147697672247887, -0.06197308003902435, -0.09482720494270325, -0.09840463101863861], "id": 16}, {"laplacian_similarity": [0.3367418944835663, 0.8258781433105469, -0.3764050602912903, -0.2568175792694092, -0.09561536461114883, -0.10924994200468063, -0.10924994200468063, -0.01582108810544014, -0.19595268368721008, -0.2701081335544586, -0.09561536461114883, 0.10027119517326355, -0.31510141491889954, 0.04782537370920181, -0.13285095989704132, -0.13285095989704132, -0.0833500549197197, 0.9999998807907104, -0.13285095989704132, 0.8291457295417786, -0.13285095989704132, 0.9999998807907104, -0.13285095989704132, -0.104569211602211, -0.02100702002644539, -0.005180063657462597, -0.05345568060874939, -0.12069369107484818, -0.22668150067329407, -0.10375052690505981, 0.07861816138029099, -0.07446203380823135, -0.28802308440208435, -0.12094241380691528], "id": 17}, {"laplacian_similarity": [-0.2552964985370636, -0.18586097657680511, -0.35535895824432373, -0.061295896768569946, -0.06299427896738052, -0.11318175494670868, -0.11318175494670868, -0.27023041248321533, -0.29090794920921326, -0.07836083322763443, -0.06299427896738052, -0.09120530635118484, 0.03159331530332565, -0.05962348356842995, 1.0, 1.0, -0.06255806237459183, -0.13285095989704132, 1.0, 0.127645343542099, 1.0, -0.13285095989704132, 1.0, -0.07894615083932877, -0.19931180775165558, -0.20433291792869568, -0.3045318126678467, -0.11125283688306808, -0.159977525472641, -0.2379005253314972, -0.1959364116191864, -0.07705680280923843, 0.7752416729927063, 0.5684211254119873], "id": 18}, {"laplacian_similarity": [0.29269301891326904, 0.5588499307632446, -0.26468586921691895, -0.406384140253067, -0.16447953879833221, -0.11269807815551758, -0.11269807815551758, -0.2535196840763092, -0.4443272650241852, 0.13633306324481964, -0.16447953879833221, 0.2378050684928894, -0.3966870605945587, 0.09893207252025604, 0.127645343542099, 0.127645343542099, -0.06047270819544792, 0.8291457295417786, 0.127645343542099, 1.0000001192092896, 0.127645343542099, 0.8291457295417786, 0.127645343542099, -0.16562514007091522, -0.11473780125379562, -0.21578946709632874, 0.004505299497395754, 0.003903354052454233, -0.017158713191747665, -0.11948603391647339, -0.3015194237232208, -0.07583818584680557, -0.3193203806877136, 0.3770824074745178], "id": 19}, {"laplacian_similarity": [-0.2552964985370636, -0.18586097657680511, -0.35535895824432373, -0.061295896768569946, -0.06299427896738052, -0.11318175494670868, -0.11318175494670868, -0.27023041248321533, -0.29090794920921326, -0.07836083322763443, -0.06299427896738052, -0.09120530635118484, 0.03159331530332565, -0.05962348356842995, 1.0, 1.0, -0.06255806237459183, -0.13285095989704132, 1.0, 0.127645343542099, 1.0, -0.13285095989704132, 1.0, -0.07894615083932877, -0.19931180775165558, -0.20433291792869568, -0.3045318126678467, -0.11125283688306808, -0.159977525472641, -0.2379005253314972, -0.1959364116191864, -0.07705680280923843, 0.7752416729927063, 0.5684211254119873], "id": 20}, {"laplacian_similarity": [0.3367418944835663, 0.8258781433105469, -0.3764050602912903, -0.2568175792694092, -0.09561536461114883, -0.10924994200468063, -0.10924994200468063, -0.01582108810544014, -0.19595268368721008, -0.2701081335544586, -0.09561536461114883, 0.10027119517326355, -0.31510141491889954, 0.04782537370920181, -0.13285095989704132, -0.13285095989704132, -0.0833500549197197, 0.9999998807907104, -0.13285095989704132, 0.8291457295417786, -0.13285095989704132, 0.9999998807907104, -0.13285095989704132, -0.104569211602211, -0.02100702002644539, -0.005180063657462597, -0.05345568060874939, -0.12069369107484818, -0.22668150067329407, -0.10375052690505981, 0.07861816138029099, -0.07446203380823135, -0.28802308440208435, -0.12094241380691528], "id": 21}, {"laplacian_similarity": [-0.2552964985370636, -0.18586097657680511, -0.35535895824432373, -0.061295896768569946, -0.06299427896738052, -0.11318175494670868, -0.11318175494670868, -0.27023041248321533, -0.29090794920921326, -0.07836083322763443, -0.06299427896738052, -0.09120530635118484, 0.03159331530332565, -0.05962348356842995, 1.0, 1.0, -0.06255806237459183, -0.13285095989704132, 1.0, 0.127645343542099, 1.0, -0.13285095989704132, 1.0, -0.07894615083932877, -0.19931180775165558, -0.20433291792869568, -0.3045318126678467, -0.11125283688306808, -0.159977525472641, -0.2379005253314972, -0.1959364116191864, -0.07705680280923843, 0.7752416729927063, 0.5684211254119873], "id": 22}, {"laplacian_similarity": [-0.23186014592647552, -0.12934458255767822, -0.14987270534038544, -0.06636694818735123, -0.04537120833992958, -0.10052964091300964, -0.10052964091300964, -0.11254114657640457, -0.07693720608949661, -0.11937486380338669, -0.04537120833992958, -0.024590078741312027, -0.026271050795912743, -0.2124193012714386, -0.07894615083932877, -0.07894615083932877, -0.06134817749261856, -0.104569211602211, -0.07894615083932877, -0.16562514007091522, -0.07894615083932877, -0.104569211602211, -0.07894615083932877, 1.0, 0.4321880638599396, 0.4237115979194641, 0.20549726486206055, 0.7077013254165649, -0.6241467595100403, 0.4701765179634094, -0.05988987907767296, -0.3645777106285095, 0.06528446078300476, -0.06147078424692154], "id": 23}, {"laplacian_similarity": [-0.11715371161699295, -0.08182311058044434, -0.07841650396585464, -0.12424980849027634, -0.07470434159040451, -0.07839319109916687, -0.07839319109916687, -0.12245912849903107, -0.13531696796417236, -0.15360127389431, -0.07470434159040451, -0.043923668563365936, -0.0896562859416008, -0.2369426190853119, -0.19931180775165558, -0.19931180775165558, -0.03292066231369972, -0.02100702002644539, -0.19931180775165558, -0.11473780125379562, -0.19931180775165558, -0.02100702002644539, -0.19931180775165558, 0.4321880638599396, 1.0, 0.9229817390441895, -0.29705703258514404, 0.4974089562892914, 0.03930745646357536, -0.20963861048221588, -0.11935876309871674, 0.506256639957428, -0.14000621438026428, -0.27830180525779724], "id": 24}, {"laplacian_similarity": [-0.14771167933940887, -0.0377364456653595, -0.3121921420097351, -0.022240400314331055, -0.05466137081384659, -0.07926946133375168, -0.07926946133375168, -0.07277387380599976, -0.11312399059534073, -0.4638213515281677, -0.05466137081384659, -0.15000741183757782, 0.0289265476167202, -0.29953497648239136, -0.20433291792869568, -0.20433291792869568, -0.03712296485900879, -0.005180063657462597, -0.20433291792869568, -0.21578946709632874, -0.20433291792869568, -0.005180063657462597, -0.20433291792869568, 0.4237115979194641, 0.9229817390441895, 1.0000001192092896, -0.09000685811042786, 0.21851849555969238, 0.02346300520002842, 0.014224246144294739, -0.0016569059807807207, 0.6038931012153625, -0.0183539018034935, -0.3679521381855011], "id": 25}, {"laplacian_similarity": [-0.08965776115655899, -0.07511203736066818, -0.1537187695503235, -0.05366845428943634, -0.042260605841875076, -0.05320842191576958, -0.05320842191576958, -0.0957537591457367, -0.07834330201148987, -0.028234779834747314, -0.042260605841875076, -0.03466234728693962, -0.017579499632120132, -0.05825541913509369, -0.3045318126678467, -0.3045318126678467, -0.027040498331189156, -0.05345568060874939, -0.3045318126678467, 0.004505299497395754, -0.3045318126678467, -0.05345568060874939, -0.3045318126678467, 0.20549726486206055, -0.29705703258514404, -0.09000685811042786, 1.0, -0.25821250677108765, 0.1893707811832428, 0.9449045658111572, -0.06398890167474747, 0.01939355581998825, -0.2438993602991104, 0.28223520517349243], "id": 26}, {"laplacian_similarity": [-0.14203061163425446, -0.13993102312088013, 0.3681737780570984, -0.17204637825489044, -0.060020968317985535, -0.07479750365018845, -0.07479750365018845, -0.08314304053783417, -0.07269541174173355, 0.4572155475616455, -0.060020968317985535, 0.1103287786245346, -0.21854323148727417, 0.008371587842702866, -0.11125283688306808, -0.11125283688306808, -0.039197858422994614, -0.12069369107484818, -0.11125283688306808, 0.003903354052454233, -0.11125283688306808, -0.12069369107484818, -0.11125283688306808, 0.7077013254165649, 0.4974089562892914, 0.21851849555969238, -0.25821250677108765, 1.0, -0.37997835874557495, -0.10240036994218826, -0.22133061289787292, -0.3899368345737457, -0.20190177857875824, 0.03375300019979477], "id": 27}, {"laplacian_similarity": [-0.12919892370700836, -0.16655424237251282, 0.34060367941856384, -0.11557833850383759, -0.05329948291182518, -0.07447528094053268, -0.07447528094053268, -0.052718762308359146, -0.02185608074069023, 0.3843216300010681, -0.05329948291182518, -0.10847994685173035, -0.18365195393562317, 0.10416115820407867, -0.159977525472641, -0.159977525472641, -0.035176750272512436, -0.22668150067329407, -0.159977525472641, -0.017158713191747665, -0.159977525472641, -0.22668150067329407, -0.159977525472641, -0.6241467595100403, 0.03930745646357536, 0.02346300520002842, 0.1893707811832428, -0.37997835874557495, 1.0, -0.08801223337650299, -0.11788817495107651, 0.7245604395866394, -0.2875466048717499, 0.31870168447494507], "id": 28}, {"laplacian_similarity": [-0.1609266698360443, -0.10575313866138458, -0.23917566239833832, -0.010975828394293785, -0.03361925110220909, -0.0749245211482048, -0.0749245211482048, -0.0863175243139267, -0.029539166018366814, -0.16493424773216248, -0.03361925110220909, -0.06981146335601807, 0.03995022550225258, -0.13641180098056793, -0.2379005253314972, -0.2379005253314972, -0.04594241827726364, -0.10375052690505981, -0.2379005253314972, -0.11948603391647339, -0.2379005253314972, -0.10375052690505981, -0.2379005253314972, 0.4701765179634094, -0.20963861048221588, 0.014224246144294739, 0.9449045658111572, -0.10240036994218826, -0.08801223337650299, 1.0000001192092896, 0.013117857277393341, -0.13213562965393066, -0.0759468823671341, 0.18643642961978912], "id": 29}, {"laplacian_similarity": [-0.16113856434822083, 0.231516033411026, 0.05081569403409958, -0.21529828011989594, -0.08899220079183578, -0.07877610623836517, -0.07877610623836517, -0.0074020251631736755, 0.8670445680618286, -0.2813875079154968, -0.08899220079183578, -0.15176858007907867, -0.25893765687942505, -0.38295015692710876, -0.1959364116191864, -0.1959364116191864, -0.018147697672247887, 0.07861816138029099, -0.1959364116191864, -0.3015194237232208, -0.1959364116191864, 0.07861816138029099, -0.1959364116191864, -0.05988987907767296, -0.11935876309871674, -0.0016569059807807207, -0.06398890167474747, -0.22133061289787292, -0.11788817495107651, 0.013117857277393341, 1.0, -0.05540279671549797, 0.3689735233783722, -0.3195286691188812], "id": 30}, {"laplacian_similarity": [-0.005818113684654236, -0.15641798079013824, -0.19491076469421387, -0.10098554193973541, -0.07085757702589035, -0.09781976789236069, -0.09781976789236069, -0.19286806881427765, -0.07515642046928406, -0.21865098178386688, -0.07085757702589035, -0.03992993012070656, 0.010883035138249397, -0.2316765934228897, -0.07705680280923843, -0.07705680280923843, -0.06197308003902435, -0.07446203380823135, -0.07705680280923843, -0.07583818584680557, -0.07705680280923843, -0.07446203380823135, -0.07705680280923843, -0.3645777106285095, 0.506256639957428, 0.6038931012153625, 0.01939355581998825, -0.3899368345737457, 0.7245604395866394, -0.13213562965393066, -0.05540279671549797, 1.0000001192092896, -0.05791114270687103, -0.0024831295013427734], "id": 31}, {"laplacian_similarity": [-0.3496345281600952, -0.2264522761106491, -0.3554609715938568, -0.013455920852720737, -0.06716182827949524, -0.15885695815086365, -0.15885695815086365, -0.20053574442863464, 0.24406592547893524, -0.37784236669540405, -0.06716182827949524, -0.1823732703924179, 0.0980626791715622, -0.322849303483963, 0.7752417325973511, 0.7752417325973511, -0.09482720494270325, -0.28802311420440674, 0.7752417325973511, -0.31932035088539124, 0.7752417325973511, -0.28802311420440674, 0.7752417325973511, 0.06528446078300476, -0.1400061994791031, -0.01835389994084835, -0.24389933049678802, -0.20190179347991943, -0.2875466048717499, -0.07594689726829529, 0.3689735233783722, -0.05791113153100014, 1.0, 0.21287481486797333], "id": 32}, {"laplacian_similarity": [-0.2948828339576721, -0.2361360788345337, 0.011004965752363205, -0.4361910820007324, -0.20304150879383087, -0.2126893550157547, -0.2126893550157547, -0.48900145292282104, -0.27341949939727783, 0.5125817060470581, -0.20304150879383087, 0.04624226689338684, -0.3705364465713501, -0.051354579627513885, 0.5684211254119873, 0.5684211254119873, -0.09840463101863861, -0.12094242870807648, 0.5684211254119873, 0.3770824074745178, 0.5684211254119873, -0.12094242870807648, 0.5684211254119873, -0.061470791697502136, -0.27830180525779724, -0.3679521381855011, 0.28223517537117004, 0.033752989023923874, 0.31870168447494507, 0.18643642961978912, -0.3195286691188812, -0.0024831390473991632, 0.21287481486797333, 0.9999999403953552], "id": 33}], "links": [{"source": 0, "target": 1}, {"source": 0, "target": 2}, {"source": 0, "target": 3}, {"source": 0, "target": 4}, {"source": 0, "target": 5}, {"source": 0, "target": 6}, {"source": 0, "target": 7}, {"source": 0, "target": 8}, {"source": 0, "target": 10}, {"source": 0, "target": 11}, {"source": 0, "target": 12}, {"source": 0, "target": 13}, {"source": 0, "target": 17}, {"source": 0, "target": 19}, {"source": 0, "target": 21}, {"source": 0, "target": 31}, {"source": 1, "target": 0}, {"source": 1, "target": 2}, {"source": 1, "target": 3}, {"source": 1, "target": 7}, {"source": 1, "target": 13}, {"source": 1, "target": 17}, {"source": 1, "target": 19}, {"source": 1, "target": 21}, {"source": 1, "target": 30}, {"source": 2, "target": 0}, {"source": 2, "target": 1}, {"source": 2, "target": 3}, {"source": 2, "target": 7}, {"source": 2, "target": 8}, {"source": 2, "target": 9}, {"source": 2, "target": 13}, {"source": 2, "target": 27}, {"source": 2, "target": 28}, {"source": 2, "target": 32}, {"source": 3, "target": 0}, {"source": 3, "target": 1}, {"source": 3, "target": 2}, {"source": 3, "target": 7}, {"source": 3, "target": 12}, {"source": 3, "target": 13}, {"source": 4, "target": 0}, {"source": 4, "target": 6}, {"source": 4, "target": 10}, {"source": 5, "target": 0}, {"source": 5, "target": 6}, {"source": 5, "target": 10}, {"source": 5, "target": 16}, {"source": 6, "target": 0}, {"source": 6, "target": 4}, {"source": 6, "target": 5}, {"source": 6, "target": 16}, {"source": 7, "target": 0}, {"source": 7, "target": 1}, {"source": 7, "target": 2}, {"source": 7, "target": 3}, {"source": 8, "target": 0}, {"source": 8, "target": 2}, {"source": 8, "target": 30}, {"source": 8, "target": 32}, {"source": 8, "target": 33}, {"source": 9, "target": 2}, {"source": 9, "target": 33}, {"source": 10, "target": 0}, {"source": 10, "target": 4}, {"source": 10, "target": 5}, {"source": 11, "target": 0}, {"source": 12, "target": 0}, {"source": 12, "target": 3}, {"source": 13, "target": 0}, {"source": 13, "target": 1}, {"source": 13, "target": 2}, {"source": 13, "target": 3}, {"source": 13, "target": 33}, {"source": 14, "target": 32}, {"source": 14, "target": 33}, {"source": 15, "target": 32}, {"source": 15, "target": 33}, {"source": 16, "target": 5}, {"source": 16, "target": 6}, {"source": 17, "target": 0}, {"source": 17, "target": 1}, {"source": 18, "target": 32}, {"source": 18, "target": 33}, {"source": 19, "target": 0}, {"source": 19, "target": 1}, {"source": 19, "target": 33}, {"source": 20, "target": 32}, {"source": 20, "target": 33}, {"source": 21, "target": 0}, {"source": 21, "target": 1}, {"source": 22, "target": 32}, {"source": 22, "target": 33}, {"source": 23, "target": 25}, {"source": 23, "target": 27}, {"source": 23, "target": 29}, {"source": 23, "target": 32}, {"source": 23, "target": 33}, {"source": 24, "target": 25}, {"source": 24, "target": 27}, {"source": 24, "target": 31}, {"source": 25, "target": 23}, {"source": 25, "target": 24}, {"source": 25, "target": 31}, {"source": 26, "target": 29}, {"source": 26, "target": 33}, {"source": 27, "target": 2}, {"source": 27, "target": 23}, {"source": 27, "target": 24}, {"source": 27, "target": 33}, {"source": 28, "target": 2}, {"source": 28, "target": 31}, {"source": 28, "target": 33}, {"source": 29, "target": 23}, {"source": 29, "target": 26}, {"source": 29, "target": 32}, {"source": 29, "target": 33}, {"source": 30, "target": 1}, {"source": 30, "target": 8}, {"source": 30, "target": 32}, {"source": 30, "target": 33}, {"source": 31, "target": 0}, {"source": 31, "target": 24}, {"source": 31, "target": 25}, {"source": 31, "target": 28}, {"source": 31, "target": 32}, {"source": 31, "target": 33}, {"source": 32, "target": 2}, {"source": 32, "target": 8}, {"source": 32, "target": 14}, {"source": 32, "target": 15}, {"source": 32, "target": 18}, {"source": 32, "target": 20}, {"source": 32, "target": 22}, {"source": 32, "target": 23}, {"source": 32, "target": 29}, {"source": 32, "target": 30}, {"source": 32, "target": 31}, {"source": 32, "target": 33}, {"source": 33, "target": 8}, {"source": 33, "target": 9}, {"source": 33, "target": 13}, {"source": 33, "target": 14}, {"source": 33, "target": 15}, {"source": 33, "target": 18}, {"source": 33, "target": 19}, {"source": 33, "target": 20}, {"source": 33, "target": 23}, {"source": 33, "target": 26}, {"source": 33, "target": 27}, {"source": 33, "target": 28}, {"source": 33, "target": 29}, {"source": 33, "target": 30}, {"source": 33, "target": 31}, {"source": 33, "target": 32}, {"source": 33, "target": 22}]} - var laplacian_colors = d3.scaleLinear([-1, 0, 1], ["#053e7a", "white", "#f7bf2c"]) @@ -19,7 +17,9 @@ var svg = d3.select("#laplacian_similarity") function graph(data) { - // Initialize the links + const pos_scale = 30; + const pos_offset = 200; + var link = svg .selectAll("line") .data(data.links) @@ -28,7 +28,6 @@ function graph(data) { .style("stroke", "#aaa") .style("stroke-width", 2) - // Initialize the nodes var nodes = svg .selectAll("circle") .data(data.nodes) @@ -37,29 +36,23 @@ function graph(data) { .attr("r", 10) .attr("fill", "white") .attr("id", function(d,i) { return i; }) - .attr("stroke", "rgb(170, 170, 170)").style('stroke-width', 3); + .attr("stroke", "rgb(170, 170, 170)").style('stroke-width', 3) + .attr("cx", function (d) { return pos_offset+pos_scale*d.ox; }) + .attr("cy", function(d) { return pos_offset+pos_scale*d.oy; }); - // Let's list the force we wanna apply on the network var simulation = d3.forceSimulation(data.nodes) .force("link", d3.forceLink() .id(function(d) { return d.id; }) .links(data.links) ) - .force("charge", d3.forceManyBody().strength(-100)) - .force("center", d3.forceCenter(width / 2, height / 2)) .on("end", ticked); - // This function is run at each iteration of the force algorithm, updating the nodes position. function ticked() { link - .attr("x1", function(d) { return d.source.x; }) - .attr("y1", function(d) { return d.source.y; }) - .attr("x2", function(d) { return d.target.x; }) - .attr("y2", function(d) { return d.target.y; }); - - nodes - .attr("cx", function (d) { return d.x+6; }) - .attr("cy", function(d) { return d.y-6; }); + .attr("x1", function(d) {return pos_offset+pos_scale*d.source.ox; }) + .attr("y1", function(d) { return pos_offset+pos_scale*d.source.oy; }) + .attr("x2", function(d) { return pos_offset+pos_scale*d.target.ox; }) + .attr("y2", function(d) { return pos_offset+pos_scale*d.target.oy; }); } nodes @@ -71,4 +64,4 @@ function graph(data) { } -graph(laplacian_data) \ No newline at end of file +graph(data) \ No newline at end of file