import numpy as np
np.random.seed(583)

import matplotlib.pyplot as plt

from cellcomplex.property_topomesh.example_topomesh import circle_voronoi_topomesh
from cellcomplex.property_topomesh.analysis import compute_topomesh_property
from cellcomplex.property_topomesh.utils.matplotlib_tools import mpl_draw_topomesh, mpl_draw_incidence_graph

topomesh = circle_voronoi_topomesh(3)
compute_topomesh_property(topomesh,'length',1)

figure = plt.figure(0)
figure.clf()
figure.gca().axis('equal')

col = mpl_draw_topomesh(topomesh,figure,1,property_name='length',colormap='viridis',linewidth=3)
mpl_draw_topomesh(topomesh,figure,0,color='k',size=20)

figure.colorbar(col)

figure.gca().axis('off')
figure.tight_layout()