You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue proposes to rewrite most of the GraphicalSurface in order to simplify it and also make it more flexible. In particular, we get rid of the GraphicalPolygon class. We propose to rename it SurfacePlot (in order to follow name conventions in sage, eg GraphPlot). The basic structure we propose is as follows.
classSurfacePlot:
defvisible_labels(self):
r""" Iterable of labels of polygons to be displayed """# go through internal attributes and figure out what to dodefpolygon_layout(self, label):
r""" Return ``None`` when the polygon with the given ``label`` is invisible or the similarity used to render it """# go through internal attributes and figure out what to dodefpolygon_options(self, label):
r""" Return ``None`` when the polygon should not be plotted or a dictionary of options. If not ``None``, the dictionary in the output has a key ``"points"`` which is the list of positions of the vertices to be rendered (which is the required argument of the sage ``polygon2d`` function). """# go through internal attributes and figure out what to dodefpolygon_label_options(self, label):
r""" Return ``None`` when the polygon label should not be plotted or a dictionary of options If not ``None``, the dictionary in the output always has a key ``"string"`` and a key ``"xy"`` which are the string label and position to be rendered (which are the required arguments of the sage ``text`` function). """# go through internal attributes and figure out what to dodefedge_options(self, label, edge):
r""" Return ``None`` when the edge should not be plotted or a dictionary of options If not ``None``, the dictionary in the output has a key ``"points"`` which is the 2-tuple of start and end to be rendered (which is the required argument of the sage ``line2d`` function). """# go through internal attributes and figure out what to dodefedge_label_options(self, label, edge):
r""" Return ``None`` when the edge label should not be plotted or a dictionary of options If not ``None``, the dictionary in the output has a key ``"string"`` and a key ``"xy"`` which are the string label and position to be rendered (which are the required arguments of the sage ``text`` function). """# go through internal attributes and figure out what to dodefplot(self):
G=Graphics()
forlabelinself.visible_polygons():
opts=self.polygon_options(label)
ifoptsisnotNone:
G+=polygon2d(**opts)
opts=self.polygon_label_options(label)
ifoptsisnotNone:
G+=text2d(**opts)
foredgeinrange(len(self._ss.polygon(label).vertices())):
opts=self.edge_options(label, edge)
ifoptsisnotNone:
G+=line2d(**opts)
opts=self.edge_label_options(label)
ifoptsisnotNone:
G+=text2d(**opts)
returnG
The main piece of code of a SurfacePlot would be to generate the visible labels and the similarities to be returned in polygon_layout. For infinite surface, these ought to be dynamical (eg via a make_visible or explore_more or ...).
Typically, one wants to plot additional features on a rendered surface. This could be handled with the access to SurfacePlot.visible_labels() and SurfacePlot.polygon_layout(label).
The text was updated successfully, but these errors were encountered:
This issue proposes to rewrite most of the
GraphicalSurface
in order to simplify it and also make it more flexible. In particular, we get rid of theGraphicalPolygon
class. We propose to rename itSurfacePlot
(in order to follow name conventions in sage, egGraphPlot
). The basic structure we propose is as follows.The main piece of code of a
SurfacePlot
would be to generate the visible labels and the similarities to be returned inpolygon_layout
. For infinite surface, these ought to be dynamical (eg via amake_visible
orexplore_more
or ...).Typically, one wants to plot additional features on a rendered surface. This could be handled with the access to
SurfacePlot.visible_labels()
andSurfacePlot.polygon_layout(label)
.The text was updated successfully, but these errors were encountered: