{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Main.HypergraphsPlot" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#include the HypergraphsPlot.jl in julia folder.\n", "include(\"julia/HypergraphsPlot.jl\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "20×5 SimpleHypergraphs.Hypergraph{Int64,Nothing,Nothing}:\n", " 1 nothing nothing 1 nothing\n", " nothing nothing nothing nothing nothing\n", " 1 nothing 1 nothing nothing\n", " nothing nothing nothing nothing nothing\n", " 1 nothing nothing nothing 1 \n", " nothing nothing nothing nothing nothing\n", " 1 nothing 1 nothing nothing\n", " nothing nothing nothing nothing 1 \n", " nothing nothing 1 nothing nothing\n", " 1 nothing nothing nothing nothing\n", " nothing nothing nothing nothing nothing\n", " nothing nothing nothing nothing nothing\n", " 1 nothing nothing nothing 1 \n", " 1 nothing nothing nothing nothing\n", " nothing nothing nothing 1 nothing\n", " nothing nothing nothing nothing nothing\n", " nothing nothing nothing 1 nothing\n", " 1 nothing nothing nothing 1 \n", " nothing nothing nothing nothing nothing\n", " nothing 1 nothing nothing 1 " ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#generate a random hypergraph with 20 nodes and 5 hyperlinks with random values.\n", "h = HypergraphsPlot.generatehg(20,5)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "HTML{String}(\"\\n\\n\\n\\n\\n\\n\")" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#plot the hypergraph with color-edge visualization\n", "HypergraphsPlot.plot(h,type=\"color-edge\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "HTML{String}(\"\\n\\n\\n\\n\\n\\n\")" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#plot the hypergraph with radal visualization\n", "HypergraphsPlot.plot(h,type=\"radal\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "HTML{String}(\"\\n\\n\\n\\n\\n\\n\")" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#plot the hypergraph with venn visualization\n", "HypergraphsPlot.plot(h,type=\"venn\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "HTML{String}(\"\\n\\n\\n\\n\\n\\n\")" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#you can also plot the hypergraph using a JSON file descriptor\n", "HypergraphsPlot.plot(\"newData.json\",type=\"color-edge\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "HTML{String}(\"\\n\\n\\n\\n\\n\\n\")" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#or specifing some preferences\n", "HypergraphsPlot.plot(h,type=\"color-edge\",colorNodes=\"red\",colorEdges=\"blue\",sizeNodes=\"10\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Julia 1.1.0", "language": "julia", "name": "julia-1.1" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.1.0" } }, "nbformat": 4, "nbformat_minor": 2 }