ivy/notebooks/bspline.ipynb

169 строки
4.3 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from widget_cy_graph import CyGraphWidget"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"w = CyGraphWidget()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"w"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"w.cy_style = [\n",
" {\n",
" \"selector\": \"node\",\n",
" \"style\": {\n",
" \"content\": \"data(id)\",\n",
" \"text-valign\": \"center\",\n",
" \"width\": 54,\n",
" \"height\": 36,\n",
" },\n",
" },\n",
" {\n",
" \"selector\": \"edge\",\n",
" \"style\": {\n",
" \"width\": 5,\n",
" \"curve-style\": \"bezier\",\n",
" \"target-arrow-shape\": \"triangle\", \n",
" #\"target-arrow-shape\": \"triangle-backcurve\", \n",
" #\"target-arrow-shape\": \"circle\", \n",
" #\"source-arrow-shape\": \"circle\", \n",
" #\"mid-source-arrow-shape\": \"triangle\", \n",
" #\"mid-target-arrow-shape\": \"triangle\", \n",
" },\n",
" },\n",
" {\n",
" \"selector\": \"node:selected\",\n",
" \"style\": {\n",
" \"overlay-opacity\": \"0.2\",\n",
" },\n",
" },\n",
"\n",
" {\n",
" \"selector\": \"edge:selected\",\n",
" \"style\": {\n",
" \"overlay-opacity\": \"0.2\",\n",
" },\n",
" },\n",
"\n",
"]\n",
"w.cy_elements = []\n",
"w.cy_elements = [\n",
" {\n",
" \"group\": \"nodes\",\n",
" \"data\": {\n",
" \"id\": 'n1', \n",
" },\n",
" \"position\": {\n",
" \"x\": 54, \n",
" \"y\": -162,\n",
" },\n",
" },\n",
" {\n",
" \"group\": \"nodes\",\n",
" \"data\": {\n",
" \"id\": 'n2', \n",
" },\n",
" \"position\": {\n",
" \"x\": 27, \n",
" \"y\": -90,\n",
" },\n",
" },\n",
" {\n",
" \"group\": \"nodes\",\n",
" \"data\": {\n",
" \"id\": 'n3', \n",
" },\n",
" \"position\": {\n",
" \"x\": 54, \n",
" \"y\": -18,\n",
" },\n",
" },\n",
" {\n",
" \"group\": \"edges\",\n",
" \"data\": {\n",
" \"id\": 'e1', \n",
" \"source\": 'n1',\n",
" \"target\": 'n3',\n",
" \"bspline\": [\n",
" {'x': 57.654, 'y': -143.91},\n",
" {'x': 59.676, 'y': -133.57},\n",
" {'x': 61.981, 'y': -120.09},\n",
" {'x': 63.0, 'y': -108.0},\n",
" {'x': 64.344, 'y': -92.057},\n",
" {'x': 64.344, 'y': -87.943},\n",
" {'x': 63.0, 'y': -72.0},\n",
" {'x': 62.283, 'y': -63.499},\n",
" {'x': 60.931, 'y': -54.312},\n",
" {'x': 59.488, 'y': -46.012},\n",
" ],\n",
" \"arrowend\": {'x': 57.654, 'y': -36.092}\n",
" }, \n",
" },\n",
"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}