def get_layout(futu_quote: FutuQuote): layout = html.Div([ html.Figure(id='futures-bookmap-chart'), html.Figure(id='futures-min-chart'), ]) pass
def show_figure(children, caption=None): if not isinstance(children, list): children = [children] if caption: children = [ html.Figcaption(className='mv2 pa0 f4 header-font b', children=caption) ] + children return html.Figure(className='mh0 mv4 pa0', children=children)
def map(self): return html.Figure( className='ma0 pa0 h-100', children=[ # html.Figcaption('Map of companies'), html.Iframe(src=f'/map/{self.area["code"]}/companies', style={ 'border': 0, 'width': '100%', 'height': '100%', }), ])
def get_images(cuerpo, date): date = datetime.strptime(re.split('T| ', date)[0], '%Y-%m-%d') idx = (date.weekday() + 1) % 7 sun = date - timedelta(idx) sat = date - timedelta(7+idx-6) martes = date - timedelta(idx-2) if cuerpo in ['R','RVDG',]: date = sun elif cuerpo in ['RVSB','RVVI']: date = sat elif cuerpo in ['RVYA']: date = martes if cuerpo == 'LASEGUNDA': url = f"https://digital.lasegunda.com/{date.strftime('%Y/%m/%d')}/A" imagen_principal = 'https://segreader.emol.cl/assets/img/logo_lasegunda.png' style = {'background' :'#159E89'} else: url = f"https://digital.elmercurio.com/{date.strftime('%Y/%m/%d')}/{cuerpo}" imagen_principal = 'https://merreader.emol.cl/assets/img/logo_mer.png' style = None site = requests.get(url) soup = bs(site.content, 'lxml') imgs = [x['src'] for x in soup.find(class_='newspaper swiper').find(class_='swiper-wrapper').find_all('img')] imgs = [x.replace('/tmb/','/big/') for x in imgs] if cuerpo in ['A','B','C','P','LASEGUNDA']: imgs = [imgs[0]]+imgs[2:]+[imgs[1]] div = html.Div( className='columns is-multiline', children=[ html.Figure( className='image', children=html.Img(src=x, className='column is-full') ) for x in imgs ] ) return div, imagen_principal, style
def create_dash_launcher(dash_name): """ Generate an individual Dash launcher element. This element exposes the "description", "thumbnail" and "name" elements of a dash app's metadata and launches them in a new browser window """ dash = dash_meta[dash_name] return html.Figure(className="gallery__item", children=[ html.H2(html.A( dash["name"], className="gallery__item-link u-stretched-link", target="_blank", href="{}/".format(dash_name)), className="gallery__item-title"), html.Img(src=app.get_asset_url( thumbnail_path(dash_name, dash["thumbnail"])), className="gallery__item-figure"), html.Figcaption(dash["description"], className="gallery__item-desc") ])
def first(): return html.Section( className='hero is-fullheight', children=[ html.Div( className='hero-body', children=[ html.Div( className='container', children=[ html.Div( className='columns is-vcentered is-centered', children=[ html.Div( className='column is-5', children=[ html.Figure( className='image is-4by4', children=[ html.Img( src= '/indicadores/assets/logo.png', alt='FabLab UTFSM'), ]), ]), html.Div( className='column is-5 main-title', children=[ html. H1('Informe de Gestión de Operaciones', className='title') ]) ]) ]), ]) ])
html.Th(children='First name'), html.Th(children='Last name'), html.Th(children='Birth Date'), html.Th(children='Is the person disabled ?') ]), html.Tr(id='person-data') ]) ] ), ]), html.Figure(children=[ html.Img(src='/assets/feet.png', style={'textAlign': 'center'} ), html.Figcaption('Sensors placement on feet'), ], style={'textAlign': 'center'} ), ], style={'columnCount': 2}), html.H2(children='Live Walking View', style={ 'textAlign': 'center' }), dcc.Graph( id='example-graph', animate=True ), html.H2(children='Historic Data Viewer', style={ 'textAlign': 'center'
html.Div( [ html. H2('Bienvenido a ACRIA: Asistente para la Clasificación de Retinografías mediante Inteligencia Artificial', style={ 'text-align': 'center', 'margin-top': '0px', 'color': 'rgb(255,255,255)' }), #Logo hover: html.Div([ html.Div( html.Figure( html.Img(src='assets/icon.PNG', style={ 'width': '30vw', 'margin-bottom': '1vh' }), ), ), ], style={ 'float': 'none', 'margin': '0 auto', 'margin-bottom': '0.5vh' }, className='hover01 column'), ], id='gradient', ), #Horizontal division: html.Div([
def chart_wrapper(chart, title, subtitle=None, description=None, children=[]): return html.Figure( className='', children=[chart_title(title, subtitle, description), chart] + children)
"Nesta implantação, um alvo de mineração corresponde a uma " "Forma de Organização, o terceiro nível hierárquico da ", html.A( "Tabela do SUS", href="http://sigtap.datasus.gov.br/tabela-unificada/app/sec/inicio.jsp", ), html. P("Para a classificação de atendimentos como excessivos nós partimos da constatação de que, " "para quase todos os alvos que estudamos, a distribuição das " "taxas de atendimento por habitante observadas nos municípios " "ajusta-se bem a uma distribuição log-normal, como os exemplos mostrados na Figura 1." ), html.Figure([ html.Img( src="./assets/ajuste_LogNormal.png", width="70%", # height=400, className="figBorderCenter"), html.Figcaption("Figura 1", style={"text-align": "center"}) ]), html.P("Isso nos permitiu definir, para qualquer alvo " "e para qualquer município, um ponto de corte para o que " "consideramos como normal ou anormal em uma taxa de " "atendimentos por habitante."), html. P('Decidimos então arbitrar que taxas de atendimento por ' 'habitante serão consideradas anormais quando se situarem ' 'à direita do ponto que divide a área sob a curva em ' 'uma parte “normal”, com 99% de probabilidade; e em uma ' 'parte “anormal”, com 1% de probabilidade. Esse limiar de ' 'anormalidade que escolhemos poderá ser ajustado para mais ou para menos, ' 'em função de resultados de auditorias que eventualmente sejam realizadas '
placeholder="Select an example", searchable=False, style=dict(fontSize="13px", marginBottom="6px"), ), dcc.Textarea(id="input-text", placeholder="Enter a movie summary", style=dict(border="1px solid #ccc", borderRadius="4px", fontSize="13px", height="200px", padding="8px 10px", resize="none", width="100%")) ], style=dict(flex=.5, marginRight="25px")), html.Figure(id="prediction", style=dict(flex=.5, marginLeft="25px")) ], style=dict(display="flex")), html.H2("Influential Words"), html.P([ "To identify words that heavily contribute to the above prediction, we define a word's ", html.Em("contribution"), " to a genre's prediction as the product of:" ], style=dict(marginBottom="0")), html.Ol([ html.Li("The model coefficient corresponding to the word and genre."), html.Li("The input's TF-IDF value corresponding to the word.") ], style=dict(marginTop=".4em", marginBottom="0")), html. P("For each genre, we display the words with the largest contributions below.",
'尝试爬取一下', html.I(className='fa fa-bug'), html.Span(' '), html.A('https://v.douyin.com/3kCpYH/', href='javascript:void(0);', id='example-crawl'), ], className='website-info'), html.Div([ html.Div(className='tile is-2'), html.Div([ html.P([html.I(className='fa fa-question-circle'), '抖音用户链接来源说明'], className='has-text-primary is-size-4'), html.Div([ html.Figure([ html.Img(src='/assets/picture/crawl_info1.jpg'), ], className='image crawl_img_info'), html.Figure([ html.Img(src='/assets/picture/crawl_info2.jpg'), ], className='image crawl_img_info'), html.Figure([ html.Img(src='/assets/picture/crawl_info3.jpg'), ], className='image crawl_img_info'), ], className='tile is-parent is-mobile'), ], className='tile is-vertical is-parent is-8') ], className='tile is-ancestor'),
"border-radius" : "0px"} ) ], className = "column", style = {"min-width" : "500px", "margin" : "0px 10px 0px 0px", "height" : "450px"}) ], className = "columns is-hidden-desktop is-mobile", style = {"margin" : "10px 10px 0px 10px", "padding" : "0px"}), html.Div([ html.Div(id = "wordcloud_box", children = [ html.Figure(className = "image", children = [html.Img(id = "image_wc", style = {"margins" : "auto", "max-height" : "500px"})], style = {"margin" : "auto", "max-height" : "500px"}), ], className = "box column", style = {"margin" : "0px 10px 10px 10px", "border-radius" : "0px", "padding" : "0px", "height" : "500px", "max-width" : "100%"}), html.Div([ html.Div([ html.Div([ html.Div([ html.H6("Average Song Tempo", className = "title is-6"),
def WeatherPage(): global CWJSON maintextsize = "2.0em" subtextcolor = "green" maintextcolor = "black" print("WP-CWSJON=", CWJSON) Row1 = html.Div([ #dbc.Row( dbc.Col(html.Div(id="Weather Instruments"))), dbc.Row( dbc.Col( html.Div( html.H6(id={ 'type': 'WPdynamic', 'index': "StringTime" }, children="Weather Instruments")))), dbc.Row( [ dbc.Col( html.Div( [ html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "OutdoorTemperature" }, children=str( CWJSON["OutdoorTemperature"]) + TUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), #children=str(round(CTUnits(CWJSON["OutdoorTemperature"]),1))+TUnits(), style={"font-size": maintextsize,"color":maintextcolor}), html.P("Outdoor Temperature", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1( id={ 'type': 'WPdynamic', 'index': "OutdoorHumidity" }, children=str( round(CWJSON["OutdoorHumidity"], 1)) + " %", style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Outdoor Humidity", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "IndoorTemperature" }, children=str( CWJSON["IndoorTemperature"]) + TUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Indoor Temperature", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "IndoorHumidity" }, children=str( round(CWJSON["IndoorHumidity"], 1)) + " %", style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Indoor Humidity", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1( id={ 'type': 'WPdynamic', 'index': "SunlightVisible" }, children=str( round(CWJSON["SunlightVisible"])) + " lux", style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Sunlight", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), ], ), width=3, ), dbc.Col( html.Div([ html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "BarometricPressureSeaLevel" }, children=str(CWJSON[ "BarometricPressureSeaLevel"]) + BUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Barometric Pressure", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "WindSpeed" }, children=str(CWJSON["WindSpeed"]) + WUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Wind Speed", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "WindGust" }, children=str(CWJSON["WindGust"]) + WUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Wind Gust", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "WindDirection" }, children=str(CWJSON["WindDirection"]) + " deg", style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Wind Direction", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "SunlightUVIndex" }, children=str( round(CWJSON["SunlightUVIndex"], 1)), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Sunlight UV Index", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), ], ), width=3, ), dbc.Col(html.Div(buildCompassRose())), ], ), ]) Row2 = html.Div([ dbc.Row([ dbc.Col(html.Div("Rain / Air Quality")), ]), dbc.Row([ dbc.Col( html.Div([ html.Div( [ html.H1( id={ 'type': 'WPdynamic', 'index': "TotalRain" }, children=str(CWJSON["TotalRain"]) + RUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Total Rain", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "CalendarDayRain" }, children=str(CWJSON["CalendarDayRain"]) + RUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Daily Rain", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "CalendarMonthRain" }, children=str(CWJSON["CalendarMonthRain"]) + RUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Calendar Month", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1( id={ 'type': 'WPdynamic', 'index': "30DayRain" }, children=str(CWJSON["30DayRain"]) + RUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Last 30 Days", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), ], ), width=3, ), dbc.Col( html.Div([ html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "24HourRain" }, children=str(CWJSON["24HourRain"]) + RUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Last 24 Hours", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "7DaysRain" }, children=str(CWJSON["7DaysRain"]) + RUnits(), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Last 7 Days", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "AQI" }, children=str(CWJSON["AQI"]), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("Current AQI", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), html.Div( [ html.H1(id={ 'type': 'WPdynamic', 'index': "AQI24Average" }, children=str(CWJSON["AQI24Average"]), style={ "font-size": maintextsize, "color": maintextcolor }), html.P("24 Hour AQI Average", style={"color": subtextcolor}) ], id="ot1", className="mini_container", ), ]), width=3, ), dbc.Col( html.Div( html.Figure([ html.Div(id={ 'type': 'WPIdynamic', 'index': "SkyCamImage" }, children=[ html.Img(height=350, width=350 * 1.77, src="/assets/skycamera.jpg"), html.Figcaption("SkyWeather Cam"), ]), ]), ), width=6, align="center", ), ], ), ]) # graphs Row3 = html.Div([ dbc.Row([ dbc.Col( [ buildOutdoorTemperature_Humidity_Graph(), buildSunlight_UVIndex_Graph(), buildAQI_Graph(), ], width=12, ) ]), ]) ######### # combined layout ######### layout = dbc.Container( [Row1, Row2, Row3], className="p-5", ) return layout
src= '/static/transactions.svg' ), html. H2('Fast and Cheap Transactions' ), 'Fast and affordable transactions, relying on the public blockchain' ])) ]) ]), html.Div( className='flex-content', children=[ html.Figure( html.Img( className='alignright size-75', src='/static/bitcoin_pile.png', alt='Bitcoin')) ]) ]) ]) ]) ## SLIDE 4: Decentralization Story slide4 = html.Section( className='bg-light', style={'background-color': '#edf2f7'}, children=[ navbar, html.Div( className='wrap',
def genResult(src, user, iframe, **kwargs): tabs = html.Div([ html.Div('', className='tile is-3'), html.Div([ html.Div([ html.Ul([ html.Li( [ html.A('视频词云'), ], className='is-active', id='tabsCloud', ), html.Li([ html.A('短文本主题建模'), ], id='tabsLDA'), html.Li([ html.A('文章统计', ), ], id='tabsOther'), ]) ], className='tabs is-centered is-medium', style={'width': '100%'}), ], className='tile is-6') ], className='tile is-ancestor', style={'marginBottom': '1rem'}) # tabs = html.Div([ # html.Ul([ # html.Li([ # html.A('视频词云'), # ], className='is-active', id='tabsCloud', ), # html.Li([ # html.A('LDA主题分析'), # ], id='tabsLDA'), # html.Li([ # html.A('文章统计', ), # ],id='tabsOther'), # ]) # ], className='tabs is-centered is-medium', style={'margin': '0 25% 2rem 25%'}), tabsColud = html.Div([ html.Img(src=src, className='', style={ 'max-width': '600px', 'min-width': '300px' }), ], className='wcImg', id='userWC'), tabsLDA = html.Div([ html.Iframe(src=iframe, style={ 'height': '130vh', 'width': '100%', 'overflow': 'hidden' }), ], className='wcImg', id='userLDA', style={'display': 'none'}), tabsOther = html.Div([ html.Div(genTongji(**kwargs), style={'width': '100%'}), ], className='', id='userOther', style={ 'display': 'none', 'width': '100%' }), userInfo = html.Div([ html.Div('', className='tile is-3'), html.Div([ html.Div([ html.Article([ html.Figure([ html.P([html.Img(src=user.avatar)], className='image is-64x64') ], className='media-left'), html.Div([ html.Div([ html.P([ html.Strong(user.nickname, id='recordNickName'), html.Small(' | ' + user.user_id, style={'whiteSpace': 'pre'}), html.P(user.user_id, style={'display': 'none'}, id='recordUserId'), html.Br(), html.Div(user.signature) ]) ], className='content'), html.Div([ html.Div([ html.Div([ html.Span('作品: ', style={'whiteSpace': 'pre'}), html.Span( format(user.aweme_count, ',') if user. aweme_count else '未知'), ], className='level-item'), html.Div([ html.Span('获赞: ', style={'whiteSpace': 'pre'}), html.Span( format(user.total_favorited, ',') if user.total_favorited else '未知'), ], className='level-item'), html.Div([ html.Span('粉丝: ', style={'whiteSpace': 'pre'}), html.Span( format(user.aweme_fans, ',') if user. aweme_fans else '未知'), ], className='level-item'), ], className='level-left') ], className='level is-mobile') ], className='media-content'), html.Div([ html.Button( '相似用户', className='button is-primary is-outlined is-small', id='searchSimalar') ], className='media-right') ], className='media'), ], className='box', style={'width': '100%'}), ], className='tile is-6 search_input') ], className='tile is-ancestor', style={'marginBottom': '1rem'}), fig = [userInfo, tabs, tabsColud, tabsLDA, tabsOther] return fig