topologicpy 0.4.63__py3-none-any.whl → 0.4.64__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
topologicpy/Graph.py CHANGED
@@ -5015,7 +5015,7 @@ class Graph:
5015
5015
  @staticmethod
5016
5016
  def Show(graph, vertexColor="black", vertexSize=6, vertexLabelKey=None, vertexGroupKey=None, vertexGroups=[], showVertices=True, showVertexLegend=False, edgeColor="black", edgeWidth=1, edgeLabelKey=None, edgeGroupKey=None, edgeGroups=[], showEdges=True, showEdgeLegend=False, colorScale='viridis', renderer="notebook",
5017
5017
  width=950, height=500, xAxis=False, yAxis=False, zAxis=False, axisSize=1, backgroundColor='rgba(0,0,0,0)', marginLeft=0, marginRight=0, marginTop=20, marginBottom=0,
5018
- camera=None, target=None, up=None, tolerance=0.0001):
5018
+ camera=[-1.25, -1.25, 1.25], center=[0, 0, 0], up=[0, 0, 1], projection="perspective", tolerance=0.0001):
5019
5019
  """
5020
5020
  Shows the graph using Plotly.
5021
5021
 
@@ -5094,11 +5094,14 @@ class Graph:
5094
5094
  marginBottom : int , optional
5095
5095
  The size in pixels of the bottom margin. The default value is 0.
5096
5096
  camera : list , optional
5097
- The desired location of the camera. The default is [0,0,0].
5098
- target : list , optional
5099
- The desired camera target. The default is [0,0,0].
5097
+ The desired location of the camera). The default is [-1.25,-1.25,1.25].
5098
+ center : list , optional
5099
+ The desired center (camera target). The default is [0,0,0].
5100
5100
  up : list , optional
5101
5101
  The desired up vector. The default is [0,0,1].
5102
+ projection : str , optional
5103
+ The desired type of projection. The options are "orthographic" or "perspective". It is case insensitive. The default is "perspective"
5104
+
5102
5105
  tolerance : float , optional
5103
5106
  The desired tolerance. The default is 0.0001.
5104
5107
 
@@ -5116,7 +5119,7 @@ class Graph:
5116
5119
  data= Plotly.DataByGraph(graph, vertexColor=vertexColor, vertexSize=vertexSize, vertexLabelKey=vertexLabelKey, vertexGroupKey=vertexGroupKey, vertexGroups=vertexGroups, showVertices=showVertices, showVertexLegend=showVertexLegend, edgeColor=edgeColor, edgeWidth=edgeWidth, edgeLabelKey=edgeLabelKey, edgeGroupKey=edgeGroupKey, edgeGroups=edgeGroups, showEdges=showEdges, showEdgeLegend=showEdgeLegend, colorScale=colorScale)
5117
5120
  fig = Plotly.FigureByData(data, width=width, height=height, xAxis=xAxis, yAxis=yAxis, zAxis=zAxis, axisSize=axisSize, backgroundColor=backgroundColor,
5118
5121
  marginLeft=marginLeft, marginRight=marginRight, marginTop=marginTop, marginBottom=marginBottom, tolerance=tolerance)
5119
- Plotly.Show(fig, renderer=renderer, camera=camera, target=target, up=up)
5122
+ Plotly.Show(fig, renderer=renderer, camera=camera, center=center, up=up, projection=projection)
5120
5123
 
5121
5124
  @staticmethod
5122
5125
  def Size(graph):
topologicpy/Plotly.py CHANGED
@@ -40,6 +40,7 @@ except:
40
40
  try:
41
41
  import plotly
42
42
  import plotly.graph_objects as go
43
+ import plotly.offline as ofl
43
44
  except:
44
45
  print("Plotly - Installing required plotly library.")
45
46
  try:
@@ -49,6 +50,7 @@ except:
49
50
  try:
50
51
  import plotly
51
52
  import plotly.graph_objects as go
53
+ import plotly.offline as ofl
52
54
  except:
53
55
  raise Exception("Plotly - Error: Could not import plotly.")
54
56
 
@@ -1450,8 +1452,7 @@ class Plotly:
1450
1452
 
1451
1453
  width=950, height=500,
1452
1454
  xAxis=False, yAxis=False, zAxis=False, axisSize=1, backgroundColor='rgba(0,0,0,0)',
1453
- marginLeft=0, marginRight=0, marginTop=20, marginBottom=0, camera=[1.25, 1.25, 1.25],
1454
- target=[0, 0, 0], up=[0, 0, 1], renderer="notebook", showScale=False,
1455
+ marginLeft=0, marginRight=0, marginTop=20, marginBottom=0, showScale=False,
1455
1456
 
1456
1457
  cbValues=[], cbTicks=5, cbX=-0.15, cbWidth=15, cbOutlineWidth=0, cbTitle="",
1457
1458
  cbSubTitle="", cbUnits="", colorScale="Viridis", mantissa=6, tolerance=0.0001):
@@ -1582,7 +1583,7 @@ class Plotly:
1582
1583
  marginBottom : int , optional
1583
1584
  The size in pixels of the bottom margin. The default value is 0.
1584
1585
  camera : list , optional
1585
- The desired location of the camera). The default is [0,0,0].
1586
+ The desired location of the camera). The default is [-1.25,-1.25,1.25].
1586
1587
  center : list , optional
1587
1588
  The desired center (camera target). The default is [0,0,0].
1588
1589
  up : list , optional
@@ -1831,7 +1832,7 @@ class Plotly:
1831
1832
  return True
1832
1833
 
1833
1834
  @staticmethod
1834
- def SetCamera(figure, camera=[1.25, 1.25, 1.25], target=[0, 0, 0], up=[0, 0, 1]):
1835
+ def SetCamera(figure, camera=[-1.25, -1.25, 1.25], center=[0, 0, 0], up=[0, 0, 1], projection="perspective"):
1835
1836
  """
