|
15 | 15 |
|
16 | 16 | from datetime import datetime
|
17 | 17 | from enum import Enum
|
| 18 | +from platform import node |
18 | 19 | from typing import Optional, Union, List, Dict
|
| 20 | +import re |
19 | 21 |
|
20 | 22 | from sagemaker.lineage._utils import get_resource_name_from_arn, get_module
|
21 | 23 |
|
@@ -330,12 +332,14 @@ def render(self, elements, path="pyvisExample.html"):
|
330 | 332 |
|
331 | 333 | # add nodes to graph
|
332 | 334 | for arn, source, entity, is_start_arn in elements["nodes"]:
|
| 335 | + source = re.sub(r"(\w)([A-Z])", r"\1 \2", source) |
| 336 | + node_info = "Entity: " + entity + "\n" + "Type: " + source + "\n" + "Name: " + arn |
333 | 337 | if is_start_arn: # startarn
|
334 | 338 | net.add_node(
|
335 |
| - arn, label=source, title=entity+"\n"+arn, color=self._node_color(entity), shape="star", borderWidth=3 |
| 339 | + arn, label=source, title=node_info, color=self._node_color(entity), shape="star", borderWidth=3 |
336 | 340 | )
|
337 | 341 | else:
|
338 |
| - net.add_node(arn, label=source, title=entity+"\n"+arn, color=self._node_color(entity), borderWidth=3) |
| 342 | + net.add_node(arn, label=source, title=node_info, color=self._node_color(entity), borderWidth=3) |
339 | 343 |
|
340 | 344 | # add edges to graph
|
341 | 345 | for src, dest, asso_type in elements["edges"]:
|
@@ -391,7 +395,7 @@ def __str__(self):
|
391 | 395 |
|
392 | 396 | """
|
393 | 397 | return (
|
394 |
| - "{\n" |
| 398 | + "{" |
395 | 399 | + "\n\n".join("'{}': {},".format(key, val) for key, val in self.__dict__.items())
|
396 | 400 | + "\n}"
|
397 | 401 | )
|
|
0 commit comments