{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "815a1030", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from bqplot import *\n", "\n", "node_data = [\n", " dict(shape='rect'),\n", " dict(label='B', shape='ellipse', label_display='outside'),\n", " dict(label='C', shape='ellipse'),\n", " dict(shape='rect'),\n", " 'E',\n", " 'F',\n", " dict(label='G', shape='ellipse'),\n", "]\n", "link_data = [\n", " {'source': 2, 'target': 5},\n", " {'source': 1, 'target': 2},\n", " {'source': 3, 'target': 6},\n", " {'source': 1, 'target': 5},\n", " {'source': 3, 'target': 0},\n", " {'source': 4, 'target': 1},\n", " {'source': 3, 'target': 6},\n", " {'source': 0, 'target': 2},\n", " {'source': 3, 'target': 6}\n", "]\n", "graph = Graph(node_data=node_data, link_data=link_data, charge=-600, static=True, colors=['orange'] * 7)\n", "Figure(marks=[graph])" ] }, { "cell_type": "code", "execution_count": null, "id": "0d74d719", "metadata": {}, "outputs": [], "source": [ "graph.directed = False" ] }, { "cell_type": "code", "execution_count": null, "id": "b0a6df4f", "metadata": {}, "outputs": [], "source": [ "graph.link_type = 'line'" ] }, { "cell_type": "code", "execution_count": null, "id": "af4a3a6f", "metadata": {}, "outputs": [], "source": [ "graph.directed = True" ] }, { "cell_type": "code", "execution_count": null, "id": "ec7ebdfe", "metadata": {}, "outputs": [], "source": [ "graph.link_type = 'slant_line'" ] }, { "cell_type": "code", "execution_count": null, "id": "e677884e", "metadata": {}, "outputs": [], "source": [ "graph.directed = False" ] }, { "cell_type": "code", "execution_count": null, "id": "7b534218", "metadata": {}, "outputs": [], "source": [ "# TOFIX\n", "# graph.colors = ['red'] * 7" ] }, { "cell_type": "code", "execution_count": null, "id": "b8ed2f4d", "metadata": {}, "outputs": [], "source": [ "# TOFIX\n", "# graph.node_data = list('ABCDEFG')" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.2" } }, "nbformat": 4, "nbformat_minor": 5 }