1836
1837
  Sets the camera for the input figure.
1837
1838
 
@@ -1840,11 +1841,13 @@ class Plotly:
1840
1841
  figure : plotly.graph_objs._figure.Figure
1841
1842
  The input plotly figure.
1842
1843
  camera : list , optional
1843
- The desired location of the camera. The default is [0,0,0].
1844
- target : list , optional
1845
- The desired camera target. The default is [0,0,0].
1844
+ The desired location of the camera. The default is [-1.25,-1.25,1.25].
1845
+ center : list , optional
1846
+ The desired center (camera target). The default is [0,0,0].
1846
1847
  up : list , optional
1847
1848
  The desired up vector. The default is [0,0,1].
1849
+ projection : str , optional
1850
+ The desired type of projection. The options are "orthographic" or "perspective". It is case insensitive. The default is "perspective"
1848
1851
 
1849
1852
  Returns
1850
1853
  -------
@@ -1853,21 +1856,27 @@ class Plotly:
1853
1856
 
1854
1857
  """
1855
1858
  if not isinstance(camera, list):
1856
- camera = [1.25, 1.25, 1.25]
1857
- if not isinstance(target, list):
1858
- target = [0,0,0]
1859
+ camera = [-1.25, -1.25, 1.25]
1860
+ if not isinstance(center, list):
1861
+ center = [0,0,0]
1859
1862
  if not isinstance(up, list):
1860
1863
  up = [0,0,1]
1864
+ projection = projection.lower()
1865
+ if projection in "orthographic":
1866
+ projection = "orthographic"
1867
+ else:
1868
+ projection = "perspective"
1861
1869
  scene_camera = dict(
1862
1870
  up=dict(x=up[0], y=up[1], z=up[2]),
1863
1871
  eye=dict(x=camera[0], y=camera[1], z=camera[2]),
1864
- center=dict(x=target[0], y=target[1], z=target[2])
1872
+ center=dict(x=center[0], y=center[1], z=center[2]),
1873
+ projection=dict(type=projection)
1865
1874
  )
1866
1875
  figure.update_layout(scene_camera=scene_camera)
1867
1876
  return figure
1868
1877
 
1869
1878
  @staticmethod
1870
- def Show(figure, camera=[-1.25, -1.25, 1.25], target=[0, 0, 0], up=[0, 0, 1], renderer="notebook"):
1879
+ def Show(figure, camera=[-1.25, -1.25, 1.25], center=[0, 0, 0], up=[0, 0, 1], renderer="notebook", projection="perspective"):
1871
1880
  """
1872
1881
  Shows the input figure.
1873
1882
 
@@ -1877,12 +1886,15 @@ class Plotly:
1877
1886
  The input plotly figure.
1878
1887
  camera : list , optional
1879
1888
  The desired location of the camera. The default is [0,0,0].
1880
- target : list , optional
1881
- The desired camera target. The default is [0,0,0].
1889
+ center : list , optional
1890
+ The desired center (camera target). The default is [0,0,0].
1882
1891
  up : list , optional
1883
1892
  The desired up vector. The default is [0,0,1].
1884
1893
  renderer : str , optional
1885
1894
  The desired rendered. See Plotly.Renderers(). The default is "notebook".
1895
+ projection : str, optional
1896
+ The desired type of projection. The options are "orthographic" or "perspective". It is case insensitive. The default is "perspective"
1897
+
1886
1898
 
1887
1899
  Returns
1888
1900
  -------
@@ -1898,10 +1910,9 @@ class Plotly:
1898
1910
  if not renderer.lower() in Plotly.Renderers():
1899
1911
  print("Plotly.Show - Error: The input renderer is not in the approved list of renderers. Returning None.")
1900
1912
  return None
1901
- if not camera == None and not target == None and not up == None:
1902
- figure = Plotly.SetCamera(figure, camera=camera, target=target, up=up)
1913
+ if not camera == None and not center == None and not up == None:
1914
+ figure = Plotly.SetCamera(figure, camera=camera, center=center, up=up, projection=projection)
1903
1915
  if renderer.lower() == "offline":
1904
- import plotly.offline as ofl
1905
1916
  ofl.plot(figure)
1906
1917
  else:
1907
1918
  figure.show(renderer=renderer)
topologicpy/Topology.py CHANGED
@@ -5439,7 +5439,7 @@ class Topology():
5439
5439
  width=950, height=500,
5440
5440
  xAxis=False, yAxis=False, zAxis=False, axisSize=1, backgroundColor='rgba(0,0,0,0)',
5441
5441
  marginLeft=0, marginRight=0, marginTop=20, marginBottom=0, camera=[-1.25, -1.25, 1.25],
5442
- target=[0, 0, 0], up=[0, 0, 1], renderer="notebook", showScale=False,
5442
+ center=[0, 0, 0], up=[0, 0, 1], projection="perspective", renderer="notebook", showScale=False,
5443
5443
 
5444
5444
  cbValues=[], cbTicks=5, cbX=-0.15, cbWidth=15, cbOutlineWidth=0, cbTitle="",
5445
5445
  cbSubTitle="", cbUnits="", colorScale="Viridis", mantissa=6, tolerance=0.0001):
@@ -5570,11 +5570,13 @@ class Topology():
5570
5570
  marginBottom : int , optional
5571
5571
  The size in pixels of the bottom margin. The default value is 0.
5572
5572
  camera : list , optional
5573
- The desired location of the camera). The default is [0,0,0].
5573
+ The desired location of the camera). The default is [-1.25,-1.25,1.25].
5574
5574
  center : list , optional
5575
5575
  The desired center (camera target). The default is [0,0,0].
5576
5576
  up : list , optional
5577
5577
  The desired up vector. The default is [0,0,1].
5578
+ projection : str , optional
5579
+ The desired type of projection. The options are "orthographic" or "perspective". It is case insensitive. The default is "perspective"
5578
5580
  renderer : str , optional
5579
5581
  The desired renderer. See Plotly.Renderers(). The default is "notebook".
5580
5582
  intensityKey : str , optional
@@ -5613,11 +5615,14 @@ class Topology():
5613
5615
  from topologicpy.Cluster import Cluster
5614
5616
  from topologicpy.Plotly import Plotly
5615
5617
  from topologicpy.Helper import Helper
5618
+ from topologicpy.Graph import Graph
5616
5619
 
5617
5620
  if isinstance(topologies, tuple):
5618
5621
  topologies = Helper.Flatten(list(topologies))
5619
5622
  if isinstance(topologies, list):
5620
5623
  new_topologies = [t for t in topologies if isinstance(t, topologic.Topology)]
5624
+ graphs = [Graph.Topology(g) for g in topologies if isinstance(g, topologic.Graph)]
5625
+ new_topologies += graphs
5621
5626
  if len(new_topologies) == 0:
5622
5627
  print("Topology.Show - Error: the input topologies parameter does not contain any valid topology. Returning None.")
5623
5628
  return None
@@ -5653,7 +5658,7 @@ class Topology():
5653
5658
  tolerance=tolerance)
5654
5659
  if showScale:
5655
5660
  figure = Plotly.AddColorBar(figure, values=cbValues, nTicks=cbTicks, xPosition=cbX, width=cbWidth, outlineWidth=cbOutlineWidth, title=cbTitle, subTitle=cbSubTitle, units=cbUnits, colorScale=colorScale, mantissa=mantissa)
5656
- Plotly.Show(figure=figure, renderer=renderer, camera=camera, target=target, up=up)
5661
+ Plotly.Show(figure=figure, renderer=renderer, camera=camera, center=center, up=up, projection=projection)
5657
5662
 
5658
5663
  @staticmethod
5659
5664
  def SortBySelectors(topologies, selectors, exclusive=False, tolerance=0.0001):
topologicpy/__init__.py CHANGED
@@ -2,7 +2,7 @@ import sys
2
2
  import os, re
3
3
  from sys import platform
4
4
 
5
- __version__ = '0.4.63'
5
+ __version__ = '0.4.64'
6
6
  __version_info__ = tuple([ int(num) for num in __version__.split('.')])
7
7
 
8
8
  if platform == 'win32':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.4.63
3
+ Version: 0.4.64
4
4
  Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/wassimj/TopologicPy
@@ -9,21 +9,21 @@ topologicpy/Dictionary.py,sha256=rgXmYrDWhoaMsir3kg7mHv-dtZqWqvp9vDMqYp3MvPI,240
9
9
  topologicpy/Edge.py,sha256=-xGhloh6FtbPNwMdlAMi1Eu11_uzIq3ZdYRalgk1Zjo,44367
10
10
  topologicpy/EnergyModel.py,sha256=pBqgsyEC1iwFNetxPAfHGPxTHqwVzeRk8fBJlLDaE6E,51052
11
11
  topologicpy/Face.py,sha256=5fN5RmlYZImqoAsophG1KARdvlIz8vaFONa1TmC6v7k,88129
12
- topologicpy/Graph.py,sha256=onUk_eO-2bYbPwpoCI7Lfr_YVGFNdUHV9JWGQ5N5Mtw,261249
12
+ topologicpy/Graph.py,sha256=jV5jEfn3K9W2TrrySoQRnP4dgcq6qoT_U2xSWa1nKAQ,261531
13
13
  topologicpy/Grid.py,sha256=77WRTTqGxxIuUHorrH74JHeBS4E7v27ydzckIdu3K54,16661
14
14
  topologicpy/Helper.py,sha256=11_Lmrp3ky5e20lTb2mQuy_QNA9HZdsOdoSvjaqmL1E,12961
15
15
  topologicpy/Honeybee.py,sha256=ICEcvlJMw0NoQLmHGSoMGpebvD6jSpcEg-iIS-w6jxQ,19617
16
16
  topologicpy/Matrix.py,sha256=GHd_o714eEWbTOhRM5X-fXcgsV5yYJJSj6xFdnkwC14,7625
17
17
  topologicpy/Neo4j.py,sha256=uWCVuTLWgl9rmSOM-3F9zwvgRyudl3hggHQPIvoSMg8,18627
18
- topologicpy/Plotly.py,sha256=TdcEMM-LWyA1kcKCFl7tVU-GnsakVmWT14lI15nEOvI,94099
18
+ topologicpy/Plotly.py,sha256=C-pHwohY1CT2GUi0cQi6PI4Xt4uEg5z8AJWVWFH9WTY,94745
19
19
  topologicpy/Polyskel.py,sha256=ZYJlC7w89CX6EZsmK_BnflR6VdIB4fmPluZNBMCET-Q,15194
20
20
  topologicpy/Shell.py,sha256=mYtjkpIEUxMutH-NOCbd-zlrQJbiuEiIGeNlfH6eg0A,80582
21
21
  topologicpy/Speckle.py,sha256=D6jk1uiHJeLHz478-hn8aWJCgbW9NFEkll84gRJbveA,14041
22
- topologicpy/Topology.py,sha256=YXwP97PM2RWWpb25GvZiikFmMi37fFkedlPfVL6rc7w,284724
22
+ topologicpy/Topology.py,sha256=VbEzFf7Ja0KwC2L_TM_OD_64d9Q9GEFIMHK6AxvHqxI,285147
23
23
  topologicpy/Vector.py,sha256=7ZyJG_Cvl5yLpbo8RDhFeLUEmRdM3EDnFnATUJKxrWo,18832
24
24
  topologicpy/Vertex.py,sha256=R0C9Q4HNuia4WRH4XrHN6yQJuuZ4VqI7yTa_o1s_JvM,54455
25
25
  topologicpy/Wire.py,sha256=l0_J3wd9lTP3Xx8pdC4vPzREqZX88yAvBVbg0v5pu-E,128287
26
- topologicpy/__init__.py,sha256=FVgpjTgwA2vHWebm-uOVJys6NFZYME9a9ew-CaCvbP8,713
26
+ topologicpy/__init__.py,sha256=paIXrMbk7E2oUAEdQllDfKZeY7vw4vepOZgKAWsK4L0,713
27
27
  topologicpy/bin/linux/topologic/__init__.py,sha256=XlFReDf3FWlYdM9uXtanYPIafgPb6GVTQczS_xJAXD0,60
28
28
  topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so,sha256=uvar01STZ8qu1c8fRmtYdVnK8evxBv305QScASXY9go,1852112
29
29
  topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so,sha256=42yjVWetFu_qn6-eZcDxgd_A8SQN_wHqkdw91txKt9U,1852112
@@ -67,8 +67,8 @@ topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd,sha256=F0sPLuMpD
67
67
  topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd,sha256=aBAJQj3OmJ58MOAF1ZIFybL_5fFK7FNR9hrIps6b6pc,1551872
68
68
  topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd,sha256=aLgNf54nbJmGc7Tdmkuy-V0m6B9zLxabIbpRwAy7cBA,1551360
69
69
  topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd,sha256=_8cp205hiRxkFHtzQQOweA4DhCPk8caH4kTVLWGQeVw,1411584
70
- topologicpy-0.4.63.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
71
- topologicpy-0.4.63.dist-info/METADATA,sha256=Ay9qUjkH_J3BNjKMPWlDYFzPnvxZsfuk2drJRR-1dBI,7231
72
- topologicpy-0.4.63.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
- topologicpy-0.4.63.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
74
- topologicpy-0.4.63.dist-info/RECORD,,
70
+ topologicpy-0.4.64.dist-info/LICENSE,sha256=RUmXeeqj63bBySLJjEfhwb9OE7M8h9K6HuOBF3ASVyI,35697
71
+ topologicpy-0.4.64.dist-info/METADATA,sha256=qZnP5SxQcd4yreleBUT0WGCUDb2YCEehbWIgUxUpqvQ,7231
72
+ topologicpy-0.4.64.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
73
+ topologicpy-0.4.64.dist-info/top_level.txt,sha256=J30bDzW92Ob7hw3zA8V34Jlp-vvsfIkGzkr8sqvb4Uw,12
74
+ topologicpy-0.4.64.dist-info/RECORD,,