简体   繁体   English

如何删除破折号 dbc 项目之间的空格?

[英]How to remove whitespace between dash dbc items?

I've been working on a dashboard for some time now and have been unable to remove a pretty large piece of whitespace between one dbc.Row element (containing two columns) and the next dcc.markdown element.我已经在仪表板上工作了一段时间,并且无法删除一个 dbc.Row 元素(包含两列)和下一个 dcc.markdown 元素之间的一大块空白。 If you look at the image below (zoomed out the proportions look a little funny), you'll see the enormous piece of whitespace I can't seem to remove.如果你看下面的图片(缩小比例看起来有点滑稽),你会看到我似乎无法删除的巨大空白。

在此处输入图像描述

I've tried all sorts of things to get rid of it including a combination of the following attributes style={'margin-bottom': '1em'}, className="h-5", no_gutters=True but nothing seems to work.我已经尝试了各种方法来摆脱它,包括以下属性的组合style={'margin-bottom': '1em'}, className="h-5", no_gutters=True但似乎没有任何效果. Is it possible, that Dash is applying some sort of page break that I'm unaware of?是否有可能,Dash 正在应用某种我不知道的分页符?

My code looks as follows:我的代码如下所示:

    dbc.Row([dbc.Col(dcc.Graph(id='table1', figure=
                go.Figure(data=[go.Table(header=dict(values=['Accumulated Performance','(gross, in %)']),
                        cells=dict(values=[a, b]))],
                        layout=go.Layout(margin={'t': 25, 'b': 5, 'l': 10, 'r': 25}
                        )))
                             ),
                     dbc.Col(dcc.Graph(id='table2', figure=
                        go.Figure(data=[go.Table(header=dict(values=['Selected Risk Metrics', '']),
                        cells=dict(values=[['Sharpe Ratio 1-y','Volatility 1-y','Information Ratio 1-y',
                                            'Max 1-m drawdown (since inception)'],
                                           ['Value', 'Value', 'Value', 'Value']]))],
                        layout=go.Layout(margin={'t': 25, 'b': 5, 'l': 10, 'r': 25},
                        )))
                             )
                     ], style={'margin-bottom': '1em'}, className="h-5", no_gutters=True),

            dcc.Markdown('''
            #### Investment Philosophy
            
            Include some text describing my investment philosophy.  
            '''),

            dcc.Graph(id='indexed_return_graph')

I needed to add a style argument to the code style={'height': '175px'} for each of the two columns.我需要为代码style={'height': '175px'}为两列中的每一列添加一个样式参数。

dbc.Row([
        dbc.Col(dcc.Graph(id='table1', figure=
            go.Figure(data=[go.Table(header=dict(values=['Accumulated Performance','(gross, in %)']),
            cells=dict(values=[a, b]))],
            layout=go.Layout(margin={'t': 5, 'b': 0, 'l': 10, 'r': 0, 'pad':10}
            )), style={'height': '175px'})),
        
        dbc.Col(dcc.Graph(id='table2', figure=
            go.Figure(data=[go.Table(header=dict(values=['Selected Risk Metrics', '']),
            cells=dict(values=[['Sharpe Ratio 1-y','Volatility 1-y','Information Ratio 1-y',
            'Max 1-m drawdown (since inception)'],
            ['Value', 'Value', 'Value', 'Value']]))],
            layout=go.Layout(margin={'t': 5, 'b': 0, 'l': 10, 'r': 0, 'pad':10}
            )), style={'height': '175px'}))
         ])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM