From ca55e55aed8faaf631c173276d1b1b586d503121 Mon Sep 17 00:00:00 2001 From: Redsandy <34872843+Redsandyg@users.noreply.github.com> Date: Sat, 5 Mar 2022 23:49:17 +0300 Subject: [PATCH] Update CoreDraw.py --- Core/CoreDraw.py | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/Core/CoreDraw.py b/Core/CoreDraw.py index 8c4669a..1140851 100644 --- a/Core/CoreDraw.py +++ b/Core/CoreDraw.py @@ -28,6 +28,36 @@ init_notebook_mode() import CoreTraidMath import plotly.express as px + + + +class agrigateFig(): + + def __init__(self,data=[],needDraw=False ,subplot_titles=None): + self.data=data + self.ans=self.getAgrPlt() + if needDraw: + self.subplot_titles=subplot_titles + self.fig=coreDraw(self.ans,True,self.subplot_titles) + + + def getAgrPlt(self): + count=0 + ans=[] + for i in self.data: + count=count+1 + if type(i)==list: + for g in i: + for j in g.figDict: + ans.append(j) + ans[-1]['row']=count + else: + for j in i.figDict: + ans.append(j) + ans[-1]['row']=count + return ans + + class corePlt(): def __init__(self, params={ 'vtype':'', @@ -47,9 +77,10 @@ class corePlt(): class coreDraw(): - def __init__(self, data=[],needShow=False): + def __init__(self, data=[], needShow=False,subplot_titles={}): self.data=self.getPlts(data) self.needShow=needShow + self.subplot_titles=subplot_titles self.ans=self.getAns() @@ -101,10 +132,11 @@ class coreDraw(): rows=maxRow, cols=maxCol, shared_xaxes=True, - vertical_spacing=0.02, + #vertical_spacing=0.2, shared_yaxes=True, - horizontal_spacing=0.02, + #horizontal_spacing=0.2, #column_widths=[] + subplot_titles=self.subplot_titles )