Skip to content

Commit 732f5a1

Browse files
committed
Removed tikz related code
1 parent e1b3399 commit 732f5a1

6 files changed

Lines changed: 131 additions & 636 deletions

File tree

src/maxplotlib/objects/layer.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/maxplotlib/subfigure/line_plot.py

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from mpl_toolkits.axes_grid1 import make_axes_locatable
55
from tikzpics import TikzFigure
66

7-
from maxplotlib.objects.layer import Tikzlayer
8-
97

108
class Node:
119
def __init__(self, x, y, label="", content="", layer=0, **kwargs):
@@ -270,77 +268,6 @@ def plot_plotly(self):
270268

271269
return traces
272270

273-
# def plot_tikzpics(self):
274-
275-
def add_node(
276-
self,
277-
x: int | float,
278-
y: int | float,
279-
label: str | None = None,
280-
content: str = "",
281-
layer=0,
282-
**kwargs,
283-
):
284-
"""
285-
Add a node to the TikZ figure.
286-
287-
Parameters:
288-
- x (float): X-coordinate of the node.
289-
- y (float): Y-coordinate of the node.
290-
- label (str, optional): Label of the node. If None, a default label will be assigned.
291-
- **kwargs: Additional TikZ node options (e.g., shape, color).
292-
293-
Returns:
294-
- node (Node): The Node object that was added.
295-
"""
296-
if label is None:
297-
label = f"node{self._node_counter}"
298-
node = Node(x=x, y=y, label=label, layer=layer, content=content, **kwargs)
299-
self.nodes.append(node)
300-
if layer in self.layers:
301-
self.layers[layer].add(node)
302-
else:
303-
self.layers[layer] = Tikzlayer(layer)
304-
self.layers[layer].add(node)
305-
self._node_counter += 1
306-
return node
307-
308-
def add_path(self, nodes, layer=0, **kwargs):
309-
"""
310-
Add a line or path connecting multiple nodes.
311-
312-
Parameters:
313-
- nodes (list of str): List of node names to connect.
314-
- **kwargs: Additional TikZ path options (e.g., style, color).
315-
316-
Examples:
317-
- add_path(['A', 'B', 'C'], color='blue')
318-
Connects nodes A -> B -> C with a blue line.
319-
"""
320-
if not isinstance(nodes, list):
321-
raise ValueError("nodes parameter must be a list of node names.")
322-
323-
nodes = [
324-
(
325-
node
326-
if isinstance(node, Node)
327-
else (
328-
self.get_node(node)
329-
if isinstance(node, str)
330-
else ValueError(f"Invalid node type: {type(node)}")
331-
)
332-
)
333-
for node in nodes
334-
]
335-
path = Path(nodes, **kwargs)
336-
self.paths.append(path)
337-
if layer in self.layers:
338-
self.layers[layer].add(path)
339-
else:
340-
self.layers[layer] = Tikzlayer(layer)
341-
self.layers[layer].add(path)
342-
return path
343-
344271
@property
345272
def xmin(self):
346273
return self._xmin

0 commit comments

Comments
 (0)